M4: real-phone playtest gate (Note 10, 60 fps) #77
Notifications
Due Date
No due date set.
Depends on
#66 M4: TLS + HTTP/2 test vhost, client dist, chromium
SirStone/FFF_vtt_frozen
#76 M4: finish — e2e audit, measurement and archive
SirStone/FFF_vtt_frozen
#80 M4: LAN playtest run script (devbox run serve)
SirStone/FFF_vtt_frozen
#79 M4: map import CLI (pulled forward from M6)
SirStone/FFF_vtt_frozen
#78 M4: GM token panel sets vision (flags.vision, vision_radius)
SirStone/FFF_vtt_frozen
#82 M4: playtest friction: fps overlay, import on fresh state, token seeding
SirStone/FFF_vtt_frozen
#83 bug: map import fails on 16384 px at tile size 64
SirStone/FFF_vtt_frozen
#84 bug: devbox scripts drop `--` arguments (serve --image ignored)
SirStone/FFF_vtt_frozen
#85 M4: cap map images at Full HD (auto-shrink on import)
SirStone/FFF_vtt_frozen
#86 bug: tile loading wastes requests and never recovers 404s
SirStone/FFF_vtt_frozen
#87 bug: GM sees no walls after reconnect/reload
SirStone/FFF_vtt_frozen
#88 bug: GM roster 'connected' goes stale on plain reconnect
SirStone/FFF_vtt_frozen
#89 M4: GM panel and phone HUD usability (dry-run findings)
SirStone/FFF_vtt_frozen
Reference: SirStone/FFF_vtt_frozen#77
Reference in New Issue
Block a user
Part of #63
Goal
Human run: laptop-hosted scene, Full HD tiled map (1920x1080 max; the import shrinks any larger image, #85), 50 tokens, fog active, phone over LAN TLS/h2.
Acceptance criteria
devbox run testanddevbox run e2egreen on the build under test on a clean checkout, no test weakened or skipped; the manual steps above are recorded with real numbers.User stories covered
Proven at
manual
Notes
Superseded by this comment — kept for history. The hand-written nginx/TLS block, the manual
scenerow patch and the fixture tiles below are replaced bydevbox run serveandfff-vtt import.Playtest checklist — Note 10 + laptop, 16384 px map, 50 tokens
Build under test: the commit this comment is posted against (
git rev-parse HEAD). First prove it:devbox run test,devbox run client-test,devbox run e2egreen on a clean checkout (standinggate in this ticket). Do not run the phone pass on a tree that has not passed those.
The recipe below was smoke-tested locally over TLS/h2 (healthz
{"status":"ok"},/200 h2,/_tiles/404, 50-token seed). It uses the same vhost shape astools/nginx.mjs, but binds theLAN IP and uses a certificate whose SAN is that IP.
1. One-time on the laptop (repo root, in
devbox shellor withdevbox run --)2. Certificate + vhost (laptop, still repo root)
Start the two processes in separate terminals:
Laptop sanity check (expect
{"status":"ok"}and HTTP/2):3. Seed the 50-token scene and the player key (third terminal)
Copy the printed
PLAYER_KEY. The GM can sign in on the laptop at the same URL with$GM_KEY(roster/panels control).
4. Phone setup and measurement
https://$LAN_IP:8443→ “Advanced” → “Proceed” (self-signedcert). Paste the player key into the sign-in field (this is the phone-keyboard check), submit,
choose the display name once.
chrome://inspect/#deviceson the laptop, “inspect” the phone tab. In DevTools:⋮ → More tools → Rendering → tick Frame Rendering Stats (FPS meter); use the Performance
panel for a 10 s recording and read the frame track for p95.
then stopwatch from tapping Sign in to the map fully painted (no black placeholders). Record
the median.
token around for 10 s; pinch in/out. Record the FPS meter median and the Performance p95 frame.
offline/reconnecting), off; time fromnetwork return to
connectedwith the same map, no reload.laptop is expected to sit at ~60 fps.
Pass thresholds (record actuals, do not round up)
tile_size=64(scene row + regenerate 64 px tiles), restart, re-measure; pass if either meets itIf the phone misses a threshold, that is a fail for this ticket: file one Gitea issue per distinct
cause with the numbers and the DevTools trace, link it here, and note whether the 64 px fallback
rescues it.
5. Record and clean up
Post one comment on this ticket with:
Add: browser version,
LAN_IP,tile_size, Wi-Fi band, date, and the path to any DevTools trace /screen recording. Then
Ctrl-Cboth terminals; keeprun/lan/if you filed a bug, otherwiserm -rf run/lan(it holds the keys).#63/#62close only after this comment says pass.Playtest checklist v2 — Note 10 + laptop, 16384 px map, 50 tokens
Replaces the first checklist. What changed:
devbox run servereplaces the hand-written nginx/TLS block,fff-vtt importreplaces the manualscenerow patch + fixture tiles, and the GM token panel now sets vision (#78). Budget: ~20 min of gates, ~1 h hands-on.Build under test:
git rev-parse --short HEAD— write it down. Everything below assumes3567058or later (that is the tree withdevbox run serveandfff-vtt import).0. Prove the build first (once)
devbox run test→ ends green (server gate + Node harnesses).devbox run client-test→ green. Thendevbox run e2e→ green.Any red line: stop, the phone numbers are not valid.
1. Make the map file (once, a few minutes, needs ~2 GB temp)
Expect:
run/map16384.png;devbox run -- magick identify run/map16384.pngprintsPNG 16384x16384 ... 8-bit.2. First start — this creates the state dir, scene, GM key, cert (once)
devbox run serve(~2 min; builds server + client).URL:(https://<lan-ip>:8443), theGM key:, and thecert:path.Expect: it also prints the phone (Android) and laptop certificate-trust steps.
curl -sk https://<lan-ip>:8443/healthz→{"status":"ok"}.serveterminal. Expect:stopped; state, GM key and certificate are on disk.3. Import the map — the server must be stopped
devbox run -- ./run/fff-vtt import --state-dir=run/lan --image=run/map16384.png --tile-size=64Expect: after a few minutes,
imported run/map16384.png: 16384x16384 px, tile 64 px, 256x256 tiles -> .../run/lan/tiles/1/v1 (art_version 1).64 px is deliberate: 32 px on 16384 px is 262,144 tile files; 64 is the README's designed fallback.
devbox run serveagain. Expect: sameURL:and sameGM key:as step 6 (the server only reads the scene row at startup, hence the restart).4. Trust the certificate (once per device, per LAN address)
serveprinted for your OS (Linux:sudo cp run/lan/tls/cert.pem /usr/local/share/ca-certificates/fff-vtt-lan.crt && sudo update-ca-certificates).Advanced→Proceed. That tap alone is enough.adb push run/lan/tls/cert.pem /sdcard/Download/fff-vtt-lan.crt, then Settings → Security → Encryption & credentials → Install a certificate → CA certificate.adbis not indevbox.json; on this NixOS host usenix shell nixpkgs#android-tools -c adb ...(or install platform-tools). You need adb at step 32 anyway.5. GM on the laptop
Sign in.Expect: the map centred on 8192,8192 (grey-green gradient with two brown rectangles) and the right-hand GM column:
GM table,Characters,Walls.GM table→Create player key→ copy the key.Expect: one roster entry; key is 5 groups of 4.
6. Phone: first sign-in (before the token exists — black screen is correct)
Sign in.Connected, screen black/empty fog. The player has no token with vision yet, so the server serves no tiles — this is the #78 behaviour, not a bug.7. Seed 49 NPC tokens — script, because the UI has no bulk create
Expect: exit 0, no output; the GM page's token list grows to 49 live.
Panel-only alternative: the token form 49 times (~10 min of clicking, same result).
Why a script: the token panel creates one token per submit; nothing in the client mass-creates tokens.
8. The player's token with sight — the #78 check
GM table→ token form: Kindpc, Descriptive namePlayer, Actual namePlayer, X8192, Y8192(the form defaults to 400,400 — change both), Radius blank, Vision ✓, Vision radius400, Controller = your player →Create token.Still black? The Vision flag did not take: select the token, tick
Vision,Save token(that edit path is part of #78).9. What to try on the phone
Walls→Window, click two points beside the player →Players see a markeron. Expect: a lit-window icon on the phone once that window has been in sight.Door, click two points, select it,Open door→ the phone's sight and fog update immediately;Close→ back.Secret→ Expect: the phone shows nothing at all (looks like solid wall).One-way, draw it between the player and a token, clickFlip direction→ Expect: the far token disappears/appears with the flip.Who sees itsection (underCharacters) → move the player's token or a wall so a token enters/leaves sight. Expect: that token's row flips betweennobody (0 %)and<player> (100 %).10. Measure fps — the client has no fps counter, so use USB debugging
nix shell nixpkgs#android-tools -c adb devices→ the phone's serial is listed.chrome://inspect/#devices→ your phone's tab →inspect.11. Load times
Sign into the map fully painted, no black squares. Record the median.12. Reconnect
Reconnecting…orOffline→ Wi-Fi on →Connectedwithin ~5 s, same map, no reload.devbox run serve, start it again → phone returns toConnectedwith the same map and token positions; the GM page too, no re-key.13. Record
LAN_IP, tile size (64), Wi-Fi band, date, and paths to any trace/screen recording.serve; keeprun/lan/if you filed a bug (it holds the keys), otherwiserm -rf run/lan.Pass/fail (write the numbers in your comment)
Connected≤ 5 s, no reload, same maptest,client-test,e2egreen on HEAD#63/#62close only after this comment says pass.Playtest checklist v3 — one-command import, seeded tokens, in-app fps
Supersedes the v2 checklist in #issuecomment-2983. What changed:
devbox run serve -- --image=…imports and starts in one command,devbox run seedmakes the 49 NPC tokens over the real WebSocket, and?perf=1shows fps on the phone without USB/adb. Budget: ~20 min gates, ~45 min hands-on.Build under test:
git rev-parse --short HEAD— write it down. This assumes30b3559or later (#82 overlay/fresh import/seed, #84--args actually reaching the scripts).0. Prove the build first (once)
9c7f9deor later.devbox run test→ ends green.devbox run client-test→ green.devbox run e2e→ green. If a red line: stop; phone numbers are not valid.4b. Sanity-check the command seam:
devbox run serve -- --dry-runprintsserve: dry-runand the parsedhost/port/state-dir/image/tile-size(no build, no server). That proves the--arguments reachserve.mjson this build (#84); an unknown flag now exits non-zero instead of being ignored.1. Make the map file (once, a few minutes, ~2 GB temp)
devbox run -- magick identify run/map16384.pngprintsPNG 16384x16384 ... 8-bit.2. First start — import and serve in one command (once)
devbox run serve -- --image=run/map16384.png --tile-size=64serve: importing run/map16384.png before starting the server...andfff-vtt import: created/migrated .../state.db ..., thenimported ... 16384x16384 px, tile 64 px, 256x256 tiles; thenURL:,GM key:,cert:and the certificate-trust steps. No second start needed.URL:(https://<lan-ip>:8443), theGM key:and thecert:path.curl -sk https://<lan-ip>:8443/healthz→{"status":"ok"}.3. Trust the certificate (once per device, per LAN address)
serveprinted for your OS. NixOS printssecurity.pki.certificateFiles = [ "<state>/tls/cert.pem" ];thensudo nixos-rebuild switch(or home-manager switch); Chrome'sAdvanced→Proceedalone is enough for the playtest. Debian/other Linux printssudo cp run/lan/tls/cert.pem /usr/local/share/ca-certificates/fff-vtt-lan.crt && sudo update-ca-certificates. macOS/Firefox lines are printed too.Advanced→Proceed. That tap alone is enough.adb push run/lan/tls/cert.pem /sdcard/Download/fff-vtt-lan.crt, then Settings → Security → Encryption & credentials → Install a certificate → CA certificate.adbis not in devbox; usenix shell nixpkgs#android-tools -c adb ...on this host.4. GM on the laptop
Sign in.GM table,Characters,Walls).GM table→Create player key→ copy the key. Expect: one roster entry, key in 5 groups of 4.5. Phone: first sign-in (black screen is correct)
Sign in; type a display name once.Connected, screen black/empty fog. The player has no vision token yet, so the server serves no tiles — that is #78 behaviour, not a bug.6. Seed 49 NPC tokens (one command, not 49 submits)
<lan-ip>;--keyis optional — without it the key is read fromrun/lan):seeded 49 tokens (49 created, 0 already present, 0 removed) ... scene 1 16384x16384, seed 1, vision 1 x 400 px; the GM token list grows to 49 live.seeded 49 tokens (0 created, 49 already present, 0 removed)— it does not double up. To rebuild the layout: add--replace(or change--seed=).7. The player's token with sight
GM table→ token form: Kindpc, Descriptive namePlayer, Actual namePlayer. Leave X/Y as they are — they now default to the current viewport centre (8192,8192 at the initial view). Radius blank, Vision ✓, Vision radius400, Controller = your player →Create token.Vision,Save token(the edit path is #78).8. What to try on the phone
Walls→Window, click two points beside the player →Players see a marker. Expect: a lit-window icon on the phone once seen.Door, click two points, select it,Open door/Close. Expect: the phone's sight and fog update immediately.Secret→ Expect: the phone shows nothing (looks like solid wall).One-way, draw it between the player and a token, clickFlip direction→ Expect: the far token appears/disappears with the flip.Who sees it→ move the player's token or a wall so a token enters/leaves sight. Expect:nobody (0 %)↔<player> (100 %).9. Measure fps — the overlay, no USB
?perf=1(e.g.https://<lan-ip>:8443/?perf=1) and reload; sign in if asked.fps 59.8 · frame p50 16.6 p95 17.1 ms · JS p50 1.20 p95 2.40 ms · tokens 50 · zoom 1.00. It is off by default and costs nothing when off.nix shell nixpkgs#android-tools -c adb devices, then laptop Chromechrome://inspect/#devices→ inspect → ⋮ More tools → Rendering → Frame Rendering Stats. The overlay is the primary number; this is the independent check.?perf=1URL in the laptop's Chrome and record the same four runs.10. Load times
cached images and files(or an Incognito tab + paste the key), stopwatch from tappingSign into the map fully painted, no black squares. Record the median.11. Reconnect
Reconnecting…/Offline→ Wi-Fi on →Connected, same map, no reload. Record the seconds.devbox run serve, start it again (no--imagethis time) → first it printsserve: no --image given, keeping current map (16384x16384, tile 64, art v<N>), then phone and GM return toConnectedwith the same map and token positions, no re-key. Record the seconds.12. Record
LAN_IP, tile size (64), Wi-Fi band, date, and paths to any trace/screen recording.serve; keeprun/lan/if you filed a bug (it holds the keys), otherwiserm -rf run/lan.Pass/fail (write the numbers in your comment)
test,client-test,e2egreen on HEAD#63/#62close only after this comment says pass.Playtest checklist v4 — Full HD cap, auto-shrink on import, seeded tokens
Supersedes the v3 checklist in #issuecomment-2993. What changed: map images are capped at Full HD (#85, ADR-0023). Any image works — the import shrinks a larger one automatically and prints
scaled WxH → WxH; scenew,hbecome the shrunk size. The 16384/64 tile-size recipe is gone. The gate scene is the Full HD maximum (1920×1080); the old squarerun/map16384.pngstill imports but becomes 1080×1080, so regenerate the map at 16:9 for the max-scene numbers.Build under test:
git rev-parse --short HEAD— write it down. This assumes43947d1or later (#85, on top of #84's--forwarding and #82's seed/overlay).0. Prove the build first (once)
43947d1or later.devbox run test→ green.devbox run client-test→ green.devbox run e2e→ green. If a red line: stop, phone numbers are not valid.4b.
devbox run serve -- --dry-runprintsserve: dry-runand the parsed options (proves--reaches the script).1. Make the map file (once, a few minutes, ~2 GB temp)
devbox run -- magick identify run/map16384.pngprintsPNG 16384x9216 ... 8-bit. (An older 16384×16384 file also imports; it shrinks to 1080×1080, not the max.)2. First start — import and serve in one command (once)
devbox run serve -- --image=run/map16384.png(no--tile-size: the cap makes 32 px practical)serve: importing ..., then the import's ownscaled 16384×9216 → 1920×1080andimported ...: 1920x1080 px, tile 32 px, 60x34 tiles, thenURL:,GM key:,cert:and the trust steps. No second start.URL:(https://<lan-ip>:8443), theGM key:and thecert:path. If the state dir still holds an old 16384 scene and you start without--image,servenow also printsWARNING: map is 16384x16384, above the Full HD cap ...; re-import to shrink.curl -sk https://<lan-ip>:8443/healthz→{"status":"ok"}.3. Trust the certificate (once per device, per LAN address)
serveprinted for your OS. NixOS printssecurity.pki.certificateFiles = [ "<state>/tls/cert.pem" ];+sudo nixos-rebuild switch; Chrome'sAdvanced→Proceedalone is enough. Debian prints theupdate-ca-certificatespair. macOS/Firefox lines are printed too.Advanced→Proceed.adb push run/lan/tls/cert.pem /sdcard/Download/fff-vtt-lan.crt, then Settings → Security → Encryption & credentials → Install a certificate → CA certificate.adbis not in devbox; usenix shell nixpkgs#android-tools -c adb ....4. GM on the laptop
Sign in.GM table,Characters,Walls).GM table→Create player key→ copy the key.5. Phone: first sign-in (black screen is correct)
Sign in; type a display name once.Connected, screen black/empty fog (the player has no vision token yet — #78 behaviour, not a bug).6. Seed 49 NPC tokens (one command)
seeded 49 tokens (49 created, 0 already present, 0 removed) ... scene 1 1920x1080, seed 1, vision 1 x 400 px; the GM token list grows to 49. On the Full HD map the 7×7 grid spacing is ≥~130 px in both axes (token diameter 40 px), so nothing overlaps badly; on a 1080×1080 square it is ≥~86 px, still clear.0 created, 49 already present, 0 removed.--replacerebuilds;--seed=changes the layout.7. The player's token with sight
GM table→ token form: Kindpc, namesPlayer, leave X/Y at their current viewport centre (960,540 here), Radius blank, Vision ✓, Vision radius400, Controller = your player →Create token.Vision,Save token(#78).8. What to try on the phone
Walls→Windowbeside the player →Players see a marker;Door+ open/close updates sight; tickSecretlooks like a wall;One-way+ flip toggles a token in/out of sight.Who sees itwhile moving the token/a wall.9. Record the numbers
?perf=1appended to the URL: record fps, frame ms, JS ms, tokens (50), zoom. The M4 target is 60 fps (PROPOSED) with 50 tokens and fog active; also record the first-load time and the laptop's view.bug, link this ticket) and record pass/fail in this ticket.Standing gate for the pass:
devbox run test,devbox run client-test,devbox run e2egreen on the commit under test, no test weakened or skipped.Playtest checklist v5 — Full HD cap, seeded tokens, collapsible GM column
Build under test:
git rev-parse --short HEAD— write it down. This assumes the HEAD that closes the "GM panel and phone HUD usability" issue (full-HD import, seed, perf overlay, collapsible Panels).0. Prove the build first (once)
devbox run test→ green.devbox run client-test→ green.devbox run e2e→ green. Any red line: stop; phone numbers are not valid.devbox run serve -- --dry-runprintsserve: dry-runand the parsed options (proves--reaches the script).1. Make the map file (once, a few minutes, ~2 GB temp)
PNG 16384x9216 ... 8-bit; the import shrinks it to 1920×1080.2. First start — import and serve in one command (once)
devbox run serve -- --image=run/map16384.png(no--tile-size: 32 px is practical at the cap).serve: importing ...;scaled 16384×9216 → 1920×1080;imported ...: 1920x1080 px, tile 32 px, 60x34 tiles;URL:;GM key:;cert:and the trust steps.On a first run (no saved LAN address/cert)
servealso printsNOTE: the LAN address is new (<ip>); the certificate was regenerated. Trust it again.— expected, not an error: trust the printed certificate.URL:(https://<lan-ip>:8443),GM key:andcert:. Second terminal:curl -sk https://<lan-ip>:8443/healthz→{"status":"ok"}.3. Trust the certificate (once per device, per LAN address)
serveprinted (NixOS:security.pki.certificateFiles = [ ... ]+nixos-rebuild switch; Debian:update-ca-certificates). Chrome'sAdvanced→Proceedalone is enough for the playtest.Advanced→Proceed.adbis not in devbox;nix shell nixpkgs#android-tools -c adb ...on this host).4. GM on the laptop — the new column layout
Sign in.Walls, thenGM table, thenWho sees it, then foldedCharacters/Encountered.TokensandNew tokenare folded;Rosteris open (at most six rows).GM table→Create player key→ copy the key (5 groups of 4).Wallsis the first block: draw presets, the selected wall's fields and Undo are reachable without scrolling past the lists. Selecting a wall on the map scrolls its editor to the top.5. Phone: first sign-in (black screen is correct)
Sign in; type a display name once.Connected, black/empty fog (the player has no vision token yet — #78 behaviour, not a bug). The HUD is one wrapped row (Player · <scene> · <name> · Connected · zoom 1.00); the player'sMy characters/Encounteredpanels are folded to two summary rows and each opens to a capped, scrolling list.6. Seed 49 NPC tokens (one command)
seeded 49 tokens (49 created, 0 already present, 0 removed) ... scene 1 1920x1080, seed 1, vision 1 x 400 px; the GM's foldedTokens (49)count updates.0 created, 49 already present, 0 removed.--replacerebuilds;--seed=changes the jitter.7. The player's token with sight — mind the seed grid
GM table→ openNew token: Kindpc, namesPlayer, X845, Y540(the seeded grid puts a token in the centre cell — Seed 25 sits at ~968,554, 16 px from 960,540, so the old "leave X/Y at the viewport centre" advice overlaps it). Radius blank, Vision ✓, Vision radius400, Controller = your player →Create token.Vision,Save token(#78).8. What to try on the phone
zoomreadout follows.Walls→Windowbeside the player →Players see a marker: the phone draws the yellow marker once the window has been seen.Door+ open/close updates sight and fog immediately. TickSecret→ the phone shows nothing at all.One-way+Flip directiontoggles a token in/out of sight.Who sees itwhile moving the token/a wall:nobody (0 %)↔<player> (100 %).9. Measure fps — the overlay, no USB
?perf=1and reload; sign in if asked.fps 59.8 · frame p50 16.6 p95 17.1 ms · JS p50 1.20 p95 2.40 ms · tokens visible 50 / total 50 · zoom 1.00. The number counts the tokens this client draws: a player only receives tokens in sight, so itstotalis what that client knows; the GM's total is the whole table.?perf=1URL.nix shell nixpkgs#android-tools -c adb devices, thenchrome://inspect/#devices→ inspect → ⋮ More tools → Rendering → Frame Rendering Stats.10. Load times
Sign into the map fully painted, no black squares. Record the median.11. Reconnect
Reconnecting…/Offline→ back on →Connected, same map, no reload. Record the seconds.serve, start it again without--image(expectserve: no --image given, keeping current map ...) → phone and GM return toConnected, same token positions, no re-key. Record the seconds.12. Console (what not to file)
/wsbefore sign-in, so there is no refused WebSocket upgrade on a healthy first load. If one appears, that is a bug: file it./tiles/...403s are expected for tiles the player has not seen (or for an unexplored/unknown area). The server refuses them by design and the browser logs the failed request; this is not an app error and must not be filed. A tile that stays black in an area the player should see is the bug.13. Record
LAN_IP, tile size (32), Wi-Fi band, date, and paths to any trace/screen recording.serve; keeprun/lan/if you filed a bug (it holds the keys), otherwiserm -rf run/lan.Pass/fail (write the numbers in your comment)
test,client-test,e2egreen on HEAD#63/#62close only after this comment says pass.