Components
World Components
TerrainComponent
Procedural terrain generation with heightmap-based landscapes and cave systems. Creates mesh geometry, collision, and biome-based texturing.
| Property | Type | Default | Description |
|---|---|---|---|
archetype | Enum | wilderness | Generation algorithm: wilderness (heightmap terrain) or cave (cellular automata + marching cubes) |
params | Nested | (see below) | Generation parameters |
scatter_rules | Array | [] | Rules for scattering objects (trees, rocks, etc.) |
heightmap_asset_guid | String | "" | Pre-generated heightmap asset GUID |
terrain_mesh_guid | String | "" | Generated terrain mesh GUID |
biome | String | "forest" | Biome type for texturing |
splatmap_guid | String | "" | Generated splatmap GUID |
Generation Parameters
| Parameter | Default | Description |
|---|---|---|
width | 200 | Terrain width in world units |
depth | 200 | Terrain depth in world units |
resolution | 256 | Heightmap vertices per side (2-512) |
height_scale | 20 | Maximum height displacement |
roughness | 0.5 | Noise roughness factor |
octaves | 6 | Number of noise octaves for detail |
seed | 0 | Random seed (0 = random) |
room_height | 5 | Room height for caves |
wall_thickness | 2 | Cave wall thickness |
Available Biomes
| Biome | Best For |
|---|---|
forest | Temperate woodland terrain |
alpine | Mountain/high-altitude terrain |
desert | Arid sandy terrain |
stone_cave | Natural stone cave system |
crystal_cave | Fantasy cave with crystal formations |
lava_cave | Volcanic cave with lava flows |
Example: Create Terrain
{
"op": "CreateTerrain",
"params": {
"entity_name": "MainTerrain",
"archetype": "wilderness",
"biome": "forest",
"width": 200,
"depth": 200,
"height_scale": 25,
"resolution": 256,
"seed": 42
}
}
Example: Create Cave
{
"op": "CreateTerrain",
"params": {
"entity_name": "DungeonCave",
"archetype": "cave",
"biome": "stone_cave",
"cave_style": "spacious",
"width": 100,
"depth": 100,
"room_height": 8,
"seed": 123
}
}
Multi-Chunk Worlds
Use the CreateWorld operation for large seamless worlds with multiple terrain chunks and biome blending:
{
"op": "CreateWorld",
"params": {
"chunks_x": 4,
"chunks_z": 4,
"world_width": 800,
"world_depth": 800,
"biomes": ["forest", "alpine", "desert"],
"water_level": 1.0,
"seed": 42
}
}
This creates a 4x4 grid of terrain chunks with Voronoi-based biome distribution and optional water planes.