The value cannot be fixed because we can shift terrain vertically.
This also makes these mapgens consistent with mgflat and mgvalleys which
have 'large_cave_depth' parameters.
# Controls width of tunnels, a smaller value creates wider tunnels.
mgv5_cave_width (Cave width) float 0.125
+# Y of upper limit of large pseudorandom caves.
+mgv5_large_cave_depth (Large cave depth) int -256
+
# Y-level of cavern upper limit.
mgv5_cavern_limit (Cavern limit) int -256
# Controls width of tunnels, a smaller value creates wider tunnels.
mgv7_cave_width (Cave width) float 0.09
+# Y of upper limit of large pseudorandom caves.
+mgv7_large_cave_depth (Large cave depth) int -33
+
# Controls the density of floatland mountain terrain.
# Is an offset added to the 'np_mountain' noise value.
mgv7_float_mount_density (Floatland mountain density) float 0.6
# Controls width of tunnels, a smaller value creates wider tunnels.
mgfractal_cave_width (Cave width) float 0.09
+# Y of upper limit of large pseudorandom caves.
+mgfractal_large_cave_depth (Large cave depth) int -33
+
# Choice of 18 fractals from 9 formulas.
# 1 = 4D "Roundy" mandelbrot set.
# 2 = 4D "Roundy" julia set.
# type: float
# mgv5_cave_width = 0.125
+# Y of upper limit of large pseudorandom caves.
+# type: int
+# mgv5_large_cave_depth = -256
+
# Y-level of cavern upper limit.
# type: int
# mgv5_cavern_limit = -256
# type: float
# mgv7_cave_width = 0.09
+# Y of upper limit of large pseudorandom caves.
+# type: int
+# mgv7_large_cave_depth = -33
+
# Controls the density of floatland mountain terrain.
# Is an offset added to the 'np_mountain' noise value.
# type: float
# type: float
# mgfractal_cave_width = 0.09
+# Y of upper limit of large pseudorandom caves.
+# type: int
+# mgfractal_large_cave_depth = -33
+
# Choice of 18 fractals from 9 formulas.
# 1 = 4D "Roundy" mandelbrot set.
# 2 = 4D "Roundy" julia set.
MapgenFractal::MapgenFractal(int mapgenid, MapgenFractalParams *params, EmergeManager *emerge)
: MapgenBasic(mapgenid, params, emerge)
{
- this->spflags = params->spflags;
- this->cave_width = params->cave_width;
- this->fractal = params->fractal;
- this->iterations = params->iterations;
- this->scale = params->scale;
- this->offset = params->offset;
- this->slice_w = params->slice_w;
- this->julia_x = params->julia_x;
- this->julia_y = params->julia_y;
- this->julia_z = params->julia_z;
- this->julia_w = params->julia_w;
+ this->spflags = params->spflags;
+ this->cave_width = params->cave_width;
+ this->large_cave_depth = params->large_cave_depth;
+ this->fractal = params->fractal;
+ this->iterations = params->iterations;
+ this->scale = params->scale;
+ this->offset = params->offset;
+ this->slice_w = params->slice_w;
+ this->julia_x = params->julia_x;
+ this->julia_y = params->julia_y;
+ this->julia_z = params->julia_z;
+ this->julia_w = params->julia_w;
//// 2D terrain noise
noise_seabed = new Noise(¶ms->np_seabed, seed, csize.X, csize.Z);
void MapgenFractalParams::readParams(const Settings *settings)
{
- settings->getFlagStrNoEx("mgfractal_spflags", spflags, flagdesc_mapgen_fractal);
- settings->getFloatNoEx("mgfractal_cave_width", cave_width);
- settings->getU16NoEx("mgfractal_fractal", fractal);
- settings->getU16NoEx("mgfractal_iterations", iterations);
- settings->getV3FNoEx("mgfractal_scale", scale);
- settings->getV3FNoEx("mgfractal_offset", offset);
- settings->getFloatNoEx("mgfractal_slice_w", slice_w);
- settings->getFloatNoEx("mgfractal_julia_x", julia_x);
- settings->getFloatNoEx("mgfractal_julia_y", julia_y);
- settings->getFloatNoEx("mgfractal_julia_z", julia_z);
- settings->getFloatNoEx("mgfractal_julia_w", julia_w);
+ settings->getFlagStrNoEx("mgfractal_spflags", spflags, flagdesc_mapgen_fractal);
+ settings->getFloatNoEx("mgfractal_cave_width", cave_width);
+ settings->getS16NoEx("mgfractal_large_cave_depth", large_cave_depth);
+ settings->getU16NoEx("mgfractal_fractal", fractal);
+ settings->getU16NoEx("mgfractal_iterations", iterations);
+ settings->getV3FNoEx("mgfractal_scale", scale);
+ settings->getV3FNoEx("mgfractal_offset", offset);
+ settings->getFloatNoEx("mgfractal_slice_w", slice_w);
+ settings->getFloatNoEx("mgfractal_julia_x", julia_x);
+ settings->getFloatNoEx("mgfractal_julia_y", julia_y);
+ settings->getFloatNoEx("mgfractal_julia_z", julia_z);
+ settings->getFloatNoEx("mgfractal_julia_w", julia_w);
settings->getNoiseParams("mgfractal_np_seabed", np_seabed);
settings->getNoiseParams("mgfractal_np_filler_depth", np_filler_depth);
void MapgenFractalParams::writeParams(Settings *settings) const
{
- settings->setFlagStr("mgfractal_spflags", spflags, flagdesc_mapgen_fractal, U32_MAX);
- settings->setFloat("mgfractal_cave_width", cave_width);
- settings->setU16("mgfractal_fractal", fractal);
- settings->setU16("mgfractal_iterations", iterations);
- settings->setV3F("mgfractal_scale", scale);
- settings->setV3F("mgfractal_offset", offset);
- settings->setFloat("mgfractal_slice_w", slice_w);
- settings->setFloat("mgfractal_julia_x", julia_x);
- settings->setFloat("mgfractal_julia_y", julia_y);
- settings->setFloat("mgfractal_julia_z", julia_z);
- settings->setFloat("mgfractal_julia_w", julia_w);
+ settings->setFlagStr("mgfractal_spflags", spflags, flagdesc_mapgen_fractal, U32_MAX);
+ settings->setFloat("mgfractal_cave_width", cave_width);
+ settings->setS16("mgfractal_large_cave_depth", large_cave_depth);
+ settings->setU16("mgfractal_fractal", fractal);
+ settings->setU16("mgfractal_iterations", iterations);
+ settings->setV3F("mgfractal_scale", scale);
+ settings->setV3F("mgfractal_offset", offset);
+ settings->setFloat("mgfractal_slice_w", slice_w);
+ settings->setFloat("mgfractal_julia_x", julia_x);
+ settings->setFloat("mgfractal_julia_y", julia_y);
+ settings->setFloat("mgfractal_julia_z", julia_z);
+ settings->setFloat("mgfractal_julia_w", julia_w);
settings->setNoiseParams("mgfractal_np_seabed", np_seabed);
settings->setNoiseParams("mgfractal_np_filler_depth", np_filler_depth);
MgStoneType stone_type = generateBiomes();
if (flags & MG_CAVES)
- generateCaves(stone_surface_max_y, MGFRACTAL_LARGE_CAVE_DEPTH);
+ generateCaves(stone_surface_max_y, large_cave_depth);
if (flags & MG_DUNGEONS)
generateDungeons(stone_surface_max_y, stone_type);
#include "mapgen.h"
-#define MGFRACTAL_LARGE_CAVE_DEPTH -33
-
class BiomeManager;
extern FlagDesc flagdesc_mapgen_fractal[];
{
u32 spflags = 0;
float cave_width = 0.09f;
+ s16 large_cave_depth = -33;
u16 fractal = 1;
u16 iterations = 11;
v3f scale = v3f(4096.0, 1024.0, 4096.0);
u16 formula;
bool julia;
+ s16 large_cave_depth;
u16 fractal;
u16 iterations;
v3f scale;
{
this->spflags = params->spflags;
this->cave_width = params->cave_width;
+ this->large_cave_depth = params->large_cave_depth;
this->cavern_limit = params->cavern_limit;
this->cavern_taper = params->cavern_taper;
this->cavern_threshold = params->cavern_threshold;
{
settings->getFlagStrNoEx("mgv5_spflags", spflags, flagdesc_mapgen_v5);
settings->getFloatNoEx("mgv5_cave_width", cave_width);
+ settings->getS16NoEx("mgv5_large_cave_depth", large_cave_depth);
settings->getS16NoEx("mgv5_cavern_limit", cavern_limit);
settings->getS16NoEx("mgv5_cavern_taper", cavern_taper);
settings->getFloatNoEx("mgv5_cavern_threshold", cavern_threshold);
{
settings->setFlagStr("mgv5_spflags", spflags, flagdesc_mapgen_v5, U32_MAX);
settings->setFloat("mgv5_cave_width", cave_width);
+ settings->setS16("mgv5_large_cave_depth", large_cave_depth);
settings->setS16("mgv5_cavern_limit", cavern_limit);
settings->setS16("mgv5_cavern_taper", cavern_taper);
settings->setFloat("mgv5_cavern_threshold", cavern_threshold);
// large caverns and floating blobs of overgenerated liquid.
generateCaves(stone_surface_max_y, -MAX_MAP_GENERATION_LIMIT);
else
- generateCaves(stone_surface_max_y, MGV5_LARGE_CAVE_DEPTH);
+ generateCaves(stone_surface_max_y, large_cave_depth);
}
// Generate dungeons and desert temples
#include "mapgen.h"
-#define MGV5_LARGE_CAVE_DEPTH -256
-
///////// Mapgen V5 flags
#define MGV5_CAVERNS 0x01
{
u32 spflags = MGV5_CAVERNS;
float cave_width = 0.125f;
+ s16 large_cave_depth = -256;
s16 cavern_limit = -256;
s16 cavern_taper = 256;
float cavern_threshold = 0.7f;
int generateBaseTerrain();
private:
+ s16 large_cave_depth;
Noise *noise_factor;
Noise *noise_height;
Noise *noise_ground;
{
this->spflags = params->spflags;
this->cave_width = params->cave_width;
+ this->large_cave_depth = params->large_cave_depth;
this->float_mount_density = params->float_mount_density;
this->float_mount_height = params->float_mount_height;
this->floatland_level = params->floatland_level;
{
settings->getFlagStrNoEx("mgv7_spflags", spflags, flagdesc_mapgen_v7);
settings->getFloatNoEx("mgv7_cave_width", cave_width);
+ settings->getS16NoEx("mgv7_large_cave_depth", large_cave_depth);
settings->getFloatNoEx("mgv7_float_mount_density", float_mount_density);
settings->getFloatNoEx("mgv7_float_mount_height", float_mount_height);
settings->getS16NoEx("mgv7_floatland_level", floatland_level);
{
settings->setFlagStr("mgv7_spflags", spflags, flagdesc_mapgen_v7, U32_MAX);
settings->setFloat("mgv7_cave_width", cave_width);
+ settings->setS16("mgv7_large_cave_depth", large_cave_depth);
settings->setFloat("mgv7_float_mount_density", float_mount_density);
settings->setFloat("mgv7_float_mount_height", float_mount_height);
settings->setS16("mgv7_floatland_level", floatland_level);
// large caverns and floating blobs of overgenerated liquid.
generateCaves(stone_surface_max_y, -MAX_MAP_GENERATION_LIMIT);
else
- generateCaves(stone_surface_max_y, water_level);
+ generateCaves(stone_surface_max_y, large_cave_depth);
}
// Generate dungeons
struct MapgenV7Params : public MapgenParams {
u32 spflags = MGV7_MOUNTAINS | MGV7_RIDGES | MGV7_CAVERNS;
float cave_width = 0.09f;
+ s16 large_cave_depth = -33;
float float_mount_density = 0.6f;
float float_mount_height = 128.0f;
s16 floatland_level = 1280;
void generateRidgeTerrain();
private:
+ s16 large_cave_depth;
float float_mount_density;
float float_mount_height;
s16 floatland_level;