feat: offshore islands (terrain-water task 11)
Sparse discoverable islets from a low-frequency ocean noise layer, seeded
resolved+7607 at 14 undulations/island (~585 px blobs).
Placed by LERPING the seabed toward a target crest (34 m raw above sea)
rather than adding to it, so an islet can surface at any ambient depth
instead of only where the seafloor happens to be shallow. After the curve's
toe compresses them they stand 5-8 m above the water: low, sandy, ringed by
beach -- which is what the existing biome rules make of that height, with no
biome-rule change.
THE THREE CONSTRAINTS, each by construction rather than by hope:
Never merges with the mainland. The raise is EXACTLY zero wherever the
ambient water is shallower than 14 m, so any continuous path from the
mainland shore to an islet must cross that depth contour, and every pixel
on it is untouched water. Measured: 0 of 13 islets merged, closest
approach 78 px.
Never touches the Trench. A distance mask zeroes the layer by 0.86 of
half-map, and the ramp starts at 0.90. Measured max islet reach 0.795.
All four corners stay below sea.
Never spawns inland. Depth alone is not a test -- a deep lake and the
carved crater bay are also below sea. The pre-Trench falloff is the honest
discriminator (mainland coast sits near f = 0.66; islets need f > 0.72),
and it is axis-invariant, because elongation moves WHERE a given f occurs,
not the f at which land ends.
Two bugs found and fixed by measuring instead of trusting the first run:
1. The density dial treated [-1,1] as the noise's actual range. Simplex
is concentrated well inside it -- this field measures 0.050..0.958 --
so "top 6%" resolved to a threshold almost nothing cleared: the first
build raised 171 px on the entire map, none above sea. The threshold is
now CALIBRATED against the field's own distribution (quantile over a
1M-sample stride grid, deterministic from the seed), so the dial means
what it says whatever FastNoiseLite returns.
2. At 26/island the layer produced 77 islets under 200 px -- scatter, not
"a handful". Retuned to 14/island at density 0.02: 13 islets of
200-4792 px.
The pass prints its own islet area, so every run says what it did.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
566abe9784
commit
6c318e4df0
3 changed files with 161 additions and 15 deletions
|
|
@ -46,22 +46,26 @@ namespace IslaApocalypse.Core // Change this if your namespace is different
|
|||
|
||||
// Island falloff shaping (task 11).
|
||||
//
|
||||
// CoastProfile: "wide" adds the submarine shelf. The height curve is identity
|
||||
// at and below sea, so it never reached the seabed — measured, land rises from
|
||||
// the shoreline at 0.038 m/px while the seabed drops at 0.258 m/px. "steep" is
|
||||
// the pre-task-11 seabed, kept for A/B. The shelf cannot move the waterline, so
|
||||
// biomes and water are bit-identical either way. Default: wide.
|
||||
// CoastProfile: "wide" adds the submarine shelf — the height curve is identity
|
||||
// at and below sea, so it never reached the seabed, which still dropped ~6.7x
|
||||
// steeper than the land it meets. "steep" is the pre-task-11 seabed, kept for
|
||||
// A/B. The shelf cannot move the waterline, so biomes and water are identical
|
||||
// either way. Default: wide.
|
||||
//
|
||||
// IslandAxisX/Y: the falloff axis ratios (pre-task-11: 1.15 / 0.90). NOTE,
|
||||
// measured: the island is already Trench-clamped in x at ~90% of the map width,
|
||||
// so AxisX is a weak lever — aspect responds almost entirely to AxisY, which
|
||||
// trades against land area. These MOVE THE COASTLINE, so they move biomes by
|
||||
// design; elongated seeds have a new biome baseline.
|
||||
// measured: the island is already Trench-clamped in x at ~90% of the map
|
||||
// width, so AxisX is a weak lever — aspect responds almost entirely to AxisY.
|
||||
// These MOVE THE COASTLINE and therefore move biomes, by design.
|
||||
//
|
||||
// OffshoreIslandDensity: fraction of the ocean noise field above the islet
|
||||
// threshold. 0 disables the layer. Islets never touch the Trench and are held
|
||||
// off the mainland by a depth moat.
|
||||
public static string CoastProfile = "wide";
|
||||
public static float IslandAxisX = 1.30f;
|
||||
public static float IslandAxisY = 0.78f;
|
||||
public static float OffshoreIslandDensity = 0.02f;
|
||||
|
||||
// The pre-task-11 axis ratios, so legacy/steep runs can restore them exactly.
|
||||
// The pre-task-11 axis ratios, so "steep"/legacy runs can restore them exactly.
|
||||
public const float LEGACY_AXIS_X = 1.15f;
|
||||
public const float LEGACY_AXIS_Y = 0.90f;
|
||||
|
||||
|
|
@ -179,6 +183,7 @@ namespace IslaApocalypse.Core // Change this if your namespace is different
|
|||
}
|
||||
if (data.ContainsKey("IslandAxisX")) IslandAxisX = (float)data["IslandAxisX"];
|
||||
if (data.ContainsKey("IslandAxisY")) IslandAxisY = (float)data["IslandAxisY"];
|
||||
if (data.ContainsKey("OffshoreIslandDensity")) OffshoreIslandDensity = (float)data["OffshoreIslandDensity"];
|
||||
|
||||
// The axis ratios divide map extents; a zero or negative one is a divide-by-
|
||||
// zero that would silently produce an all-ocean map. Refuse it loudly.
|
||||
|
|
@ -188,6 +193,7 @@ namespace IslaApocalypse.Core // Change this if your namespace is different
|
|||
IslandAxisX = LEGACY_AXIS_X;
|
||||
IslandAxisY = LEGACY_AXIS_Y;
|
||||
}
|
||||
OffshoreIslandDensity = Mathf.Clamp(OffshoreIslandDensity, 0f, 0.5f);
|
||||
|
||||
switch (profile)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue