update base:demo generator

This commit is contained in:
MihailRis 2025-01-25 03:56:52 +03:00
parent 2f93d38fde
commit 227224ccfe
3 changed files with 24 additions and 20 deletions

View file

@ -1,7 +1,7 @@
[forest] [forest]
parameters = [ parameters = [
{weight=1, value=0}, {weight=2, value=0.0},
{weight=0.5, value=0.2} {weight=1.6, value=-0.0}
] ]
layers = [ layers = [
{below-sea-level=false, height=1, block="base:grass_block"}, {below-sea-level=false, height=1, block="base:grass_block"},
@ -28,8 +28,8 @@ structures = [
[desert] [desert]
parameters = [ parameters = [
{weight=1.0, value=1}, {weight=1.0, value=0.0},
{weight=0.8, value=0} {weight=2.0, value=1.1}
] ]
layers = [ layers = [
{height=6, block="base:sand"}, {height=6, block="base:sand"},
@ -44,7 +44,7 @@ sea-layers = [
[plains] [plains]
parameters = [ parameters = [
{weight=0.8, value=0.5}, {weight=0.8, value=0.5},
{weight=0.8, value=0.0} {weight=0.8, value=-0.2}
] ]
layers = [ layers = [
{below-sea-level=false, height=1, block="base:grass_block"}, {below-sea-level=false, height=1, block="base:grass_block"},

View file

@ -50,14 +50,19 @@ function generate_heightmap(x, y, w, h, s, inputs)
local vmap = Heightmap(w, h) local vmap = Heightmap(w, h)
umap.noiseSeed = SEED umap.noiseSeed = SEED
vmap.noiseSeed = SEED vmap.noiseSeed = SEED
vmap:noise({x+521, y+70}, 0.1*s, 3, 25.8) vmap:noise({x+521, y+70}, 0.1*s, 2, 25.8)
vmap:noise({x+95, y+246}, 0.15*s, 3, 25.8) vmap:noise({x+95, y+246}, 0.15*s, 2, 25.8)
local map = Heightmap(w, h) local map = Heightmap(w, h)
map.noiseSeed = SEED map.noiseSeed = SEED
map:noise({x, y}, 0.8*s, 4, 0.02) map:noise({x, y}, 0.5*s, 3, -0.1)
map:cellnoise({x, y}, 0.1*s, 3, 0.3, umap, vmap) --map:cellnoise({x, y}, 0.1*s, 3, 0.3, umap, vmap)
map:add(0.7) map:mul(inputs[1])
--map:add(1.0)
--map:pow(0.2)
--map:mul(0.02)
map:mul(0.3)
map:add(0.3)
local rivermap = Heightmap(w, h) local rivermap = Heightmap(w, h)
rivermap.noiseSeed = SEED rivermap.noiseSeed = SEED
@ -66,26 +71,25 @@ function generate_heightmap(x, y, w, h, s, inputs)
rivermap:mul(2.0) rivermap:mul(2.0)
rivermap:pow(0.15) rivermap:pow(0.15)
rivermap:max(0.5) rivermap:max(0.5)
map:mul(rivermap) --map:mul(rivermap)
local desertmap = Heightmap(w, h) local desertmap = Heightmap(w, h)
desertmap.noiseSeed = SEED desertmap.noiseSeed = SEED
desertmap:cellnoise({x+52, y+326}, 0.3*s, 2, 0.2) desertmap:cellnoise({x+52, y+326}, 0.3*s, 2, 0.1)
desertmap:add(0.5) desertmap:add(0.35)
map:mixin(desertmap, inputs[1])
map:mixin(desertmap, inputs[2])
return map return map
end end
function generate_biome_parameters(x, y, w, h, s) function generate_biome_parameters(x, y, w, h, s)
local tempmap = Heightmap(w, h) local tempmap = Heightmap(w, h)
tempmap.noiseSeed = SEED + 5324 tempmap.noiseSeed = SEED + 5324
tempmap:noise({x, y}, 0.08*s, 6) tempmap:noise({x, y}, 0.4*s, 4)
tempmap:mul(0.5) tempmap:mul(0.3)
tempmap:add(0.5) tempmap:add(0.5)
local hummap = Heightmap(w, h) local hummap = Heightmap(w, h)
hummap.noiseSeed = SEED + 953 hummap.noiseSeed = SEED + 953
hummap:noise({x, y}, 0.08*s, 6) hummap:noise({x, y}, 0.2*s, 6)
tempmap:pow(3)
hummap:pow(3)
return tempmap, hummap return tempmap, hummap
end end

View file

@ -2,4 +2,4 @@
# 2 - humidity # 2 - humidity
biome-parameters = 2 biome-parameters = 2
sea-level = 64 sea-level = 64
heightmap-inputs = [1] heightmap-inputs = [1, 2]