better biomes and cleaned up code

This commit is contained in:
kaadmy 2015-10-02 10:41:35 -07:00
parent 4eee09c3be
commit 7184c0be7e

View File

@ -29,6 +29,8 @@ minetest.register_alias("mapgen_lava_source", "default:water_source")
-- Ore generation -- Ore generation
-- --
-- Coal
minetest.register_ore( minetest.register_ore(
{ {
ore_type = "scatter", ore_type = "scatter",
@ -65,6 +67,8 @@ minetest.register_ore(
height_max = -64, height_max = -64,
}) })
-- Iron
minetest.register_ore( minetest.register_ore(
{ {
ore_type = "scatter", ore_type = "scatter",
@ -89,6 +93,8 @@ minetest.register_ore(
height_max = -32, height_max = -32,
}) })
-- Steel blocks
minetest.register_ore( minetest.register_ore(
{ {
ore_type = "blob", ore_type = "blob",
@ -107,81 +113,147 @@ minetest.register_ore(
minetest.clear_registered_biomes() minetest.clear_registered_biomes()
-- Biomes -- Aboveground biomes
minetest.register_biome( minetest.register_biome(
{ {
name = "Deep Forest", name = "Deep Forest",
node_top = "default:dirt_with_grass", depth_top = 1,
node_filler = "default:dirt", depth_filler = 6, node_top = "default:dirt_with_grass",
node_underwater = "default:dirt", node_filler = "default:dirt",
node_shore_top = "default:dirt",
node_shore_filler = "default:dirt", height_shore = 0, depth_filler = 6,
y_min = 10, y_max = 50, depth_top = 1,
heat_point = 30, humidity_point = 40,
y_min = 2,
y_max = 50,
heat_point = 30,
humidity_point = 40,
}) })
minetest.register_biome( minetest.register_biome(
{ {
name = "Forest", name = "Forest",
node_top = "default:dirt_with_grass", depth_top = 1,
node_filler = "default:dirt", depth_filler = 6,
node_underwater = "default:dirt",
node_shore_top = "default:sand",
node_shore_filler = "default:sandstone", height_shore = 0,
y_min = 0, y_max = 200,
heat_point = 35, humidity_point = 40,
})
minetest.register_biome( node_top = "default:dirt_with_grass",
{ node_filler = "default:dirt",
name = "Grassland Ocean",
node_top = "default:sand", depth_top = 3, depth_filler = 6,
node_filler = "default:dirt", depth_filler = 1, depth_top = 1,
node_underwater = "default:dirt",
node_shore_top = "default:sand", y_min = 2,
node_shore_filler = "default:sand", height_shore = 0, y_max = 200,
y_min = -32000, y_max = 2,
heat_point = 50, humidity_point = 35, heat_point = 35,
humidity_point = 40,
}) })
minetest.register_biome( minetest.register_biome(
{ {
name = "Grassland", name = "Grassland",
node_top = "default:dirt_with_grass", depth_top = 1,
node_filler = "default:dirt", depth_filler = 3, node_top = "default:dirt_with_grass",
node_underwater = "default:dirt", node_filler = "default:dirt",
node_shore_top = "default:sand",
node_shore_filler = "default:sand", height_shore = 0, depth_filler = 3,
y_min = 3, y_max = 32000, depth_top = 1,
heat_point = 50, humidity_point = 35,
y_min = 3,
y_max = 32000,
heat_point = 50,
humidity_point = 35,
}) })
minetest.register_biome( minetest.register_biome(
{ {
name = "Savanna", name = "Savanna",
node_top = "default:dirt_with_dry_grass", depth_top = 1,
node_filler = "default:dirt", depth_filler = 2, node_top = "default:dirt_with_dry_grass",
node_underwater = "default:dirt", node_filler = "default:dirt",
node_shore_top = "default:sand",
node_shore_filler = "default:sand", height_shore = 0, depth_filler = 2,
y_min = -32000, y_max = 32000, depth_top = 1,
heat_point = 60, humidity_point = 25,
y_min = 0,
y_max = 32000,
heat_point = 60,
humidity_point = 30,
}) })
minetest.register_biome( minetest.register_biome(
{ {
name = "Desert", name = "Desert",
node_top = "default:sand", depth_top = 3,
node_filler = "default:sandstone", depth_filler = 8, node_top = "default:sand",
node_underwater = "default:dirt", node_filler = "default:sandstone",
node_shore_top = "default:sand",
node_shore_filler = "default:sand", height_shore = 0, depth_filler = 8,
y_min = 0, y_max = 32000, depth_top = 3,
heat_point = 70, humidity_point = 20,
y_min = 0,
y_max = 32000,
heat_point = 70,
humidity_point = 20,
}) })
-- Oceans
minetest.register_biome(
{
name = "Grassland Ocean",
node_top = "default:sand",
node_filler = "default:dirt",
depth_filler = 1,
depth_top = 3,
y_min = -32000,
y_max = 2,
heat_point = 50,
humidity_point = 35,
})
minetest.register_biome(
{
name = "Savanna Ocean",
node_top = "default:dirt",
node_filler = "dfault:dirt",
depth_filler = 0,
depth_top = 1,
y_min = -32000,
y_max = -1,
heat_point = 60,
humidity_point = 30,
})
--
-- Decorations -- Decorations
--
-- Trees
minetest.register_decoration(
{
deco_type = "schematic",
place_on = {"default:dirt_with_grass"},
sidelen = 16,
fill_ratio = 0.004,
biomes = {"Forest"},
flags = "place_center_x, place_center_z",
replacements = {["default:leaves"] = "default:leaves_birch", ["default:tree"] = "default:tree_birch", ["default:apple"] = "air"},
schematic = minetest.get_modpath("default").."/schematics/default_squaretree.mts",
y_min = -32000,
y_max = 32000,
})
minetest.register_decoration( minetest.register_decoration(
{ {
@ -192,7 +264,7 @@ minetest.register_decoration(
biomes = {"Grassland"}, biomes = {"Grassland"},
flags = "place_center_x, place_center_z", flags = "place_center_x, place_center_z",
schematic = minetest.get_modpath("default").."/schematics/default_tree.mts", schematic = minetest.get_modpath("default").."/schematics/default_tree.mts",
y_min = -32000, y_min = 10,
y_max = 32000, y_max = 32000,
}) })
@ -210,34 +282,6 @@ minetest.register_decoration(
y_max = 32000, y_max = 32000,
}) })
minetest.register_decoration(
{
deco_type = "schematic",
place_on = {"default:dirt_with_grass"},
sidelen = 16,
fill_ratio = 0.028,
biomes = {"Deep Forest"},
flags = "place_center_x, place_center_z",
-- replacements = {["default:leaves"] = "default:leaves_birch", ["default:tree"] = "default:tree_birch"},
schematic = minetest.get_modpath("default").."/schematics/default_gigatree.mts",
y_min = -32000,
y_max = 32000,
})
minetest.register_decoration(
{
deco_type = "schematic",
place_on = {"default:dirt_with_grass"},
sidelen = 16,
fill_ratio = 0.004,
biomes = {"Forest"},
flags = "place_center_x, place_center_z",
replacements = {["default:leaves"] = "default:leaves_birch", ["default:tree"] = "default:tree_birch", ["default:apple"] = "air"},
schematic = minetest.get_modpath("default").."/schematics/default_squaretree.mts",
y_min = -32000,
y_max = 32000,
})
minetest.register_decoration( minetest.register_decoration(
{ {
deco_type = "schematic", deco_type = "schematic",
@ -253,20 +297,19 @@ minetest.register_decoration(
minetest.register_decoration( minetest.register_decoration(
{ {
deco_type = "simple", deco_type = "schematic",
place_on = {"default:sand", "default:dirt", "default:dirt_with_grass"}, place_on = {"default:dirt_with_grass"},
spawn_by = {"default:water_source", "default:water_flowing"},
num_spawn_by = 1,
sidelen = 16, sidelen = 16,
fill_ratio = 0.08, fill_ratio = 0.028,
biomes = {"Grassland Ocean", "Grassland", "Forest"}, biomes = {"Deep Forest"},
decoration = {"default:papyrus"}, flags = "place_center_x, place_center_z",
height = 2, schematic = minetest.get_modpath("default").."/schematics/default_gigatree.mts",
height_max = 3, y_min = -32000,
y_min = 0, y_max = 32000,
y_max = 31000,
}) })
-- Papyrus
minetest.register_decoration( minetest.register_decoration(
{ {
deco_type = "simple", deco_type = "simple",
@ -274,8 +317,8 @@ minetest.register_decoration(
spawn_by = {"default:water_source", "default:water_flowing"}, spawn_by = {"default:water_source", "default:water_flowing"},
num_spawn_by = 1, num_spawn_by = 1,
sidelen = 16, sidelen = 16,
fill_ratio = 0.22, fill_ratio = 0.08,
biomes = {"Deep Forest"}, biomes = {"Grassland Ocean", "Grassland", "Forest", "Deep Forest"},
decoration = {"default:papyrus"}, decoration = {"default:papyrus"},
height = 2, height = 2,
height_max = 3, height_max = 3,
@ -283,6 +326,8 @@ minetest.register_decoration(
y_max = 31000, y_max = 31000,
}) })
-- Grasses
minetest.register_decoration( minetest.register_decoration(
{ {
deco_type = "simple", deco_type = "simple",
@ -301,10 +346,10 @@ minetest.register_decoration(
place_on = "default:dirt_with_dry_grass", place_on = "default:dirt_with_dry_grass",
sidelen = 16, sidelen = 16,
fill_ratio = 0.07, fill_ratio = 0.07,
biomes = {"Savanna"}, biomes = {"Desert", "Savanna"},
decoration = {"default:dry_grass"}, decoration = {"default:dry_grass"},
y_min = 0, y_min = 10,
y_max = 50, y_max = 500,
}) })
minetest.register_decoration( minetest.register_decoration(
@ -343,51 +388,35 @@ minetest.register_decoration(
y_max = 32000, y_max = 32000,
}) })
minetest.register_decoration( -- Farming
{
deco_type = "simple",
place_on = "default:dirt_with_grass",
sidelen = 16,
fill_ratio = 0.006,
biomes = {"Grassland"},
decoration = {"farming:wheat_4"},
y_min = 0,
y_max = 32000,
})
minetest.register_decoration( if minetest.get_modpath("farming") ~= nil then
{ minetest.register_decoration(
deco_type = "simple", {
place_on = "default:sand", deco_type = "simple",
sidelen = 16, place_on = "default:dirt_with_grass",
fill_ratio = 0.004, sidelen = 16,
biomes = {"Desert"}, fill_ratio = 0.006,
decoration = {"farming:cotton_4"}, biomes = {"Grassland", "Savanna"},
y_min = 0, decoration = {"farming:wheat_4"},
y_max = 32000, y_min = 0,
}) y_max = 32000,
})
--[[minetest.register_decoration( minetest.register_decoration(
{ {
deco_type = "schematic", deco_type = "simple",
place_on = {"default:dirt_with_grass"}, place_on = "default:sand",
noise_params = { sidelen = 16,
offset = 0.03, fill_ratio = 0.004,
scale = 0.03, biomes = {"Desert"},
spread = {x = 2000, y = 4000, z = 2000}, decoration = {"farming:cotton_4"},
seed = 2442, y_min = 0,
octaves = 1, y_max = 32000,
persist = 0.01, })
}, end
sidelen = 16,
fill_ratio = 0.004,
flags = "place_center_x, place_center_z, force_placement",
schematic = minetest.get_modpath("default").."/schematics/default_house.mts",
y_min = 5,
y_max = 50,
rotation = "random", -- Cactus
})--]]
minetest.register_decoration( minetest.register_decoration(
{ {
@ -398,23 +427,9 @@ minetest.register_decoration(
biomes = {"Desert"}, biomes = {"Desert"},
flags = "place_center_x, place_center_z", flags = "place_center_x, place_center_z",
schematic = minetest.get_modpath("default").."/schematics/default_cactus.mts", schematic = minetest.get_modpath("default").."/schematics/default_cactus.mts",
y_min = 5, y_min = 10,
y_max = 32000, y_max = 500,
rotation = "random", rotation = "random",
}) })
--[[minetest.register_decoration(
{
deco_type = "simple",
place_on = "default:sand",
sidelen = 16,
fill_ratio = 0.004,
biomes = {"Desert"},
decoration = {"default:cactus"},
height = 2,
height_max = 3,
y_min = 5,
y_max = 32000,
})--]]
default.log("mapgen", "loaded") default.log("mapgen", "loaded")