Generate cave stone deep underground

This commit is contained in:
Wuzzy 2024-12-24 13:48:32 +01:00
parent dd2681e787
commit 77859b12bb
2 changed files with 15 additions and 5 deletions

View File

@ -37,7 +37,7 @@ the corresponding backdrop will use the listed position ]]
-- Ocean backdrop
lzr_globals.BACKDROP_POS_OCEAN = table.copy(lzr_globals.DEFAULT_LEVEL_POS)
-- Underground backdrop
lzr_globals.BACKDROP_POS_UNDERGROUND = vector.new(-1999, -1999, -23007)
lzr_globals.BACKDROP_POS_UNDERGROUND = vector.new(-1999, -2999, -23007)
-- Sky backdrop
lzr_globals.BACKDROP_POS_SKY = vector.new(-3999, 129, -23007)

View File

@ -55,8 +55,11 @@ seam.
local WATER_LEVEL = 1
-- The seabed will be at this Y level, all the way down to SEASTONE_LEVEL+1 (deep ocean only)
local SEABED_LEVEL = -1000
-- The seastone will be at and below this Y level, all the way down to the bottom of the world (deep ocean only)
-- The seastone will be at and below this Y level, down to CAVESTONE_LEVEL+1 (deep ocean only)
local SEASTONE_LEVEL = -1002
-- The cave stone will be at and below this Y level, all the way down to the bottom of the world (deep ocean only)
local CAVESTONE_LEVEL = -2002
-- The deep ocean will begin when the Z coordinate is this value or lower.
-- WARNING: This value is duplicated in lzr_globals.
@ -162,6 +165,7 @@ local result_heightmap = {}
-- Get the content IDs for the nodes used.
local c_stone = minetest.get_content_id("lzr_core:stone")
local c_cave_stone = minetest.get_content_id("lzr_core:cave_stone")
local c_sand = minetest.get_content_id("lzr_core:sand")
local c_sand_dark = minetest.get_content_id("lzr_core:seabed")
local c_dirt = minetest.get_content_id("lzr_core:dirt")
@ -319,7 +323,9 @@ local generate_piece = function(minp, maxp, vm, prot_min, prot_max)
local vi = area:index(x, y, z)
-- Deep ocean
if z <= DEEP_OCEAN_Z then
if y <= SEASTONE_LEVEL then
if y <= CAVESTONE_LEVEL then
vm_data[vi] = c_cave_stone
elseif y <= SEASTONE_LEVEL then
vm_data[vi] = c_stone
elseif y <= SEABED_LEVEL then
vm_data[vi] = c_seabed
@ -341,8 +347,12 @@ local generate_piece = function(minp, maxp, vm, prot_min, prot_max)
local dirt = (theight > 2 and theight < hills_thresh and isln_trees[z-minp.z+1][x-minp.x+1] > 0) and c_dirt_l or c_dirt_g
if theight > y then
vm_data[vi] = c_stone
if y < theight then
if y <= CAVESTONE_LEVEL then
vm_data[vi] = c_cave_stone
else
vm_data[vi] = c_stone
end
elseif y==ceil(theight) then
vm_data[vi]= y < -3 and c_sand_dark or y<4 and c_sand or (y<60-random(3) and dirt or c_snow)
elseif y <= WATER_LEVEL then