refactor: terrain generation (#9)

* feat: add BlockType

* refactor: use fBM for heightmap generation

* feat: improve mountain realism

* refactor: adjust mountain spawn probability

* feat: add biome boundary blending

* refactor: remove resolve_biome_adjacency_conflict function

* feat: add snowy plain

* perf: speed up world generation

* refactor: lower overall terrain height
This commit is contained in:
zhenyan121
2026-05-23 10:33:52 +08:00
committed by GitHub
parent 1a26474a05
commit a54e87dbc6
28 changed files with 455 additions and 155 deletions

View File

@@ -10,7 +10,7 @@ void BiomeBuilder::build_bottom() {
for (int x = 0; x < CHUNK_SIZE; x++) {
for (int y = 0; y < 5; y++) {
for (int z = 0; z < CHUNK_SIZE; z++) {
m_blocks[Chunk::get_index(x, y, z)] = 3;
m_blocks[Chunk::index(x, y, z)] = 3;
}
}
}
@@ -30,7 +30,7 @@ void BiomeBuilder::fill_water() {
}
int height = heightmap[x][z];
for (int y = height; y < SEA_LEVEL; y++) {
m_blocks[Chunk::get_index(x, y, z)] = 7;
m_blocks[Chunk::index(x, y, z)] = 7;
}
}
}