Deposition now spreads over the same cone brush as carving, and the per-cell erosion ledger becomes a signed NET displacement ledger, so both caps are measured from the height the pass found. Brush-spreading alone cut the spike 15.49 -> 6.12 m at task-17 dials, but NOT at hierarchy dials (long paths carry far more sediment; a loaded droplet meeting a rise dumps min(rise, load) at once -> 25.5 m). So deposition also gets governor 4, ErosionDepositCap (default 6 m, <= 0 = unbounded), asserted on exit like the carve cap. Dial defaults retuned for a drainage HIERARCHY: 250k droplets x 384 steps at inertia 0.35 / evaporation 0.004, erode 0.12, carve cap 15 m. Diagnosis was that lifetime 48 let a droplet travel at most 48 px on a ~3000 px island radius, so paths could not overlap into trunks: the deepest task-17 features were 43x36 px patches. Now 177 channel systems of 200+ cells at the 3 m threshold, top one 204x279 px with 14 tributary tips; cells past 5 m up 8.6x (4,948 -> 42,385) while the fine rills are retained. Verified descending, not contour-locked: 0/155 components have drop/extent < 0.12 (median 1.13). EROS body version -> 2 (deposit cap inserted after the carve cap); v1 payloads are skipped whole by the existing rule. HydraulicErosion.VERSION now reads BlueprintFormat.EROS_VERSION instead of restating it — the local copy had already drifted and stamped a v2 body as v1, which readers decode with every float shifted by one field. Oracle green on both seeds (1280587109, 1512575962): 1_biomes/0_water md5-identical erosion-ON vs OFF, BIOM/WBID bitwise equal. Flood guard 0 new water px, 0 below-sea cells touched, crater zone untouched, island top unchanged, carve field isotropic to 1.4% across the folded 45deg period. Erosion pass 34 s at these dials. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| Scripts | ||
| README.md | ||
Core Module
Shared, stateless logic used by both the server and client paths: the .dat parser, the mesher, the
voxel data containers, and the material lookups. No Godot nodes, no scene state. These scripts
define what things are and how to calculate them; they never remember what is currently happening.
Components
MapDataParser.cs — the data bridge
Deserializes the binary .dat blueprint written by /Tools into a WorldBlueprint held in RAM:
map size, the float heightmap, the biome map, town locations, all four tiers of A* road
vectors (Highways, Branch Roads, Rugged Roads, Trails), and — from v2 files — the embedded
generation params (seed, sizes, impact centre, provenance) and each town's highway-node flag.
Two formats are live (byte-accurate contract: Core/Scripts/BLUEPRINT_FORMAT.md). The parser
dispatches on the file's first byte:
- v2 (primary) — raw
ISLAmagic, u32 version gate, then tagged sections[u32 tag][u64 length][payload]. Unknown tags are skipped by length, so future sections are invisible to older readers. Validated on read: version, MapSize bounds, section lengths against the file, biome/tier ordinal ranges. Since the water-bodies stage, v2 files also carry the optionalWBID/WBTB/WSRFwater sections (per-pixel body ids, the body table, quantized surface levels) — parsed intoWorldBlueprintand consumed by nothing at runtime yet. - v1 (legacy) — the positional
"ISLA_V1"format, still written beside v2 as_v1.datand still loadable (with a deprecation warning) until a future removal task.
⚠ Wire-format hazard. Biome and town-tier enums are serialized as their ordinal values
(u8 in v2, i32 in v1). Never reorder or insert members in Enums.cs — append only, at the end.
v2's range checks make drift fail loudly at parse time; legacy v1 has no validation and silently
reinterprets every pixel. (RoadTier is exempt: road tiers are stored in separate file sections —
tagged in v2, positional in v1 — so that enum never hits disk.)
ChunkData.cs + Constants.cs — voxel containers and tuning
- Chunk dimensions:
24 × 24horizontal,256vertical (Constants.cs). - The
+1padding is structural.DensitiesandBlockIDsare one cell larger on every axis —[25, 257, 25]— so the mesher can evaluate the boundary cells shared with the neighbouring chunk and the meshes meet without gaps. - Per-column data for rendering:
SurfaceHeights(the true, unrounded surface),ColumnBiomes, andColumnRoadMaterial(0 = not a road). These let the mesher colour by real height rather than a rounded integer. - Tunables in
Constants.cs:BLEND_BAND_METERS(how far one surface material fades into the next) and the per-tier road block — width, shoulder, grade-smoothing and surface material for each of the four road tiers, plus the derived cull padding.
MarchingCubes.cs — the mesher
Turns a chunk's density field into a Godot ArrayMesh.
- Analytical normals: exact density gradients at each cell corner, interpolated along the edge by the same fraction used for the vertex position — smooth lighting without Godot's normal pass.
- Deterministic vertex welding: shared vertices are keyed by an integer
EdgeKeyordered lowest-to-highest, so neighbouring chunks compute identical keys and no float drift creeps in. - Vertex colouring: each vertex is coloured from its true float depth below the surface, fading between the two materials either side of a boundary rather than switching at an integer depth.
Density sign convention (load-bearing): density is positive above the surface and negative
below it. A corner counts as inside the terrain when density < ISO_LEVEL.
BiomePalette.cs + BlockRegistry.cs + BlockData.cs — materials
-
BlockRegistry: byte-ID lookup for every block (AIR,BEDROCK,STONE,DIRT,SAND, the three grasses,SNOW,WASTELAND_DIRT,ASPHALT). -
BiomePaletteanswers "what material is here?" twice, deliberately:GetVoxelID(...)— the authoritative integer classification by whole-block depth. Decides what is actually stored in each voxel; used for everything non-visual.GetBlendedVoxelIDs(...)— the rendering version. Same question by float depth, returning the two materials either side of the nearest boundary plus how far between them the point is, so the renderer fades instead of snapping.
Both take a road-surface byte, so a trail is surfaced in dirt where a highway is surfaced in asphalt.