Repository navigation
Description
Why
Throw the Timber Wolf at the right-hand edge of the rightmost display and it
walks off, gets caught by the wall, and spends the next several seconds with
half of itself off screen. It comes to rest still clipped.
EDGE_CLEARANCE is the constant that is supposed to prevent this, and its own
comment states the contract:
How far from a horizontal display edge the feet must stay so the full sprite
is on-screen when standing (not climbing). The Engine does not know the art's
size; 64 is 16px at 4x, enough for a character of typical width.
It is a guess, and two shipped Characters are wider than it. Timber Wolf's
frames are 176 points across, so its half-width is 88 — the feet stop 64 from
the edge and 24 points of art hang past it. Jotaro is 172 wide and clips by 22.
This is the resting state #55 said would not happen. That issue accepted
seam clipping as "at most half the sprite's rendered width [...] a brief pop
during a crossing, not a resting state", which is fair at a seam: the
neighbouring display's overlay draws the other half. At the outermost edge
there is no neighbour, so the clipped half is drawn by nobody.
The same guess is wrong in the other direction for narrow Characters. Nim is 32
points wide and is held 64 from the edge — 48 points further back than it needs,
so it can never walk up to the edge of its own screen.
Evidence
From a trace of the reporter's desktop, two displays, the right-hand one ending
at x=3648. drawn is how much of the 176-point-wide art falls inside any
overlay:
485 Grounded pos(3647,1117) drawn=176px walk
486 Falling pos(3648, 161) drawn=88px climb <- caught by the wall, climbs
... ~5 seconds of climbing ...
525 Falling pos(3648,1114) drawn=88px fall
526 Grounded pos(3584,1117) drawn=152px land <- settles, still 24px clipped
The Engine never lost the Character; it put it exactly where it decided to.
The decision
The Engine is told how wide its Character is, and EDGE_CLEARANCE becomes the
fallback for an Engine nobody told.
Every edge the Engine keeps the sprite clear of — the display's and the Dock's —
is a distance from the feet, and how far that has to be is half a sprite. So
at_horizontal_edge, dock_side_reached and dock_top_at take the clearance
as a parameter instead of reading the constant.
The width is the widest frame the Character declares, times its scale, taken
once at spawn: the Engine holds it for the Instance's life, so it has to cover
whichever Animation is playing when the sprite reaches an edge.
The whole frame rather than the opaque pixels inside it. Measuring the ink would
mean remeasuring every frame, and the alpha mask is the renderer's business.
The cost is that a Character with wide transparent padding rests with that
padding off screen, which is invisible.
Deliberately not fixed here: the climb. wall_reached pins the feet exactly
on the outermost edge and the climb frames assume the wall runs down the middle
of the frame, so a climb there is still half off screen. That is by design at a
seam and wrong only at the outer edge, and separating the two is its own change.
Acceptance criteria
- A Character wider than 128 points comes to rest with all of its art inside a
display, at either horizontal edge. - A Character narrower than 128 points can stand closer to the edge than the old
constant allowed. - The Dock's side wall and its top inset move with the same measurement.
- An Engine told nothing keeps today's behaviour.
Tests
The Engine invariant is pure and unit tested, asserted on the art's extent
rather than on the constant so it cannot drift back. The wiring from Character
through Roster::spawn gets its own test — it is one line and the easiest thing
to drop — and the scale multiplication gets a third, being the easiest part to
get wrong.
— Cursor agent, on @omesser's behalf.
Metadata
Metadata
Assignees
Labels
Projects
- StatusShow more project fieldsDone
Activity
omesser commentedon Sep 5, 2026
Not a bug. Closed with #328, which was the fix for it.
The premise was that a Character wider than
EDGE_CLEARANCErests with its artover the edge. Measuring the opaque pixels rather than the frame canvas shows
no shipped Character does: the widest real reach from centre is 63 (bmo), and
the constant is 64. Timber Wolf's 176 and Jotaro's 172 are padded canvases, not
art — their bodies reach 57 and 60.
The only art that reaches past 64 is Timber Wolf's
scanlaser sweep. Fullnumbers in the closing comment on #328.
— Cursor agent, on @omesser's behalf.