Skip to content

Commit 29a4a8e

Browse files
authoredNov 9, 2019
Tunnels: Completely disable generation when 'cave width' >= 10.0 (#9093)
Previously, the only way to disable the 3D noise tunnels was to set 'cave width' > 1.0, however doing so did not disable the very intensive noise calculations or the generation loop. All the other types of cave generation (randomwalk caves, caverns) can already be independently and completely disabled. This feature is now needed more because the small randomwalk caves are now available for use as an alternative to the 3D noise tunnels.
1 parent d11bfa3 commit 29a4a8e

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed
 

Diff for: ‎builtin/settingtypes.txt

+12
Original file line numberDiff line numberDiff line change
@@ -1470,6 +1470,8 @@ mg_biome_np_humidity_blend (Humidity blend noise) noise_params_2d 0, 1.5, (8, 8,
14701470
mgv5_spflags (Mapgen V5 specific flags) flags caverns caverns,nocaverns
14711471

14721472
# Controls width of tunnels, a smaller value creates wider tunnels.
1473+
# Value >= 10.0 completely disables generation of tunnels and avoids the
1474+
# intensive noise calculations.
14731475
mgv5_cave_width (Cave width) float 0.09
14741476

14751477
# Y of upper limit of large caves.
@@ -1602,6 +1604,8 @@ mgv7_spflags (Mapgen V7 specific flags) flags mountains,ridges,nofloatlands,cave
16021604
mgv7_mount_zero_level (Mountain zero level) int 0
16031605

16041606
# Controls width of tunnels, a smaller value creates wider tunnels.
1607+
# Value >= 10.0 completely disables generation of tunnels and avoids the
1608+
# intensive noise calculations.
16051609
mgv7_cave_width (Cave width) float 0.09
16061610

16071611
# Y of upper limit of large caves.
@@ -1725,6 +1729,8 @@ mgcarpathian_river_depth (River channel depth) float 24.0
17251729
mgcarpathian_valley_width (River valley width) float 0.25
17261730

17271731
# Controls width of tunnels, a smaller value creates wider tunnels.
1732+
# Value >= 10.0 completely disables generation of tunnels and avoids the
1733+
# intensive noise calculations.
17281734
mgcarpathian_cave_width (Cave width) float 0.09
17291735

17301736
# Y of upper limit of large caves.
@@ -1849,6 +1855,8 @@ mgflat_large_cave_num_max (Large cave maximum number) int 2 0 64
18491855
mgflat_large_cave_flooded (Large cave proportion flooded) float 0.5 0.0 1.0
18501856

18511857
# Controls width of tunnels, a smaller value creates wider tunnels.
1858+
# Value >= 10.0 completely disables generation of tunnels and avoids the
1859+
# intensive noise calculations.
18521860
mgflat_cave_width (Cave width) float 0.09
18531861

18541862
# Terrain noise threshold for lakes.
@@ -1898,6 +1906,8 @@ mgflat_np_dungeons (Dungeon noise) noise_params_3d 0.9, 0.5, (500, 500, 500), 0,
18981906
mgfractal_spflags (Mapgen Fractal specific flags) flags terrain terrain,noterrain
18991907

19001908
# Controls width of tunnels, a smaller value creates wider tunnels.
1909+
# Value >= 10.0 completely disables generation of tunnels and avoids the
1910+
# intensive noise calculations.
19011911
mgfractal_cave_width (Cave width) float 0.09
19021912

19031913
# Y of upper limit of large caves.
@@ -2076,6 +2086,8 @@ mgvalleys_river_depth (River depth) int 4
20762086
mgvalleys_river_size (River size) int 5
20772087

20782088
# Controls width of tunnels, a smaller value creates wider tunnels.
2089+
# Value >= 10.0 completely disables generation of tunnels and avoids the
2090+
# intensive noise calculations.
20792091
mgvalleys_cave_width (Cave width) float 0.09
20802092

20812093
# Lower Y limit of dungeons.

Diff for: ‎src/mapgen/mapgen.cpp

+3-1
Original file line numberDiff line numberDiff line change
@@ -831,7 +831,9 @@ void MapgenBasic::dustTopNodes()
831831

832832
void MapgenBasic::generateCavesNoiseIntersection(s16 max_stone_y)
833833
{
834-
if (node_min.Y > max_stone_y)
834+
// cave_width >= 10 is used to disable generation and avoid the intensive
835+
// 3D noise calculations. Tunnels already have zero width when cave_width > 1.
836+
if (node_min.Y > max_stone_y || cave_width >= 10.0f)
835837
return;
836838

837839
CavesNoiseIntersection caves_noise(ndef, m_bmgr, csize,

0 commit comments

Comments
 (0)