Volcano taper wall, deeper rivers, more river sand

This commit is contained in:
paramat 2014-04-02 02:44:33 +01:00
parent 6a49a77032
commit 5ea4bd4918
3 changed files with 25 additions and 20 deletions

View File

@ -1,4 +1,4 @@
watershed 0.3.1 by paramat watershed 0.3.2 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

View File

@ -3,7 +3,7 @@ function watershed_appletree(x, y, z, area, data)
local c_apple = minetest.get_content_id("default:apple") local c_apple = minetest.get_content_id("default:apple")
local c_wsappleaf = minetest.get_content_id("watershed:appleleaf") local c_wsappleaf = minetest.get_content_id("watershed:appleleaf")
for j = -2, 4 do for j = -2, 4 do
if j >= 1 then if j == 3 then
for i = -2, 2 do for i = -2, 2 do
for k = -2, 2 do for k = -2, 2 do
local vil = area:index(x + i, y + j + 1, z + k) local vil = area:index(x + i, y + j + 1, z + k)
@ -14,6 +14,15 @@ function watershed_appletree(x, y, z, area, data)
end end
end end
end end
elseif j == 2 or j == 4 then
for i = -1, 1 do
for k = -1, 1 do
if math.random(5) ~= 2 then
local vil = area:index(x + i, y + j + 1, z + k)
data[vil] = c_wsappleaf
end
end
end
end end
local vit = area:index(x, y + j, z) local vit = area:index(x, y + j, z)
data[vit] = c_tree data[vit] = c_tree
@ -314,7 +323,7 @@ if SINGLENODE then
persist = 0.4 persist = 0.4
} }
for chunk = 1, 32 do for chunk = 1, 32 do
print ("[watershed] chunk "..chunk) print ("[watershed] searching for spawn "..chunk)
local x0 = 80 * math.random(-24, 24) - 32 local x0 = 80 * math.random(-24, 24) - 32
local z0 = 80 * math.random(-24, 24) - 32 local z0 = 80 * math.random(-24, 24) - 32
local y0 = -32 local y0 = -32

View File

@ -1,14 +1,10 @@
-- watershed 0.3.1 by paramat -- watershed 0.3.2 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
-- bugfixes
-- optional mod clouds
-- stacked realm / singlenode option
-- volcanoes
-- TODO -- TODO
-- check river continuous over faults -- river continuous over faults?
-- tree heights vary -- tree heights vary
-- fog -- fog
@ -28,9 +24,9 @@ local CANAMP = 0.4 -- Canyon terrain amplitude
local CANEXP = 1.33 -- Canyon shape exponent local CANEXP = 1.33 -- Canyon shape exponent
local ATANAMP = 1.1 -- Arctan function amplitude, smaller = more and larger floatlands above ridges local ATANAMP = 1.1 -- Arctan function amplitude, smaller = more and larger floatlands above ridges
local TSTONE = 0.02 -- Density threshold for stone, depth of soil at TERCEN local TSTONE = 0.03 -- Density threshold for stone, depth of soil at TERCEN
local TRIV = -0.015 -- Maximum densitybase threshold for river water local TRIV = -0.02 -- Maximum densitybase threshold for river water
local TSAND = -0.018 -- Maximum densitybase threshold for river sand local TSAND = -0.025 -- Maximum densitybase threshold for river sand
local TLAVA = 2 -- Maximum densitybase threshold for lava local TLAVA = 2 -- Maximum densitybase threshold for lava
local FIST = 0 -- Fissure threshold at surface, controls size of fissure entrances at surface local FIST = 0 -- Fissure threshold at surface, controls size of fissure entrances at surface
local FISEXP = 0.02 -- Fissure expansion rate under surface local FISEXP = 0.02 -- Fissure expansion rate under surface
@ -180,14 +176,14 @@ local np_cloud = {
persist = 0.7 persist = 0.7
} }
-- 2D noise for magma -- 2D noise for magma surface
local np_magma = { local np_magma = {
offset = 0, offset = 0,
scale = 1, scale = 1,
spread = {x=128, y=128, z=128}, spread = {x=128, y=128, z=128},
seed = -13, seed = -13,
octaves = 2, octaves = 3,
persist = 0.5 persist = 0.5
} }
@ -320,11 +316,11 @@ minetest.register_on_generated(function(minp, maxp, seed)
local n_base = nvals_base[nixz] local n_base = nvals_base[nixz]
local terblen = math.max(1 - math.abs(n_base), 0) local terblen = math.max(1 - math.abs(n_base), 0)
local densitybase = (1 - math.abs(n_base)) * BASAMP + nvals_xlscale[nixz] * XLSAMP + grad local densitybase = (1 - math.abs(n_base)) * BASAMP + nvals_xlscale[nixz] * XLSAMP + grad
local altprop = (y - YWAT) / (TERCEN + TERSCA - YWAT) --local altprop = (y - YWAT) / (TERCEN + TERSCA - YWAT)
local triv = TRIV * (1 - terblen) local triv = TRIV * (1 - terblen)
local tsand = TSAND * (1 - terblen * 1.1) local tsand = TSAND * (1 - terblen)
local tstone = TSTONE * (1 - math.atan(altprop) * 0.6) -- 1 to 0.05 local tstone = TSTONE * (1 + grad)
local tlava = TLAVA * (1 - nvals_magma[nixz] ^ 4 * terblen ^ 16) local tlava = TLAVA * (1 - nvals_magma[nixz] ^ 4 * terblen ^ 16 * 0.7)
local density local density
if nvals_fault[nixyz] >= 0 then if nvals_fault[nixyz] >= 0 then
density = densitybase density = densitybase
@ -395,12 +391,12 @@ minetest.register_on_generated(function(minp, maxp, seed)
end end
if densitybase >= tlava then if densitybase >= tlava then
if densitybase >= -0.05 then if densitybase >= -0.033 then
data[vi] = c_wslava data[vi] = c_wslava
end end
stable[si] = 0 stable[si] = 0
under[si] = 0 under[si] = 0
elseif densitybase >= tlava - 0.5 and densitybase >= -0.1 then elseif densitybase >= tlava - math.min(1 + densitybase * 10, 1) then
data[vi] = c_obsidian data[vi] = c_obsidian
stable[si] = 1 stable[si] = 1
under[si] = 0 under[si] = 0