mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2026-12-01 10:14:36 +00:00
Tune tidal arm shape
- Find the lowest monotone path inland with a wander term, replacing the greedy walk - Scale the meander to arm length and skip slope damping, since arms are cut flat - Remove the steep-ray cone from tidal banks, which made the spiky bank teeth - Round heads, damp width wobble inland and tune the funnel defaults - Narrow territories to the water while keeping mouths apart
This commit is contained in:
9 files changed
+138
-50
No files matched your search
+1
-1
@@ -33,7 +33,7 @@ public class IrisHydrologyDefaultsTest {
|
||||
"lakes": { "enabled": true, "minArea": 65536, "maxArea": 4194304 },
|
||||
"deformation": { "maxFill": 6, "bankSlope": 0.2, "bankSteepFactor": 3.5, "bankNoise": 0.2, "caveMask": true },
|
||||
"underground": {
|
||||
"seaInlets": { "enabled": true, "spacing": 192, "length": [64, 256], "maximumBankHeight": 28, "mouthHalfWidth": [10, 14], "headHalfWidth": [2, 3], "taper": 1.8, "widthVariation": 0.18, "meanderWidth": 4, "depth": [2, 5], "bankBand": 24, "bankStyle": "SMOOTH" },
|
||||
"seaInlets": { "enabled": true, "spacing": 192, "length": [64, 256], "maximumBankHeight": 40, "mouthHalfWidth": [13, 15], "headHalfWidth": [2.5, 3], "taper": 1.4, "widthVariation": 0.18, "meanderWidth": 4, "depth": [2, 5], "bankBand": 24, "bankStyle": "SMOOTH" },
|
||||
"cavePools": { "enabled": true, "density": 0.15, "minArea": 6, "maxArea": 400, "maxDepth": 4, "radius": 15, "freeboard": [0, 1], "fluid": "water" }
|
||||
},
|
||||
"fluids": [ { "name": "water", "palette": { "palette": [ { "block": "minecraft:water" } ] } } ],
|
||||
|
||||
+6
-6
@@ -38,7 +38,7 @@ public class HydrologySettingsTest {
|
||||
private static final int SEA_LEVEL = 62;
|
||||
private static final int MIN_Y = -64;
|
||||
private static final int MAX_Y = 320;
|
||||
private static final long DEFAULT_FINGERPRINT = -6680786385526424170L;
|
||||
private static final long DEFAULT_FINGERPRINT = 7426172183353655598L;
|
||||
|
||||
@Test
|
||||
public void densityIsBoundedAndChangesThePlanIdentity() {
|
||||
@@ -717,10 +717,10 @@ public class HydrologySettingsTest {
|
||||
assertTrue(inlets.enabled());
|
||||
assertEquals(192, inlets.spacing());
|
||||
assertEquals(new HydrologySettings.IntRange(64, 256), inlets.length());
|
||||
assertEquals(28, inlets.maximumBankHeight());
|
||||
assertEquals(new HydrologySettings.FloatRange(10f, 14f), inlets.mouthHalfWidth());
|
||||
assertEquals(new HydrologySettings.FloatRange(2f, 3f), inlets.headHalfWidth());
|
||||
assertEquals(1.8f, inlets.taper(), 0f);
|
||||
assertEquals(40, inlets.maximumBankHeight());
|
||||
assertEquals(new HydrologySettings.FloatRange(13f, 15f), inlets.mouthHalfWidth());
|
||||
assertEquals(new HydrologySettings.FloatRange(2.5f, 3f), inlets.headHalfWidth());
|
||||
assertEquals(1.4f, inlets.taper(), 0f);
|
||||
assertEquals(0.18f, inlets.widthVariation(), 1e-6f);
|
||||
assertEquals(4f, inlets.meanderWidth(), 0f);
|
||||
assertEquals(new HydrologySettings.IntRange(2, 5), inlets.depth());
|
||||
@@ -766,7 +766,7 @@ public class HydrologySettingsTest {
|
||||
|
||||
@Test
|
||||
public void overLongSeaInletsFailAtCompile() {
|
||||
compile(inlets(config -> config.setLength(new KList<>(64, 447)).setMouthHalfWidth(new KList<>(10D, 16D)).setBankBand(24)));
|
||||
compile(inlets(config -> config.setLength(new KList<>(64, 447)).setMouthHalfWidth(new KList<>(11D, 16D)).setBankBand(24)));
|
||||
IllegalArgumentException failure = assertThrows(IllegalArgumentException.class,
|
||||
() -> compile(inlets(config -> config.setLength(new KList<>(64, 512)))));
|
||||
assertTrue(failure.getMessage(), failure.getMessage().contains("underground.seaInlets"));
|
||||
|
||||
@@ -111,7 +111,7 @@ public class TidalPlannerTest {
|
||||
|
||||
@Test
|
||||
public void tallCoastsHoldNoArms() {
|
||||
assertTrue(arms(planner(settings(), SyntheticTerrain.cliffCoast(COAST_X))).isEmpty());
|
||||
assertTrue(arms(planner(settings(), SyntheticTerrain.cliffCoast(COAST_X).lowered(-30D))).isEmpty());
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -267,7 +267,7 @@ public class TidalPlannerTest {
|
||||
for (int q = 0; q < second.xs().length; q += 2) {
|
||||
double apart = Math.hypot(first.xs()[p] - second.xs()[q], first.zs()[p] - second.zs()[q]);
|
||||
assertTrue(first + " and " + second + " come within " + apart,
|
||||
apart >= first.halfWidth()[p] + second.halfWidth()[q] + settings.underground().seaInlets().bankBand());
|
||||
apart >= first.halfWidth()[p] + second.halfWidth()[q]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+32
@@ -414,6 +414,38 @@ public class ChunkWaterRasterTest {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void tidalBanksFollowTheBandInsteadOfCuttingRaysToSteepGround() {
|
||||
HydrologySettings settings = settings(new IrisHydrology());
|
||||
int points = 9;
|
||||
float[] xs = new float[points];
|
||||
float[] zs = new float[points];
|
||||
int[] grade = new int[points];
|
||||
float[] halfWidth = new float[points];
|
||||
float[] depth = new float[points];
|
||||
ReachStyle[] style = new ReachStyle[points];
|
||||
for (int point = 0; point < points; point++) {
|
||||
xs[point] = -16f + point * 8f;
|
||||
zs[point] = -8f;
|
||||
grade[point] = SEA_LEVEL;
|
||||
halfWidth[point] = 3f;
|
||||
depth[point] = 3f;
|
||||
style[point] = ReachStyle.TIDAL;
|
||||
}
|
||||
Reach reach = new Reach(71L, settings.tidalTier(), 0L, xs, zs, grade, halfWidth, depth, style, 0f);
|
||||
WindowKey key = new WindowKey(0, 0);
|
||||
IndexedWindow own = new IndexedWindow(new WindowPlan(key, List.of(reach), List.of()), ReachIndex.build(key, List.of(reach), List.of()));
|
||||
ChunkRasterizer rasterizer = new ChunkRasterizer(settings, ChannelFluids.TIER);
|
||||
ChunkWaterRaster ridged = rasterizer.rasterize(0, 0, (x, z) -> SEA_LEVEL + 20 + (Math.floorMod(x, 8) < 2 ? 8 : 0), List.of(own), regions(0, 0, List.of()));
|
||||
ChunkWaterRaster plain = rasterizer.rasterize(0, 0, (x, z) -> SEA_LEVEL + 28, List.of(own), regions(0, 0, List.of()));
|
||||
for (int lz = 0; lz < 16; lz++) {
|
||||
for (int lx = 0; lx < 16; lx++) {
|
||||
assertTrue("a ridge reaches no higher than the same band over plain ground at " + lx + "," + lz + ": "
|
||||
+ ridged.terrainHeight(lx, lz) + " over " + plain.terrainHeight(lx, lz), ridged.terrainHeight(lx, lz) <= plain.terrainHeight(lx, lz));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void tidalReachColumnsTakeTheInletRoleAtSeaLevelBetweenBanks() {
|
||||
HydrologySettings settings = settings(new IrisHydrology());
|
||||
|
||||
@@ -84,7 +84,7 @@ public class SchemaBuilderIdentityTest {
|
||||
@ClassRule
|
||||
public static final PlatformLeakGuard PLATFORM_GUARD = PlatformLeakGuard.clean();
|
||||
|
||||
private static final String EXPECTED_SCHEMA_DIGEST = "a900bb5a9f8685d8bd8d28d0abaed52010cbd748053368f4b399f969e6b25178";
|
||||
private static final String EXPECTED_SCHEMA_DIGEST = "deb2538c92e5801beea672d32ded75301a441cf36d102bb09474f1c16f7821cc";
|
||||
|
||||
private static final List<Class<?>> SCHEMA_ROOTS = List.of(
|
||||
IrisDimension.class,
|
||||
|
||||
Reference in new issue
Block a user