From 2d98393010cc157a98294102451ffc885fc589a6 Mon Sep 17 00:00:00 2001 From: Eric Wagoner Date: Thu, 3 Sep 2026 19:39:13 -0400 Subject: [PATCH] The recorder takes one poster per clip MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Once written, the poster's countdown fell back to idle while the same move still showed, re-armed, and overwrote the poster with the next move — for two scenes, the change-of-eyes wipe. A done flag holds it. Co-Authored-By: Claude Fable 5.1 Claude-Session: https://claude.ai/code/session_01Jm2auWk6RP71CjaAb4FMoG --- deploy/film-clips.mjs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/deploy/film-clips.mjs b/deploy/film-clips.mjs index 4046d88..b82421c 100644 --- a/deploy/film-clips.mjs +++ b/deploy/film-clips.mjs @@ -22,7 +22,7 @@ if (!outDir) { console.error("usage: film-clips.mjs [scene ...]"); pro const PORT = 8809; const FPS = 25; const TAIL_MS = 2500; // hold on the last move -const POSTER_SETTLE_MS = 2000; // the poster beat's tween, fx, and any change-of-eyes wipe, done +const POSTER_SETTLE_MS = 1100; // the poster beat's tween and fx done, still inside its 1.5s beat const EPOCH = new Date("2026-01-01T00:00:00Z").getTime(); const server = startServer(PORT, "wizwar-film"); @@ -58,13 +58,13 @@ try { // run longer than the beat), then hold the tail. const posterBeat = sp.beats?.[0] ?? 1; const MAX_FRAMES = FPS * 240; // four minutes: a reel that never reaches its last move - let f = 0, tail = -1, posterIn = -1; + let f = 0, tail = -1, posterIn = -1, posterDone = false; while (tail !== 0 && f < MAX_FRAMES) { const png = await page.screenshot({ clip }); writeFileSync(join(frames, `${String(f).padStart(5, "0")}.png`), png); const at = Number((await page.locator(".replay-count").textContent()).match(/move (\d+)/)[1]); - if (view === "fpv" && posterIn < 0 && at === posterBeat + 1) posterIn = Math.round(POSTER_SETTLE_MS / (1000 / FPS)); - if (posterIn === 0) writeFileSync(join(frames, "poster.png"), png); + if (view === "fpv" && !posterDone && posterIn < 0 && at === posterBeat + 1) posterIn = Math.round(POSTER_SETTLE_MS / (1000 / FPS)); + if (posterIn === 0) { writeFileSync(join(frames, "poster.png"), png); posterDone = true; } if (posterIn >= 0) posterIn--; if (tail < 0 && at === count) tail = Math.round(TAIL_MS / (1000 / FPS)); if (tail > 0) tail--;