Pre-Flight — WP-021 — 2026-11-14

Filled-in copy of docs/reference/pre-flight for WP-021. Verdict at the bottom.

Written on Jeff’s “start WP-021 clickable actions”, while WP-020 (the exit transition) was still in progress in another session. The trace and the reference model don’t depend on WP-020. The engine code does.


Pre-flight intent

Validating readiness for WP-021. Verdict only.

Dependency check

Prereq Status in WORK_INDEX Locked on Notes
WP-018 ✅ Done 2026-11-14 Hit test and rollover; clickables start stopped.
WP-019 ✅ Done 2026-11-14 Sound plays a clip by name.
WP-020 ✅ Done 2026-11-14 Fork commit 7e03ae779a (PR #56). Brings Character (the ghost needs state 0x12) and the input lock. It also changes room.cpp and scooby.cpp, which this WP changes too.

Repo + disc state

Doc-vs-tree cross-check

Scope lock

Allowed paths (this repo):

docs/formats/scooby-exe.md       (clickable rows)
docs/work-packets/WP-021-clickable-actions.md
docs/work-packets/WORK_INDEX.md
docs/reference/pre-flight-WP-021-2026-11-14.md

Fork: engines/scooby/**, staged by name, on top of WP-020’s commit.

Risk review

Risk Likelihood Impact Mitigation
WP-020 changes Room and the input path after this WP’s design high med Write the engine code only after WP-020’s fork commit lands, and build on its Character and input lock.
The ghost’s 1-in-30 chance can’t be hit on demand high low A debug config key sets the chance to 1 for the live test.
Room code drives some clickables (graves, keys, bells) high low The default behaviour still runs, as it would in a room class without an override. The +0x14 hook is logged so later per-room code has a seam.

Verdict

Prepared by: Claude, on Jeff’s “start WP-021 clickable actions” of 2026-11-14 Date: 2026-11-14


After execution — lessons learned

Lesson: names in the data can stand in for a script. The clickable sections in object.ini are empty. The behaviour comes from the placed ANIM’s name: its last letter is the state, and the sound is SFX_ plus the name. The trace found the rule, and the data check confirmed it on 59 of 96 Showdown clickables before any engine code was written.

Lesson: use the original’s lookup in the reference too. The reference first looked sounds up in Sfx.dat alone. Two clickable sounds live in Music.dat, and the first comparison showed six differing lines. The engine was right, because it searches all three files as 0x434DC0 does.

Lesson: a real mouse needs the window on top. SetCursorPos and mouse_event reach SDL only if the ScummVM window is the one under the cursor. A background Start-Process doesn’t put it there. An Alt key tap, SetWindowPos(HWND_TOPMOST) and SetForegroundWindow did.

Lesson: start WP work in its own fork worktree when another session holds the fork checkout. WP-020 was still editing C:\dev\scummvm while this WP was traced. A git worktree on WP-020’s pushed commit gave this WP a clean base without touching that checkout, and a separate scratch Ghidra project left the shared scooby.gpr unlocked.

Lesson: a reference that shares the engine’s reading shares its mistakes. Both played sequence 0 for an unknown ANIM name, and they matched. The WP-001 session, reading 0x430A00, 0x4309C0 and 0x430D10, found that the original shows nothing. WP-018’s lesson again: an exact match checks the code against the model, not the model against the binary.

Scope note: the lock held. One fork commit, staged by name, fast-forwarded onto scooby-engine. The test configuration and the scratch Ghidra projects stayed in the session scratchpad.