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.
Header
- WP:
WP-021 - Title: Clickable actions: state letters, sounds and the ghost (Gen 1)
- Pre-flight date:
2026-11-14 - Targets generation(s): 1
- Targets disc(s): Showdown, Phantom
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
- Project worktree on new branch
claude/wp-021-clickablesfromorigin/main(282f872), clean; rebased onto140097awhen WP-020’s docs merged. - Fork:
scooby-engineatac1b4def76when this was first written; theC:\dev\scummvmcheckout then held WP-020’s uncommitted edits. Once WP-020’s7e03ae779awas pushed, this WP built on it in a separate fork worktree, so WP-020’s checkout was never touched. - Ghidra. A scratch project of Showdown’s and Phantom’s
Scooby.exe, outside the repo. The sharedC:\dev\scooby-engine\ghidra\scooby.gprwas left to the WP-020 session. - Data check. Clickable placements, sounds and next states listed for both titles (WP-021 §Background). One state name is missing from the art file even after the
Afallback: Showdown’sANIM_P12_SALOON_CHANDPUMA. The original then shows nothing:0x430A00stores id 0, so no frame is selected and the object can’t be hit. (First written here as “plays sequence 0”; corrected after execution.)
Doc-vs-tree cross-check
- WP-001’s label
script_ExitObject_OnClick(0x402130) is vtable+0x0C, the per-tick update the sprite tree calls (WP-017). It handles clicks, but it runs every tick. The clickable’s equivalent is0x401440. - WP-018 left “the saved Clickables state” out of scope. This WP keeps it in memory.
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
- READY TO EXECUTE, once WP-020’s fork commit landed. First written as NOT READY, because WP-020 wasn’t done; the trace, the WP and the reference model came first.
- NOT READY
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.