feat: config-gated flat-scalar sea level (D-033, terrain-water task 04)
SeaLevelModel: "flat" (one scalar, SeaLevelValue) or "field" (the legacy latitude Lerp 0.26..0.15). Only GetSeaLevel's body changes — all nine call sites (crater carve target, both flood fills, biome split, beach band, Capitol window, town filters, A* zero-point) inherit the model automatically; no consumer re-tuning. Default: flat 0.15, pinned in ServerConfig.json. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
parent
1f957b3430
commit
200adcaf5a
3 changed files with 31 additions and 2 deletions
|
|
@ -19,6 +19,13 @@ namespace IslaApocalypse.Core // Change this if your namespace is different
|
|||
// not a shippable world. Default false.
|
||||
public static bool SkipRoads = false;
|
||||
|
||||
// Sea-level model (D-033, terrain-water task 04): "flat" = one scalar sea
|
||||
// level everywhere (SeaLevelValue); "field" = the legacy latitude Lerp
|
||||
// (0.26 north .. 0.15 south). Generator-only — the runtime never computes
|
||||
// sea level. Default: flat 0.15.
|
||||
public static string SeaLevelModel = "flat";
|
||||
public static float SeaLevelValue = 0.15f;
|
||||
|
||||
public static void LoadConfig()
|
||||
{
|
||||
string path = "res://ServerConfig.json";
|
||||
|
|
@ -74,6 +81,20 @@ namespace IslaApocalypse.Core // Change this if your namespace is different
|
|||
SkipRoads = (bool)data["SkipRoads"];
|
||||
}
|
||||
|
||||
// Extract the sea-level model
|
||||
if (data.ContainsKey("SeaLevelModel"))
|
||||
{
|
||||
string model = (string)data["SeaLevelModel"];
|
||||
if (model == "flat" || model == "field")
|
||||
SeaLevelModel = model;
|
||||
else
|
||||
GD.PrintErr($"[ConfigManager] Unknown SeaLevelModel '{model}'. Keeping '{SeaLevelModel}'.");
|
||||
}
|
||||
if (data.ContainsKey("SeaLevelValue"))
|
||||
{
|
||||
SeaLevelValue = (float)data["SeaLevelValue"];
|
||||
}
|
||||
|
||||
switch (profile)
|
||||
{
|
||||
case "4K":
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue