First tuning run (seed 1375359975): p50 2.3 / p90 6.1 / p99 13.6 / max
30.0 m — typical gullies under the 8-15 m target. K=1.40 confirmed:
p50 3.3 / p90 10.2 / p99 22.9 / max 30.0, zero sea-clamp hits.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Two paired detail passes on the locked v5 skeleton, output-heights
only (classify path untouched):
PASS A — shelf micro-relief: +-ShelfReliefAmp (default 3 m) Simplex
skin (seed resolved+7409, ~40 undulations/island ~ 200 m features),
weighted by shelf-ness (full mid-shelf, feathered to zero 30% of a
band half-width into the risers) — both shelves get their rolling
texture back; risers and peaks untouched.
PASS B — drainage incision: D8 steepest-descent routing + height-
ordered flow accumulation over the curved+relieved land
(TerrainDetailPass — pure array machinery, named C++ candidate per
D-035); depth = K*accum^p*slope (K=0.78, p=0.45 concave, cap 30 m),
masked full on risers / 30% on shelves / zero on the toe, above the
plateau top, and within 1.2x CraterRadius (feathered to 1.4x); hard
clamp: carved height >= sea + 1 m. Ordering: curve -> relief ->
incision -> crater carve (the carve stays the final authority; carve
moved to its own pass 2c, bit-identical expression on both maps).
The pass prints its own MEASURED depth distribution.
Gate TerrainDetail "off"|"v1" (default v1; both passes one judged
unit; no-op without the curve) + ShelfReliefAmp dial. New TDTL section
(38 B: version + relief/incision params + seed offset) across
writer/parser/harness — blueprints stay self-describing.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The documented one-liner the task-09 gate triggers: TerrainCurve gate
is now "off"|"v5" (default v5 = the BALANCED preset, id 2);
"v5-compact" retired with a verdict-specific error, "v5-balanced"
redirects to plain "v5". Knots/TCRV encoding unchanged.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The three corner fixes (both presets): riser endpoint slope floors
0.2 -> 0.1 (0.1u + 0.9*smoothstep — climbs decelerate into shelves and
accelerate out); summit-spike base floor 0.1 -> 0.05
(0.05u + 0.95*u^4 — no hard skirt under the peaks); SHELF_SPAN_MIN
2 m -> 6 m (pronounced shelves keep a gentle tilt).
Knots are preset-parameterized (CurveKnots, explicit parameter — pure,
D-035), calibrated from the same pooled batch-04 CDF:
COMPACT P65/77/84/88/94/97 -> 65/12/7/4/6/3/3 land split
BALANCED P60/73/83/88/96/99 -> 60/13/10/5/8/3/1
Gate: "off"|"v5-compact"|"v5-balanced" (batch-only tri-state;
interim default v5-balanced pending the developer's verdict — the
winner becomes plain "v5" in a follow-up commit); v1-v4 retired
loudly. Assertion runs per preset (8 corners x per-seed spikeMax; the
lowered floors stay strictly positive). TCRV v5 extension (+9 B):
preset id + K5/K6 — the effective curve is unambiguous from the
record; old records parse (version-dispatched); harness compares.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Per the task-07 gate: the terraces work but uniform anchors put a flat
ring at exactly 100 m and 220 m on every mountain. v4 keeps v3's
structure (frozen toe/rise, three risers, per-seed u4 spike to 420 m)
and turns the shelf anchors into smooth spatial fields: bench
100+-12 m and plateau 220+-20 m via two decorrelated very-low-freq
Simplex fields (~3 undulations per island width), plus a strength
field (~5/island) blending each shelf's output span between ~2 m
(pronounced flat) and ~25 m (barely a hint) — the optional strength
modulation shipped, ordering-safe by construction (worst-case bench
top 0.6962 < plateau min 0.9468). Field seeds derive from the RESOLVED
noise seed + fixed offsets (7101/7207/7303) — no config knob. Apply is
per-column with all modulated values as pure parameters (D-035); the
classify path never sees them.
Monotonicity assertion now sweeps all 8 modulation-extreme corners x
per-seed spikeMax. TerrainCurve gate "off"|"v4" (default v4);
v1-v3 retired loudly. TCRV extended (+36 B when version>=4:
amplitudes, span range, frequencies, seed offsets — length-framed
section makes the layout change safe; parser dispatches on the curve
version byte; harness compares the extension).
Note: MapGenerator.cs also carries the developer's editor whitespace
normalization (spaces->tabs, git diff -w empty before this change).
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Per the task-06 ground-test verdict (floor and 420 m ceiling frozen;
v2's ascent read flat-then-wall — 87% of the vertical budget in the
last 4% of input): the ascent is rebuilt as a terraced climb. Knots
recalibrated from the same pooled batch-04 land CDF at
P59/72/82/87/95/98 (K=0.509179/0.604081/0.698485/0.767213/0.930304/
1.050720), pooled land fractions exactly 59/13/10/5/8/3/2 (orange/red/
foothill-riser/bench/mid-riser/plateau/spike). Segments: frozen toe
and rise (storm anchors), smoothstep foothill riser to a near-flat
100 m bench, smoothstep mid riser to the near-flat white plateau at
220 m (relocated from 50 m — mountain towns/snow belong there),
per-seed-normalized u4 summit spike to 420 m (both retained from v2),
linear tail. Per-seed effective-curve monotonicity assertion retained.
TerrainCurve gate: "off"|"v3" (default v3); v1/v2 retired with a
loud config error (old blueprints regenerable). TCRV: knot slots carry
K1..K4 (K5/K6 are version constants), PlateauLo/Hi carry the two bench
anchors; version byte selects the semantics.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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>
The coarse and fine sampling loops both touched h=0.10 and the two
doubles round to the same float32, so the strict check compared the
identity value against itself and threw on every curve-on run. Only
strictly increasing float samples are compared now. The curve itself
was never non-monotonic.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
0_height: hypsometric storm-ladder tint x Lambert NW hillshade over
the curved heights, captured after topography in both curve modes —
relief is finally visible. Renumbers nothing.
TCRV (50 B, emitted when the curve is on): curve version + input knots
+ output bands, so blueprints are self-describing about the map their
heights went through (H7 spirit). Parsed into
WorldBlueprint.TerrainCurve (null = raw legacy profile); server treats
it as metadata. Round-trip harness compares it when present.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
HeightCurve (pure static, D-035): calibrated monotonic piecewise map —
identity at/below sea 0.15; ease-out toe to the orange ceiling 0.206
(75% coverage, knot t1=P75=0.628736 from batch-04's pooled flat-sea
land CDF, 340.6M samples); linear rise to red 0.27 (t2=P90); smooth
shoulder to the 50m plateau shelf 0.3492 (t3=P93); near-flat plateau
step (t4=P96); accelerating spike to the 220m peak cap 1.0265; linear
tail past the calibrated max. Strict monotonicity asserted numerically
at startup, loud throw on violation.
Applied in GenerateTopography AFTER noise+falloff+Trench, BEFORE the
crater carve (carve cuts curved terrain; rim/bowl untouched by the
curve). Biome oracle mechanism: a retained uncurved classify heightmap
(alias of _heightMap when off, zero cost) feeds biome rules, both
flood fills, and the shared water predicates — classification is
curve-invariant by construction. Towns/roads/diagnostics/exported
heights use curved terrain; town positions may legitimately move.
Config gate TerrainCurve: "off"|"v1" (default v1), unknown values
rejected loudly.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
PlaceTownNodes read _heightMap[rx ± slopeRadius] unclamped; candidates
spawn at [20, MapSize-20] but slopeRadius is 40 at 8K, so border
candidates indexed out of bounds. Never fired only because border land
stayed underwater and failed the above-sea test first — the
redistribution curve's flat coastal toe arms exactly that path
(D-033 consequence (b), recorded in sweep 01 and task 04).
Behavior-preserving except where it would have crashed.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Both sea-level modes documented (flat default 0.15 / legacy field
Lerp); noted the blueprint does not record which model produced it —
the WBTB levels are the observable. Batch runner lives in /tmp
(throwaway), not in-repo.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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>
Byte-accurate entries for the three water sections (transitional
per-body level rule, provisional salinity, WSRF sentinel/quantization),
updated size math (~576 MiB at 8K with water), the on-the-record
rationale for NOT serializing basins, and README updates for the new
pipeline stage, the 0_water snapshot, and the SkipRoads toggle.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Three new v2 tagged sections carrying the water-bodies stage output:
WBID (MapSize^2 u16 body ids; 0 none, 1 ocean, 2..N lakes), WBTB
(count-prefixed 20-byte records: id, type, provisional salinity,
transitional flat surface level, pixel count, centroid), WSRF
(MapSize^2 u16 quantized levels; 0 = no-water sentinel, 1 + L*32768
encoding, ~7.7 mm world resolution). Written only when the blueprint
carries water; absent on legacy re-encodes. Parser registers all
three (length + type checks) into new WorldBlueprint members —
consumed by nothing at runtime. Round-trip harness now compares the
water sections whenever the source carries them; v1-source baseline
stays green.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
IsWaterPixel/IsOceanPixel/IsLakePixel are the single per-pixel water
truth; AssignBiomesAndDraw's water branch now calls them (verbatim
rules — behavior-preserving, proven by the bit-identical-biomes oracle
at acceptance). New IdentifyWaterBodies stage between the masks and
biomes: ocean = body 1, lakes labeled 2..N with CalculateTrueOcean's
4-connectivity in deterministic scan order; one transitional surface
level per body (GetSeaLevel at the body centroid; ocean at map
centre). 0_water snapshot painted from the stage's own outputs.
Priority-flood pit-fill (heap + pit-queue variant) runs as validated
diagnostics only — serializes nothing, asserts filled>=original and
full-map non-ascending drainage (reverse BFS, no sampling), reports
closed-basin statistics.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Config flag SkipRoads (default false): when on, GenerateRoadsAsync and
the 3_roads snapshot are skipped entirely; export proceeds with all
four road sections present but empty (both v2 and legacy v1 permit
zero counts); the console states loudly that the blueprint is a
road-less iteration artifact.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Generated by the engine on first run of the project after the v2
envelope landed (terrain-water task 02).
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
v2 tagged-section container (D-030): raw ISLA magic + u32 version gate,
[u32 tag][u64 length][payload] sections — params (resolved generation
inputs incl. impact centre), heights f32, biomes u8, towns with the
highway-node flag, four road tiers identified by tag not position.
- BlueprintFormat.cs: the single tag/constant registry.
- BlueprintWriter.WriteV2: blueprint-typed, callable outside a
generation run; generator and harness are both just callers.
- ExportMapData dual-writes: v2 under the primary seed name, legacy v1
beside it as _v1.dat (safety net; removal is a future task).
- MapDataParser: LoadMapDataFromPath entry point; v1 parse body
extracted intact as LoadV1 (v2 reader lands in the next commit).
- RoundTripHarness scene: load v1 -> write v2 -> load v2 -> semantic
equality, headless, seconds per cycle.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Two additions, both observability only — no generation, routing, weight,
terrain or mesher behaviour changes.
1. Every progress print is now prefixed with elapsed time since generation
started, e.g. [+ 142.7s], including a line per pipeline stage and per county
road. The per-stage split (setup / continental loop / branch / county) can
now be read straight off the console. Two A* fix attempts have been reasoned
from structure rather than measurement; this makes the measurement free.
2. The end-of-run PNG capture was extracted into a reusable stage capture that
can be called at any pipeline boundary. Snapshots are now taken after
biomes, after towns, and after roads. The draw proxy renders whatever exists
at the time, so stages that have not run simply do not appear — and a future
water stage will show up automatically once it populates its data.
The existing capture path is reused unchanged: same offscreen SubViewport,
same draw proxy, same frame-yield plus double GPU wait. Those waits are
load-bearing, not superstition, and each staged capture honours them.
Snapshot filenames gain a stage suffix: Map_Seed_<seed>_1_biomes.png,
_2_towns.png, _3_roads.png. Nothing reads these but a human, verified.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
A* was searching almost the whole island for every road. Godot's stock
estimate-to-goal is plain straight-line distance, which assumes every step
costs 1 — but a step through mountains costs up to 401 and a step near an
existing road cost 10,001. With the estimate that far below reality, A* cannot
rule anything out, so it degenerates toward Dijkstra.
Two changes, both aimed at that:
1. RoadPathGrid overrides the estimate to scale it by HEURISTIC_WEIGHT (3.0),
i.e. weighted A*. Paths may be up to 3x costlier than the theoretical best
in exchange for exploring far less. This does NOT push roads over mountains:
a ridge costs hundreds of times more than going around, which a 3x bias
nowhere near pays for.
2. ROAD_REPULSION_PENALTY replaces the hardcoded +10000 with 250. The old value
made ground near a road effectively infinite, and it compounded — each road
drawn made the next search slower. 250 still strongly discourages roads from
running alongside each other.
Terrain weights are untouched: the mountain curve (1 + elevation^3 * 400),
beach and wasteland costs are exactly as before, so mountains remain expensive
and roads still avoid them. Routing, tiers, smoothing and grid resolution are
also unchanged.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Every road path search — highway, branch, county — now goes through one
function instead of three direct GetPointPath calls. The function body is
exactly the call it replaced, so behaviour is unchanged.
This exists so the next commit's pathfinding change can be judged on its own:
if the generated map changes after this point, it was the heuristic, not a
refactor slip.
Routing is untouched: which towns connect, loop order, Prim's daisy-chain,
tier assignment and the abandon protocol all deal only in town positions and
never touch the grid.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Every README was read first, checked against the code in its directory, then
rewritten to describe what the code actually does now.
Corrected throughout: map size is config-driven (8192 default) not a fixed
4096; chunks are 24x24x256 not 32x32; road carving is implemented for all four
tiers, not a 'next step'; Data/ and Resources/ are empty, not populated.
Also fixed MATH_MARCHING_CUBES.md, which documented the density sign convention
exactly backwards — it claimed positive was underground, where the code treats
positive as above the surface and counts a corner inside when density < iso.
Getting that backwards inverts every normal, a bug this project has hit before.
The root README now carries accurate run steps: F5 runs the map generator (not
the game), F6 on Scenes/Main.tscn runs the 3D world, and ChunkRadius is a load
radius that should be dropped to 4-8 while iterating.
Docs only. No code changed.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>