Add snowy plains biome to make grid of 9 biomes
This commit is contained in:
parent
e7295638ed
commit
d5097935cf
|
@ -1,4 +1,4 @@
|
||||||
watershed 0.2.16 by paramat
|
watershed 0.3.0 by paramat
|
||||||
For latest stable Minetest back to 0.4.8
|
For latest stable Minetest back to 0.4.8
|
||||||
Depends default
|
Depends default
|
||||||
Licenses: code WTFPL
|
Licenses: code WTFPL
|
|
@ -29,7 +29,7 @@ function watershed_pinetree(x, y, z, area, data)
|
||||||
for i = -2, 2 do
|
for i = -2, 2 do
|
||||||
for k = -2, 2 do
|
for k = -2, 2 do
|
||||||
if math.abs(i) == 2 or math.abs(k) == 2 then
|
if math.abs(i) == 2 or math.abs(k) == 2 then
|
||||||
if math.random(5) ~= 2 then
|
if math.random(7) ~= 2 then
|
||||||
local vil = area:index(x + i, y + j, z + k)
|
local vil = area:index(x + i, y + j, z + k)
|
||||||
data[vil] = c_wsneedles
|
data[vil] = c_wsneedles
|
||||||
local vila = area:index(x + i, y + j + 1, z + k)
|
local vila = area:index(x + i, y + j + 1, z + k)
|
||||||
|
@ -42,7 +42,7 @@ function watershed_pinetree(x, y, z, area, data)
|
||||||
for i = -1, 1 do
|
for i = -1, 1 do
|
||||||
for k = -1, 1 do
|
for k = -1, 1 do
|
||||||
if not (i == 0 and j == 0) then
|
if not (i == 0 and j == 0) then
|
||||||
if math.random(7) ~= 2 then
|
if math.random(11) ~= 2 then
|
||||||
local vil = area:index(x + i, y + j, z + k)
|
local vil = area:index(x + i, y + j, z + k)
|
||||||
data[vil] = c_wsneedles
|
data[vil] = c_wsneedles
|
||||||
local vila = area:index(x + i, y + j + 1, z + k)
|
local vila = area:index(x + i, y + j + 1, z + k)
|
||||||
|
@ -55,14 +55,12 @@ function watershed_pinetree(x, y, z, area, data)
|
||||||
for i = -1, 1 do
|
for i = -1, 1 do
|
||||||
for k = -1, 1 do
|
for k = -1, 1 do
|
||||||
if not (i == 0 and j == 0) then
|
if not (i == 0 and j == 0) then
|
||||||
if math.random(7) ~= 2 then
|
local vil = area:index(x + i, y + j, z + k)
|
||||||
local vil = area:index(x + i, y + j, z + k)
|
data[vil] = c_wsneedles
|
||||||
data[vil] = c_wsneedles
|
local vila = area:index(x + i, y + j + 1, z + k)
|
||||||
local vil = area:index(x + i, y + j + 1, z + k)
|
data[vila] = c_wsneedles
|
||||||
data[vil] = c_wsneedles
|
local vilaa = area:index(x + i, y + j + 2, z + k)
|
||||||
local vila = area:index(x + i, y + j + 2, z + k)
|
data[vilaa] = c_snowblock
|
||||||
data[vila] = c_snowblock
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -129,7 +127,7 @@ function watershed_acaciatree(x, y, z, area, data)
|
||||||
for i = -4, 4 do
|
for i = -4, 4 do
|
||||||
for k = -4, 4 do
|
for k = -4, 4 do
|
||||||
if not (i == 0 or k == 0) then
|
if not (i == 0 or k == 0) then
|
||||||
if math.random(5) ~= 2 then
|
if math.random(7) ~= 2 then
|
||||||
local vil = area:index(x + i, y + j, z + k)
|
local vil = area:index(x + i, y + j, z + k)
|
||||||
data[vil] = c_wsaccleaf
|
data[vil] = c_wsaccleaf
|
||||||
end
|
end
|
||||||
|
@ -227,7 +225,7 @@ minetest.register_craft({
|
||||||
replacements = {{"watershed:bucket_lava", "bucket:bucket_empty"}},
|
replacements = {{"watershed:bucket_lava", "bucket:bucket_empty"}},
|
||||||
})
|
})
|
||||||
|
|
||||||
-- ABM
|
-- Lavacooling
|
||||||
|
|
||||||
minetest.register_abm({
|
minetest.register_abm({
|
||||||
nodenames = {"watershed:lavaflow"},
|
nodenames = {"watershed:lavaflow"},
|
||||||
|
@ -310,13 +308,10 @@ function spawnplayer(player)
|
||||||
octaves = 3,
|
octaves = 3,
|
||||||
persist = 0.4
|
persist = 0.4
|
||||||
}
|
}
|
||||||
for chunk = 1, 64 do
|
for chunk = 1, 32 do
|
||||||
local xr = math.random(-2000, 2000)
|
print ("[watershed] chunk "..chunk)
|
||||||
local zr = math.random(-2000, 2000)
|
local x0 = 80 * math.random(-24, 24) - 32
|
||||||
print ("[watershed] xr "..xr)
|
local z0 = 80 * math.random(-24, 24) - 32
|
||||||
print ("[watershed] zr "..zr)
|
|
||||||
local x0 = math.floor((80 * math.floor((xr + 32) / 80)) - 32)
|
|
||||||
local z0 = math.floor((80 * math.floor((zr + 32) / 80)) - 32)
|
|
||||||
local y0 = -32
|
local y0 = -32
|
||||||
local x1 = x0 + 79
|
local x1 = x0 + 79
|
||||||
local z1 = z0 + 79
|
local z1 = z0 + 79
|
||||||
|
@ -354,7 +349,7 @@ function spawnplayer(player)
|
||||||
- nvals_smooth[nixyz] * (1 - terblen)) ^ CANEXP * CANAMP
|
- nvals_smooth[nixyz] * (1 - terblen)) ^ CANEXP * CANAMP
|
||||||
end
|
end
|
||||||
if y >= 1 and density > -0.01 and density < 0 then
|
if y >= 1 and density > -0.01 and density < 0 then
|
||||||
ysp = y + 2
|
ysp = y
|
||||||
xsp = x
|
xsp = x
|
||||||
zsp = z
|
zsp = z
|
||||||
break
|
break
|
||||||
|
@ -376,9 +371,7 @@ function spawnplayer(player)
|
||||||
break
|
break
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
print ("[watershed] xsp "..xsp)
|
print ("[watershed] spawn player ("..xsp.." "..ysp.." "..zsp..")")
|
||||||
print ("[watershed] ysp "..ysp)
|
|
||||||
print ("[watershed] zsp "..zsp)
|
|
||||||
player:setpos({x=xsp, y=ysp, z=zsp})
|
player:setpos({x=xsp, y=ysp, z=zsp})
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
137
init.lua
137
init.lua
|
@ -1,13 +1,13 @@
|
||||||
-- watershed 0.2.16 by paramat
|
-- watershed 0.3.0 by paramat
|
||||||
-- For latest stable Minetest and back to 0.4.8
|
-- For latest stable Minetest and back to 0.4.8
|
||||||
-- Depends default
|
-- Depends default
|
||||||
-- License: code WTFPL
|
-- License: code WTFPL
|
||||||
|
|
||||||
-- acacialeaf
|
-- add snowy plains biome
|
||||||
-- TODO
|
-- TODO
|
||||||
-- all tree heights vary
|
-- lava at surface: volcanic cone?
|
||||||
|
-- tree heights vary
|
||||||
-- fog
|
-- fog
|
||||||
-- singlenode and then game version
|
|
||||||
|
|
||||||
-- Parameters
|
-- Parameters
|
||||||
|
|
||||||
|
@ -38,7 +38,6 @@ local HITET = 0.4 -- High temperature threshold
|
||||||
local LOTET = -0.4 -- Low ..
|
local LOTET = -0.4 -- Low ..
|
||||||
local ICETET = -0.8 -- Ice ..
|
local ICETET = -0.8 -- Ice ..
|
||||||
local HIHUT = 0.4 -- High humidity threshold
|
local HIHUT = 0.4 -- High humidity threshold
|
||||||
local MIDHUT = 0 -- Mid ..
|
|
||||||
local LOHUT = -0.4 -- Low ..
|
local LOHUT = -0.4 -- Low ..
|
||||||
local CLOHUT = 0 -- Cloud humidity threshold
|
local CLOHUT = 0 -- Cloud humidity threshold
|
||||||
local DCLOHUT = 1 -- Dark cloud ..
|
local DCLOHUT = 1 -- Dark cloud ..
|
||||||
|
@ -365,26 +364,28 @@ minetest.register_on_generated(function(minp, maxp, seed)
|
||||||
local n_humid = nvals_humid[nixyz]
|
local n_humid = nvals_humid[nixyz]
|
||||||
local biome = false -- select biome for node
|
local biome = false -- select biome for node
|
||||||
if n_temp < LOTET then
|
if n_temp < LOTET then
|
||||||
if n_humid < MIDHUT then
|
if n_humid < LOHUT then
|
||||||
biome = 1 -- tundra
|
biome = 1 -- tundra
|
||||||
|
elseif n_humid > HIHUT then
|
||||||
|
biome = 3 -- taiga
|
||||||
else
|
else
|
||||||
biome = 2 -- taiga
|
biome = 2 -- snowy plains
|
||||||
end
|
end
|
||||||
elseif n_temp > HITET then
|
elseif n_temp > HITET then
|
||||||
if n_humid < LOHUT then
|
if n_humid < LOHUT then
|
||||||
biome = 6 -- desert
|
biome = 7 -- desert
|
||||||
elseif n_humid > HIHUT then
|
elseif n_humid > HIHUT then
|
||||||
biome = 8 -- rainforest
|
biome = 9 -- rainforest
|
||||||
else
|
else
|
||||||
biome = 7 -- savanna
|
biome = 8 -- savanna
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
if n_humid < LOHUT then
|
if n_humid < LOHUT then
|
||||||
biome = 3 -- dry grassland
|
biome = 4 -- dry grassland
|
||||||
elseif n_humid > HIHUT then
|
elseif n_humid > HIHUT then
|
||||||
biome = 5 -- deciduous forest
|
biome = 6 -- deciduous forest
|
||||||
else
|
else
|
||||||
biome = 4 -- grassland
|
biome = 5 -- grassland
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -405,7 +406,7 @@ minetest.register_on_generated(function(minp, maxp, seed)
|
||||||
or (densityper >= 0.84 and densityper <= 0.87)
|
or (densityper >= 0.84 and densityper <= 0.87)
|
||||||
or (densityper >= 0.92 and densityper <= 0.95) then
|
or (densityper >= 0.92 and densityper <= 0.95) then
|
||||||
data[vi] = c_sandstone
|
data[vi] = c_sandstone
|
||||||
elseif biome == 6 and density < TSTONE * 3 then -- desert stone
|
elseif biome == 7 and density < TSTONE * 3 then -- desert stone
|
||||||
data[vi] = c_wsredstone
|
data[vi] = c_wsredstone
|
||||||
elseif math.abs(nvals_ore[nixyz]) < ORET then -- if seam
|
elseif math.abs(nvals_ore[nixyz]) < ORET then -- if seam
|
||||||
if densityper >= 0.9 and densityper <= 0.9 + ORETHI
|
if densityper >= 0.9 and densityper <= 0.9 + ORETHI
|
||||||
|
@ -442,30 +443,33 @@ minetest.register_on_generated(function(minp, maxp, seed)
|
||||||
or y <= YWAT + 1 + math.random(2) then
|
or y <= YWAT + 1 + math.random(2) then
|
||||||
data[vi] = c_sand
|
data[vi] = c_sand
|
||||||
elseif nofis then -- fine materials cut by fissures
|
elseif nofis then -- fine materials cut by fissures
|
||||||
if biome == 6 then
|
if biome == 1 then
|
||||||
data[vi] = c_desand
|
|
||||||
under[si] = 6 -- desert
|
|
||||||
elseif biome == 7 then
|
|
||||||
data[vi] = c_wsdirt
|
|
||||||
under[si] = 7 -- savanna
|
|
||||||
elseif biome == 8 then
|
|
||||||
data[vi] = c_wsdirt
|
|
||||||
under[si] = 8 -- rainforest
|
|
||||||
elseif biome == 3 then
|
|
||||||
data[vi] = c_wsdirt
|
|
||||||
under[si] = 3 -- dry grassland
|
|
||||||
elseif biome == 4 then
|
|
||||||
data[vi] = c_wsdirt
|
|
||||||
under[si] = 4 -- grassland
|
|
||||||
elseif biome == 5 then
|
|
||||||
data[vi] = c_wsdirt
|
|
||||||
under[si] = 5 -- forest
|
|
||||||
elseif biome == 1 then
|
|
||||||
data[vi] = c_wspermafrost
|
data[vi] = c_wspermafrost
|
||||||
under[si] = 1 -- tundra
|
under[si] = 1 -- tundra
|
||||||
elseif biome == 2 then
|
elseif biome == 2 then
|
||||||
data[vi] = c_wsdirt
|
data[vi] = c_wsdirt
|
||||||
under[si] = 2 -- taiga
|
under[si] = 2 -- snowy plains
|
||||||
|
elseif biome == 3 then
|
||||||
|
data[vi] = c_wsdirt
|
||||||
|
under[si] = 3 -- taiga
|
||||||
|
elseif biome == 4 then
|
||||||
|
data[vi] = c_wsdirt
|
||||||
|
under[si] = 4 -- dry grassland
|
||||||
|
elseif biome == 5 then
|
||||||
|
data[vi] = c_wsdirt
|
||||||
|
under[si] = 5 -- grassland
|
||||||
|
elseif biome == 6 then
|
||||||
|
data[vi] = c_wsdirt
|
||||||
|
under[si] = 6 -- forest
|
||||||
|
elseif biome == 7 then
|
||||||
|
data[vi] = c_desand
|
||||||
|
under[si] = 7 -- desert
|
||||||
|
elseif biome == 8 then
|
||||||
|
data[vi] = c_wsdirt
|
||||||
|
under[si] = 8 -- savanna
|
||||||
|
elseif biome == 9 then
|
||||||
|
data[vi] = c_wsdirt
|
||||||
|
under[si] = 9 -- rainforest
|
||||||
end
|
end
|
||||||
else -- fissure
|
else -- fissure
|
||||||
stable[si] = 0
|
stable[si] = 0
|
||||||
|
@ -476,7 +480,7 @@ minetest.register_on_generated(function(minp, maxp, seed)
|
||||||
data[vi] = c_ice
|
data[vi] = c_ice
|
||||||
else
|
else
|
||||||
data[vi] = c_water
|
data[vi] = c_water
|
||||||
if y == YWAT and biome >= 6 and stable[si] >= 1
|
if y == YWAT and biome >= 7 and stable[si] >= 1
|
||||||
and math.random(PAPCHA) == 2 then -- papyrus in desert and rainforest
|
and math.random(PAPCHA) == 2 then -- papyrus in desert and rainforest
|
||||||
watershed_papyrus(x, y, z, area, data)
|
watershed_papyrus(x, y, z, area, data)
|
||||||
end
|
end
|
||||||
|
@ -521,13 +525,32 @@ minetest.register_on_generated(function(minp, maxp, seed)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
elseif under[si] == 2 then
|
elseif under[si] == 2 then
|
||||||
if n_humid > HIHUT and math.random(PINCHA) == 2 then
|
data[viu] = c_dirtsnow
|
||||||
|
data[vi] = c_snowblock
|
||||||
|
elseif under[si] == 3 then
|
||||||
|
if math.random(PINCHA) == 2 then
|
||||||
watershed_pinetree(x, y, z, area, data)
|
watershed_pinetree(x, y, z, area, data)
|
||||||
else
|
else
|
||||||
data[viu] = c_dirtsnow
|
data[viu] = c_dirtsnow
|
||||||
data[vi] = c_snowblock
|
data[vi] = c_snowblock
|
||||||
end
|
end
|
||||||
|
elseif under[si] == 4 then
|
||||||
|
data[viu] = c_wsdrygrass
|
||||||
|
if math.random(GRACHA) == 2 then
|
||||||
|
if math.random(5) == 2 then
|
||||||
|
data[vi] = c_wsgoldgrass
|
||||||
|
else
|
||||||
|
data[vi] = c_dryshrub
|
||||||
|
end
|
||||||
|
end
|
||||||
elseif under[si] == 5 then
|
elseif under[si] == 5 then
|
||||||
|
data[viu] = c_wsgrass
|
||||||
|
if math.random(FLOCHA) == 2 then
|
||||||
|
watershed_flower(data, vi, fnoise)
|
||||||
|
elseif math.random(GRACHA) == 2 then
|
||||||
|
data[vi] = c_grass5
|
||||||
|
end
|
||||||
|
elseif under[si] == 6 then
|
||||||
if math.random(APTCHA) == 2 then
|
if math.random(APTCHA) == 2 then
|
||||||
watershed_appletree(x, y, z, area, data)
|
watershed_appletree(x, y, z, area, data)
|
||||||
else
|
else
|
||||||
|
@ -540,32 +563,13 @@ minetest.register_on_generated(function(minp, maxp, seed)
|
||||||
data[vi] = c_grass5
|
data[vi] = c_grass5
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
elseif under[si] == 3 then
|
elseif under[si] == 7 and n_temp < HITET + 0.1 then
|
||||||
data[viu] = c_wsdrygrass
|
if math.random(CACCHA) == 2 then
|
||||||
if math.random(GRACHA) == 2 then
|
watershed_cactus(x, y, z, area, data)
|
||||||
if math.random(5) == 2 then
|
elseif math.random(DRYCHA) == 2 then
|
||||||
data[vi] = c_wsgoldgrass
|
data[vi] = c_dryshrub
|
||||||
else
|
|
||||||
data[vi] = c_dryshrub
|
|
||||||
end
|
|
||||||
end
|
|
||||||
elseif under[si] == 4 then
|
|
||||||
data[viu] = c_wsgrass
|
|
||||||
if math.random(FLOCHA) == 2 then
|
|
||||||
watershed_flower(data, vi, fnoise)
|
|
||||||
elseif math.random(GRACHA) == 2 then
|
|
||||||
data[vi] = c_grass5
|
|
||||||
end
|
end
|
||||||
elseif under[si] == 8 then
|
elseif under[si] == 8 then
|
||||||
if math.random(JUTCHA) == 2 then
|
|
||||||
watershed_jungletree(x, y, z, area, data)
|
|
||||||
else
|
|
||||||
data[viu] = c_wsgrass
|
|
||||||
if math.random(JUGCHA) == 2 then
|
|
||||||
data[vi] = c_jungrass
|
|
||||||
end
|
|
||||||
end
|
|
||||||
elseif under[si] == 7 then
|
|
||||||
if math.random(ACACHA) == 2 then
|
if math.random(ACACHA) == 2 then
|
||||||
watershed_acaciatree(x, y, z, area, data)
|
watershed_acaciatree(x, y, z, area, data)
|
||||||
else
|
else
|
||||||
|
@ -574,11 +578,14 @@ minetest.register_on_generated(function(minp, maxp, seed)
|
||||||
data[vi] = c_wsgoldgrass
|
data[vi] = c_wsgoldgrass
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
elseif under[si] == 6 and n_temp < HITET + 0.1 then
|
elseif under[si] == 9 then
|
||||||
if math.random(CACCHA) == 2 then
|
if math.random(JUTCHA) == 2 then
|
||||||
watershed_cactus(x, y, z, area, data)
|
watershed_jungletree(x, y, z, area, data)
|
||||||
elseif math.random(DRYCHA) == 2 then
|
else
|
||||||
data[vi] = c_dryshrub
|
data[viu] = c_wsgrass
|
||||||
|
if math.random(JUGCHA) == 2 then
|
||||||
|
data[vi] = c_jungrass
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue
Block a user