From 2f7ab6e29f6ac21c1182eb722e36e741b9a32d89 Mon Sep 17 00:00:00 2001 From: zhenyan121 <3367366583@qq.com> Date: Fri, 22 May 2026 21:52:56 +0800 Subject: [PATCH] refactor: adjust mountain spawn probability --- src/gameplay/biome.cpp | 2 +- src/gameplay/chunk_generator.cpp | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/gameplay/biome.cpp b/src/gameplay/biome.cpp index 51b4361..6d4d893 100644 --- a/src/gameplay/biome.cpp +++ b/src/gameplay/biome.cpp @@ -185,7 +185,7 @@ int get_interpolated_height(float world_x, float world_z, float temp, */ BiomeType determine_biome(const BiomeConditions& conditions) { - if (conditions.mountainous > 0.85) { + if (conditions.mountainous > 0.75) { return MOUNTAIN; } auto temp = conditions.temp; diff --git a/src/gameplay/chunk_generator.cpp b/src/gameplay/chunk_generator.cpp index 3c1cab6..db8aad0 100644 --- a/src/gameplay/chunk_generator.cpp +++ b/src/gameplay/chunk_generator.cpp @@ -164,16 +164,16 @@ void ChunkGenerator::generate_heightmap() { amplitude = std::lerp(10, 40, t); */ float t; - if (mountainous >= 0.8f) { - t = Math::smootherstep(0.80f, 0.85, mountainous); + if (mountainous >= 0.7f) { + t = Math::smootherstep(0.7f, 0.75, mountainous); base_y = std::lerp(72, 88, t); amplitude = std::lerp(28, 48, t); - } else if (mountainous >= 0.75f) { - t = Math::smootherstep(0.75f, 0.80f, mountainous); + } else if (mountainous >= 0.65f) { + t = Math::smootherstep(0.65f, 0.7f, mountainous); base_y = std::lerp(68, 72, t); amplitude = std::lerp(18, 28, t); } else { - t = Math::smootherstep(0.5, 0.75, mountainous); + t = Math::smootherstep(0.55, 0.65, mountainous); base_y = std::lerp(60, 68, t); amplitude = std::lerp(8, 18, t); }