From fb53b3941c564b123fd4fb4db0fab531c6f21ede Mon Sep 17 00:00:00 2001 From: MihailRis Date: Thu, 10 Oct 2024 04:44:44 +0300 Subject: [PATCH] update caves distribution --- res/content/base/generators/demo.files/script.lua | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/res/content/base/generators/demo.files/script.lua b/res/content/base/generators/demo.files/script.lua index 983ec628..63445863 100644 --- a/res/content/base/generators/demo.files/script.lua +++ b/res/content/base/generators/demo.files/script.lua @@ -31,17 +31,17 @@ end function place_structures_wide(x, z, w, d, seed, chunk_height) local placements = {} - if math.random() < 0.3 then -- generate caves + if math.random() < 0.05 then -- generate caves local sx = x + math.random() * 10 - 5 - local sy = math.random() * (chunk_height / 6) + 40 + local sy = math.random() * (chunk_height / 4) + 27 local sz = z + math.random() * 10 - 5 local dir = math.random() * math.pi * 2 local dir_inertia = (math.random() - 0.5) * 2 - local elevation = -sy / (chunk_height / 6) - local width = math.random()*3+2 + local elevation = -3 + local width = math.random() * 3 + 2 - for i=1,10 do + for i=1,18 do local dx = math.sin(dir) * 10 local dz = -math.cos(dir) * 10 @@ -84,7 +84,7 @@ function generate_heightmap(x, y, w, h, seed, s) rivermap:abs() rivermap:mul(2.0) rivermap:pow(0.15) - rivermap:max(0.3) + rivermap:max(0.5) map:mul(rivermap) return map end