Skip to content

Commit e51ea66

Browse files
committedDec 2, 2015
Mgv5/v7/flat/fractal: More large pseudorandom caves
Mgv7/flat/fractal: Reduce tunnel noise spreads to 96
1 parent 97908cc commit e51ea66

File tree

4 files changed

+14
-14
lines changed

4 files changed

+14
-14
lines changed
 

Diff for: ‎src/mapgen_flat.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -148,8 +148,8 @@ MapgenFlatParams::MapgenFlatParams()
148148

149149
np_terrain = NoiseParams(0, 1, v3f(600, 600, 600), 7244, 5, 0.6, 2.0);
150150
np_filler_depth = NoiseParams(0, 1.2, v3f(150, 150, 150), 261, 3, 0.7, 2.0);
151-
np_cave1 = NoiseParams(0, 12, v3f(128, 128, 128), 52534, 4, 0.5, 2.0);
152-
np_cave2 = NoiseParams(0, 12, v3f(128, 128, 128), 10325, 4, 0.5, 2.0);
151+
np_cave1 = NoiseParams(0, 12, v3f(96, 96, 96), 52534, 4, 0.5, 2.0);
152+
np_cave2 = NoiseParams(0, 12, v3f(96, 96, 96), 10325, 4, 0.5, 2.0);
153153
}
154154

155155

