Data Structures
HexaPattern
Enum defining the grid placement type.
| Name | Description |
|---|---|
| SQUARE | Regular square grid |
| HEXAGONE | Flat-top hexagonal grid with axial coordinates (q, r) |
ZPositionCalculate
Enum defining the algorithm for computing a mesh’s Z position.
| Name | Description |
|---|---|
| SINGLE_POINT | Z computed at the mesh center only |
| FOUR_POINT | Z = minimum of the 4 bounding box corners (rotation taken into account) |
| HEIGHT_POINT | Z = minimum of 8 points (4 corners + 4 edge midpoints) |
FCMeshStruct
Configuration structure for an individual mesh (DataTable row).
| Name | Description |
|---|---|
| description | Text description of the mesh |
| mesh | Reference to the UStaticMesh |
| zAlgo | Z calculation algorithm (ZPositionCalculate) |
| percentBelowFloor | Percentage of the mesh sunk below ground (default 10.0) |
// FCMeshStruct is configured in a DataTable.
// Each row represents a mesh with its Z positioning algorithm.
FCMeshStruct meshStruct;
meshStruct.mesh = myStaticMesh;
meshStruct.zAlgo = ZPositionCalculate::FOUR_POINT;
meshStruct.percentBelowFloor = 15.0; // 15% of the bounding box below ground
FCMeshProbaStruct
Probabilistic mesh selection structure.
| Name | Description |
|---|---|
| meshProbaRHArray | FDataTableRowHandle pointing to a FCMeshStruct row |
| meshSelectLowerBound | Selection lower bound (default 0.0) |
| meshSelectUpperBound | Selection upper bound (default 2.0) |
// Selection works as follows:
// A random [0.0, 1.0] is drawn per tile.
// The first FCMeshProbaStruct whose [lowerBound, upperBound] contains the value is selected.
// Example: 3 meshes with probabilities 60%, 30%, 10%
FCMeshProbaStruct tree; // lowerBound=0.0, upperBound=0.6
FCMeshProbaStruct rock; // lowerBound=0.6, upperBound=0.9
FCMeshProbaStruct bush; // lowerBound=0.9, upperBound=1.0
FCHexaMakerStruct
Main configuration structure for a placement layer (DataTable row). Each layer is independent and has its own parameters.
| Name | Description |
|---|---|
| description | Text description of the layer |
| enable | Enables/disables this layer |
| biomeSelectLowerBound | Biome noise filter lower bound |
| biomeSelectUpperBound | Biome noise filter upper bound (0=0 disables the filter) |
| onlyForRoomTag | Allowed room tags (empty = all) |
| meshProbaRHArray | Array of FCMeshProbaStruct for probabilistic selection |
| shadowBehavior | Shadow configuration (FCShadowDefinition) |
| pattern | Grid type: SQUARE or HEXAGONE |
| tileSize | Cell size in world units (default 150) |
| nbHexaAround | Number of cells around the player (generation radius) |
| alignToSlope | Aligns mesh rotation to terrain slope |
| rotate | Random Y rotation [0°, 360°] |
| minJitterForce | Minimum dispersion force (ratio of tileSize) |
| maxJitterForce | Maximum dispersion force (ratio of tileSize) |
| minScalePercent | Minimum scale (default 0.5) |
| maxScalePercent | Maximum scale (default 2.0) |
| cullDistanceStart | Fade start distance (requires material support) |
| cullDistanceEnd | Full disappearance distance |
| withBound | Enables altitude filtering |
| above | Minimum allowed altitude |
| below | Maximum allowed altitude |
| withNormal | Enables slope filtering |
| zMinNornal | Minimum slope (0=vertical, 0.5=45°, 1=horizontal) |
| zMaxNornal | Maximum slope |
| collision | Enables collisions on ISMs |
| explicitRemove | If true, old ISMs are explicitly unregistered |
| roomType | Zone type: UNSET, ROOM, CORRIDOR, WALL |
| meshSelectRateDistanceToEdgeLowerBound | Lower bound distance to corridor edge (if CORRIDOR) |
| meshSelectRateDistanceToEdgeUpperBound | Upper bound distance to corridor edge (if CORRIDOR) |
| meshSelectRateDistanceToRoomLowerBound | Lower bound distance to room center (if ROOM) |
| meshSelectRateDistanceToRoomUpperBound | Upper bound distance to room center (if ROOM) |
// FCHexaMakerStruct is configured in a DataTable.
// Each row represents an independent placement "layer".
FCHexaMakerStruct layer;
layer.pattern = HexaPattern::HEXAGONE;
layer.tileSize = 200;
layer.nbHexaAround = 8;
layer.rotate = true;
layer.minJitterForce = 0.1;
layer.maxJitterForce = 0.3;
layer.minScalePercent = 0.8;
layer.maxScalePercent = 1.5;
layer.alignToSlope = true;
layer.withBound = true;
layer.above = -500.0;
layer.below = 5000.0;
layer.withNormal = true;
layer.zMinNornal = 0.7; // no placement on steep slopes
layer.zMaxNornal = 1.0;
layer.cullDistanceStart = 10000;
layer.cullDistanceEnd = 15000;
layer.roomType = CRoomType::ROOM;FCHexaSpawnerDataStruct
DataTable structure combining multiple placement layers.
| Name | Description |
|---|---|
| hexaMakerRHArray | Array of FDataTableRowHandle pointing to FCHexaMakerStruct rows |
// FCHexaSpawnerDataStruct is referenced by ACHexaSpawner via FDataTableRowHandle.
// It contains the list of layers to generate.
// Each layer is distributed across available CPU cores for parallel computation.
TArray<FCHexaMakerStruct*> layers = data->getHexaMakerStructArray();
// Returns the resolved FCHexaMakerStruct* from the DataTableRowHandles.