Skip to content

PLZA AutoStory: rewind to the backup save after an autosaved failure - #622

Closed
dayfine wants to merge 5 commits into
plza/0308-catch-in-zonefrom
plza/backup-retry
Closed

dayfine wants to merge 5 commits into
plza/0308-catch-in-zonefrom
plza/backup-retry

Conversation

@dayfine

@dayfine dayfine commented Nov 16, 2026 •

Copy link
Copy Markdown
Owner

Depends on #620

When a PLZA checkpoint failed after the game autosaved in it, the run just stopped (save_moved), and getting back meant loading the backup by hand. Now the program does it: it closes the game, opens the backup card at the title (Up + B + X), reads the Pokédex count and matches it to a checkpoint start. Then it loads the backup and runs from that checkpoint to the end of the range. An unknown or unread card is cancelled with B and the run stops. A new option caps the rewinds (default 2), and nothing is saved by hand.

The run start had the same gap: a run from 03.08 loaded a save at the Center counter (03.06's start) and searched Wild Zone 1 inside the Center. Now, after the load, the program reads where the player is (the A talk prompt, the lead's panel that shows in a wild zone) and checks it against one table of checkpoint start signatures, the plan field "start_signature" (03.06: registered 1, talk prompt, not in a wild zone; 03.08: in a wild zone). The backup card count is one field of that table, so the rewind uses the same lookup. If the screen matches an earlier start, the run starts from that checkpoint. If it matches no start, the run stops with start_position_unknown and a screenshot. A checkpoint whose plan has no signature yet still runs as asked.

Tested with the AutoStoryBackups unit tests (the card table and scripted rewinds, including a replay of the 03.08 → 03.06 rewind) and the new AutoStoryStarts tests: the built-in table (counter → 03.06, rocks → 03.08, street or unknown → stop), the matching rules on a made-up table, and the two console frames. The frame tests and the backup card reader's console-frame tests skip until the Italian frames land in the CLT pin (PokemonLZA/AutoStoryStarts/Italian_center_counter.png and Italian_zone1_rocks.png). Not run on console yet.

It also merges the parked 03.08 work from plza/0308-road-legs-wip: face_heading reads the minimap arrow only after each turn has finished and turns by the error the short way round, and the walk from Taunie's rocks to 100 uses the legs measured on console B (L, left 900 ms, one marker read of 120-135, then walk to 103 or closer within 8 s), with AutoStoryBackend unit tests for the turns.

A checkpoint that fails after the game autosaved in it has no start save
left. The run now closes the game, opens the title's backup card
(Up + B + X), reads its Pokedex count, and when a plan's "backup_card"
names that card (03.06: 1 registered, the Center counter), loads it and
plays on from that checkpoint to the range's end. An unknown or unread
card is cancelled with B and the run stops; rewinds are capped by a new
option (default 2). No manual save.
…rt checkpoint

After the load, read the screen (the A talk prompt, the lead's panel of a
wild zone) and match it against one table of checkpoint start signatures
(execution "start_signature", which replaces "backup_card"). A save at
an earlier checkpoint's start runs from there; a position that matches no
start stops as start_position_unknown with a screenshot. The backup
rewind reads its card through the same table.
face_heading reads the arrow only after each turn and turns by the error;
03.08's rocks -> 100 start by the measured legs. Conflicts in
PokemonLZA_Tests.cpp and SourceFiles.cmake: kept both sides' test files.
@dayfine

dayfine commented Nov 17, 2026

Copy link
Copy Markdown
Owner Author

Superseded by #644 (one lean branch; split for review later)

@dayfine dayfine closed this Nov 17, 2026
@dayfine
dayfine deleted the plza/backup-retry branch November 17, 2026 10:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant