feat(editor): visible Z + road auto-grading (#246) #248
No reviewers
Labels
No labels
alpha:wave-0
alpha:wave-1
alpha:wave-2
alpha:wave-3
area:assets
area:combat
area:ecology
area:infra
area:render
area:scripting
area:ui
area:world
enhancement
epic
migration
post-alpha
roadmap
tech-debt
type:bug
type:chore
type:design
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
marco/IsoMmo!248
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/editor-z-roads"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Two coupled map-editor authoring aids (#246):
Z is now visible on the canvas. The flat top-down bitmap shades each cell by its local
Z-gradient (a hillshade,
ReliefShadeinMapEditor.Core), so elevation reads at a glance — youcan see the slopes you're authoring. It stays one bitmap + one blit (the shade multiplies the
per-cell colour;
ChunkedEditModel.FillZWindowfills the Z window chunk-by-chunk like the terrainwindow). A Relief shade checkbox (on by default) toggles it.
Roads grade their own Z into a walkable ramp. Painting a road terrain (any
isRoadkind —a new
tiledataflag;road_dirt/road_dirt_snowset it) with the single-cell brush records thestroke; on release its Z is graded (
RoadGrader) from one end's land height to the other's, eachstep clamped to
WorldRules.MaxWalkStepZ, so the road climbs a slope without hitting the walk-stepwall. A run too steep for its length climbs at the cap and won't fully reach — make it longer /
switchback.
WorldRules.MaxWalkStepZis a new shared constant so the editor grades to the exact limit the serverenforces (
GameOptions.MaxStepZnow defaults from it). Offline tool — the roads write authoritativeZ into the chunked format the server already validates with the unchanged
CanStep; no wire/serverchange. Design:
docs/superpowers/specs/2026-08-01-editor-z-roads-design.md.Screenshots / recording
just editoron asterra (--goto 7520 4930 --cellpx 5): the volcanic crater's shape, ridges and lavanow read via the relief shade — flat grey before.
How it was tested
MapEditor.Core.Tests):RoadGrader— a walkable length follows the linear ramp, atoo-steep run climbs at exactly the cap, every consecutive step ≤ cap, endpoints anchored, count 0/1
edges.
ReliefShade— flat = 1, a light-facing-away slope darkens to the floor, stays in[floor,1].ChunkedEditModel.FillZWindow— matches per-cellZAtacross chunk boundaries and edits.Shared.Tests):tiledataparsesisRoad(default false, round-trips).isn't auto-captured — the editor has no mouse-injection harness like the client — but the grading is
fully unit-tested and the wiring is thin glue.
dotnet csharpier check .clean ·dotnet build IsoMmo.slnx0 warnings ·dotnet testall green (incl. the 9 new editor/Shared tests).
Checklist
just lintpasses (CSharpier + analyzers, zero warnings)just testis greenRoadGrader,ReliefShade,FillZWindow,isRoadparse)