summaryrefslogtreecommitdiff
path: root/src/mapgen.cpp
diff options
context:
space:
mode:
authorparamat <mat.gregory@virginmedia.com>2016-06-12 03:11:26 +0100
committerparamat <mat.gregory@virginmedia.com>2016-06-17 04:42:42 +0100
commit04fb10914c0d03ee77dafe610f336f23c58949ab (patch)
tree7eee0d7ddc799a2bcae919b3618d5700eca7dace /src/mapgen.cpp
parent39a9e9874ee739aea91acf36c6f81fc38bce7363 (diff)
downloadminetest-04fb10914c0d03ee77dafe610f336f23c58949ab.tar.gz
minetest-04fb10914c0d03ee77dafe610f336f23c58949ab.tar.bz2
minetest-04fb10914c0d03ee77dafe610f336f23c58949ab.zip
Dungeons: Generalise use, add capabilities, various modifications
- Generalise node names to c_wall and c_alt_wall - Remove 'mossratio' and instead disable alt_wall loop if c_alt_wall == CONTENT_IGNORE - Use one generalised 3D noise for alternative wall nodes and in mgv6 create moss distribution similar to the previous - Rename rarity noise to density noise and enable the option of multiple dungeons per chunk determined by the value. Recreate previous distribution - Add parameters for min and max rooms per dungeon - Add dungeon y limits - Integrate river water properly Generalisation is needed now that we have sandstone and desert stone dungeons by default and can choose any node for alternative structure. The current code is based around cobble dungeons with mossycobble alternative nodes, the 2 noises controlling the alternative nodes are based on wetness. Enabling multiple dungeons per chunk with definable number of rooms allows the option of very dense and complex underground structures that could interconnect to create megastructures. Y limits are added to be consistent with other mapgen elements, and enable locaton of dungeon or megastructure realms as part of our 'stacked realms' philosophy.
Diffstat (limited to 'src/mapgen.cpp')
-rw-r--r--src/mapgen.cpp36
1 files changed, 18 insertions, 18 deletions
diff --git a/src/mapgen.cpp b/src/mapgen.cpp
index 576fb219a..1e0e3aa44 100644
--- a/src/mapgen.cpp
+++ b/src/mapgen.cpp
@@ -738,44 +738,44 @@ void MapgenBasic::generateDungeons(s16 max_stone_y, MgStoneType stone_type)
DungeonParams dp;
- dp.seed = seed;
-
- dp.np_rarity = nparams_dungeon_rarity;
- dp.np_density = nparams_dungeon_density;
- dp.np_wetness = nparams_dungeon_wetness;
- dp.c_water = c_water_source;
+ dp.seed = seed;
+ dp.c_water = c_water_source;
+ dp.c_river_water = c_river_water_source;
+ dp.rooms_min = 2;
+ dp.rooms_max = 16;
+ dp.y_min = -MAX_MAP_GENERATION_LIMIT;
+ dp.y_max = MAX_MAP_GENERATION_LIMIT;
+ dp.np_density = nparams_dungeon_density;
+ dp.np_alt_wall = nparams_dungeon_alt_wall;
switch (stone_type) {
default:
case MGSTONE_STONE:
- dp.c_cobble = c_cobble;
- dp.c_moss = c_mossycobble;
- dp.c_stair = c_stair_cobble;
+ dp.c_wall = c_cobble;
+ dp.c_alt_wall = c_mossycobble;
+ dp.c_stair = c_stair_cobble;
dp.diagonal_dirs = false;
- dp.mossratio = 3.0;
dp.holesize = v3s16(1, 2, 1);
dp.roomsize = v3s16(0, 0, 0);
dp.notifytype = GENNOTIFY_DUNGEON;
break;
case MGSTONE_DESERT_STONE:
- dp.c_cobble = c_desert_stone;
- dp.c_moss = c_desert_stone;
- dp.c_stair = c_desert_stone;
+ dp.c_wall = c_desert_stone;
+ dp.c_alt_wall = CONTENT_IGNORE;
+ dp.c_stair = c_desert_stone;
dp.diagonal_dirs = true;
- dp.mossratio = 0.0;
dp.holesize = v3s16(2, 3, 2);
dp.roomsize = v3s16(2, 5, 2);
dp.notifytype = GENNOTIFY_TEMPLE;
break;
case MGSTONE_SANDSTONE:
- dp.c_cobble = c_sandstonebrick;
- dp.c_moss = c_sandstonebrick;
- dp.c_stair = c_sandstonebrick;
+ dp.c_wall = c_sandstonebrick;
+ dp.c_alt_wall = CONTENT_IGNORE;
+ dp.c_stair = c_sandstonebrick;
dp.diagonal_dirs = false;
- dp.mossratio = 0.0;
dp.holesize = v3s16(2, 2, 2);
dp.roomsize = v3s16(2, 0, 2);
dp.notifytype = GENNOTIFY_DUNGEON;