Procedural Generation - MassiveMiniteam/OddModKit GitHub Wiki

Grid

The Grid (accessed with GetGridInstance) is a singleton and used for all operations on the world. Such as to add objects, modify height or access world generation info.

image

(World-)Cells

Cells are voronoi cells that the WorldGenerator generates with a seed. Each cell has a CellConfig type and belongs to a Biome

image image

Chunks

The world is chunked in 10x10 units. Chunks hold 100 GridCells and each GridCell holds information on the GridObjects and SimulationActors on it. The terrain height will be calculated when the chunk is loaded and saved in the GridCell. It also holds information such as snow (also used for grass and diggable remains), landscape and ground layers.

image

Generators

Generators are run only once when the Cell is loaded. Most register actors on the grid to spawn when players get close such as the ForestGenerator (which we use for basically everything).

BiomeConfig

Defines a type of Biome. Holds information how the CellConfigs are distributed. Also how the landscape is generated (NoiseGraph).

The generation how and where Biomes are generated is setup in the WorldGenerationConfig.

CellConfig

Defines a (World-)Cell and what generators should run.

NoiseGraph

Used for landscape generation and as NoiseGenerators (to distribute objects with a noise).

image

ChunkSpawnerSimulationComponent

Keeps a chunk (or multiple) loaded once the chunk is loaded around the PositionComponent.

CellLoaderSimulationComponent

Triggers the generators of the (World-)Cells around the PositionComponent.