M4: playtest friction: fps overlay, import on fresh state, token seeding #82

Closed
opened 2026-11-21 16:52:22 +01:00 by SirStone · 1 comment
Owner

Part of #63

Owner's real-phone checklist (#77 comment 2983) found three frictions before the playtest is repeatable. All three are tooling, not wire behaviour; proto stays 2.

a. No in-app fps readout

Reading fps on the phone requires USB + adb + chrome://inspect. Add an in-app, opt-in perf overlay:

  • URL switch (e.g. ?perf=1) and/or a settings toggle. Off by default, no wire change, no per-frame cost when off.
  • Shows fps (rAF), frame ms p50/p95 over the last N seconds, JS ms per frame if measurable, token count and zoom.
  • Text via textContent/BitmapText per client conventions.

b. fff-vtt import needs an already-migrated state.db

Today the owner serves, Ctrl-Cs, imports, serves again. Import must work on a fresh/empty state dir: create and migrate through the same code path as server startup (no duplicated migration logic). devbox run serve gains --image <file>: import before starting; refuse (exit 3 semantics) when a server holds the state-dir lock.

c. Seeding 50 tokens means 50 panel submits

Add a seeding tool (e.g. devbox run seed -- --tokens 49 ...) that connects as GM over the real WS (LAN/loopback URL), creates N NPC tokens spread deterministically over the scene with an optional vision subset, and is idempotent-ish (labelled so a rerun does not double up, or --replace). Also: the GM token panel's create form defaults X/Y to the current viewport centre instead of 400,400.

Acceptance

  • e2e: overlay hidden by default; ?perf=1 shows fps/frame/JS/token/zoom numbers.
  • Node: import into an empty dir creates a servable scene; serve --image smoke; seed creates N tokens visible to the GM and rerun/--replace behave.
  • Unit/e2e: panel create-at-viewport-centre.
  • README + docs/HANDOFF-M4.md updated; gates green; #77 checklist rewritten to use these.
Part of #63 Owner's real-phone checklist (#77 comment 2983) found three frictions before the playtest is repeatable. All three are tooling, not wire behaviour; proto stays 2. ## a. No in-app fps readout Reading fps on the phone requires USB + adb + `chrome://inspect`. Add an in-app, opt-in perf overlay: - URL switch (e.g. `?perf=1`) and/or a settings toggle. Off by default, no wire change, no per-frame cost when off. - Shows fps (rAF), frame ms p50/p95 over the last N seconds, JS ms per frame if measurable, token count and zoom. - Text via `textContent`/`BitmapText` per client conventions. ## b. `fff-vtt import` needs an already-migrated state.db Today the owner serves, Ctrl-Cs, imports, serves again. Import must work on a fresh/empty state dir: create and migrate through the same code path as server startup (no duplicated migration logic). `devbox run serve` gains `--image <file>`: import before starting; refuse (exit 3 semantics) when a server holds the state-dir lock. ## c. Seeding 50 tokens means 50 panel submits Add a seeding tool (e.g. `devbox run seed -- --tokens 49 ...`) that connects as GM over the real WS (LAN/loopback URL), creates N NPC tokens spread deterministically over the scene with an optional vision subset, and is idempotent-ish (labelled so a rerun does not double up, or `--replace`). Also: the GM token panel's create form defaults X/Y to the current viewport centre instead of 400,400. ## Acceptance - e2e: overlay hidden by default; `?perf=1` shows fps/frame/JS/token/zoom numbers. - Node: import into an empty dir creates a servable scene; `serve --image` smoke; seed creates N tokens visible to the GM and rerun/`--replace` behave. - Unit/e2e: panel create-at-viewport-centre. - README + `docs/HANDOFF-M4.md` updated; gates green; `#77` checklist rewritten to use these.
SirStone added the enhancementready-for-agent labels 2026-11-21 16:52:30 +01:00
SirStone added a new dependency 2026-11-21 16:52:30 +01:00
Author
Owner

Implemented in 9c7f9de on main: opt-in ?perf=1 overlay, import creates/migrates a fresh state dir (same startup path) and devbox run serve -- --image, devbox run seed with deterministic labelled tokens and --replace, GM token form defaults X/Y to the viewport centre. Gates: devbox run test (165 pass), devbox run client-test (180 pass), devbox run e2e (29 pass; one known tiles-ready audit flake on the first run, green on rerun — owned by the deflake lane). #77 checklist rewritten in #issuecomment-2993.

Implemented in 9c7f9de on main: opt-in `?perf=1` overlay, import creates/migrates a fresh state dir (same startup path) and `devbox run serve -- --image`, `devbox run seed` with deterministic labelled tokens and `--replace`, GM token form defaults X/Y to the viewport centre. Gates: `devbox run test` (165 pass), `devbox run client-test` (180 pass), `devbox run e2e` (29 pass; one known tiles-ready audit flake on the first run, green on rerun — owned by the deflake lane). #77 checklist rewritten in #issuecomment-2993.
Sign in to join this conversation.