CWORLDUMODULE

Overview

The CWORLDUMODULE is a multi-threaded procedural landscape runtime builder based on noise definition. It generates terrain meshes around the player using a tile-based LOD system, with optional CROOMUMODULE edge, room and room-cluster modulation.

Depends on CCOREUMODULE.

Functionalities Overview
Data Configuration structures for world generation (FCWorldMakerStruct, FCWorldSpawnerDataStruct)
Spawner ACWorldSpawner actor that drives world generation at runtime, tracking a pawn
Worldmaker Abstract worldmaker base class (UCAbstractWorldmaker) with two implementations: ProceduralMesh and DynamicMesh
Blueprint Blueprint-callable functions for Z calculation and slope adaptation (UCWorldBPLibrary)

Architecture

The world generation pipeline works as follows:

  1. ACWorldSpawner is placed in the level with a reference to a DataTable row (FCWorldSpawnerDataStruct) and a pawn to track.
  2. On tick, the spawner delegates to UCAbstractWorldmaker::buildASync which computes tile UV coordinates around the pawn asynchronously.
  3. Tile mesh data is calculated in parallel (ParallelFor) with LOD based on distance to the pawn (curvature reduction).
  4. Mesh creation is pooled and dequeued on the game thread (updatePMC_sync), creating either UProceduralMeshComponent or UDynamicMeshComponent tiles.
  5. Z values are computed per-vertex via innerZCalculate, which blends world noise, cluster noise, room noise and edge noise using configurable easing.
  6. Vertex colors encode spatial context (cluster, room, corridor) for material-driven rendering.
  7. Delegates onTileReady / onTileRemoved notify other systems (foliage, AI, etc.) when tiles change.