Save all generated chunks instead of only chunks that were changed
This commit is contained in:
+11
-10
@@ -12,19 +12,20 @@ What world generation has today (see [World Generation](docs/modding/worldgen/in
|
||||
|
||||
- **The server generates every chunk** (`server/game/world.ts`, `common/generation.ts`). Players only get finished
|
||||
chunks, so generation code and data never have to reach clients.
|
||||
- **Three passes per chunk:** terrain (data, see [GENERATION.md](GENERATION.md)), then ores (`worldgen/ores.json`), then
|
||||
features, code or data, by step. The base game's trees are a code feature in `vegetal_decoration`.
|
||||
- **Three passes per chunk:** terrain (data, see [terrain.md](docs/modding/worldgen/terrain.md)), then ores
|
||||
(`worldgen/ores.json`), then features, code or data, by step. The base game's trees are a code feature in
|
||||
`vegetal_decoration`.
|
||||
- **Chunks generate alone.** A feature may write up to one chunk away. Those writes are "spills" that only fill air in
|
||||
the neighbor, so the result doesn't depend on which chunk generates first.
|
||||
- **Determinism is the rule everything rests on.** A save only keeps player changes. Untouched terrain is generated
|
||||
again on every load, and when generation changes, a fingerprint makes the server compare saved chunks against the new
|
||||
output (`ServerWorld.load_chunks`).
|
||||
- **Determinism matters at chunk borders.** Every chunk generated is saved whole, like Minecraft, so a change to
|
||||
generation only shows in chunks never generated before. A chunk generated next to a saved one still takes the saved
|
||||
one's spills from generation, so features cross the border the same way only when generation hasn't changed.
|
||||
- **Heights and biomes for any column**, without generating its chunk: `OverworldTerrain.column` and `estimate_biome`.
|
||||
The biome is exact away from coasts and cliffs. The height is the height before 3D noise, so it isn't the real
|
||||
surface.
|
||||
- **Blocks:** numeric states (up to 16 bits), `variants`, `parts`, shapes, tile data, containers, components and shared
|
||||
rules. Tags exist for blocks, items and entities. Biomes are a registry of data (`worldgen/biomes/` in a mod), but
|
||||
which one a column gets is data too, a biome source's rules (see [GENERATION.md](GENERATION.md)).
|
||||
which one a column gets is data too, a biome source's rules (see [biomes.md](docs/modding/worldgen/biomes.md)).
|
||||
- **Loot:** a block's `drops` is one item id. There are no loot tables.
|
||||
|
||||
What's missing for structures:
|
||||
@@ -507,10 +508,10 @@ the same hook later.
|
||||
|
||||
### Determinism and Saves
|
||||
|
||||
- Starts and pieces are recomputed whenever needed and never saved, following the [modding plan's](docs/modding_plan.md)
|
||||
rule that a save only keeps changes.
|
||||
- Adding or removing a mod with structures changes untouched terrain in existing worlds, the same as features do now.
|
||||
The worldgen fingerprint already detects it and keeps saved chunks as they were.
|
||||
- Starts and pieces are recomputed whenever needed and never saved: a chunk with a piece in it is saved with its blocks
|
||||
like any other, and pieces reaching into chunks not generated yet need the same start.
|
||||
- Adding or removing a mod with structures changes only chunks not generated yet, the same as features do now. Saved
|
||||
chunks stay as they were, so there can be seams.
|
||||
- Tests generate the same chunks in different orders and compare every block. A golden test records a few chunks with
|
||||
structures in them, so changes to generation show up.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user