From 75cd9aeefb2cccb544e0169063908760977d6615 Mon Sep 17 00:00:00 2001 From: neveix Date: Mon, 10 Aug 2026 13:14:57 +0500 Subject: [PATCH] fix rivers in base:demo --- .../base/generators/demo.files/script.lua | 27 ++++++++++++++----- 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/res/content/base/generators/demo.files/script.lua b/res/content/base/generators/demo.files/script.lua index 7a3282c3c..ff05e08cc 100644 --- a/res/content/base/generators/demo.files/script.lua +++ b/res/content/base/generators/demo.files/script.lua @@ -86,12 +86,27 @@ function generate_heightmap(x, y, w, h, s, inputs) local rivermap = Heightmap(w, h) rivermap.noiseSeed = SEED - rivermap:noise({x+21, y+12}, 0.1*s, 4) - rivermap:abs() - rivermap:mul(2.0) - rivermap:pow(0.15) - rivermap:max(0.5) - map:mul(rivermap) + rivermap:noise({ x + 21, y + 12 }, 0.1 * s, 4) + rivermap:pow(4) + rivermap:mul(3500) + rivermap:add(1) + rivermap:pow(-1) + rivermap:mul(-1) + rivermap:add(1) + + local rivermap_bottom = Heightmap(w, h) + rivermap_bottom:add(0.23) + rivermap_bottom:noise({ x, y }, 2 * s, 4, 0.005) + + map:sub(rivermap_bottom) + + local map_multiplied = Heightmap(w, h) + map_multiplied:add(map) + map_multiplied:mul(rivermap) + + map:min(map_multiplied) + + map:add(rivermap_bottom) local desertmap = Heightmap(w, h) desertmap.noiseSeed = SEED