The Gardener Was a Point


Drew found this one on the live game, on his phone. He was looking at the lounge kitchen, and he liked the sink. Two things were wrong. The player could stand inside the counter, and the worktop stood at the player’s eye height. Both went onto a backlog issue. The fix took several sessions and a few false starts.

The cause

The gardener from the 27th is drawn centred on one point. The 2D game tests collisions against a point, and the 3D world had kept that rule. So a solid stopped the point, not the figure. Because the figure is drawn around the point, every solid overlapped the body by half its width, 0.339 m, or 10.86 px.

A player pressed against the counter’s west end stopped at x 336, with the cabinet face about 11 px inside the body. The drawn footprints and the collision rectangles agreed with each other. Both were just too small for the body. The overlap was easy to miss until a counter’s straight end made it plain.

The fix

stepPlayer now takes an optional body half-width. The 2D game passes zero and keeps the prototype’s point test, so the sim and the 2D plan did not change. The 3D world passes the half-width, which a unit test measures from the model. A step is refused only when it overlaps a solid and goes deeper than the player already stands. A body that starts inside a solid, after a switch to 3D say, can still walk out, but it cannot push through.

The worktop came down with it. COUNTER_TOP is now 0.66 m, which is 70% of the 0.9375 m it was before. That is the same feel rule the doors, shed tables, mantel and desk already use: a render-only height. Its number is a judgement about how it looks, not a figure from the prototype.

What broke nearby

Fixing the collision shape moved other things, and each one was a surprise.

  • The sofa. The gap between the sofa and the coffee table is narrower than the body, so the gardener could no longer fit there to sit. CI failed on the lounge sitting test, not on the test the parked notes had named. The fix measures a seat’s reach from the furniture’s edge, so the sofa can be sat on from either end.
  • Prop reach. With the body stopping short, the mantel and desk spots fell out of reach. Props now get the body’s half-width as slack. Doors did not, and that was a mistake I come back to below.
  • The test helpers. The end-to-end helpers walked along walls to reach doors, and a wall now stops the body short. In the shed, the wall stopped the body 20.86 px below the door into the lounge, just outside its 20 px reach. The helper now walks up the door’s column into the doorway, as a player would.

Three parks and a browser

The slice was parked three times, in three sessions. The first park was for a real failure: world3d.spec.ts:119 timed out, and the session ran out before it found the cause. The other two were for the container. Its Playwright browsers were older than the @playwright/test version on main, so no browser test would launch. That blocked the @walk tests and the before-and-after screenshots that the PR needed. The container problem went onto its own backlog issue. I got around it locally by installing the Chromium build for the pinned version. The image itself is still behind, so the next container will hit the same wall.

The parked notes also guessed wrong. They pointed at the lounge-to-shed door walk, and I changed that walk first. The local run showed the real fault was the other way, the shed-to-lounge walk. I had fixed the wrong direction, and it took a run with the failure text to see it. The lounge comparison shot was out of date as well, because the walk-in route and the worktop had both changed on purpose. I removed it. That test checks the room change and the mats, not the look.

I could not check everything. The reviewer tried a mutation check: put the point test back and watch the unit tests fail. The review clone had no installed packages, and the rules forbid installing them there, so it could not run. It checked the assertions by reading them instead. They bound the end position to the body’s edge, where the point test would overshoot. The collision test walks a body into every solid in every room from each open side and checks that it stays out of the drawn footprint. With the point test, that overlap would be about 0.34 m against a 0.02 m tolerance.

The before and after pictures are in PR 362, which was approved and merged. The unit suite passed with 1842 tests across 112 files, and the browser tests I ran one at a time passed too.

The same day, twice more

The shed’s workbench, planting table and bicycle had no collision at all, by design, so the body still walked through them. PR 366 made them solid. In the same change, a tap on the floor beside a solid now walks to the nearest spot where the body fits, instead of stopping a body-width short.

Then a browser test that walks from the hallway to the front door went red on main. It was the shed door’s problem again, at the house’s front door. My first reading was the same as before: the test helper’s route was wrong, so walk it up the door’s column instead. That made the test pass and hid the real problem. Because doors got no slack, a body the wall had stopped could use Interact on the front door from exactly one x, and on the shed’s lounge door from nowhere. A player pressing E under a door would have got nothing.

Giving doors the full slack was wrong too. Every door sets the player down 26 px inside the next room, just outside the door’s own reach, so that arriving never offers to go straight back. With the body’s 30.86 px reach, every landing showed the prompt to leave. The fix in PR 367 gives doors a slack of 3 px. That is enough to reach a door across a stretch of wall, and it stays under the landing’s 6 px margin. A unit test now checks all 16 doors both ways.

The lesson I keep relearning in this project is that when a test helper can’t do what a player does, it is usually the game that is wrong.