feat: curve v2 — per-seed spike normalization, u4 wall, 420 m ceiling (terrain-water task 06)

Per the task-05 hillshade-gate verdict: lowlands frozen (identity/toe/
rise/shoulder/plateau byte-unchanged); the spike now maps [t4,
hMaxSeed] — each seed's own raw pre-curve maximum, computed in a new
pass-1 over GenerateTopography — onto the peak band, so every island
reaches the ceiling (v1's pooled-max domain left mid-range seeds at
110–175 m). Spike stiffened to 0.1u + 0.9u^4; peak cap raised to
420 m above sea (1.82869). Degenerate near-flat guard: spike domain
floored at t4 + 0.01. The curve is now SEED-DEPENDENT: hMaxSeed is a
pure parameter (D-035), recorded in TCRV (field renamed
HMaxCal -> SpikeMax, same byte layout; v1 semantics = pooled max, v2 =
per-seed), and the monotonicity assertion runs per generation against
the effective curve. TerrainCurve gate: "off"|"v2" (default v2);
"v1" retired with a loud config error (task-05 blueprints are
regenerable). Classify path untouched — the biome/water oracle must
hold unchanged.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Stewart Howe 2026-08-08 00:21:25 -04:00
parent 46a991f352
commit ac67c27952
7 changed files with 116 additions and 62 deletions

View file

@ -128,7 +128,7 @@ namespace IslaApocalypse.Core
{
writer.Write(c.Version);
writer.Write(c.T1); writer.Write(c.T2); writer.Write(c.T3); writer.Write(c.T4);
writer.Write(c.HMaxCal);
writer.Write(c.SpikeMax);
writer.Write(c.Sea); writer.Write(c.OrangeCeil); writer.Write(c.RedCeil);
writer.Write(c.PlateauLo); writer.Write(c.PlateauHi); writer.Write(c.PeakCap);
writer.Write(c.TailSlope);

View file

@ -26,11 +26,12 @@ namespace IslaApocalypse.Core // Change this if your namespace is different
public static string SeaLevelModel = "flat";
public static float SeaLevelValue = 0.15f;
// Height-redistribution curve (task 05, graduation M-7): "v1" applies the
// calibrated storm-ladder curve to above-sea terrain (see HeightCurve.cs);
// "off" is the raw legacy profile. Biome classification is curve-invariant
// by construction either way. Default: v1.
public static string TerrainCurve = "v1";
// Height-redistribution curve (tasks 05/06, graduation M-7): "v2" applies the
// calibrated storm-ladder curve with the per-seed peak spike (HeightCurve.cs);
// "off" is the raw legacy profile. "v1" was dropped with the v2 recalibration
// (task-05 blueprints are regenerable). Biome classification is curve-invariant
// by construction either way. Default: v2.
public static string TerrainCurve = "v2";
public static void LoadConfig()
{
@ -105,8 +106,10 @@ namespace IslaApocalypse.Core // Change this if your namespace is different
if (data.ContainsKey("TerrainCurve"))
{
string curve = (string)data["TerrainCurve"];
if (curve == "off" || curve == "v1")
if (curve == "off" || curve == "v2")
TerrainCurve = curve;
else if (curve == "v1")
GD.PrintErr($"[ConfigManager] TerrainCurve 'v1' was retired by the v2 recalibration (task 06). Keeping '{TerrainCurve}' — use \"v2\" or \"off\".");
else
GD.PrintErr($"[ConfigManager] Unknown TerrainCurve '{curve}'. Keeping '{TerrainCurve}'.");
}

View file

@ -68,7 +68,11 @@ namespace IslaApocalypse.Core
public class TerrainCurveInfo
{
public ushort Version;
public float T1, T2, T3, T4, HMaxCal; // input knots
// Input knots. SpikeMax is the spike domain's top: under curve v1 it was the
// pooled calibration max (identical every seed); from v2 it is the SEED'S own
// effective raw maximum — blueprints are no longer reproducible from curve
// constants alone, which is exactly why it is recorded here.
public float T1, T2, T3, T4, SpikeMax;
public float Sea, OrangeCeil, RedCeil, PlateauLo, PlateauHi, PeakCap, TailSlope; // output bands
}
@ -390,7 +394,7 @@ namespace IslaApocalypse.Core
c.Version = reader.ReadUInt16();
c.T1 = reader.ReadSingle(); c.T2 = reader.ReadSingle();
c.T3 = reader.ReadSingle(); c.T4 = reader.ReadSingle();
c.HMaxCal = reader.ReadSingle();
c.SpikeMax = reader.ReadSingle();
c.Sea = reader.ReadSingle(); c.OrangeCeil = reader.ReadSingle();
c.RedCeil = reader.ReadSingle(); c.PlateauLo = reader.ReadSingle();
c.PlateauHi = reader.ReadSingle(); c.PeakCap = reader.ReadSingle();