MapGen: add Region class and MapGen:pointInRegion2D. close #17

This commit is contained in:
Van
2026-01-20 20:59:58 +03:00
parent 1d1591accc
commit 8c7aaefe09
5 changed files with 167 additions and 2 deletions

View File

@@ -70,6 +70,16 @@ local land2 = {
lacunarity = 2,
}
local land3 = {
offset = 40,
scale = 20,
spread = {x = 45, y = 20, z = 45},
seed = 472,
octaves = 3,
persistence = 0.3,
lacunarity = 2,
}
local climat1 = {
offset = 80,
scale = 10,
@@ -137,6 +147,7 @@ mapGenerator:register2DPeaks('midgard',
for _, c in ipairs({'landscape', 'temp', 'humidity'}) do
mapGenerator:registerLayerNoiseColor('midgard', c, '#4978c6', land1)
mapGenerator:registerLayerNoiseColor('midgard', c, '#77ea72', land2)
mapGenerator:registerLayerNoiseColor('midgard', c, '#46B331', land3)
--[[
mapGenerator:register2DPeaks('midgard', c, {
{
@@ -158,11 +169,11 @@ for _, c in ipairs({'landscape', 'temp', 'humidity'}) do
})--]]
end
mapGenerator:register2DPeaksFromFile('midgard', 'map.ff', 100,{x=0, y=0}, 'landscape')
mapGenerator:register2DPeaksFromFile('midgard', 'map.ff', 32,{x=0, y=0}, 'landscape')
mapGenerator:register2DPeaksFromFile('midgard', 'map.ff', 150,{x=0, y=0}, 'temp')
mapGenerator:register2DPeaksFromFile('midgard', 'map.ff', 200,{x=0, y=0}, 'humidity')
-- [[
--[[
mapGenerator:registerCavern('midgard', 'cavern1', {
minY = -48,
maxY = 50,