added more debugging, a tree schematic a oriignal tree textures
This commit is contained in:
parent
9ba65f6a4c
commit
25fbcf19cb
47
init.lua
47
init.lua
@ -33,7 +33,7 @@ local HEIGHT_VARIANCE = 800 -- total height variance for the heightmap used to c
|
||||
|
||||
local GRASS_FREQUENCY = 0.7
|
||||
|
||||
local CYANLANDS_DISPLACEMENT = 0
|
||||
local CYANLANDS_DISPLACEMENT = 20
|
||||
local CYANLANDS_LAYER_HEIGHT = 350
|
||||
local CYANLANDS_TOPGRADIENT_LENGTH = 250 -- used to ease of the density of the noise as height within the layer increases
|
||||
local CYANLANDS_TOPGRADIENT_START = CYANLANDS_LAYER_HEIGHT-CYANLANDS_TOPGRADIENT_LENGTH -- height within the layer for the top gradient
|
||||
@ -41,7 +41,7 @@ local CYANLANDS_HORIZONTAL_UPPERGRADIENT_LENGTH = 40 -- used to ease of the dens
|
||||
local CYANLANDS_HORIZONTAL_LOWERGRADIENT_LENGTH = 40 -- ^ orangelands
|
||||
|
||||
-- TODO _BIOME_HEIGHT should have the same meaning for any biome
|
||||
local BLUELANDS_DISPLACEMENT = 0
|
||||
local BLUELANDS_DISPLACEMENT = 20
|
||||
local BLUELANDS_BIOME_HEIGHT = HEIGHT_VARIANCE - 200 -- when the heightmap is above this, the biome is bluelands
|
||||
local BLUELANDS_LAYER_HEIGHT = 200
|
||||
local BLUELANDS_TOPGRADIENT_LENGTH = 100
|
||||
@ -61,7 +61,7 @@ local REALM_FINISH = REALM_START+HEIGHT_VARIANCE
|
||||
-- debug stuff
|
||||
local DEBUG_FLAGS = { debug_blocks=true, overwrite_seed = true, cherrypicked_spawn = false, cherrypick_biome=true, give_privs=true }
|
||||
local DEBUG_FREQUENCY = 5
|
||||
local DESIRED_BIOME = "bluelands"
|
||||
local DESIRED_BIOME = "cyanlands"
|
||||
local debug_data = {
|
||||
mapblock_count = 0,
|
||||
timeAccumulator_total = 0,
|
||||
@ -72,6 +72,26 @@ local debug_data = {
|
||||
timeAccumulator_calcLight = 0,
|
||||
}
|
||||
|
||||
local schematics_path = minetest.get_modpath("ether_lands").."/schematics/"
|
||||
|
||||
ether_lands.schematics = {
|
||||
path = minetest.get_modpath("ether_lands").."/schematics/",
|
||||
cyanlands_tree1 = schematics_path.."cyanlands_tree1.mts",
|
||||
}
|
||||
|
||||
minetest.register_chatcommand("testschem", {
|
||||
func = function( name, param )
|
||||
minetest.place_schematic(
|
||||
minetest.string_to_pos(param),
|
||||
ether_lands.schematics.cyanlands_tree1,
|
||||
"random",
|
||||
nil,
|
||||
true,
|
||||
"place_center_x,place_center_z"
|
||||
)
|
||||
end
|
||||
|
||||
})
|
||||
-- noise parameters -----------------------------------------------------------
|
||||
|
||||
ether_lands.heightmap_parameters = {
|
||||
@ -105,7 +125,9 @@ ether_lands.cyanland_noise2_parameters = {
|
||||
local modpath = minetest.get_modpath("ether_lands")
|
||||
dofile(modpath .. "/nodes.lua")
|
||||
|
||||
local cid_debug_node = minetest.get_content_id("ether_lands:grass_orange")
|
||||
local cid_debugnode_mapchunk = minetest.get_content_id("default:meselamp")
|
||||
local cid_debugnode_edge = minetest.get_content_id("ether_lands:debugnode_edge")
|
||||
local cid_debugnode_actualedge = minetest.get_content_id("ether_lands:debugnode_actualedge")
|
||||
|
||||
local cid_stone_cyan = minetest.get_content_id("ether_lands:levistone_cyan")
|
||||
local cid_stone_blue = minetest.get_content_id("ether_lands:levistone_blue")
|
||||
@ -179,6 +201,8 @@ function( generate_VoxelArea, buffer_VoxelArea, cid_buffer, param2_buffer, noise
|
||||
time_init = os.clock()
|
||||
heightmap_generator:get_2d_map_flat(
|
||||
{x=generate_VoxelArea.MinEdge.x, y=generate_VoxelArea.MinEdge.z}, noise_buffers.heightmap_buffer )
|
||||
-- TODO only retrieve 3d noises if this mapchunk overlaps the biome edges
|
||||
-- otherwise skip get_map, and loops (maybe even return error so calc lighting and writing back can be skept)
|
||||
cyanland_noise1_generator:get_3d_map_flat(
|
||||
generate_VoxelArea.MinEdge, noise_buffers.cyanland1_buffer )
|
||||
cyanland_noise2_generator:get_3d_map_flat(
|
||||
@ -222,6 +246,7 @@ function( generate_VoxelArea, buffer_VoxelArea, cid_buffer, param2_buffer, noise
|
||||
height = base_height
|
||||
height = height + REALM_START
|
||||
|
||||
|
||||
--TODO precalc most of these and add horizontal_uppergradient_start and __lowergradient_start
|
||||
if( base_height < ORANGELANDS_BIOME_HEIGHT ) then
|
||||
levistone_id = cid_stone_orange
|
||||
@ -319,12 +344,24 @@ function( generate_VoxelArea, buffer_VoxelArea, cid_buffer, param2_buffer, noise
|
||||
|
||||
end
|
||||
if( DEBUG_FLAGS.debug_blocks ) then
|
||||
if (( y == math.floor(height) ) or ( y == math.floor(max_height) ))
|
||||
then
|
||||
node_index_in_emerged = buffer_VoxelArea:index(x, y, z)
|
||||
cid_buffer[node_index_in_emerged] = cid_debugnode_edge
|
||||
end
|
||||
local actualedge_min = height
|
||||
local actualedge_max = top_gradient_start+top_gradient_length*0.5 -- 0.5 is dirt density remaped to [0:1]
|
||||
if (( y == math.floor(actualedge_min) ) or ( y == math.floor(actualedge_max) ))
|
||||
then
|
||||
node_index_in_emerged = buffer_VoxelArea:index(x, y, z)
|
||||
cid_buffer[node_index_in_emerged] = cid_debugnode_actualedge
|
||||
end
|
||||
if (( x == xmin+16*2+8) or ( x == xmin+16*2+1+8 ))
|
||||
and(( y == ymin+16*2+8) or ( y == ymin+16*2+1+8 ))
|
||||
and(( z == zmin+16*2+8) or ( z == zmin+16*2+1+8 ))
|
||||
then
|
||||
node_index_in_emerged = buffer_VoxelArea:index(x, y, z)
|
||||
cid_buffer[node_index_in_emerged] = cid_debug_node
|
||||
cid_buffer[node_index_in_emerged] = cid_debugnode_mapchunk
|
||||
end
|
||||
end
|
||||
end
|
||||
|
36
nodes.lua
36
nodes.lua
@ -1,12 +1,30 @@
|
||||
minetest.register_node("ether_lands:debugnode_edge", {
|
||||
description = "edge",
|
||||
drawtype = "glasslike_framed_optional",
|
||||
tiles = {"debugnode_edge.png", "debugnode_edge.png"},
|
||||
paramtype = "light",
|
||||
paramtype2 = "glasslikeliquidlevel",
|
||||
sunlight_propagates = true,
|
||||
is_ground_content = false,
|
||||
})
|
||||
|
||||
minetest.register_node("ether_lands:debugnode_actualedge", {
|
||||
description = "actualedge",
|
||||
drawtype = "glasslike_framed_optional",
|
||||
tiles = {"debugnode_actualedge.png", "debugnode_actualedge.png"},
|
||||
paramtype = "light",
|
||||
paramtype2 = "glasslikeliquidlevel",
|
||||
sunlight_propagates = true,
|
||||
is_ground_content = false,
|
||||
})
|
||||
-- cyan biome
|
||||
|
||||
minetest.register_node("ether_lands:cyan_tree", {
|
||||
description = "Cyanlands Tree Trunk",
|
||||
tiles = {"cyanlands_tree_top.png", "cyanlands_tree_top.png", "cyanlands_tree.png"},
|
||||
tiles = {"cyanlands_treetrunk.png"},
|
||||
paramtype2 = "facedir",
|
||||
is_ground_content = false,
|
||||
groups = {tree = 1, choppy = 2, oddly_breakable_by_hand = 1, flammable = 2},
|
||||
groups = {tree = 1, choppy = 2, oddly_breakable_by_hand = 100, flammable = 2},
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
|
||||
on_place = minetest.rotate_node,
|
||||
@ -29,7 +47,9 @@ minetest.register_node("ether_lands:cyan_leaves", {
|
||||
minetest.register_node("ether_lands:levistone_cyan", {
|
||||
description = "Cyan Levistone",
|
||||
tiles = { "levistone_cyan.png" },
|
||||
sounds = default.node_sound_stone_defaults()
|
||||
sounds = default.node_sound_stone_defaults(),
|
||||
groups = {tree = 1, choppy = 2, oddly_breakable_by_hand = 100, flammable = 2},
|
||||
is_ground_content = false,
|
||||
})
|
||||
|
||||
minetest.register_node("ether_lands:dirt_cyan", {
|
||||
@ -37,7 +57,9 @@ minetest.register_node("ether_lands:dirt_cyan", {
|
||||
tiles = { "dirt_cyan.png" },
|
||||
sounds = default.node_sound_dirt_defaults({
|
||||
footstep = {name="default_grass_footstep", gain=0.25}
|
||||
})
|
||||
}),
|
||||
is_ground_content = false,
|
||||
groups = {tree = 1, choppy = 2, oddly_breakable_by_hand = 100, flammable = 2},
|
||||
})
|
||||
|
||||
minetest.register_node("ether_lands:grass_cyan", {
|
||||
@ -45,7 +67,9 @@ minetest.register_node("ether_lands:grass_cyan", {
|
||||
tiles = { "grass_cyan.png" },
|
||||
sounds = default.node_sound_dirt_defaults({
|
||||
footstep = {name="default_grass_footstep", gain=0.25}
|
||||
})
|
||||
}),
|
||||
is_ground_content = false,
|
||||
groups = {tree = 1, choppy = 2, oddly_breakable_by_hand = 100, flammable = 2},
|
||||
})
|
||||
|
||||
minetest.register_node("ether_lands:plant_1_grass_cyan", {
|
||||
@ -58,6 +82,8 @@ minetest.register_node("ether_lands:plant_1_grass_cyan", {
|
||||
walkable = false,
|
||||
buildable_to = true,
|
||||
drop = "ether_lands:plant_1_grass_cyan",
|
||||
groups = {tree = 1, choppy = 2, oddly_breakable_by_hand = 100, flammable = 2},
|
||||
is_ground_content = false,
|
||||
})
|
||||
|
||||
--blue biome
|
||||
|
BIN
schematics/cyanlands_tree1.mts
Normal file
BIN
schematics/cyanlands_tree1.mts
Normal file
Binary file not shown.
BIN
textures/cyanlands_treetrunk.png
Normal file
BIN
textures/cyanlands_treetrunk.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 892 B |
BIN
textures/debugnode_actualedge.png
Normal file
BIN
textures/debugnode_actualedge.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.1 KiB |
BIN
textures/debugnode_edge.png
Normal file
BIN
textures/debugnode_edge.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.1 KiB |
Loading…
x
Reference in New Issue
Block a user