fix(client): a biome stops painting where the ground steps away from it #293
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!293
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/blend-knows-a-bank"
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
"Va insegnato al blend che cos'è un argine" — and "anche per costruzioni future".
On every lake shore the water was painted UP the bank: a wide, slope-shaded band of water colour sitting
above the waterline. The ocean did not do it, and the ocean is the control —
beach_sandis the only landterrain with no
baseZ, so there the water and the sand are coplanar and there is no bank to climb.The blend field had no idea a bank existed.
TerrainBlendField.Computetook a 2-D biome grid and no Zwhatsoever, so a water cell's SDF influence reached
BlendWidth = 3cells inland regardless of whetherthose cells were 5 units higher — and inland is uphill.
So the fix is not about water. A new
TerrainBank(Client.Core) says what an argine is — the stepbetween two adjacent pieces of ground that are not the same surface — derived from the authoritative
height, never declared. One rule covers a lake shore, a beach against the inland, a paved platform, a
house foundation and the cut face of a mountain road, so a thing nobody has built yet is already covered
and there is no per-terrain flag and no "water doesn't blend" special case. Like the cutaway it reads a
difference, so nothing in it is absolute.
Computenow takes a height accessor; per cell, a biome's weight is multiplied byTerrainBank.Continuity(dz)where dz is the minimum |ΔZ| between the cell and the cells of that biomewithin
blendWidth— a 7×7 search, because the weight is already zero beyond that, so no distancetransform is needed. The cell's own biome is level with itself, so no cell is ever left without weight.
The threshold is not taste: every land terrain in
content/tiledata.txtsits atbaseZ 5and every fluidand beach at 0, so
WorldRules.MaxWalkStepZis the world's one level change. Below half of it is theripple of ordinary ground (the massif's flanks measure ~1 z/cell) and goes on blending, or every slope in
the world would go crisp.
BuildWindowalready heldsnapshot.GroundZAt— the AUTHORITATIVE ground, never the smoothedDisplayZ, because feeding the display height back in would let the smoothing erase the step this existsto keep. No new data channel.
The design review, its full Invariants Check and the verification plan are in #292.
Not in this PR, deliberately: the display-Z cliff gate classifies a 5-step as a "walkable terrace"
(
CliffStart = MaxWalkStepZ + 1= 6) and smooths the waterline into a ramp, so the bank is still a softslope rather than an edge. That is geometry, not colour; it should read the same
TerrainBankand it getsits own change and its own screenshots.
Screenshots / recording
Fresh DB,
just dev, driven through the debug harness (docs/debug-harness.md); the BEFORE frames arefrom the same three coordinates on the parent commit.
Commands, per stop:
login test→key enter→type /tp <x> <y>→key enter→screenshot <path>.The ocean is unchanged, measured rather than eyeballed. Comparing the after frame against the before
frame at the same camera, excluding every pixel that moved across a 4-frame before-burst (the animated
water) plus the HUD and the character card: 0 changed pixels out of 593,896 still pixels, and 0 out of
the 54,630 in the shoreline band itself.
How it was tested
IsoMmo.Client.Core.Tests(pure logic, no engine):TerrainBankTestspins thecurve's shape (1 at level, unchanged at a 1-2 ripple, 0 at the world's own step, symmetric in sign,
monotone, a real ramp in between);
TerrainBlendFieldTestsadds the bank cases — a bank stops a biomepainting across it; the same grid four steps higher blends identically, because a bank is a
difference; a stride-height step is not a bank; a raised 3×3 paved platform keeps its material to itself
and does not feather three cells out (the future-construction case); and every cell still sums to 1 on a
grid where every cell is a step from all four neighbours (the
Normalizedivide-by-zero shape).dotnet csharpier check .clean,dotnet buildof the whole solution 0 warnings / 0 errors,dotnet testfully green (1,011 tests) — run in a clean worktree at this commit so the result is therepo's committed content, not my working tree.
window build median 431 → 465 ms, worst 558 → 558 ms. The added work is per boundary cell only.
Checklist
just lintpasses (CSharpier + analyzers, zero warnings)just testis greenCloses #292
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.