paramat wrote:Only up to 1 dungeon is generated per chunk, and each has up to 16 rooms, both these values are hardcoded in C++. There is such a thing as dungeon parameters, currently inaccessible to players, dungeon number per chunk and room number could be added. If i can work out how to make dungeon parameters settable i'll do it.
diff --git a/builtin/settingtypes.txt b/builtin/settingtypes.txt
index 2521140..f2b313e 100644
--- a/builtin/settingtypes.txt
+++ b/builtin/settingtypes.txt
@@ -865,6 +865,9 @@ mg_biome_np_heat_blend (Mapgen heat blend noise parameters) noise_params 0, 1.5,
mg_biome_np_humidity (Mapgen biome humidity noise parameters) noise_params 50, 50, (750, 750, 750), 842, 3, 0.5, 2.0
mg_biome_np_humidity_blend (Mapgen biome humidity blend noise parameters) noise_params 0, 1.5, (8, 8, 8), 90003, 2, 1.0, 2.0
+# Noise parameters for dungeon generation.
+mg_dungeon_rarity (Mapgen dungeon frequency noise) noise_params 0, 1, (500, 500, 500, 0, 2, 0.8, 2.0
+
[***Mapgen v5]
mgv5_np_filler_depth (Mapgen v5 filler depth noise parameters) noise_params 0, 1, (150, 150, 150), 261, 4, 0.7, 2.0
diff --git a/minetest.conf.example b/minetest.conf.example
index 4dd6d95..dd79aac 100644
--- a/minetest.conf.example
+++ b/minetest.conf.example
@@ -1071,6 +1071,9 @@
# type: noise_params
# mg_biome_np_humidity_blend = 0, 1.5, (8, 8, 8), 90003, 2, 1.0, 2.0
+# Noise parameters for dungeon generation.
+#mg_dungeon_rarity = 0, 1, (500, 500, 500, 0, 2, 0.8, 2.0
+
#### Mapgen v5
# type: noise_params
diff --git a/src/mapgen.cpp b/src/mapgen.cpp
index 36d19bf..e4836a9 100644
--- a/src/mapgen.cpp
+++ b/src/mapgen.cpp
@@ -436,6 +436,7 @@ void MapgenParams::load(const Settings &settings)
settings.getNoiseParams("mg_biome_np_heat_blend", np_biome_heat_blend);
settings.getNoiseParams("mg_biome_np_humidity", np_biome_humidity);
settings.getNoiseParams("mg_biome_np_humidity_blend", np_biome_humidity_blend);
+ settings.getNoiseParams("mg_dungeon_rarity", np_dungeon_rarity);
delete sparams;
MapgenFactory *mgfactory = EmergeManager::getMapgenFactory(mg_name);
diff --git a/src/mapgen.h b/src/mapgen.h
index 9bb7d03..0d093e5 100644
--- a/src/mapgen.h
+++ b/src/mapgen.h
@@ -120,6 +120,8 @@ struct MapgenParams {
NoiseParams np_biome_humidity;
NoiseParams np_biome_humidity_blend;
+ NoiseParams np_dungeon_rarity;
+
MapgenSpecificParams *sparams;
MapgenParams() :
@@ -132,6 +134,7 @@ struct MapgenParams {
np_biome_heat_blend(NoiseParams(0, 1.5, v3f(8.0, 8.0, 8.0), 13, 2, 1.0, 2.0)),
np_biome_humidity(NoiseParams(50, 50, v3f(750.0, 750.0, 750.0), 842, 3, 0.5, 2.0)),
np_biome_humidity_blend(NoiseParams(0, 1.5, v3f(8.0, 8.0, 8.0), 90003, 2, 1.0, 2.0)),
+ np_dungeon_rarity(NoiseParams(0.0, 1.0, v3f(500.0, 500.0, 500.0), 0, 2, 0.8, 2.0)),
sparams(NULL)
{}
diff --git a/src/mapgen_valleys.cpp b/src/mapgen_valleys.cpp
index d64d7e0..7607b8b 100644
--- a/src/mapgen_valleys.cpp
+++ b/src/mapgen_valleys.cpp
@@ -93,6 +93,7 @@ MapgenValleys::MapgenValleys(int mapgenid, MapgenParams *params, EmergeManager *
this->altitude_chill = sp->altitude_chill;
this->cave_water_max_height = sp->cave_water_max_height;
+ this->dungeon_rarity = ¶ms->np_dungeon_rarity;
this->humidity_adjust = sp->humidity - 50.f;
this->humidity_break_point = sp->humidity_break_point;
this->lava_max_height = sp->lava_max_height;
@@ -309,7 +310,7 @@ void MapgenValleys::makeChunk(BlockMakeData *data)
if ((flags & MG_DUNGEONS) && node_max.Y < 50 && (stone_surface_max_y >= node_min.Y)) {
DungeonParams dp;
- dp.np_rarity = nparams_dungeon_rarity;
+ dp.np_rarity = *dungeon_rarity;
dp.np_density = nparams_dungeon_density;
dp.np_wetness = nparams_dungeon_wetness;
dp.c_water = c_water_source;
diff --git a/src/mapgen_valleys.h b/src/mapgen_valleys.h
index 8ac2cf2..b3691d2 100644
--- a/src/mapgen_valleys.h
+++ b/src/mapgen_valleys.h
@@ -65,6 +65,7 @@ struct MapgenValleysParams : public MapgenSpecificParams {
NoiseParams np_biome_humidity_blend;
NoiseParams np_cliffs;
NoiseParams np_corr;
+ NoiseParams np_dungeon_rarity;
NoiseParams np_filler_depth;
NoiseParams np_inter_valley_fill;
NoiseParams np_inter_valley_slope;
@@ -121,6 +122,7 @@ class MapgenValleys : public Mapgen {
float altitude_chill;
float cave_water_max_height;
+ NoiseParams *dungeon_rarity;
float humidity_adjust;
float humidity_break_point;
float lava_max_height;Users browsing this forum: No registered users and 9 guests