WP-026: The player profile, and ScummVM saves that hold it (Gen 1)
Status: ✅ Done (2026-11-14) Phase: 4 (game logic: saves) Depends on: WP-020 ✅ (exits), WP-021 ✅ (clickables), WP-022 ✅ (movies), WP-023 ✅ and WP-024 ✅ (the inventory, snacks, suspects) Companion EC: none (inline checklist under Exit criteria) Estimated effort: Half-day Pre-flight: pre-flight-WP-026-2026-11-14
Result (2026-11-14)
The reference is wp026_ref.py, written from the trace. It reads the art and object.ini through tools/probe_art.py, and never runs the engine. For the check’s own state, it prints the keys the profile must hold. It also writes an original-format profile for the engine to read, and prints what that must give.
| Exit criterion | Result |
|---|---|
| 1. The written profile | ✅ Both titles match key for key: 128 keys on Showdown, 127 on Phantom, whose first room has no clickable. The state: two items in slots and a third taken and used up, 7 snacks, ARTIE met, movies 1 and 32 seen, an exit taken and a clickable’s state. Read into a new game and written again, the profile’s text is the same, byte for byte. |
| 2. An original profile | ✅ All 137 keys match on both titles. The file has CRLF lines and story keys the engine doesn’t model (Difficulty, Whodunit, CluesFound0, SheriffPuzzle), which come back as written. Odd values come back by the original’s rules: MovieHistory5=yes reads as No (only Yes is true), and exits TRUE and on are taken while 0 and yes aren’t; they stay as written. An empty Snacks gives 1, and Nothing slots are empty. The game went to the profile’s StartRoom (Street 1, Souvenir Shop). |
| 3. Live, Showdown | ✅ The input played through test_script, minimized, with saves in a scratch folder. In Town Center the sign was picked up, and slot 1 was saved. The gang walked to Street 2. Loading slot 1 brought back Town Center, the sign in the toolbar and gone from the street, and the exit untaken. A new run with save_slot=1, as the launcher starts it, loaded the same state. That is Integration §8’s “saved before a room change, restored after a restart”. |
| 4. Build and diff | ✅ Scooby-only build: 0 errors, 0 warnings. Before the rebase onto WP-025, the exit, click, inventory, hint and snack checks were identical to WP-024’s run, hashed. After it, they still end with 0 stuck, and the profile check still matches. Fork commit 22d8978458 stages its 10 files by name, inside engines/scooby/, sits on WP-025’s ec9a31a9f4, and is pushed. |
Deviations and gaps:
- ScummVM’s slots stand in for the Sign In room’s one profile per player. There is still no Sign In room.
- The story’s keys are kept, not used. The story flags, each room class’s keys, and the game’s
Difficulty,Whodunitand clues aren’t modelled yet; they ride along as read. - No
.savexport. The console’sprofileprints the text instead.
Goal
Save and load a Gen 1 game in ScummVM, keeping the original’s own record of a game. That record is the player’s profile: an INI file the game writes as it plays.
Background
The original has no save slots (details in scooby-exe):
- Choosing a profile. The Sign In room picks a player, and that
player’s
<name>.savbecomes the profile. - The sections.
Game: the start room, the movies seen, the suspects met, and the story’s flags.Exits: the exits taken, written as each is taken.Clickables: each object’s state, written as a room is left.Inventory.
- Loading reads the profile and goes to its
StartRoom.
The fork kept these as session state (WP-020 to WP-024), so they were lost when the game closed.
Scope
In scope (fork, engines/scooby/ only):
- Building and applying the profile (
profile.cpp).- Build: the original’s keys, from the start room, movies, exits, clickables, the inventory and the suspects met.
- Apply: read them back by the original’s rules, then go to
StartRoom. - Keys the fork doesn’t model, such as the story’s flags, are kept as read.
- ScummVM saves.
saveGameStream()/loadGameStream()hold the profile’s text.- The metaengine lists, deletes and loads saves at startup, in the extended format with thumbnails.
- Saving is refused while a scene or an exit plays.
StartRoomfollows the original: the last room that isn’t a menu.- Testing aids. A console
profilecommand, andsave N/load Nsteps fortest_script. - A
scriptlevel 3 check.- A round trip: a state of every kind, written, read into a new game and written again.
- An import: an original-format profile read in and written out again.
Out of scope:
- The Sign In room and one profile per player name; ScummVM’s slots stand in for them.
- The story flags’ meaning, and the per-room classes’ own keys. Those are kept as read but not used.
- Exporting a profile to a
.savfile on disk.
Exit criteria
- On both discs, the profile the check writes matches an independent reference key for key, and reading it back writes the same text.
- An original-format profile matches the reference after reading and
writing. That covers CRLF lines, a lowercase
yes,TRUE/onexits, an emptySnacks,Nothingslots and story keys. - Live, in Showdown:
- a save after a pick-up, then a walk to another room, and a load brings the room and the item back;
- starting with
save_slotloads it too.
- Scooby-only build: 0 errors and 0 warnings. The earlier checks are
unchanged line for line. The fork diff stays inside
engines/scooby/, staged by name.
Deliverables
- Fork commit on
scooby-engine. - scooby-exe: the profile’s sections and rules.
- Integration §8: the implementation notes.