M4: map tiles, grid and pan/zoom #69

Closed
opened 2026-11-20 22:31:44 +01:00 by SirStone · 1 comment
Owner

Part of #63

Goal

Tile sprites loaded lazily and cached; pan/zoom/pinch; player min zoom 0.5; GM no low clamp; max 4; grid toggle; culling.

Acceptance criteria

  • Viewport + one-tile margin only
  • 403 not retried in a loop
  • Cache survives reconnect
  • Clamp values exact
  • Touch pinch
  • Grid toggle
  • E2e mobile emulation viewport fills < 1 s at zoom 1 over h2
  • Tile-size gate (a) documented
  • Standing gate: full devbox run test green on a clean checkout, no test weakened or skipped, and the behaviour above proven at the seam(s) listed under "Proven at".

User stories covered

  • 13 — As a player, I want map art to appear only as tiles the server allows, so that I never see unexplored floor.
  • 14 — As a player, I want tiles cached across a reconnect, so that recovery is fast on a phone.
  • 15 — As a player, I want to drag to pan and use wheel or pinch to zoom, so that looking around feels natural on mouse and touch.
  • 16 — As a player, I want zoom-out to stop at 0.5, so that my browser never asks for thousands of tiles.
  • 17 — As a GM, I want to zoom out further than players can, so that I can survey the whole map while authoring.
  • 18 — As a player, I want a toggleable grid, so that I can judge distance.
  • 19 — As a player, I want the first viewport to fill in under a second on a phone-class device, so that the table does not wait.

Proven at

camera/viewport, tile layer, grid; e2e

Notes

  • Size: M (about one agent session, ~100K tokens). Lane: V (map).
Part of #63 ## Goal Tile sprites loaded lazily and cached; pan/zoom/pinch; player min zoom 0.5; GM no low clamp; max 4; grid toggle; culling. ## Acceptance criteria - [ ] Viewport + one-tile margin only - [ ] 403 not retried in a loop - [ ] Cache survives reconnect - [ ] Clamp values exact - [ ] Touch pinch - [ ] Grid toggle - [ ] E2e mobile emulation viewport fills < 1 s at zoom 1 over h2 - [ ] Tile-size gate (a) documented - [ ] Standing gate: full `devbox run test` green on a clean checkout, no test weakened or skipped, and the behaviour above proven at the seam(s) listed under "Proven at". ## User stories covered - 13 — As a player, I want map art to appear only as tiles the server allows, so that I never see unexplored floor. - 14 — As a player, I want tiles cached across a reconnect, so that recovery is fast on a phone. - 15 — As a player, I want to drag to pan and use wheel or pinch to zoom, so that looking around feels natural on mouse and touch. - 16 — As a player, I want zoom-out to stop at 0.5, so that my browser never asks for thousands of tiles. - 17 — As a GM, I want to zoom out further than players can, so that I can survey the whole map while authoring. - 18 — As a player, I want a toggleable grid, so that I can judge distance. - 19 — As a player, I want the first viewport to fill in under a second on a phone-class device, so that the table does not wait. ## Proven at camera/viewport, tile layer, grid; e2e ## Notes - Size: M (about one agent session, ~100K tokens). Lane: V (map).
SirStone added the ready-for-agentenhancement labels 2026-11-20 22:31:44 +01:00
SirStone added a new dependency 2026-11-20 22:31:45 +01:00
SirStone added a new dependency 2026-11-20 22:31:45 +01:00
SirStone added a new dependency 2026-11-20 22:31:45 +01:00
SirStone added a new dependency 2026-11-20 22:31:46 +01:00
Author
Owner

Done in 4534ed6 on main.

AC: viewport+1-tile margin (visibleTiles, row-major, clamped); 403/404 remembered denied, never retried (unit + e2e); module-level decoded-texture cache survives reconnect (e2e: zero refetches); clamps exact — player 0.5/4.0, GM 1/64 sanity floor/4.0; wheel + two-touch-pointer pinch around anchor; #grid-toggle (TilingSprite, no per-frame redraw); sprites outside the window culled. Gate (a) documented in client/README.md and measured in client/e2e/map.test.mjs (412x869, DPR 2.625, h2, <1 s at zoom 1).

Gates green, sequential on a clean fetch of main: devbox run test 159 Node harness tests + Nim suite, evidence 19/19; devbox run client-test 120/120 (10 files); devbox run e2e 14/14 incl. map, clamps, 403 and h2.

Done in 4534ed6 on `main`. AC: viewport+1-tile margin (`visibleTiles`, row-major, clamped); 403/404 remembered `denied`, never retried (unit + e2e); module-level decoded-texture cache survives reconnect (e2e: zero refetches); clamps exact — player 0.5/4.0, GM 1/64 sanity floor/4.0; wheel + two-touch-pointer pinch around anchor; `#grid-toggle` (TilingSprite, no per-frame redraw); sprites outside the window culled. Gate (a) documented in `client/README.md` and measured in `client/e2e/map.test.mjs` (412x869, DPR 2.625, h2, <1 s at zoom 1). Gates green, sequential on a clean fetch of `main`: `devbox run test` 159 Node harness tests + Nim suite, evidence 19/19; `devbox run client-test` 120/120 (10 files); `devbox run e2e` 14/14 incl. map, clamps, 403 and h2.
Sign in to join this conversation.