Pre-Flight — WP-022 — 2026-11-14
Filled-in copy of docs/reference/pre-flight for WP-022. Verdict at the bottom.
Written before engine code, on Jeff’s “continue” after PR #57 merged. The session that wrote WP-021 was told that this session is taking movies, so the two don’t overlap.
Header
- WP:
WP-022 - Title: Movies through
Video::BinkDecoder(Gen 1) - Pre-flight date:
2026-11-14 - Targets generation(s): 1
- Targets disc(s): Showdown, Phantom
Pre-flight intent
Validating readiness for
WP-022. Verdict only.
Dependency check
| Prereq | Status in WORK_INDEX |
Locked on | Notes |
|---|---|---|---|
| WP-019 | ✅ Done | 2026-11-14 | Sounds stop before a movie, as in the original. |
| WP-020 | ✅ Done | 2026-11-14 | The walk-off ends with the movie id and the next room. |
Repo + disc state
- Project worktree on new branch
claude/wp-022fromorigin/main(d49f14e), clean. - Fork on
scooby-engineat4f135d3a9f, clean, in sync. - The build has Bink.
USE_BINKis set in the out-of-tree build’sconfig.h. - Movies on the discs. Showdown has
BK.001–BK.042(noBK.024) andBK.058. Phantom hasBK.001–BK.067with gaps. All areBIKi, 640 × 480. Everymovie=an exit names exists. - An independent decoder.
ffmpegandffprobeare installed (WinGet), for the reference.
Doc-vs-tree cross-check
- Integration §7 asks that cutscenes use
Video::BinkDecoderand neverbinkw32.dll. The disc’sbinkw32.dllstays unused. - WP-020 logs “movie N not played”; this WP replaces that.
Scope lock
Allowed paths (this repo):
docs/02-SCUMMVM-INTEGRATION.md (§7 implementation notes)
docs/formats/scooby-exe.md (movie functions)
docs/work-packets/WP-022-movies.md
docs/work-packets/WORK_INDEX.md
docs/reference/pre-flight-WP-022-2026-11-14.md
Fork: engines/scooby/**, staged by name.
Risk review
| Risk | Likelihood | Impact | Mitigation |
|---|---|---|---|
| Decoded pixels differ between decoders (YUV-to-RGB rounding). | high | low | Compare mean colour within a tolerance, not exact MD5s. A wrong decode is far off. |
| The skip keys are untraced. | certain | low | Escape, Space and a click stand in; documented as a stand-in. |
| Decoding 98 movies to the end is slow. | med | low | It is a level-3 check only, run once per title. |
Verdict
- READY TO EXECUTE
- NOT READY
Prepared by: Claude (WP-001 session, continuing), on Jeff’s “continue” of 2026-11-14 Date: 2026-11-14
After execution — lessons learned
Lesson: a second decoder makes a reference even where pixels can’t match. ffmpeg decodes Bink independently. Exact frames differ by YUV-to-RGB rounding, but frame counts, lengths and mean colours pin down a correct decode: 98 movies agree, with no colour more than 2 levels apart.
Lesson: test damaged input, even through an upstream decoder. A truncated movie hung Video::BinkDecoder inside a call, where no watchdog in the engine loop could reach it. The fix was a cheap header check before opening, confirmed against all 98 genuine files first.
Lesson: count from the listing, not from memory. The first draft said 43 and 58 movies; the census says 42 and 56. Corrected before commit.
Scope note: the lock held. One fork commit, staged by name. The scratch game folder was deleted, and the ISOs were dismounted. The other session confirmed it wasn’t working on movies before this WP started.