Diagrams
Overview
Visual diagrams illustrating the internal architecture and runtime behavior of CHEXAUMODULE.
1. Spatial Streaming & ISM Recycling
How the spawn zone follows the player, when re-generation is triggered, how old ISMs are recycled vs kept, and how cull distance controls rendering visibility.
The system works as a spatial streamer:
nbHexaArounddefines the generation radius (in tiles) around the player.wantDraw()only triggers a new generation pass when the player has moved more than 25% of the radius (nbHexaAround × 0.25tiles).- On re-generation, tiles still in range are kept (
ismToMaintainArray), tiles out of range are garbage collected, and new tiles are computed viacalculateTile(). cullDistanceStart/cullDistanceEndcontrol per-ISM rendering fade (requires material support).forceDrawbypasses the movement threshold (used when banned areas change).
2. Biome Noise → Layer Zoning
How the biomeNoise singleton (shared UCNoisator) creates spatial biome zones by filtering different layers at different noise value ranges.
Each FCHexaMakerStruct (layer) defines its own biomeSelectLowerBound / biomeSelectUpperBound. The biome noise provides a spatially varying value at each (x, y) position. A layer only spawns where the noise value falls within its bounds. By assigning non-overlapping bounds to different layers (e.g. trees [0.0, 0.3], houses [0.3, 0.6], rocks [0.6, 1.0]), the noise naturally creates distinct biome zones across the world.
- Layers can overlap (shared bounds) → multiple mesh types coexist in the same area.
- Within each layer, the specific mesh is selected by
meshProbaRHArray(random probability), not by noise. - When both bounds equal 0, the biome filter is disabled and the layer spawns everywhere.
3. Async Generation Pipeline
How ACHexaSpawner drives tile generation across game thread and worker threads.
4. Class Architecture
Class hierarchy, ownership and interface relationships within CHEXAUMODULE.
5. Layer Distribution Across CPU Cores
How ACHexaSpawner::init() distributes placement layers across available CPU cores, creating normal + ghost hexamaker pairs per group.
6. Banned Areas & Ghost Mode
How the grid handles exclusion zones: normal hexamakers skip banned areas, ghost hexamakers render only inside them with a transparent material.
7. calculateTile Filter Pipeline
Detailed decision flowchart showing how each tile is evaluated through the 6-stage filter chain. Each stage can reject the tile. Covers early exit checks, biome/mesh selection, transform computation, banned area logic (normal vs ghost), world filters (Z algo, altitude bounds, slope), and room filters (ROOM/CORRIDOR/WALL with distance bounds). Also shows the dual result: new tiles are placed, existing tiles that fail re-evaluation are force-removed.
8. ISM Lifecycle: Creation, Tracking & Removal
How UCHexamaker creates ISM components, how FCIndexHandler maintains the bidirectional UV ↔ instance mapping, and how tile removal propagates. Shows the three phases: creation (proceedIsm → updateISM_sync → new ISM → AddInstances → assignIndexWithInstance), removal by UV index (mapIndexToInstanceMap.Find → RemoveInstances → OnInstanceIndexUpdated delegate), and removal by world position (pixelToCoord → UV → same removal path).