refactor: adjust mountain spawn probability

This commit is contained in:
2026-05-22 21:52:56 +08:00
parent ca4d767a52
commit 2f7ab6e29f
2 changed files with 6 additions and 6 deletions

View File

@@ -185,7 +185,7 @@ int get_interpolated_height(float world_x, float world_z, float temp,
*/ */
BiomeType determine_biome(const BiomeConditions& conditions) { BiomeType determine_biome(const BiomeConditions& conditions) {
if (conditions.mountainous > 0.85) { if (conditions.mountainous > 0.75) {
return MOUNTAIN; return MOUNTAIN;
} }
auto temp = conditions.temp; auto temp = conditions.temp;

View File

@@ -164,16 +164,16 @@ void ChunkGenerator::generate_heightmap() {
amplitude = std::lerp(10, 40, t); amplitude = std::lerp(10, 40, t);
*/ */
float t; float t;
if (mountainous >= 0.8f) { if (mountainous >= 0.7f) {
t = Math::smootherstep(0.80f, 0.85, mountainous); t = Math::smootherstep(0.7f, 0.75, mountainous);
base_y = std::lerp(72, 88, t); base_y = std::lerp(72, 88, t);
amplitude = std::lerp(28, 48, t); amplitude = std::lerp(28, 48, t);
} else if (mountainous >= 0.75f) { } else if (mountainous >= 0.65f) {
t = Math::smootherstep(0.75f, 0.80f, mountainous); t = Math::smootherstep(0.65f, 0.7f, mountainous);
base_y = std::lerp(68, 72, t); base_y = std::lerp(68, 72, t);
amplitude = std::lerp(18, 28, t); amplitude = std::lerp(18, 28, t);
} else { } else {
t = Math::smootherstep(0.5, 0.75, mountainous); t = Math::smootherstep(0.55, 0.65, mountainous);
base_y = std::lerp(60, 68, t); base_y = std::lerp(60, 68, t);
amplitude = std::lerp(8, 18, t); amplitude = std::lerp(8, 18, t);
} }