Skip to content

Commit 44235de

Browse files
committed
Recalibrate Stable Layers edge detail presets
1 parent 9fb6190 commit 44235de

5 files changed

Lines changed: 65 additions & 14 deletions

File tree

docs/CONFIGURATION.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,21 @@ When a control is `custom`, its value comes from `formations.custom`:
7575
| `edge_octaves` | 1-8 | Number of boundary-detail scales |
7676
| `continuity` | 0-1 | Proportion of formations retaining global identity |
7777

78+
For Stable Layers, the Edge Detail presets use these
79+
`wavelength / amplitude / octaves` values:
80+
81+
| Preset | Edge detail |
82+
|---|---:|
83+
| Tiny | `48 / 4 / 1` |
84+
| Small | `64 / 12 / 2` |
85+
| Average | `96 / 24 / 3` |
86+
| Large | `128 / 48 / 4` |
87+
| Huge | `192 / 96 / 5` |
88+
89+
Average is calibrated to retain visible variation at later layer contacts.
90+
Custom profiles keep their explicit values; these numbers are only used by the
91+
named presets and as defaults for new Custom settings.
92+
7893
Cyano settings use `cyano.geome_size` (4-32767),
7994
`cyano.rock_layer_noise` (1-32767), and `cyano.rock_layer_thickness` (1-255).
8095
They are ignored by Sky.

src/main/java/zone/moddev/mc/orespawn/worldgen/FormationSettings.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,12 @@ public static Algorithm fromConfigName(String name) {
2626
}
2727

2828
public enum Preset {
29-
TINY("tiny", 64.0D, 25.0D, 128.0D, 1, 15.0D, 1, 0.00D, 12.0D, 32.0D, 0.0D, 0),
30-
SMALL("small", 128.0D, 50.0D, 192.0D, 3, 30.0D, 2, 0.50D, 24.0D, 48.0D, 4.0D, 1),
31-
AVERAGE("average", 256.0D, 100.0D, 256.0D, 8, 60.0D, 4, 0.85D, 48.0D, 64.0D, 12.0D, 2),
32-
LARGE("large", 512.0D, 200.0D, 384.0D, 28, 90.0D, 5, 0.95D, 128.0D, 96.0D, 24.0D, 3),
33-
HUGE("huge", 1024.0D, 640.0D, 512.0D, 128, 120.0D, 6, 1.00D, 288.0D, 128.0D, 48.0D, 4),
34-
CUSTOM("custom", 256.0D, 100.0D, 256.0D, 8, 60.0D, 4, 0.85D, 48.0D, 64.0D, 12.0D, 2);
29+
TINY("tiny", 64.0D, 25.0D, 128.0D, 1, 15.0D, 1, 0.00D, 12.0D, 48.0D, 4.0D, 1),
30+
SMALL("small", 128.0D, 50.0D, 192.0D, 3, 30.0D, 2, 0.50D, 24.0D, 64.0D, 12.0D, 2),
31+
AVERAGE("average", 256.0D, 100.0D, 256.0D, 8, 60.0D, 4, 0.85D, 48.0D, 96.0D, 24.0D, 3),
32+
LARGE("large", 512.0D, 200.0D, 384.0D, 28, 90.0D, 5, 0.95D, 128.0D, 128.0D, 48.0D, 4),
33+
HUGE("huge", 1024.0D, 640.0D, 512.0D, 128, 120.0D, 6, 1.00D, 288.0D, 192.0D, 96.0D, 5),
34+
CUSTOM("custom", 256.0D, 100.0D, 256.0D, 8, 60.0D, 4, 0.85D, 48.0D, 96.0D, 24.0D, 3);
3535

3636
final String configName;
3737
final double stratumWavelength;

src/main/java/zone/moddev/mc/orespawn/worldgen/GeomeConfig.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -449,16 +449,16 @@ private static FormationSettings readFormationSettings(JsonObject root) {
449449
: stableLayers ? waviness.stableWavinessAmplitude : waviness.wavinessAmplitude;
450450
double edgeWavelength = stableLayers
451451
? irregularity == Preset.CUSTOM
452-
? getBoundedDouble(custom, "edge_wavelength", 64.0D, 8.0D, 512.0D)
452+
? getBoundedDouble(custom, "edge_wavelength", 96.0D, 8.0D, 512.0D)
453453
: irregularity.stableEdgeWavelength
454454
: 64.0D;
455455
double edgeAmplitude = !stableLayers
456456
? 0.0D
457457
: irregularity == Preset.CUSTOM
458-
? getBoundedDouble(custom, "edge_amplitude", 12.0D, 0.0D, 256.0D)
458+
? getBoundedDouble(custom, "edge_amplitude", 24.0D, 0.0D, 256.0D)
459459
: irregularity.stableEdgeAmplitude;
460460
int edgeOctaves = irregularity == Preset.CUSTOM
461-
? getBoundedInt(custom, "edge_octaves", stableLayers ? 2 : 4, 1, 8)
461+
? getBoundedInt(custom, "edge_octaves", stableLayers ? 3 : 4, 1, 8)
462462
: stableLayers ? irregularity.stableEdgeOctaves : irregularity.edgeOctaves;
463463
double formationContinuity = continuity == Preset.CUSTOM
464464
? getBoundedDouble(custom, "continuity", 0.85D, 0.0D, 1.0D)
@@ -1547,8 +1547,8 @@ private static JsonObject defaultFormationConfig() {
15471547
formations.addProperty("edge_irregularity", Preset.AVERAGE.configName);
15481548
formations.addProperty("formation_continuity", Preset.AVERAGE.configName);
15491549
formations.add("custom", customFormationConfig(
1550-
256.0D, 100.0D, 8, 48.0D, 2, 0.85D,
1551-
256.0D, 64.0D, 12.0D));
1550+
256.0D, 100.0D, 8, 48.0D, 3, 0.85D,
1551+
256.0D, 96.0D, 24.0D));
15521552
return formations;
15531553
}
15541554

