Pre-Flight — WP-017 — 2026-11-14
Filled-in copy of docs/reference/pre-flight for WP-017. Verdict at the bottom.
Written before engine code, on Jeff’s “continue” after PR #48 merged. Animation was the next step named at WP-016’s close. The tick rate was not in the docs. It was traced in WP-001’s decompile dump before this WP was written, because the WP depends on it.
Header
- WP:
WP-017 - Title: Sprite animation at the original tick rate (Gen 1)
- Pre-flight date:
2026-11-14 - Targets generation(s): 1
- Targets disc(s): Showdown, Phantom
Pre-flight intent
Validating readiness for
WP-017. Verdict only.
Dependency check
| Prereq | Status in WORK_INDEX |
Locked on | Notes |
|---|---|---|---|
| WP-016 | ✅ Done | 2026-11-14 (PR #48 merged) | Rooms render with every placement at step 0, exactly. |
| WP-001 | ✅ Done | 2026-11-13 | Player functions 0x430890/0x430AA0 labelled. The caller and tick rate were traced for this WP. |
Repo + disc state
- Project worktree on new branch
claude/wp-017fromorigin/main(66be02d), clean. - Fork
C:\dev\scummvmonscooby-engineat8717f5da6b, clean, in sync with origin. - Tick trace (2026-11-14).
- The sprite vtable slot
+8is0x430890; it is in 18 vtables. 0x431130walks the tree front to back and calls slots+8and+0xCunless the subtree is paused (+0x30).- Its only caller is
0x435BC0, which computesticks = elapsed × 36 / 1000 − doneand runs each owed tick, then draws once. - The base time comes from the time manager (
timeGetTimewithtimeBeginPeriod). - Phantom’s
0x4368F0is byte-identical.
- The sprite vtable slot
Doc-vs-tree cross-check
- “Ticks per step” had no unit in tgifile-art §Sequences. It is 1/36 s; the close adds this.
- WP-001’s sprite table names
0x430890_Tickbut not its caller or rate. The close adds both to scooby-exe.
Scope lock
Allowed paths (this repo):
docs/formats/tgifile-art.md (§Sequences: tick unit, start step)
docs/formats/scooby-exe.md (tick loop rows)
docs/02-SCUMMVM-INTEGRATION.md (§1 or §5 note)
docs/work-packets/WP-017-sprite-animation.md
docs/work-packets/WORK_INDEX.md
docs/reference/pre-flight-WP-017-2026-11-14.md
Fork: engines/scooby/** only, staged by name.
Risk review
| Risk | Likelihood | Impact | Mitigation |
|---|---|---|---|
| Redraw cost. Decoding cels every frame would be slow. | med | med | Per-room cel cache, and redraw only when a step changes. |
| Engine and model agree on a wrong step formula | low | med | The formula comes straight from the decompiled countdown, and a non-zero tick count (37) exercises it on every room. |
| Wall-clock timing flakiness in the rate check | med | low | A ±1 tick tolerance over 10 s; the exact formula is checked by reading the code, not by timing. |
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: trace the caller, not just the callee. WP-001 had labelled the sprite tick, but its unit lived two calls up, in the game loop’s × 36 / 1000. A vtable search on the function pointer found the tree walk, and the tree walk’s only caller held the rate.
Lesson: test a non-zero time, not just the start. Tick 0 had already matched in WP-016. Hashing every room again after 37 ticks put 89 rooms (55 + 34) through different steps, which checks the countdown and the wrap.
Lesson: default behaviour shows where scripts are missing. The looping root-beer sign and piano bench are correct for the default path and wrong for the game. They are a concrete list of per-room overrides for Phase 4.
Scope note: the lock held. One fork commit, staged by name. The ISOs were dismounted afterwards, and the captures stayed in the scratchpad.