@@ -559,7 +559,7 @@ void MapgenFlat::generateCaves(s16 max_stone_y)
559559
for (s16 x = node_min.X; x <= node_max.X; x++, vi++, index++) {
560560
float d1 = contour(noise_cave1->result[index]);
561561
float d2 = contour(noise_cave2->result[index]);
562-
if (d1 * d2 > 0.4f) {
562+
if (d1 * d2 > 0.3f) {
563563
content_t c = vm->m_data[vi].getContent();
564564
if (!ndef->get(c).is_ground_content || c == CONTENT_AIR)
565565
continue;
@@ -574,7 +574,7 @@ void MapgenFlat::generateCaves(s16 max_stone_y)
574574
return;
575575

576576
PseudoRandom ps(blockseed + 21343);
577-
u32 bruises_count = (ps.range(1, 4) == 1) ? ps.range(1, 2) : 0;
577+
u32 bruises_count = ps.range(0, 2);
578578
for (u32 i = 0; i < bruises_count; i++) {
579579
CaveV5 cave(this, &ps);
580580
cave.makeCave(node_min, node_max, max_stone_y);

Diff for: ‎src/mapgen_fractal.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -154,8 +154,8 @@ MapgenFractalParams::MapgenFractalParams()
154154

155155
np_seabed = NoiseParams(-14, 9, v3f(600, 600, 600), 41900, 5, 0.6, 2.0);
156156
np_filler_depth = NoiseParams(0, 1.2, v3f(150, 150, 150), 261, 3, 0.7, 2.0);
157-
np_cave1 = NoiseParams(0, 12, v3f(128, 128, 128), 52534, 4, 0.5, 2.0);
158-
np_cave2 = NoiseParams(0, 12, v3f(128, 128, 128), 10325, 4, 0.5, 2.0);
157+
np_cave1 = NoiseParams(0, 12, v3f(96, 96, 96), 52534, 4, 0.5, 2.0);
158+
np_cave2 = NoiseParams(0, 12, v3f(96, 96, 96), 10325, 4, 0.5, 2.0);
159159
}
160160

161161

@@ -624,7 +624,7 @@ void MapgenFractal::generateCaves(s16 max_stone_y)
624624
for (s16 x = node_min.X; x <= node_max.X; x++, vi++, index++) {
625625
float d1 = contour(noise_cave1->result[index]);
626626
float d2 = contour(noise_cave2->result[index]);
627-
if (d1 * d2 > 0.4f) {
627+
if (d1 * d2 > 0.3f) {
628628
content_t c = vm->m_data[vi].getContent();
629629
if (!ndef->get(c).is_ground_content || c == CONTENT_AIR)
630630
continue;
@@ -639,7 +639,7 @@ void MapgenFractal::generateCaves(s16 max_stone_y)
639639
return;
640640

641641
PseudoRandom ps(blockseed + 21343);
642-
u32 bruises_count = (ps.range(1, 4) == 1) ? ps.range(1, 2) : 0;
642+
u32 bruises_count = ps.range(0, 2);
643643
for (u32 i = 0; i < bruises_count; i++) {
644644
CaveV5 cave(this, &ps);
645645
cave.makeCave(node_min, node_max, max_stone_y);

Diff for: ‎src/mapgen_v5.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -518,7 +518,7 @@ void MapgenV5::generateCaves(int max_stone_y)
518518
for (s16 x = node_min.X; x <= node_max.X; x++, i++, index++) {
519519
float d1 = contour(noise_cave1->result[index]);
520520
float d2 = contour(noise_cave2->result[index]);
521-
if (d1*d2 > 0.125) {
521+
if (d1 * d2 > 0.125f) {
522522
content_t c = vm->m_data[i].getContent();
523523
if (!ndef->get(c).is_ground_content || c == CONTENT_AIR)
524524
continue;
@@ -533,7 +533,7 @@ void MapgenV5::generateCaves(int max_stone_y)
533533
return;
534534

535535
PseudoRandom ps(blockseed + 21343);
536-
u32 bruises_count = (ps.range(1, 4) == 1) ? ps.range(1, 2) : 0;
536+
u32 bruises_count = ps.range(0, 2);
537537
for (u32 i = 0; i < bruises_count; i++) {
538538
CaveV5 cave(this, &ps);
539539
cave.makeCave(node_min, node_max, max_stone_y);

Diff for: ‎src/mapgen_v7.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -157,8 +157,8 @@ MapgenV7Params::MapgenV7Params()
157157
np_ridge_uwater = NoiseParams(0, 1, v3f(1000, 1000, 1000), 85039, 5, 0.6, 2.0);
158158
np_mountain = NoiseParams(-0.6, 1, v3f(250, 350, 250), 5333, 5, 0.63, 2.0);
159159
np_ridge = NoiseParams(0, 1, v3f(100, 100, 100), 6467, 4, 0.75, 2.0);
160-
np_cave1 = NoiseParams(0, 12, v3f(100, 100, 100), 52534, 4, 0.5, 2.0);
161-
np_cave2 = NoiseParams(0, 12, v3f(100, 100, 100), 10325, 4, 0.5, 2.0);
160+
np_cave1 = NoiseParams(0, 12, v3f(96, 96, 96), 52534, 4, 0.5, 2.0);
161+
np_cave2 = NoiseParams(0, 12, v3f(96, 96, 96), 10325, 4, 0.5, 2.0);
162162
}
163163

164164

@@ -870,7 +870,7 @@ void MapgenV7::generateCaves(s16 max_stone_y)
870870
for (s16 x = node_min.X; x <= node_max.X; x++, i++, index++) {
871871
float d1 = contour(noise_cave1->result[index]);
872872
float d2 = contour(noise_cave2->result[index]);
873-
if (d1 * d2 > 0.3) {
873+
if (d1 * d2 > 0.3f) {
874874
content_t c = vm->m_data[i].getContent();
875875
if (!ndef->get(c).is_ground_content || c == CONTENT_AIR)
876876
continue;
@@ -882,7 +882,7 @@ void MapgenV7::generateCaves(s16 max_stone_y)
882882
}
883883

884884
PseudoRandom ps(blockseed + 21343);
885-
u32 bruises_count = (ps.range(1, 4) == 1) ? ps.range(1, 2) : 0;
885+
u32 bruises_count = ps.range(0, 2);
886886
for (u32 i = 0; i < bruises_count; i++) {
887887
CaveV7 cave(this, &ps);
888888
cave.makeCave(node_min, node_max, max_stone_y);

0 commit comments

Comments
 (0)
Please sign in to comment.