src/main/java/zone/moddev/mc/orespawn/worldgen/WorldGeologyProfile.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -289,9 +289,9 @@ private static JsonObject recommendedFormationJson() {
289289
custom.addProperty("vertical_thickness", 8);
290290
custom.addProperty("waviness_wavelength", 256.0D);
291291
custom.addProperty("waviness_amplitude", 48.0D);
292-
custom.addProperty("edge_wavelength", 64.0D);
293-
custom.addProperty("edge_amplitude", 12.0D);
294-
custom.addProperty("edge_octaves", 2);
292+
custom.addProperty("edge_wavelength", 96.0D);
293+
custom.addProperty("edge_amplitude", 24.0D);
294+
custom.addProperty("edge_octaves", 3);
295295
custom.addProperty("continuity", 0.85D);
296296
formations.add("custom", custom);
297297
return formations;
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
package zone.moddev.mc.orespawn.worldgen;
2+
3+
import static org.junit.jupiter.api.Assertions.assertEquals;
4+
5+
import com.google.gson.JsonObject;
6+
import org.junit.jupiter.api.Test;
7+
import zone.moddev.mc.orespawn.worldgen.FormationSettings.Preset;
8+
9+
class FormationSettingsTest {
10+
@Test
11+
void stableLayerEdgeDetailUsesTheRecalibratedPresetLadder() {
12+
assertEdgeDetail(Preset.TINY, 48.0D, 4.0D, 1);
13+
assertEdgeDetail(Preset.SMALL, 64.0D, 12.0D, 2);
14+
assertEdgeDetail(Preset.AVERAGE, 96.0D, 24.0D, 3);
15+
assertEdgeDetail(Preset.LARGE, 128.0D, 48.0D, 4);
16+
assertEdgeDetail(Preset.HUGE, 192.0D, 96.0D, 5);
17+
}
18+
19+
@Test
20+
void customAndRecommendedEdgeDefaultsMatchAverage() {
21+
assertEdgeDetail(Preset.CUSTOM, 96.0D, 24.0D, 3);
22+
23+
JsonObject custom = WorldGeologyProfile.recommended(false).toFormationJson()
24+
.getAsJsonObject("custom");
25+
assertEquals(96.0D, custom.get("edge_wavelength").getAsDouble());
26+
assertEquals(24.0D, custom.get("edge_amplitude").getAsDouble());
27+
assertEquals(3, custom.get("edge_octaves").getAsInt());
28+
}
29+
30+
private static void assertEdgeDetail(Preset preset, double wavelength, double amplitude,
31+
int octaves) {
32+
assertEquals(wavelength, preset.stableEdgeWavelength);
33+
assertEquals(amplitude, preset.stableEdgeAmplitude);
34+
assertEquals(octaves, preset.stableEdgeOctaves);
35+
}
36+
}

0 commit comments

Comments
 (0)