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:
ACWorldSpawneris placed in the level with a reference to aDataTablerow (FCWorldSpawnerDataStruct) and a pawn to track.- On tick, the spawner delegates to
UCAbstractWorldmaker::buildASyncwhich computes tile UV coordinates around the pawn asynchronously. - Tile mesh data is calculated in parallel (
ParallelFor) with LOD based on distance to the pawn (curvature reduction). - Mesh creation is pooled and dequeued on the game thread (
updatePMC_sync), creating eitherUProceduralMeshComponentorUDynamicMeshComponenttiles. - Z values are computed per-vertex via
innerZCalculate, which blends world noise, cluster noise, room noise and edge noise using configurable easing. - Vertex colors encode spatial context (cluster, room, corridor) for material-driven rendering.
- Delegates
onTileReady/onTileRemovednotify other systems (foliage, AI, etc.) when tiles change.