Terrain Generation
The terrain generation system is extremely complex and intricate. "Terrain Generation" is the term for all the parts of the world that are created by the game that are blocks. This includes, but is not limited to, soil, mountains, lakes, trees, and ruins.
Stages of terrain generation
The following steps are an overview, the next section will have a much more in depth explanation of these stages.
- generate noise maps for various properties.
- landforms, these are chosen based on a landform noise map.
- rock strata, this is the stage where the type of rock in a region is chosen partly based on a geologic province noise map.
- caves, chunks are populated with caves.
- block layers, layers placed on top of the current ground, e.g. soil, snow, and grass.
- deposits, ores and other things in the stone are placed.
- structures, this adds ruins, trader carts, treasure chests, and more.
- ponds, bodies of water.
- vegetation and patches, plants that are randomly found in groups, cattails, horsetail, and flowers. It also adds trees.
- finalize, this finishes the process, processing light in a chunk, spawning animals, and adding snow.
Technical
Each stage is defined in the Survival base mod.
Noise maps
VS utilizes three methods for generating noise: weighted octave, Perlin, and normalized simplex noise. Each one behaves differently. In total, seven [1] noise maps are created at this stage.
- Climate
- Flower
- Bush
- Forest
- Beach
- Geologic province
- Landform
These maps are utilized by later stages to provide randomness to terrain.
Landforms
These are the shapes the land takes. There are many different landforms that can generate and some utilize more than one noise map, mostly the climate map. Each landform's properties are defined in the game assets. There are several optional properties, but all landforms must specify:
- Octaves
- Octave thresholds
- Terrain Y key positions
- Terrain Y key thresholds
Octaves defines how rough or smooth terrain is.
Rock strata
Layers of rocks.
Caves
Caves
Block layers
Layers of blocks.
Deposits
Ore and other blocks.
Structures
Trader carts, ruins, vugs.