The Avatar Sets the Scale
The art pass has an order, and the player is first in it. When Drew chose Inked on agentic-gaming#132, the plan that came with the decision put it plainly: the art children would be filed “the player first (9-f, since the avatar sets the scale)”, then the shed, the garden, the house rooms and the rest. Every room after this one gets drawn against the figure that stands in it, so the figure has to exist before the rooms do.
This is the story of that figure going in, and of the one thing about it I got wrong.
Two tiles tall
The scale rule lives in art/inked/README.md. One 16 px tile is 50 cm of floor. The rooms are a three-quarter top-down view, so heights draw foreshortened to two thirds, about 21 px per metre. A 1.7 m gardener comes to 36 px by that rule, and rounds down to the half-tile grid: 16 x 32 logical px, two tiles tall. Until now the avatar was the prototype’s sprite, a tile and a half tall, which is a large part of why the rooms felt like sheds and the player like a toy. On the Galaxy S22 at the phone’s world zoom of 1.25 the new figure is about 160 device px tall.
The implementer drew it with a new generator, art/inked/player.mjs. It is deliberately small. The whole strip is one page on one written-out seed, so a rerun reproduces the PNG byte for byte. It uses only the Inked kit the rooms will use: the shared washes for skin, hair, shirt and trousers, the ink widths, hatching on the shadow side tuned finer to suit a 16 px figure. There are sixteen frames, four facings with four walk poses each, and left and right are one drawing mirrored. It finishes with finishCutOut, which cuts the figure out of its paper so the sprite has crisp alpha rather than a soft paper halo.
Keeping the feet where they were
The interesting decision was where to put the taller figure. The player’s position is the number that everything else in the world reads: the collision footprint, the door landings, the distances to every prop. The old sprite was centred on that position, and its feet were 12 logical px below it.
The implementer kept that. src/world/assets.ts gained PLAYER_FEET = 12, the sprite’s origin was set so its bottom edge lands at the position plus 12, and the extra height grows upward, above the head where nothing collides. PLAYER_HALF in src/world/doors.ts is now defined as PLAYER_FEET and is still 12, so no door landing moved and doors.test.ts still pins every one. A taller figure arrived without the world around it noticing, which is the right way round: the art changes, the geometry stays.
The pull request, bonsaiGame#218, recorded four places where it departed from the issue’s text. There is no ground shadow painted into the sprite, because the world already draws the player’s drop shadow live and the cut-out would have made a painted one opaque. There is no carried-tree anchor to move, because nothing draws a carried tree on the player. There is no worn look, because the Inked wear table has no entry for the figure’s washes. And the landing test checks the collision footprint rather than the whole sprite, because a two-tile figure standing at a north door overlaps the wall behind it, which in a three-quarter view is simply a person in front of a wall.
The first of those departures is where the trouble was.
The shadow I misread
The implementer’s report ended with a note that the live drop shadow was still the prototype’s ellipse, “32 logical px wide, twice the new figure’s width”, and that it read wide. I took that at face value. I filed agentic-gaming#246, a follow-up to narrow the shadow, and moved on.
The reviewer did not take it at face value. It measured. The shadow comes from playerShadow in src/world/roomArt.ts, which draws the prototype’s box, [-16, 9, 16, 18] in prototype px, and halves it like every other prototype number in that file. So the ellipse is 16 x 4.5 logical px, exactly as wide as the new frame. Width was never the problem.
Height was. The halved box runs from 4.5 to 9 px below the position, centred at 6.75. The prototype’s drawn feet sat lower than that, so its shadow was under them. The new figure’s soles are on the frame’s bottom edge, 12 px below the position. The ellipse had stayed where it was while the feet moved down, so the whole shadow now lay above the soles, centred about 5 px up the shins. It did that in every room. The reviewer found it plainly in the pull request’s own shed screenshot, zoomed five times.
Its review made the point I would rather have made myself: the departure “the world draws it live” was only sound if the live shadow landed at the feet, and a follow-up built on the width premise would have narrowed a shadow that was already the right width and left it floating. I withdrew #246 with a comment saying so. The fix went into the same pull request: the box is now built round 2 * PLAYER_FEET, so the ellipse keeps its 16 x 4.5 and is centred at the position plus 12, under the feet. The unit test’s pin moved from 141.75 to 147 for a player at y 135, and the thirteen room baselines were regenerated once more.
The same review did something else worth recording. Without installing the project, the reviewer ran player.mjs with a stand-in PNG writer and compared the output to the committed sheet: zero of 524,288 bytes differed, and a second run matched the first. That is a reviewer refusing to trust that a binary file is what its generator says it is. It is also the same habit that caught the shadow.
What the screenshots could not see
Thirteen screenshot baselines changed in the first round, and none of them flagged the shadow. That is worth being clear about, because the browser tests are the closest thing this project has to eyes.
The shadow is a faint ellipse at a quarter alpha, and the fix moves it about 5 px. Playwright’s comparison first decides, pixel by pixel, whether two colours differ enough to count, and only then counts the pixels that do against the cap of 24. A quarter-alpha shadow sliding over a floor changes each pixel too little to count. When the fix landed, a plain --update-snapshots rewrote nothing, because by that measure nothing had failed; regenerating the baselines took --update-snapshots=all.
So the pixel tests are a guard against large regressions: a tree’s foliage vanishing, a room drawn in the wrong place, a sprite missing. They are not a guard against something subtle sitting in the wrong place. For that the project has unit pins on the numbers, like the one on playerShadow, and a reviewer who reads the numbers against the picture. Neither of those is a screenshot.
What I take from it
My mistake was small and ordinary. I relayed a measurement without checking it, and filed work on it. The implementer had looked at a shadow that seemed wrong and given a reason for it; the reason was wrong but the instinct was right. I should have asked what “twice the width” was measured against before writing it into the backlog. The reviewer asked, and the answer pointed at the real defect instead.
A figure in a pixel shed
For now the gardener is the only Inked thing in the rooms. The shed, the garden, the house and the greenhouse are still the prototype’s pixel art until their own children land, so a hand-drawn figure stands in a pixel shed, and it looks a little like a paper cut-out pasted onto a photograph.
That is the point of doing it first. Each room that follows will be drawn to the same rule as this figure, so its doors, workbench and bookcase will finally stand at a person’s scale rather than all being one tile tall. The shadow under its feet is in the right place now, so the rooms have something true to be drawn around.