Skip to content

Commit 80c7612

Browse files
duane-rparamat
authored andcommittedJan 31, 2016
Mgvalleys: use standard caves
Replace simple caves with V5 caves, adding unpredictable water and lava settings and massive caves based on subterrain. Remove fast terrain mode and accompanying settings. Remove superfluous temperature/humidity settings. Remove lava/water height setting. Fix errors in humidity handling and remove humidity_break_point setting. Move cave noises to generateCaves. Fix minor formatting/naming issues and use MYMAX/MYMIN/myround.
1 parent 83583aa commit 80c7612

File tree

4 files changed

+326
-392
lines changed

4 files changed

+326
-392
lines changed
 

‎builtin/settingtypes.txt

+18-27
Original file line numberDiff line numberDiff line change
@@ -1043,59 +1043,50 @@ mgfractal_np_cave2 (Mapgen fractal cave2 noise parameters) noise_params 0, 12, (
10431043
# Flags that are not specified in the flag string are not modified from the default.
10441044
# Flags starting with "no" are used to explicitly disable them.
10451045
# "altitude_chill" makes higher elevations colder, which may cause biome issues.
1046-
# "fast" produces softer terrain, more quickly
10471046
# "humid_rivers" modifies the humidity around rivers and in areas where water would tend to pool. It may interfere with delicately adjusted biomes.
1048-
# "rugged" and "cliffs" do nothing unless "fast" is enabled
1049-
mg_valleys_spflags (Valleys C Flags) flags altitude_chill,cliffs,humid_rivers,nofast,rugged altitude_chill,noaltitude_chill,cliffs,nocliffs,fast,nofast,humid_rivers,nohumid_rivers,rugged,norugged
1047+
mg_valleys_spflags (Valleys C Flags) flags altitude_chill,humid_rivers altitude_chill,noaltitude_chill,humid_rivers,nohumid_rivers
10501048

10511049
# The altitude at which temperature drops by 20C
10521050
mg_valleys_altitude_chill (Altitude Chill) int 90
10531051

1054-
# Average humidity
1055-
mg_valleys_humidity (Humidity) int 50
1052+
# Depth below which you'll find large caves.
1053+
mg_valleys_large_cave_depth (Large cave depth) int -33
10561054

1057-
# The highest humidity around rivers in otherwise dry areas
1058-
mg_valleys_humidity_break_point (Humidity Break) int 65
1055+
# Creates unpredictable lava features in caves.
1056+
# These can make mining difficult. Zero disables them. (0-10)
1057+
mg_valleys_lava_features (Lava Features) int 0
10591058

1060-
# Maximum altitude where lava can emerge
1061-
mg_valleys_lava_max_height (Lava Height) int 0
1062-
1063-
# Maximum altitude where water occurs in caves (and tends to fall out)
1064-
mg_valleys_cave_water_max_height (Cave Water Height) int 31000
1059+
# Depth below which you'll find massive caves.
1060+
mg_valleys_massive_cave_depth (Massive cave depth) int -256
10651061

10661062
# How deep to make rivers
10671063
mg_valleys_river_depth (River Depth) int 4
10681064

10691065
# How wide to make rivers
10701066
mg_valleys_river_size (River Size) int 5
10711067

1072-
# Average temperature
1073-
mg_valleys_temperature (Temperature) int 50
1074-
1075-
# How often water occurs in caves (0-10)
1076-
mg_valleys_water_features (Water Features) int 3
1068+
# Creates unpredictable water features in caves.
1069+
# These can make mining difficult. Zero disables them. (0-10)
1070+
mg_valleys_water_features (Water Features) int 0
10771071

10781072
# Noise parameters
10791073
[****Noises]
10801074

1081-
# Cliff noise
1082-
mg_valleys_np_cliffs (Cliffs) noise_params 0, 1, (750, 750, 750), 8445, 5, 1.0, 2.0
1075+
# Caves and tunnels form at the intersection of the two noises
1076+
mg_valleys_np_cave1 (Cave noise #1) noise_params 0, 12, (100, 100, 100), 52534, 4, 0.5, 2.0
10831077

1084-
# Mountain corrugation
1085-
mg_valleys_np_corr (Corrugation) noise_params 0, 1, (40, 40, 40), -3536, 4, 1.0, 2.0
1078+
# Caves and tunnels form at the intersection of the two noises
1079+
mg_valleys_np_cave2 (Cave noise #2) noise_params 0, 12, (100, 100, 100), 10325, 4, 0.5, 2.0
10861080

10871081
# The depth of dirt or other filler
10881082
mg_valleys_np_filler_depth (Filler Depth) noise_params 0, 1.2, (256, 256, 256), 1605, 3, 0.5, 2.0
10891083

1084+
# Massive caves form here.
1085+
mg_valleys_np_massive_caves (Massive cave noise) noise_params 0, 1, (768, 256, 768), 59033, 6, 0.63, 2.0
1086+
10901087
# River noise -- rivers occur close to zero
10911088
mg_valleys_np_rivers (River Noise) noise_params 0, 1, (256, 256, 256), -6050, 5, 0.6, 2.0
10921089

1093-
# Caves and tunnels form at the intersection of the two noises
1094-
mg_valleys_np_simple_caves_1 (Simple Caves #1) noise_params 0, 1, v3f(64, 64, 64), -8402, 3, 0.5, 2.0
1095-
1096-
# Caves and tunnels form at the intersection of the two noises
1097-
mg_valleys_np_simple_caves_2 (Simple Caves #2) noise_params 0, 1, v3f(64, 64, 64), 3944, 3, 0.5, 2.0
1098-
10991090
# Base terrain height
11001091
mg_valleys_np_terrain_height (Terrain Height) noise_params -10, 50, (1024, 1024, 1024), 5202, 6, 0.4, 2.0
11011092

‎minetest.conf.example

+10-13
Original file line numberDiff line numberDiff line change
@@ -1315,31 +1315,28 @@
13151315

13161316
#### Mapgen Valleys
13171317

1318-
#mg_valleys_spflags = altitude_chill,cliffs,humid_rivers,nofast,rugged
1318+
#mg_valleys_spflags = altitude_chill,humid_rivers
13191319
# "altitude_chill" makes higher elevations colder, which may cause biome issues.
1320-
# "fast" produces softer terrain, more quickly
13211320
# "humid_rivers" modifies the humidity around rivers and in areas where water would tend to pool. It may interfere with delicately adjusted biomes.
1322-
# "rugged" and "cliffs" do nothing unless "fast" is enabled
13231321
#
13241322
#mg_valleys_altitude_chill = 90 # the altitude at which temperature drops by 20C
1325-
#mg_valleys_cave_water_max_height = 31000 # max altitude of water in caves
1326-
#mg_valleys_humidity = 50 # the average humidity
1327-
#mg_valleys_humidity_break_point = 65 # The highest humidity around rivers in otherwise dry areas
1328-
#mg_valleys_lava_max_height = 0 # maximum altitude of lava
1323+
#mg_valleys_large_cave_depth = -33 # Depth below which you'll find large caves.
1324+
#mg_valleys_lava_features = 0 # Creates unpredictable lava features in caves. These can make mining difficult. Zero disables them. (0-10)
1325+
#mg_valleys_massive_cave_depth = -256 # Depth below which you'll find massive caves.
13291326
#mg_valleys_river_depth = 4 # how deep to make rivers
13301327
#mg_valleys_river_size = 5 # how wide to make rivers
1331-
#mg_valleys_temperature = 50 # the average temperature
1332-
#mg_valleys_water_features = 3 # how often water occurs in caves (0-10)
1328+
#mg_valleys_water_features = 0 # Creates unpredictable water features in caves. These can make mining difficult. Zero disables them. (0-10)
13331329
#
1334-
#mg_valleys_np_cliffs = 0, 1, (750, 750, 750), 8445, 5, 1.0, 2.0
1335-
#mg_valleys_np_corr = 0, 1, (40, 40, 40), -3536, 4, 1.0, 2.0
13361330
#mg_valleys_np_filler_depth = 0, 1.2, (256, 256, 256), 1605, 3, 0.5, 2.0
13371331
#
13381332
# River noise -- rivers occur close to zero
13391333
#mg_valleys_np_rivers = 0, 1, (256, 256, 256), -6050, 5, 0.6, 2.0
13401334
#
1341-
#mg_valleys_np_simple_caves_1 = 0, 1, v3f(64, 64, 64), -8402, 3, 0.5, 2.0
1342-
#mg_valleys_np_simple_caves_2 = 0, 1, v3f(64, 64, 64), 3944, 3, 0.5, 2.0
1335+
# Caves and tunnels form at the intersection of the two noises
1336+
#mg_valleys_np_cave1 = 0, 12, (100, 100, 100), 52534, 4, 0.5, 2.0
1337+
#mg_valleys_np_cave2 = 0, 12, (100, 100, 100), 10325, 4, 0.5, 2.0
1338+
#
1339+
#mg_valleys_np_massive_caves = 0, 1, (768, 256, 768), 59033, 6, 0.63, 2 # Massive caves form here.
13431340
#
13441341
# Base terrain height
13451342
#mg_valleys_np_terrain_height = -10, 50, (1024, 1024, 1024), 5202, 6, 0.4, 2.0

‎src/mapgen_valleys.cpp

+270-321
Large diffs are not rendered by default.

‎src/mapgen_valleys.h

+28-31
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,12 @@ with this program; if not, write to the Free Software Foundation, Inc.,
3131
#include "mapgen.h"
3232

3333
/////////////////// Mapgen Valleys flags
34-
#define MG_VALLEYS_ALT_CHILL 0x01
35-
#define MG_VALLEYS_CLIFFS 0x02
36-
#define MG_VALLEYS_FAST 0x04
37-
#define MG_VALLEYS_HUMID_RIVERS 0x08
38-
#define MG_VALLEYS_RUGGED 0x10
34+
#define MG_VALLEYS_ALT_CHILL 0x01
35+
#define MG_VALLEYS_HUMID_RIVERS 0x02
36+
37+
// Feed only one variable into these.
38+
#define MYSQUARE(x) (x) * (x)
39+
#define MYCUBE(x) (x) * (x) * (x)
3940

4041
class BiomeManager;
4142

@@ -47,28 +48,25 @@ class BiomeManager;
4748
struct MapgenValleysParams : public MapgenSpecificParams {
4849
u32 spflags;
4950

51+
s16 large_cave_depth;
52+
s16 massive_cave_depth;
5053
u16 altitude_chill;
51-
s16 cave_water_max_height;
52-
s16 humidity;
53-
s16 humidity_break_point;
54-
s16 lava_max_height;
54+
u16 lava_features;
5555
u16 river_depth;
5656
u16 river_size;
57-
s16 temperature;
5857
u16 water_features;
5958

6059
NoiseParams np_biome_heat;
6160
NoiseParams np_biome_heat_blend;
6261
NoiseParams np_biome_humidity;
6362
NoiseParams np_biome_humidity_blend;
64-
NoiseParams np_cliffs;
65-
NoiseParams np_corr;
63+
NoiseParams np_cave1;
64+
NoiseParams np_cave2;
6665
NoiseParams np_filler_depth;
6766
NoiseParams np_inter_valley_fill;
6867
NoiseParams np_inter_valley_slope;
6968
NoiseParams np_rivers;
70-
NoiseParams np_simple_caves_1;
71-
NoiseParams np_simple_caves_2;
69+
NoiseParams np_massive_caves;
7270
NoiseParams np_terrain_height;
7371
NoiseParams np_valley_depth;
7472
NoiseParams np_valley_profile;
@@ -89,8 +87,6 @@ struct TerrainNoise {
8987
float valley_profile;
9088
float *slope;
9189
float inter_valley_fill;
92-
float cliffs;
93-
float corr;
9490
};
9591

9692
class MapgenValleys : public Mapgen {
@@ -102,17 +98,18 @@ class MapgenValleys : public Mapgen {
10298
virtual void makeChunk(BlockMakeData *data);
10399
int getGroundLevelAtPoint(v2s16 p);
104100

101+
s16 large_cave_depth;
102+
105103
private:
106104
EmergeManager *m_emerge;
107105
BiomeManager *bmgr;
108106

109107
int ystride;
110108
int zstride;
111109

110+
float map_gen_limit;
111+
112112
u32 spflags;
113-
bool cliff_terrain;
114-
bool fast_terrain;
115-
bool rugged_terrain;
116113
bool humid_rivers;
117114
bool use_altitude_chill;
118115

@@ -123,30 +120,30 @@ class MapgenValleys : public Mapgen {
123120

124121
Noise *noise_filler_depth;
125122

126-
Noise *noise_cliffs;
127-
Noise *noise_corr;
123+
Noise *noise_cave1;
124+
Noise *noise_cave2;
128125
Noise *noise_heat;
129126
Noise *noise_heat_blend;
130127
Noise *noise_humidity;
131128
Noise *noise_humidity_blend;
132129
Noise *noise_inter_valley_fill;
133130
Noise *noise_inter_valley_slope;
134131
Noise *noise_rivers;
135-
Noise *noise_simple_caves_1;
136-
Noise *noise_simple_caves_2;
132+
Noise *noise_massive_caves;
137133
Noise *noise_terrain_height;
138134
Noise *noise_valley_depth;
139135
Noise *noise_valley_profile;
140136

141137
float altitude_chill;
142-
float cave_water_max_height;
138+
s16 cave_water_max_height;
143139
float humidity_adjust;
144-
float humidity_break_point;
145-
float lava_max_height;
146-
float river_depth;
147-
float river_size;
148-
float temperature_adjust;
149-
s16 water_features;
140+
s16 lava_features_lim;
141+
s16 lava_max_height;
142+
s16 massive_cave_depth;
143+
float river_depth_bed;
144+
float river_size_factor;
145+
float *tcave_cache;
146+
s16 water_features_lim;
150147

151148
content_t c_cobble;
152149
content_t c_desert_stone;
@@ -176,7 +173,7 @@ class MapgenValleys : public Mapgen {
176173
MgStoneType generateBiomes(float *heat_map, float *humidity_map);
177174
void dustTopNodes();
178175

179-
void generateSimpleCaves(s16 max_stone_y);
176+
void generateCaves(s16 max_stone_y);
180177
};
181178

182179
struct MapgenFactoryValleys : public MapgenFactory {

0 commit comments

Comments
 (0)
Please sign in to comment.