Randomwalk caves: Add parameters for number, proportion flooded. Allow small caves (#8928)

Add mapgen parameters to set the range of the random number of
randomwalk caves per mapchunk, and to set the proportion that are
flooded with liquids.
Default values are, for now, unchanged from the previous hardcoded
values.

Add parameters to allow small randomwalk caves
Disabled by default for now as they have never been present in the
non-mgv6 mapgens.
This commit is contained in:
Paramat 2019-11-08 03:09:43 +00:00 committed by GitHub
parent 5506e97ed8
commit 2a74727857
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
17 changed files with 416 additions and 188 deletions

@ -1479,6 +1479,21 @@ mgv5_large_cave_depth (Large cave depth) int -256
# Y of upper limit of lava in large caves.
mgv5_lava_depth (Lava depth) int -256
# Minimum limit of random number of small caves per mapchunk.
mgv5_small_cave_num_min (Small cave minimum number) int 0 0 256
# Maximum limit of random number of small caves per mapchunk.
mgv5_small_cave_num_max (Small cave maximum number) int 0 0 256
# Minimum limit of random number of large caves per mapchunk.
mgv5_large_cave_num_min (Large cave minimum number) int 0 0 64
# Maximum limit of random number of large caves per mapchunk.
mgv5_large_cave_num_max (Large cave maximum number) int 2 0 64
# Proportion of large caves that contain liquid.
mgv5_large_cave_flooded (Large cave proportion flooded) float 0.5 0.0 1.0
# Y-level of cavern upper limit.
mgv5_cavern_limit (Cavern limit) int -256
@ -1596,6 +1611,21 @@ mgv7_large_cave_depth (Large cave depth) int -33
# Y of upper limit of lava in large caves.
mgv7_lava_depth (Lava depth) int -256
# Minimum limit of random number of small caves per mapchunk.
mgv7_small_cave_num_min (Small cave minimum number) int 0 0 256
# Maximum limit of random number of small caves per mapchunk.
mgv7_small_cave_num_max (Small cave maximum number) int 0 0 256
# Minimum limit of random number of large caves per mapchunk.
mgv7_large_cave_num_min (Large cave minimum number) int 0 0 64
# Maximum limit of random number of large caves per mapchunk.
mgv7_large_cave_num_max (Large cave maximum number) int 2 0 64
# Proportion of large caves that contain liquid.
mgv7_large_cave_flooded (Large cave proportion flooded) float 0.5 0.0 1.0
# Controls the density of mountain-type floatlands.
# Is a noise offset added to the 'mgv7_np_mountain' noise value.
mgv7_float_mount_density (Floatland mountain density) float 0.6
@ -1704,6 +1734,21 @@ mgcarpathian_large_cave_depth (Large cave depth) int -33
# Y of upper limit of lava in large caves.
mgcarpathian_lava_depth (Lava depth) int -256
# Minimum limit of random number of small caves per mapchunk.
mgcarpathian_small_cave_num_min (Small cave minimum number) int 0 0 256
# Maximum limit of random number of small caves per mapchunk.
mgcarpathian_small_cave_num_max (Small cave maximum number) int 0 0 256
# Minimum limit of random number of large caves per mapchunk.
mgcarpathian_large_cave_num_min (Large cave minimum number) int 0 0 64
# Maximum limit of random number of large caves per mapchunk.
mgcarpathian_large_cave_num_max (Large cave maximum number) int 2 0 64
# Proportion of large caves that contain liquid.
mgcarpathian_large_cave_flooded (Large cave proportion flooded) float 0.5 0.0 1.0
# Y-level of cavern upper limit.
mgcarpathian_cavern_limit (Cavern limit) int -256
@ -1788,6 +1833,21 @@ mgflat_large_cave_depth (Large cave depth) int -33
# Y of upper limit of lava in large caves.
mgflat_lava_depth (Lava depth) int -256
# Minimum limit of random number of small caves per mapchunk.
mgflat_small_cave_num_min (Small cave minimum number) int 0 0 256
# Maximum limit of random number of small caves per mapchunk.
mgflat_small_cave_num_max (Small cave maximum number) int 0 0 256
# Minimum limit of random number of large caves per mapchunk.
mgflat_large_cave_num_min (Large cave minimum number) int 0 0 64
# Maximum limit of random number of large caves per mapchunk.
mgflat_large_cave_num_max (Large cave maximum number) int 2 0 64
# Proportion of large caves that contain liquid.
mgflat_large_cave_flooded (Large cave proportion flooded) float 0.5 0.0 1.0
# Controls width of tunnels, a smaller value creates wider tunnels.
mgflat_cave_width (Cave width) float 0.09
@ -1847,6 +1907,21 @@ mgfractal_large_cave_depth (Large cave depth) int -33
# Y of upper limit of lava in large caves.
mgfractal_lava_depth (Lava depth) int -256
# Minimum limit of random number of small caves per mapchunk.
mgfractal_small_cave_num_min (Small cave minimum number) int 0 0 256
# Maximum limit of random number of small caves per mapchunk.
mgfractal_small_cave_num_max (Small cave maximum number) int 0 0 256
# Minimum limit of random number of large caves per mapchunk.
mgfractal_large_cave_num_min (Large cave minimum number) int 0 0 64
# Maximum limit of random number of large caves per mapchunk.
mgfractal_large_cave_num_max (Large cave maximum number) int 2 0 64
# Proportion of large caves that contain liquid.
mgfractal_large_cave_flooded (Large cave proportion flooded) float 0.5 0.0 1.0
# Lower Y limit of dungeons.
mgfractal_dungeon_ymin (Dungeon minimum Y) int -31000
@ -1970,6 +2045,21 @@ mgvalleys_large_cave_depth (Large cave depth) int -33
# Y of upper limit of lava in large caves.
mgvalleys_lava_depth (Lava depth) int 1
# Minimum limit of random number of small caves per mapchunk.
mgvalleys_small_cave_num_min (Small cave minimum number) int 0 0 256
# Maximum limit of random number of small caves per mapchunk.
mgvalleys_small_cave_num_max (Small cave maximum number) int 0 0 256
# Minimum limit of random number of large caves per mapchunk.
mgvalleys_large_cave_num_min (Large cave minimum number) int 0 0 64
# Maximum limit of random number of large caves per mapchunk.
mgvalleys_large_cave_num_max (Large cave maximum number) int 2 0 64
# Proportion of large caves that contain liquid.
mgvalleys_large_cave_flooded (Large cave proportion flooded) float 0.5 0.0 1.0
# Depth below which you'll find giant caverns.
mgvalleys_cavern_limit (Cavern upper limit) int -256

@ -280,6 +280,7 @@ CavesRandomWalk::CavesRandomWalk(
int water_level,
content_t water_source,
content_t lava_source,
float large_cave_flooded,
int lava_depth,
BiomeGen *biomegen)
{
@ -290,6 +291,7 @@ CavesRandomWalk::CavesRandomWalk(
this->seed = seed;
this->water_level = water_level;
this->np_caveliquids = &nparams_caveliquids;
this->large_cave_flooded = large_cave_flooded;
this->lava_depth = lava_depth;
this->bmgn = biomegen;
@ -322,7 +324,7 @@ void CavesRandomWalk::makeCave(MMVManip *vm, v3s16 nmin, v3s16 nmax,
this->ystride = nmax.X - nmin.X + 1;
flooded = ps->range(1, 2) == 2;
flooded = ps->range(1, 1000) <= large_cave_flooded * 1000.0f;
// If flooded:
// Get biome at mapchunk midpoint. If cave liquid defined for biome, use it.

@ -116,15 +116,14 @@ public:
s16 *heightmap;
BiomeGen *bmgn;
// configurable parameters
s32 seed;
int water_level;
float large_cave_flooded;
// TODO 'lava_depth' and 'np_caveliquids' are deprecated and should be removed.
// Cave liquids are now defined and located using biome definitions.
int lava_depth;
NoiseParams *np_caveliquids;
// intermediate state variables
u16 ystride;
s16 min_tunnel_diameter;
@ -161,7 +160,8 @@ public:
CavesRandomWalk(const NodeDefManager *ndef, GenerateNotifier *gennotify =
NULL, s32 seed = 0, int water_level = 1, content_t water_source =
CONTENT_IGNORE, content_t lava_source = CONTENT_IGNORE,
int lava_depth = -256, BiomeGen *biomegen = NULL);
float large_cave_flooded = 0.5f, int lava_depth = -256,
BiomeGen *biomegen = NULL);
// vm and ps are mandatory parameters.
// If heightmap is NULL, the surface level at all points is assumed to

@ -843,18 +843,29 @@ void MapgenBasic::generateCavesNoiseIntersection(s16 max_stone_y)
void MapgenBasic::generateCavesRandomWalk(s16 max_stone_y, s16 large_cave_depth)
{
if (node_min.Y > max_stone_y || node_max.Y > large_cave_depth)
if (node_min.Y > max_stone_y)
return;
PseudoRandom ps(blockseed + 21343);
u32 bruises_count = ps.range(0, 2);
// Small randomwalk caves
u32 num_small_caves = ps.range(small_cave_num_min, small_cave_num_max);
for (u32 i = 0; i < bruises_count; i++) {
for (u32 i = 0; i < num_small_caves; i++) {
CavesRandomWalk cave(ndef, &gennotify, seed, water_level,
c_water_source, c_lava_source, lava_depth, biomegen);
c_water_source, c_lava_source, large_cave_flooded, lava_depth, biomegen);
cave.makeCave(vm, node_min, node_max, &ps, false, max_stone_y, heightmap);
}
cave.makeCave(vm, node_min, node_max, &ps, true, max_stone_y,
heightmap);
if (node_max.Y > large_cave_depth)
return;
// Large randomwalk caves below 'large_cave_depth'
u32 num_large_caves = ps.range(large_cave_num_min, large_cave_num_max);
for (u32 i = 0; i < num_large_caves; i++) {
CavesRandomWalk cave(ndef, &gennotify, seed, water_level,
c_water_source, c_lava_source, large_cave_flooded, lava_depth, biomegen);
cave.makeCave(vm, node_min, node_max, &ps, true, max_stone_y, heightmap);
}
}

@ -280,6 +280,11 @@ protected:
float cavern_limit;
float cavern_taper;
float cavern_threshold;
int small_cave_num_min;
int small_cave_num_max;
int large_cave_num_min;
int large_cave_num_max;
float large_cave_flooded;
// TODO 'lava_depth' is deprecated and should be removed. Cave liquids are
// now defined and located using biome definitions.
int lava_depth;

@ -62,6 +62,11 @@ MapgenCarpathian::MapgenCarpathian(MapgenCarpathianParams *params, EmergeManager
cave_width = params->cave_width;
large_cave_depth = params->large_cave_depth;
lava_depth = params->lava_depth;
small_cave_num_min = params->small_cave_num_min;
small_cave_num_max = params->small_cave_num_max;
large_cave_num_min = params->large_cave_num_min;
large_cave_num_max = params->large_cave_num_max;
large_cave_flooded = params->large_cave_flooded;
cavern_limit = params->cavern_limit;
cavern_taper = params->cavern_taper;
cavern_threshold = params->cavern_threshold;
@ -151,6 +156,11 @@ void MapgenCarpathianParams::readParams(const Settings *settings)
settings->getFloatNoEx("mgcarpathian_cave_width", cave_width);
settings->getS16NoEx("mgcarpathian_large_cave_depth", large_cave_depth);
settings->getS16NoEx("mgcarpathian_lava_depth", lava_depth);
settings->getU16NoEx("mgcarpathian_small_cave_num_min", small_cave_num_min);
settings->getU16NoEx("mgcarpathian_small_cave_num_max", small_cave_num_max);
settings->getU16NoEx("mgcarpathian_large_cave_num_min", large_cave_num_min);
settings->getU16NoEx("mgcarpathian_large_cave_num_max", large_cave_num_max);
settings->getFloatNoEx("mgcarpathian_large_cave_flooded", large_cave_flooded);
settings->getS16NoEx("mgcarpathian_cavern_limit", cavern_limit);
settings->getS16NoEx("mgcarpathian_cavern_taper", cavern_taper);
settings->getFloatNoEx("mgcarpathian_cavern_threshold", cavern_threshold);
@ -189,6 +199,11 @@ void MapgenCarpathianParams::writeParams(Settings *settings) const
settings->setFloat("mgcarpathian_cave_width", cave_width);
settings->setS16("mgcarpathian_large_cave_depth", large_cave_depth);
settings->setS16("mgcarpathian_lava_depth", lava_depth);
settings->setU16("mgcarpathian_small_cave_num_min", small_cave_num_min);
settings->setU16("mgcarpathian_small_cave_num_max", small_cave_num_max);
settings->setU16("mgcarpathian_large_cave_num_min", large_cave_num_min);
settings->setU16("mgcarpathian_large_cave_num_max", large_cave_num_max);
settings->setFloat("mgcarpathian_large_cave_flooded", large_cave_flooded);
settings->setS16("mgcarpathian_cavern_limit", cavern_limit);
settings->setS16("mgcarpathian_cavern_taper", cavern_taper);
settings->setFloat("mgcarpathian_cavern_threshold", cavern_threshold);

@ -41,6 +41,11 @@ struct MapgenCarpathianParams : public MapgenParams
float cave_width = 0.09f;
s16 large_cave_depth = -33;
s16 lava_depth = -256;
u16 small_cave_num_min = 0;
u16 small_cave_num_max = 0;
u16 large_cave_num_min = 0;
u16 large_cave_num_max = 2;
float large_cave_flooded = 0.5f;
s16 cavern_limit = -256;
s16 cavern_taper = 256;
float cavern_threshold = 0.7f;

@ -55,6 +55,11 @@ MapgenFlat::MapgenFlat(MapgenFlatParams *params, EmergeManager *emerge)
ground_level = params->ground_level;
large_cave_depth = params->large_cave_depth;
lava_depth = params->lava_depth;
small_cave_num_min = params->small_cave_num_min;
small_cave_num_max = params->small_cave_num_max;
large_cave_num_min = params->large_cave_num_min;
large_cave_num_max = params->large_cave_num_max;
large_cave_flooded = params->large_cave_flooded;
cave_width = params->cave_width;
lake_threshold = params->lake_threshold;
lake_steepness = params->lake_steepness;
@ -100,6 +105,11 @@ void MapgenFlatParams::readParams(const Settings *settings)
settings->getS16NoEx("mgflat_ground_level", ground_level);
settings->getS16NoEx("mgflat_large_cave_depth", large_cave_depth);
settings->getS16NoEx("mgflat_lava_depth", lava_depth);
settings->getU16NoEx("mgflat_small_cave_num_min", small_cave_num_min);
settings->getU16NoEx("mgflat_small_cave_num_max", small_cave_num_max);
settings->getU16NoEx("mgflat_large_cave_num_min", large_cave_num_min);
settings->getU16NoEx("mgflat_large_cave_num_max", large_cave_num_max);
settings->getFloatNoEx("mgflat_large_cave_flooded", large_cave_flooded);
settings->getFloatNoEx("mgflat_cave_width", cave_width);
settings->getFloatNoEx("mgflat_lake_threshold", lake_threshold);
settings->getFloatNoEx("mgflat_lake_steepness", lake_steepness);
@ -122,6 +132,11 @@ void MapgenFlatParams::writeParams(Settings *settings) const
settings->setS16("mgflat_ground_level", ground_level);
settings->setS16("mgflat_large_cave_depth", large_cave_depth);
settings->setS16("mgflat_lava_depth", lava_depth);
settings->setU16("mgflat_small_cave_num_min", small_cave_num_min);
settings->setU16("mgflat_small_cave_num_max", small_cave_num_max);
settings->setU16("mgflat_large_cave_num_min", large_cave_num_min);
settings->setU16("mgflat_large_cave_num_max", large_cave_num_max);
settings->setFloat("mgflat_large_cave_flooded", large_cave_flooded);
settings->setFloat("mgflat_cave_width", cave_width);
settings->setFloat("mgflat_lake_threshold", lake_threshold);
settings->setFloat("mgflat_lake_steepness", lake_steepness);

@ -36,6 +36,11 @@ struct MapgenFlatParams : public MapgenParams
s16 ground_level = 8;
s16 large_cave_depth = -33;
s16 lava_depth = -256;
u16 small_cave_num_min = 0;
u16 small_cave_num_max = 0;
u16 large_cave_num_min = 0;
u16 large_cave_num_max = 2;
float large_cave_flooded = 0.5f;
float cave_width = 0.09f;
float lake_threshold = -0.45f;
float lake_steepness = 48.0f;

@ -55,6 +55,11 @@ MapgenFractal::MapgenFractal(MapgenFractalParams *params, EmergeManager *emerge)
cave_width = params->cave_width;
large_cave_depth = params->large_cave_depth;
lava_depth = params->lava_depth;
small_cave_num_min = params->small_cave_num_min;
small_cave_num_max = params->small_cave_num_max;
large_cave_num_min = params->large_cave_num_min;
large_cave_num_max = params->large_cave_num_max;
large_cave_flooded = params->large_cave_flooded;
dungeon_ymin = params->dungeon_ymin;
dungeon_ymax = params->dungeon_ymax;
fractal = params->fractal;
@ -109,6 +114,11 @@ void MapgenFractalParams::readParams(const Settings *settings)
settings->getFloatNoEx("mgfractal_cave_width", cave_width);
settings->getS16NoEx("mgfractal_large_cave_depth", large_cave_depth);
settings->getS16NoEx("mgfractal_lava_depth", lava_depth);
settings->getU16NoEx("mgfractal_small_cave_num_min", small_cave_num_min);
settings->getU16NoEx("mgfractal_small_cave_num_max", small_cave_num_max);
settings->getU16NoEx("mgfractal_large_cave_num_min", large_cave_num_min);
settings->getU16NoEx("mgfractal_large_cave_num_max", large_cave_num_max);
settings->getFloatNoEx("mgfractal_large_cave_flooded", large_cave_flooded);
settings->getS16NoEx("mgfractal_dungeon_ymin", dungeon_ymin);
settings->getS16NoEx("mgfractal_dungeon_ymax", dungeon_ymax);
settings->getU16NoEx("mgfractal_fractal", fractal);
@ -135,6 +145,11 @@ void MapgenFractalParams::writeParams(Settings *settings) const
settings->setFloat("mgfractal_cave_width", cave_width);
settings->setS16("mgfractal_large_cave_depth", large_cave_depth);
settings->setS16("mgfractal_lava_depth", lava_depth);
settings->setU16("mgfractal_small_cave_num_min", small_cave_num_min);
settings->setU16("mgfractal_small_cave_num_max", small_cave_num_max);
settings->setU16("mgfractal_large_cave_num_min", large_cave_num_min);
settings->setU16("mgfractal_large_cave_num_max", large_cave_num_max);
settings->setFloat("mgfractal_large_cave_flooded", large_cave_flooded);
settings->setS16("mgfractal_dungeon_ymin", dungeon_ymin);
settings->setS16("mgfractal_dungeon_ymax", dungeon_ymax);
settings->setU16("mgfractal_fractal", fractal);

@ -39,6 +39,11 @@ struct MapgenFractalParams : public MapgenParams
float cave_width = 0.09f;
s16 large_cave_depth = -33;
s16 lava_depth = -256;
u16 small_cave_num_min = 0;
u16 small_cave_num_max = 0;
u16 large_cave_num_min = 0;
u16 large_cave_num_max = 2;
float large_cave_flooded = 0.5f;
s16 dungeon_ymin = -31000;
s16 dungeon_ymax = 31000;
u16 fractal = 1;

@ -52,6 +52,11 @@ MapgenV5::MapgenV5(MapgenV5Params *params, EmergeManager *emerge)
cave_width = params->cave_width;
large_cave_depth = params->large_cave_depth;
lava_depth = params->lava_depth;
small_cave_num_min = params->small_cave_num_min;
small_cave_num_max = params->small_cave_num_max;
large_cave_num_min = params->large_cave_num_min;
large_cave_num_max = params->large_cave_num_max;
large_cave_flooded = params->large_cave_flooded;
cavern_limit = params->cavern_limit;
cavern_taper = params->cavern_taper;
cavern_threshold = params->cavern_threshold;
@ -102,6 +107,11 @@ void MapgenV5Params::readParams(const Settings *settings)
settings->getFloatNoEx("mgv5_cave_width", cave_width);
settings->getS16NoEx("mgv5_large_cave_depth", large_cave_depth);
settings->getS16NoEx("mgv5_lava_depth", lava_depth);
settings->getU16NoEx("mgv5_small_cave_num_min", small_cave_num_min);
settings->getU16NoEx("mgv5_small_cave_num_max", small_cave_num_max);
settings->getU16NoEx("mgv5_large_cave_num_min", large_cave_num_min);
settings->getU16NoEx("mgv5_large_cave_num_max", large_cave_num_max);
settings->getFloatNoEx("mgv5_large_cave_flooded", large_cave_flooded);
settings->getS16NoEx("mgv5_cavern_limit", cavern_limit);
settings->getS16NoEx("mgv5_cavern_taper", cavern_taper);
settings->getFloatNoEx("mgv5_cavern_threshold", cavern_threshold);
@ -125,6 +135,11 @@ void MapgenV5Params::writeParams(Settings *settings) const
settings->setFloat("mgv5_cave_width", cave_width);
settings->setS16("mgv5_large_cave_depth", large_cave_depth);
settings->setS16("mgv5_lava_depth", lava_depth);
settings->setU16("mgv5_small_cave_num_min", small_cave_num_min);
settings->setU16("mgv5_small_cave_num_max", small_cave_num_max);
settings->setU16("mgv5_large_cave_num_min", large_cave_num_min);
settings->setU16("mgv5_large_cave_num_max", large_cave_num_max);
settings->setFloat("mgv5_large_cave_flooded", large_cave_flooded);
settings->setS16("mgv5_cavern_limit", cavern_limit);
settings->setS16("mgv5_cavern_taper", cavern_taper);
settings->setFloat("mgv5_cavern_threshold", cavern_threshold);

@ -35,6 +35,11 @@ struct MapgenV5Params : public MapgenParams
float cave_width = 0.09f;
s16 large_cave_depth = -256;
s16 lava_depth = -256;
u16 small_cave_num_min = 0;
u16 small_cave_num_max = 0;
u16 large_cave_num_min = 0;
u16 large_cave_num_max = 2;
float large_cave_flooded = 0.5f;
s16 cavern_limit = -256;
s16 cavern_taper = 256;
float cavern_threshold = 0.7f;

@ -65,6 +65,11 @@ MapgenV7::MapgenV7(MapgenV7Params *params, EmergeManager *emerge)
cave_width = params->cave_width;
large_cave_depth = params->large_cave_depth;
lava_depth = params->lava_depth;
small_cave_num_min = params->small_cave_num_min;
small_cave_num_max = params->small_cave_num_max;
large_cave_num_min = params->large_cave_num_min;
large_cave_num_max = params->large_cave_num_max;
large_cave_flooded = params->large_cave_flooded;
cavern_limit = params->cavern_limit;
cavern_taper = params->cavern_taper;
cavern_threshold = params->cavern_threshold;
@ -173,6 +178,11 @@ void MapgenV7Params::readParams(const Settings *settings)
settings->getFloatNoEx("mgv7_cave_width", cave_width);
settings->getS16NoEx("mgv7_large_cave_depth", large_cave_depth);
settings->getS16NoEx("mgv7_lava_depth", lava_depth);
settings->getU16NoEx("mgv7_small_cave_num_min", small_cave_num_min);
settings->getU16NoEx("mgv7_small_cave_num_max", small_cave_num_max);
settings->getU16NoEx("mgv7_large_cave_num_min", large_cave_num_min);
settings->getU16NoEx("mgv7_large_cave_num_max", large_cave_num_max);
settings->getFloatNoEx("mgv7_large_cave_flooded", large_cave_flooded);
settings->getFloatNoEx("mgv7_float_mount_density", float_mount_density);
settings->getFloatNoEx("mgv7_float_mount_height", float_mount_height);
settings->getFloatNoEx("mgv7_float_mount_exponent", float_mount_exponent);
@ -209,6 +219,11 @@ void MapgenV7Params::writeParams(Settings *settings) const
settings->setFloat("mgv7_cave_width", cave_width);
settings->setS16("mgv7_large_cave_depth", large_cave_depth);
settings->setS16("mgv7_lava_depth", lava_depth);
settings->setU16("mgv7_small_cave_num_min", small_cave_num_min);
settings->setU16("mgv7_small_cave_num_max", small_cave_num_max);
settings->setU16("mgv7_large_cave_num_min", large_cave_num_min);
settings->setU16("mgv7_large_cave_num_max", large_cave_num_max);
settings->setFloat("mgv7_large_cave_flooded", large_cave_flooded);
settings->setFloat("mgv7_float_mount_density", float_mount_density);
settings->setFloat("mgv7_float_mount_height", float_mount_height);
settings->setFloat("mgv7_float_mount_exponent", float_mount_exponent);

@ -46,6 +46,11 @@ struct MapgenV7Params : public MapgenParams {
float cave_width = 0.09f;
s16 large_cave_depth = -33;
s16 lava_depth = -256;
u16 small_cave_num_min = 0;
u16 small_cave_num_max = 0;
u16 large_cave_num_min = 0;
u16 large_cave_num_max = 2;
float large_cave_flooded = 0.5f;
s16 cavern_limit = -256;
s16 cavern_taper = 256;
float cavern_threshold = 0.7f;

@ -68,6 +68,11 @@ MapgenValleys::MapgenValleys(MapgenValleysParams *params, EmergeManager *emerge)
cave_width = params->cave_width;
large_cave_depth = params->large_cave_depth;
lava_depth = params->lava_depth;
small_cave_num_min = params->small_cave_num_min;
small_cave_num_max = params->small_cave_num_max;
large_cave_num_min = params->large_cave_num_min;
large_cave_num_max = params->large_cave_num_max;
large_cave_flooded = params->large_cave_flooded;
cavern_limit = params->cavern_limit;
cavern_taper = params->cavern_taper;
cavern_threshold = params->cavern_threshold;
@ -128,6 +133,11 @@ void MapgenValleysParams::readParams(const Settings *settings)
settings->getU16NoEx("mgvalleys_altitude_chill", altitude_chill);
settings->getS16NoEx("mgvalleys_large_cave_depth", large_cave_depth);
settings->getS16NoEx("mgvalleys_lava_depth", lava_depth);
settings->getU16NoEx("mgvalleys_small_cave_num_min", small_cave_num_min);
settings->getU16NoEx("mgvalleys_small_cave_num_max", small_cave_num_max);
settings->getU16NoEx("mgvalleys_large_cave_num_min", large_cave_num_min);
settings->getU16NoEx("mgvalleys_large_cave_num_max", large_cave_num_max);
settings->getFloatNoEx("mgvalleys_large_cave_flooded", large_cave_flooded);
settings->getU16NoEx("mgvalleys_river_depth", river_depth);
settings->getU16NoEx("mgvalleys_river_size", river_size);
settings->getFloatNoEx("mgvalleys_cave_width", cave_width);
@ -158,6 +168,11 @@ void MapgenValleysParams::writeParams(Settings *settings) const
settings->setU16("mgvalleys_altitude_chill", altitude_chill);
settings->setS16("mgvalleys_large_cave_depth", large_cave_depth);
settings->setS16("mgvalleys_lava_depth", lava_depth);
settings->setU16("mgvalleys_small_cave_num_min", small_cave_num_min);
settings->setU16("mgvalleys_small_cave_num_max", small_cave_num_max);
settings->setU16("mgvalleys_large_cave_num_min", large_cave_num_min);
settings->setU16("mgvalleys_large_cave_num_max", large_cave_num_max);
settings->setFloat("mgvalleys_large_cave_flooded", large_cave_flooded);
settings->setU16("mgvalleys_river_depth", river_depth);
settings->setU16("mgvalleys_river_size", river_size);
settings->setFloat("mgvalleys_cave_width", cave_width);

@ -50,6 +50,11 @@ struct MapgenValleysParams : public MapgenParams {
float cave_width = 0.09f;
s16 large_cave_depth = -33;
s16 lava_depth = 1;
u16 small_cave_num_min = 0;
u16 small_cave_num_max = 0;
u16 large_cave_num_min = 0;
u16 large_cave_num_max = 2;
float large_cave_flooded = 0.5f;
s16 cavern_limit = -256;
s16 cavern_taper = 192;
float cavern_threshold = 0.6f;