From c7a1ff9790de61aa99f079984757538034d9915e Mon Sep 17 00:00:00 2001 From: Vanic Date: Sun, 16 Nov 2025 20:08:50 +0300 Subject: [PATCH] Mapgen: write SuperUltraSigmaMapgen part 5.1 --- mods/CORE/MapGen/src/MapGen.lua | 32 ++------------------------ mods/ENVIRONMENT/MapGenerator/init.lua | 30 +++++------------------- 2 files changed, 8 insertions(+), 54 deletions(-) diff --git a/mods/CORE/MapGen/src/MapGen.lua b/mods/CORE/MapGen/src/MapGen.lua index a876b57..3a54755 100644 --- a/mods/CORE/MapGen/src/MapGen.lua +++ b/mods/CORE/MapGen/src/MapGen.lua @@ -191,34 +191,6 @@ function MapGen:initBiomesDiagram() end end ----Calculate the weight for noise based on ----the distance of the point from the center of the peak. ---- ----If the `weightFactor` is `0`, then the peak's ----weight is not calculated and is always equal to `1`. ----@param minPos vector ----@param maxPos vector ----@param x number ----@param z number ----@param weightFactor number ----@return number -local function calculateWeight2D(minPos, maxPos, x, z, weightFactor) - if weightFactor == 0 then - return 1 - end - - local centerX = (minPos.x + maxPos.x) / 2 - local centerZ = (minPos.z + maxPos.z) / 2 - - local distX = 1 - (mathAbs(x - centerX) / (mathAbs((maxPos.x - minPos.x)) / 2))^weightFactor - local distZ = 1 - (mathAbs(z - centerZ) / (mathAbs((maxPos.z - minPos.z)) / 2))^weightFactor - - ---@type number - local weight = distX * distZ -- mathMin(distX, distZ) - - return weight -end - local function generateSoil(biome, data, index, x, y, z) data[index] = core.get_content_id(biome.groundNodes.turf) -- TODO: убрать тут get_content_id(), переместить его куда-то "выше" end @@ -267,8 +239,8 @@ end local function generateNode(mapGenerator, hight, temp, humidity, data, index, x, y, z) local ids = mapGenerator.nodeIDs - temp = mathMin(0, mathMax(100, temp)) - humidity = mathMin(0, mathMax(100, humidity)) + temp = mathMin(100, mathMax(0, temp)) + humidity = mathMin(100, mathMax(0, humidity)) local biome = mapGenerator.biomesDiagram[mathRound(temp)][mathRound(humidity)] diff --git a/mods/ENVIRONMENT/MapGenerator/init.lua b/mods/ENVIRONMENT/MapGenerator/init.lua index 24d800f..63a6bdc 100644 --- a/mods/ENVIRONMENT/MapGenerator/init.lua +++ b/mods/ENVIRONMENT/MapGenerator/init.lua @@ -75,7 +75,7 @@ local climat0 = { mapGenerator:RegisterPeak("world", vector.new(0,0,0), { - landscapeNoise = land1, + landscapeNoise = land2, tempNoise = climat2, humidityNoise = climat2, }, @@ -85,8 +85,8 @@ mapGenerator:RegisterPeak("world", vector.new(25,0,25), { landscapeNoise = land2, - tempNoise = climat2, - humidityNoise = climat2, + tempNoise = climat1, + humidityNoise = climat1, }, {is2d = 1, is3d = 1}) @@ -103,8 +103,8 @@ mapGenerator:RegisterPeak("world", vector.new(25,0, -25), { landscapeNoise = land2, - tempNoise = climat2, - humidityNoise = climat2, + tempNoise = climat1, + humidityNoise = climat1, }, {is2d = 1, is3d = 1}) @@ -112,28 +112,10 @@ mapGenerator:RegisterPeak("world", vector.new(-25,0,25), { landscapeNoise = land2, - tempNoise = climat2, - humidityNoise = climat2, - }, - {is2d = 1, is3d = 1}) - - mapGenerator:RegisterPeak("world", - vector.new(25,50,25), - { - landscapeNoise = land1, tempNoise = climat1, humidityNoise = climat1, }, - {is3d = 1}) - -mapGenerator:RegisterPeak("world", - vector.new(-25,50,-25), - { - landscapeNoise = land1, - tempNoise = climat2, - humidityNoise = climat2, - }, - {is3d = 1}) + {is2d = 1, is3d = 1}) mapGenerator:RegisterBiome("biome1", 0, 0, { soil = "soils:clay_soil_baren",