mgv5_spflags (Mapgen V5 specific flags) flags caverns caverns,nocaverns
# Controls width of tunnels, a smaller value creates wider tunnels.
+# Value >= 10.0 completely disables generation of tunnels and avoids the
+# intensive noise calculations.
mgv5_cave_width (Cave width) float 0.09
# Y of upper limit of large caves.
mgv7_mount_zero_level (Mountain zero level) int 0
# Controls width of tunnels, a smaller value creates wider tunnels.
+# Value >= 10.0 completely disables generation of tunnels and avoids the
+# intensive noise calculations.
mgv7_cave_width (Cave width) float 0.09
# Y of upper limit of large caves.
mgcarpathian_valley_width (River valley width) float 0.25
# Controls width of tunnels, a smaller value creates wider tunnels.
+# Value >= 10.0 completely disables generation of tunnels and avoids the
+# intensive noise calculations.
mgcarpathian_cave_width (Cave width) float 0.09
# Y of upper limit of large caves.
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.
+# Value >= 10.0 completely disables generation of tunnels and avoids the
+# intensive noise calculations.
mgflat_cave_width (Cave width) float 0.09
# Terrain noise threshold for lakes.
mgfractal_spflags (Mapgen Fractal specific flags) flags terrain terrain,noterrain
# Controls width of tunnels, a smaller value creates wider tunnels.
+# Value >= 10.0 completely disables generation of tunnels and avoids the
+# intensive noise calculations.
mgfractal_cave_width (Cave width) float 0.09
# Y of upper limit of large caves.
mgvalleys_river_size (River size) int 5
# Controls width of tunnels, a smaller value creates wider tunnels.
+# Value >= 10.0 completely disables generation of tunnels and avoids the
+# intensive noise calculations.
mgvalleys_cave_width (Cave width) float 0.09
# Lower Y limit of dungeons.
void MapgenBasic::generateCavesNoiseIntersection(s16 max_stone_y)
{
- if (node_min.Y > max_stone_y)
+ // cave_width >= 10 is used to disable generation and avoid the intensive
+ // 3D noise calculations. Tunnels already have zero width when cave_width > 1.
+ if (node_min.Y > max_stone_y || cave_width >= 10.0f)
return;
CavesNoiseIntersection caves_noise(ndef, m_bmgr, csize,