Tree generation

This commit is contained in:
2026-09-25 17:41:36 -03:00
parent ea9d821047
commit fdd236071e
7 changed files with 305 additions and 7 deletions
+4 -3
View File
@@ -714,7 +714,7 @@ produce identical terrain. So worldgen scripts must be **deterministic**.
Each chunk is generated in three passes:
1. **Terrain.** One terrain generator fills in the ground and water.
1. **Terrain.** One terrain generator fills in the ground, water and trees.
2. **Ores.** Every mod's `worldgen/ores.json`, in load order.
3. **Features.** Every mod's registered features, in load order.
@@ -724,8 +724,9 @@ the Terralith datapack: continentalness, erosion and weirdness noises feed neste
height, jaggedness and roughness, a 3D density around that height is sampled on a coarse grid and interpolated, and
caves are cut out of it. On top of that come Terralith-style shapes: terraced plateaus, shattered hills, river valleys
and gorges, jagged peaks and rare sky islands. Its biome ids (`biome_at`) are the keys of `BIOMES` in
`common/worldgen/overworld.ts`, like `bworld:yosemite_cliffs` or `bworld:skylands`. It places no trees or other
features yet. `deno run -A tools/worldgen_preview.ts [seed]` renders it to PNG files.
`common/worldgen/overworld.ts`, like `bworld:yosemite_cliffs` or `bworld:skylands`. Trees
(`common/worldgen/trees.ts`) are spread out like Poisson disk sampling, never closer than 4 blocks, and each biome sets
how many grow and which kinds. `deno run -A tools/worldgen_preview.ts [seed]` renders it to PNG files.
### Terrain generators