summaryrefslogtreecommitdiff
path: root/src/mapgen/dungeongen.h
diff options
context:
space:
mode:
authorParamat <paramat@users.noreply.github.com>2019-07-09 20:38:51 +0100
committerGitHub <noreply@github.com>2019-07-09 20:38:51 +0100
commit0c319469439237ba0db31ccbffeef06e2f5ab45f (patch)
tree97511d51edfc75e591a509e6ebe7ac1288035768 /src/mapgen/dungeongen.h
parent140aeabd877bad674971ce5b9a43b59f888e511e (diff)
downloadminetest-0c319469439237ba0db31ccbffeef06e2f5ab45f.tar.gz
minetest-0c319469439237ba0db31ccbffeef06e2f5ab45f.tar.bz2
minetest-0c319469439237ba0db31ccbffeef06e2f5ab45f.zip
Move more dungeon parameter selection to mapgens (#8653)
Move 'num_dungeons' to 'DungeonParams'. Add new parameter 'num_rooms' to replace 'rooms_min' and 'rooms_max', so that the mapgen has complete control over the number of rooms. Add new bool 'first_room_large' so that the mapgen chooses this instead of a hardcoded 1 in 4 chance. Add new parameter 'room_size_large' to replace 'room_size_large_min' and 'room_size_large_max', so that the mapgen has complete control over this.
Diffstat (limited to 'src/mapgen/dungeongen.h')
-rw-r--r--src/mapgen/dungeongen.h38
1 files changed, 19 insertions, 19 deletions
diff --git a/src/mapgen/dungeongen.h b/src/mapgen/dungeongen.h
index 7b476527b..dd5245fa9 100644
--- a/src/mapgen/dungeongen.h
+++ b/src/mapgen/dungeongen.h
@@ -46,32 +46,33 @@ struct DungeonParams {
content_t c_alt_wall;
content_t c_stair;
- // Diagonal corridors are possible
- bool diagonal_dirs;
- // Dungeon only generates in ground
+ // 3D noise that determines which c_wall nodes are converted to c_alt_wall
+ NoiseParams np_alt_wall;
+
+ // Number of dungeons generated in mapchunk
+ u16 num_dungeons;
+ // Dungeons only generate in ground
bool only_in_ground;
+ // Number of rooms
+ u16 num_rooms;
+ // Room size random range. Includes walls / floor / ceilng
+ v3s16 room_size_min;
+ v3s16 room_size_max;
+ // Large room size
+ v3s16 room_size_large;
+ // First generated room is large
+ bool first_room_large;
// Dimensions of 3D 'brush' that creates corridors.
// Dimensions are of the empty space, not including walls / floor / ceilng.
v3s16 holesize;
- // Corridor length
+ // Corridor length random range
u16 corridor_len_min;
u16 corridor_len_max;
- // Room size includes walls / floor / ceilng
- v3s16 room_size_min;
- v3s16 room_size_max;
- // The 1st room generated has a 1 in 4 chance of being 'large', all other
- // rooms are not 'large'.
- v3s16 room_size_large_min;
- v3s16 room_size_large_max;
- // Number of rooms
- u16 rooms_min;
- u16 rooms_max;
+ // Diagonal corridors are possible
+ bool diagonal_dirs;
// Usually 'GENNOTIFY_DUNGEON', but mapgen v6 uses 'GENNOTIFY_TEMPLE' for
// desert dungeons.
GenNotifyType notifytype;
-
- // 3D noise that determines which c_wall nodes are converted to c_alt_wall
- NoiseParams np_alt_wall;
};
class DungeonGen {
@@ -94,8 +95,7 @@ public:
DungeonGen(const NodeDefManager *ndef,
GenerateNotifier *gennotify, DungeonParams *dparams);
- void generate(MMVManip *vm, u32 bseed,
- v3s16 full_node_min, v3s16 full_node_max, u16 num_dungeons);
+ void generate(MMVManip *vm, u32 bseed, v3s16 full_node_min, v3s16 full_node_max);
void makeDungeon(v3s16 start_padding);
void makeRoom(v3s16 roomsize, v3s16 roomplace);