diff --git a/beach_biomes.lua b/beach_biomes.lua deleted file mode 100644 index f045af2..0000000 --- a/beach_biomes.lua +++ /dev/null @@ -1,162 +0,0 @@ --- 1 -minetest.register_biome({ - name = "gravel_beach", - node_top = "default:gravel", - depth_top = 1, - node_filler = "default:gravel", - depth_filler = 3, - node_stone = "default:stone", - y_min = -7, - y_max = 6, - heat_point = 19, - humidity_point = 19, -}) - --- 2 -minetest.register_biome({ - name = "sand_dunes", - node_top = "default:sand", - depth_top = 1, - node_filler = "default:sand", - depth_filler = 3, - node_stone = "default:stone", - y_min = -5, - y_max = 5, - heat_point = 21, - humidity_point = 61, -}) - --- 3 -minetest.register_biome({ - name = "mangrove", - node_top = "default:dirt", - depth_top = 1, - node_filler = "default:dirt", - depth_filler = 4, - node_stone = "default:stone", - y_min = -4, - y_max = 0, - heat_point = 96, - humidity_point = 106, -}) - --- 4 -minetest.register_biome({ - name = "desert_dunes", - node_top = "default:sand", - depth_top = 1, - node_filler = "default:sand", - depth_filler = 2, - node_stone = "default:stone", - y_min = -5, - y_max = 6, - heat_point = 70, - humidity_point = 6, -}) - --- 5 -minetest.register_biome({ - name = "hot_sand_dunes", - node_top = "default:sand", - depth_top = 1, - node_filler = "default:sand", - depth_filler = 3, - node_stone = "default:stone", - y_min = -5, - y_max = 5, - heat_point = 106, - humidity_point = 49, -}) - --- 6 -minetest.register_biome({ - name = "tundra_dunes", - node_dust = "default:snow", - node_top = "default:sand", - depth_top = 2, - node_filler = "default:gravel", - depth_filler = 1, - node_stone = "default:stone", - y_min = -5, - y_max = 2, - heat_point = 5, - humidity_point = 21, -}) - --- Glacier 2 without snow -minetest.register_biome({ - name = "glacier_2_shore", - node_dust = "default:snowblock", - node_top = "default:ice", - depth_top = 4, - node_stone = "default:stone", - node_water_top = "default:ice", - depth_water_top = 6, - node_river_water = "default:ice", - y_min = -4, - y_max = 0, - heat_point = -19, - humidity_point = 40, -}) - --- Glacier 3 without snow -minetest.register_biome({ - name = "glacier_3_shore", - node_dust = "default:snowblock", - node_top = "default:ice", - depth_top = 12, - node_stone = "default:stone", - node_water_top = "default:ice", - depth_water_top = 6, - node_river_water = "default:ice", - y_min = -4, - y_max = 0, - heat_point = -27, - humidity_point = 80, -}) - --- Swamp without grass -minetest.register_biome({ - name = "swamp_shore", - node_top = "default:dirt", - depth_top = 1, - node_filler = "default:dirt", - depth_filler = 3, - node_stone = "default:stone", - y_min = -3, - y_max = 0, - heat_point = 30, - humidity_point = 114, -}) - --- Icy swamp without snow -minetest.register_biome({ - name = "icy_swamp_shore", - node_dust = "default:snow", - node_top = "default:dirt", - depth_top = 3, - node_filler = "default:dirt", - depth_filler = 3, - node_stone = "default:stone", - node_water_top = "default:ice", - depth_water_top = 1, - node_river_water = "default:ice", - y_min = -4, - y_max = 0, - heat_point = -10, - humidity_point = 107, -}) - --- Hot swamp without grass -minetest.register_biome({ - name = "hot_swamp_shore", - node_top = "default:dirt", - depth_top = 1, - node_filler = "default:dirt", - depth_filler = 4, - node_stone = "default:stone", - y_min = -3, - y_max = 0, - heat_point = 83, - humidity_point = 116, -}) diff --git a/biomes.csv b/biomes.csv new file mode 100644 index 0000000..38e7e39 --- /dev/null +++ b/biomes.csv @@ -0,0 +1,60 @@ +#Open this file with a spreadsheet software,,,,,,,,,, +#Use a leading '#' to disable a line,,,,,,,,,, +#Blank cells are ignored,,,,,,,,,, +,,,,,,,,,, +#Name,Stone,Fill,Top,Dust,Sea,River,Elev_min,Elev_max,Heat,Humidity +,,,,,,,,,, +#Main biomes,,,,,,,,,, +glacier_1,default:stone,,default:ice 2,default:snowblock,default:ice 2,default:ice,-6,31000,-11,20 +glacier_2,default:stone,default:ice 4,default:snowblock 3,default:snowblock,default:ice 6,default:ice,1,31000,-19,40 +glacier_3,default:stone,default:ice 12,default:snowblock 5,default:snowblock,default:ice 10,default:ice,1,31000,-27,80 +taiga,default:stone,default:dirt 5,default:dirt_with_snow,default:snow,,,4,31000,11,67 +tundra,default:stone,default:dirt 2,default:dirt_with_snow,,,,3,31000,4,32 +coniferous_forest,default:stone,default:dirt 2,default:dirt_with_grass,,,,5,31000,22,71 +cold_gravel_desert,default:stone,default:gravel,default:gravel,default:snow,,,-6,31000,-2,2 +gravel_desert,default:stone,default:gravel 2,default:gravel,,,,2,31000,20,-2 +dry_tundra,default:stone,default:dirt 2,default:dirt_with_snow,,,,2,31000,4,12 +cold_desert,default:stone,,,,,,3,31000,32,-3 +swamp,default:stone,default:dirt 3,default:dirt_with_grass,,,,1,31000,30,114 +icy_swamp,default:stone,default:dirt 3,default:dirt_with_snow,default:snow,default:ice,default:ice,1,31000,-10,107 +stone_grasslands,default:stone,default:dirt,default:dirt_with_grass,,,,4,31000,29,22 +mixed_forest,default:stone,default:dirt 2,default:dirt_with_grass,,,,5,31000,24,56 +cold_deciduous_forest,default:stone,default:dirt 2,default:dirt_with_grass,,,,4,31000,31,48 +deciduous_forest,default:stone,default:dirt 3,default:dirt_with_grass,,,,5,31000,45,65 +bushes,default:stone,default:dirt,default:dirt_with_grass,,,,7,31000,43,30 +scrub,default:stone,default:dirt,default:dirt_with_dry_grass,,,,8,31000,57,25 +hot_pine_forest,default:stone,default:dirt,default:dirt_with_grass,,,,6,31000,65,35 +desert,default:desert_stone,default:desert_sand 3,default:desert_sand,,,,7,31000,89,9 +sandstone_grasslands,default:sandstone,default:dirt 2,default:dirt_with_grass,,,,3,31000,55,15 +savanna,default:stone,default:dirt,default:dirt_with_dry_grass,,,,6,31000,80,24 +desert_stone_grasslands,default:desert_stone,default:dirt,default:dirt_with_grass,,,,4,31000,90,41 +red_savanna,default:desert_stone,default:dirt,default:dirt_with_dry_grass,,,,5,31000,90,31 +semi-tropical_forest,default:stone,default:dirt 3,default:dirt_with_grass,,,,4,31000,72,61 +rainforest,default:stone,default:dirt 4,default:dirt_with_grass,,,,1,31000,89,76 +sandstone_desert,default:sandstone,default:desert_sand,default:desert_sand,,,,6,31000,60,0 +orchard,default:stone,default:dirt 2,default:dirt_with_grass,,,,6,31000,40,40 +hot_deciduous_forest,default:stone,default:dirt 2,default:dirt_with_grass,,,,5,31000,61,58 +hot_swamp,default:stone,default:dirt 4,default:dirt_with_grass,,,,1,31000,83,116 +,,,,,,,,,, +#Beach biomes,,,,,,,,,, +gravel_beach,default:stone,default:gravel 3,default:gravel,,,,-7,6,19,19 +sand_dunes,default:stone,default:sand 3,default:sand,,,,-5,5,21,61 +mangrove,default:stone,default:dirt 4,default:dirt,,,,-4,0,96,106 +desert_dunes,default:stone,default:sand 2,deault:sand,,,,-5,6,70,6 +hot_sand_dunes,default:stone,default:sand 3,default:sand,,,,-5,5,106,49 +tundra_dunes,default:stone,default:gravel,default:sand 2,default:snow,,,-5,2,5,21 +,,,,,,,,,, +glacier_2_shore,default:stone,,default:ice 4,default:snowblock,default:ice 6,default:ice,-4,0,-19,40 +glacier_3_shore,default:stone,,default:ice 12,default:snowblock,default:ice 6,default:ice,-4,0,-27,80 +swamp_shore,default:stone,default:dirt 3,default:dirt,,,,-3,0,30,114 +icy_swamp_shore,default:stone,default:dirt 4,default:dirt 3,default:snow,default:ice,default:ice,-4,0,-10,107 +hot_swamp_shore,default:stone,default:dirt 4,default:dirt,,,,-3,0,83,116 +,,,,,,,,,, +#Sea biomes,,,,,,,,,, +pack_ice,default:stone,,default:gravel,default:snow,default:ice 5,default:ice,-112,-6,-24,41 +cold_sea,default:stone,,default:gravel 2,,,,-112,-6,20,47 +tempered_sea,default:stone,,default:sand 2,,,,-112,-6,41,48 +warm_sea,default:stone,default:sand 2,default:sand,,,,-112,-6,89,51 +,,,,,,,,,, +#Underground,,,,,,,,,, +underground,default:stone,,,,,,-31000,-113,50,50 diff --git a/init.lua b/init.lua index 29dc304..a798100 100644 --- a/init.lua +++ b/init.lua @@ -19,16 +19,56 @@ minetest.register_node("biomes:mud", { sounds = default.node_sound_dirt_defaults(), }) -dofile(path .. "/main_biomes.lua") -dofile(path .. "/beach_biomes.lua") -dofile(path .. "/sea_biomes.lua") -dofile(path .. "/decorations.lua") +for line in io.lines(path .. "/biomes.csv") do + local attribs = line:split(",", true) + local name, stone, fill, top, dust, sea, river, ymin, ymax, heat, humidity = unpack(attribs) -minetest.register_biome({ - name = "underground", - node_stone = "default:stone", - y_min = -113, - y_max = -31000, - heat_point = 50, - humidity_point = 50, -}) + if #name > 0 and name:sub(1,1) ~= "#" then + -- Register biome + local biome = {name=name} + + if stone and #stone > 0 then + biome.stone = stone + end + + if fill and #fill > 0 then + fill = fill:split("%s", false, 1, true) + biome.node_filler = fill[1] + biome.depth_filler = tonumber(fill[2] or 1) + end + + if top and #top > 0 then + top = top:split("%s", false, 1, true) + biome.node_top = top[1] + biome.depth_top = tonumber(top[2] or 1) + end + + if dust and #dust > 0 then + biome.node_dust = dust + end + + if sea and #sea > 0 then + sea = sea:split("%s", false, 1, true) + biome.node_water_top = sea[1] + biome.depth_water_top = tonumber(sea[2] or 1) + end + + if river and #river > 0 then + biome.node_river_water = river + end + + biome.y_min = tonumber(ymin) or -31000 + biome.y_max = tonumber(ymax) or 31000 + biome.heat_point = tonumber(heat) or 50 + biome.humidity_point = tonumber(humidity) or 50 + + local id = minetest.register_biome(biome) + + print("Biome \"" .. name .. "\" registered with ID=" .. id .. ", temperature " .. biome.heat_point .. ", humidity " .. biome.humidity_point .. ".") + end +end + +--dofile(path .. "/main_biomes.lua") +--dofile(path .. "/beach_biomes.lua") +--dofile(path .. "/sea_biomes.lua") +dofile(path .. "/decorations.lua") diff --git a/main_biomes.lua b/main_biomes.lua deleted file mode 100644 index 07ade8c..0000000 --- a/main_biomes.lua +++ /dev/null @@ -1,433 +0,0 @@ --- 30 main biomes - --- 1 -minetest.register_biome({ - name = "glacier_1", - node_dust = "default:snowblock", - node_top = "default:ice", - depth_top = 2, - node_stone = "default:stone", - node_water_top = "default:ice", - depth_water_top = 2, - node_river_water = "default:ice", - y_min = -6, - y_max = 31000, - heat_point = -11, - humidity_point = 20, -}) - --- 2 -minetest.register_biome({ - name = "glacier_2", - node_dust = "default:snowblock", - node_top = "default:snowblock", - depth_top = 3, - node_filler = "default:ice", - depth_filler = 4, - node_stone = "default:stone", - node_water_top = "default:ice", - depth_water_top = 6, - node_river_water = "default:ice", - y_min = 1, - y_max = 31000, - heat_point = -19, - humidity_point = 40, -}) - --- 3 -minetest.register_biome({ - name = "glacier_3", - node_dust = "default:snowblock", - node_top = "default:snowblock", - depth_top = 5, - node_filler = "default:ice", - depth_filler = 12, - node_stone = "default:stone", - node_water_top = "default:ice", - depth_water_top = 10, - node_river_water = "default:ice", - y_min = 1, - y_max = 31000, - heat_point = -27, - humidity_point = 80, -}) - --- 4 -minetest.register_biome({ - name = "taiga", - node_dust = "default:snow", - node_top = "default:dirt_with_snow", - depth_top = 1, - node_filler = "default:dirt", - depth_filler = 5, - node_stone = "default:stone", - y_min = 4, - y_max = 31000, - heat_point = 11, - humidity_point = 67, -}) - --- 5 -minetest.register_biome({ - name = "tundra", - node_top = "default:dirt_with_snow", - depth_top = 1, - node_filler = "default:dirt", - depth_filler = 2, - node_stone = "default:stone", - y_min = 3, - y_max = 31000, - heat_point = 4, - humidity_point = 32, -}) - --- 6 -minetest.register_biome({ - name = "coniferous_forest", - node_top = "default:dirt_with_grass", - depth_top = 1, - node_filler = "default:dirt", - depth_filler = 2, - node_stone = "default:stone", - y_min = 5, - y_max = 31000, - heat_point = 22, - humidity_point = 71, -}) - --- 7 -minetest.register_biome({ - name = "cold_gravel_desert", - node_dust = "default:snow", - node_top = "default:gravel", - depth_top = 1, - node_filler = "default:gravel", - depth_filler = 1, - node_stone = "default:stone", - y_min = -6, - y_max = 31000, - heat_point = -2, - humidity_point = 2, -}) - --- 8 -minetest.register_biome({ - name = "gravel_desert", - node_top = "default:gravel", - depth_top = 1, - node_filler = "default:gravel", - depth_filler = 2, - node_stone = "default:stone", - y_min = 2, - y_max = 31000, - heat_point = 20, - humidity_point = -2, -}) - --- 9 -minetest.register_biome({ - name = "dry_tundra", - node_top = "default:dirt_with_snow", - depth_top = 1, - node_filler = "default:dirt", - depth_filler = 2, - node_stone = "default:stone", - y_min = 2, - y_max = 31000, - heat_point = 4, - humidity_point = 12, -}) - --- 10 -minetest.register_biome({ - name = "cold_desert", - node_stone = "default:stone", - y_min = 3, - y_max = 31000, - heat_point = 32, - humidity_point = -3, -}) - --- 11 -minetest.register_biome({ - name = "swamp", - node_top = "default:dirt_with_grass", - depth_top = 1, - node_filler = "default:dirt", - depth_filler = 3, - node_stone = "default:stone", - y_min = 1, - y_max = 31000, - heat_point = 30, - humidity_point = 114, -}) - --- 12 -minetest.register_biome({ - name = "icy_swamp", - node_dust = "default:snow", - node_top = "default:dirt_with_snow", - depth_top = 3, - node_filler = "default:dirt", - depth_filler = 3, - node_stone = "default:stone", - node_water_top = "default:ice", - depth_water_top = 1, - node_river_water = "default:ice", - y_min = 1, - y_max = 31000, - heat_point = -10, - humidity_point = 107, -}) - --- 13 -minetest.register_biome({ - name = "stone_grasslands", - node_top = "default:dirt_with_grass", - depth_top = 1, - node_filler = "default:dirt", - depth_filler = 1, - node_stone = "default:stone", - y_min = 4, - y_max = 31000, - heat_point = 29, - humidity_point = 22, -}) - --- 14 -minetest.register_biome({ - name = "mixed_forest", - node_top = "default:dirt_with_grass", - depth_top = 1, - node_filler = "default:dirt", - depth_filler = 2, - node_stone = "default:stone", - y_min = 5, - y_max = 31000, - heat_point = 24, - humidity_point = 56, -}) - --- 15 -minetest.register_biome({ - name = "cold_deciduous_forest", - node_top = "default:dirt_with_grass", - depth_top = 1, - node_filler = "default:dirt", - depth_filler = 2, - node_stone = "default:stone", - y_min = 4, - y_max = 31000, - heat_point = 31, - humidity_point = 48, -}) - --- 16 -minetest.register_biome({ - name = "deciduous_forest", - node_top = "default:dirt_with_grass", - depth_top = 1, - node_filler = "default:dirt", - depth_filler = 3, - node_stone = "default:stone", - y_min = 5, - y_max = 31000, - heat_point = 45, - humidity_point = 65, -}) - --- 17 -minetest.register_biome({ - name = "bushes", - node_top = "default:dirt_with_grass", - depth_top = 1, - node_filler = "default:dirt", - depth_filler = 1, - node_stone = "default:stone", - y_min = 7, - y_max = 31000, - heat_point = 43, - humidity_point = 30, -}) - --- 18 -minetest.register_biome({ - name = "scrub", - node_top = "default:dirt_with_dry_grass", - depth_top = 1, - node_filler = "default:dirt", - depth_filler = 1, - node_stone = "default:stone", - y_min = 8, - y_max = 31000, - heat_point = 57, - humidity_point = 25, -}) - --- 19 -minetest.register_biome({ - name = "hot_pine_forest", - node_top = "default:dirt_with_grass", - depth_top = 1, - node_filler = "default:dirt", - depth_filler = 1, - node_stone = "default:stone", - y_min = 6, - y_max = 31000, - heat_point = 65, - humidity_point = 35, -}) - --- 20 -minetest.register_biome({ - name = "desert", - node_top = "default:desert_sand", - depth_top = 1, - node_filler = "default:desert_sand", - depth_filler = 3, - node_stone = "default:desert_stone", - y_min = 7, - y_max = 31000, - heat_point = 89, - humidity_point = 9, -}) - --- 21 -minetest.register_biome({ - name = "sandstone_grasslands", - node_top = "default:dirt_with_grass", - depth_top = 1, - node_filler = "default:dirt", - depth_filler = 2, - node_stone = "default:sandstone", - y_min = 3, - y_max = 31000, - heat_point = 55, - humidity_point = 15, -}) - --- 22 -minetest.register_biome({ - name = "savanna", - node_top = "default:dirt_with_dry_grass", - depth_top = 1, - node_filler = "default:dirt", - depth_filler = 1, - node_stone = "default:stone", - y_min = 6, - y_max = 31000, - heat_point = 80, - humidity_point = 24, -}) - --- 23 -minetest.register_biome({ - name = "desert_stone_grasslands", - node_top = "default:dirt_with_grass", - depth_top = 1, - node_filler = "default:dirt", - depth_filler = 1, - node_stone = "default:desert_stone", - y_min = 4, - y_max = 31000, - heat_point = 90, - humidity_point = 41, -}) - --- 24 -minetest.register_biome({ - name = "red_savanna", - node_top = "default:dirt_with_dry_grass", - depth_top = 1, - node_filler = "default:dirt", - depth_filler = 1, - node_stone = "default:desert_stone", - y_min = 5, - y_max = 31000, - heat_point = 90, - humidity_point = 31, -}) - --- 25 -minetest.register_biome({ - name = "semi-tropical_forest", - node_top = "default:dirt_with_grass", - depth_top = 1, - node_filler = "default:dirt", - depth_filler = 3, - node_stone = "default:stone", - y_min = 4, - y_max = 31000, - heat_point = 72, - humidity_point = 61, -}) - --- 26 -minetest.register_biome({ - name = "rainforest", - node_top = "default:dirt_with_grass", - depth_top = 1, - node_filler = "default:dirt", - depth_filler = 4, - node_stone = "default:stone", - y_min = 1, - y_max = 31000, - heat_point = 89, - humidity_point = 76, -}) - --- 27 -minetest.register_biome({ - name = "sandstone_desert", - node_top = "default:desert_sand", - depth_top = 1, - node_filler = "default:desert_sand", - depth_filler = 1, - node_stone = "default:sandstone", - y_min = 6, - y_max = 31000, - heat_point = 60, - humidity_point = 0, -}) - --- 28 -minetest.register_biome({ - name = "orchard", - node_top = "default:dirt_with_grass", - depth_top = 1, - node_filler = "default:dirt", - depth_filler = 2, - node_stone = "default:stone", - y_min = 6, - y_max = 31000, - heat_point = 40, - humidity_point = 40, -}) - --- 29 -minetest.register_biome({ - name = "hot_deciduous_forest", - node_top = "default:dirt_with_grass", - depth_top = 1, - node_filler = "default:dirt", - depth_filler = 2, - node_stone = "default:stone", - y_min = 5, - y_max = 31000, - heat_point = 61, - humidity_point = 58, -}) - --- 30 -minetest.register_biome({ - name = "hot_swamp", - node_top = "default:dirt_with_grass", - depth_top = 1, - node_filler = "default:dirt", - depth_filler = 4, - node_stone = "default:stone", - y_min = 1, - y_max = 31000, - heat_point = 83, - humidity_point = 116, -}) diff --git a/sea_biomes.lua b/sea_biomes.lua deleted file mode 100644 index 71684e8..0000000 --- a/sea_biomes.lua +++ /dev/null @@ -1,53 +0,0 @@ --- 1 -minetest.register_biome({ - name = "pack_ice", - node_dust = "default:snow", - node_top = "default:gravel", - depth_top = 1, - node_stone = "default:stone", - node_water_top = "default:ice", - depth_water_top = 5, - node_river_water = "default:ice", - y_min = -112, - y_max = -6, - heat_point = -24, - humidity_point = 41, -}) - --- 2 -minetest.register_biome({ - name = "cold_sea", - node_top = "default:gravel", - depth_top = 2, - node_stone = "default:stone", - y_min = -112, - y_max = -6, - heat_point = 20, - humidity_point = 47, -}) - --- 3 -minetest.register_biome({ - name = "tempered_sea", - node_top = "default:sand", - depth_top = 2, - node_stone = "default:stone", - y_min = -112, - y_max = -6, - heat_point = 41, - humidity_point = 48, -}) - --- 4 -minetest.register_biome({ - name = "hot_sea", - node_top = "default:sand", - depth_top = 1, - node_filler = "default:sand", - depth_filler = 2, - node_stone = "default:stone", - y_min = -112, - y_max = -6, - heat_point = 89, - humidity_point = 51, -})