Skip to content

AutoStory: shared story-run start and finish for BDSP and FRLG - #380

Merged
dayfine merged 2 commits into
nav/grid-story-stepsfrom
autostory/program-shell
Nov 11, 2026
Merged

dayfine merged 2 commits into
nav/grid-story-stepsfrom
autostory/program-shell

Conversation

@dayfine

@dayfine dayfine commented Nov 11, 2026 •

Copy link
Copy Markdown
Owner

Depends on #362 (nav/grid-story-steps). Seam 1 of 5 in unifying BDSP and FRLG AutoStory.

BDSP and FRLG each had their own start and finish of a story run, and they drifted: BDSP's start from a save did not reload it (a run started at 00.04b walked from 00.04d's position on console B, 2026-11-11), and BDSP closed the game on failure while FRLG left it. This adds it once in Pokemon/AutoStory/Pokemon_StoryRun.h; BDSP and FRLG move onto it in their own stacks (follow-up PRs).

enum class StoryStart{ NEW_GAME, LIVE, FROM_SAVE };
struct StoryGameHooks{
    Act load_save;                                   // BDSP: reset from HOME; FRLG: soft reset
    MoveOnlyFunction<std::string()> check_save_place; // optional: "" or why the save is wrong
    Act after_load;                                  // optional: reread the save (FRLG bag)
    Act save;                                        // optional
    EventLogger log, status;
};
Outcome prepare_story_start(std::string_view checkpoint, StoryStart, StoryGameHooks&, RunState&);
SegmentHooks story_segment_hooks(StoryGameHooks&);   // reload = load + place check + reread
std::string finish_story_run(const SegmentReport&, std::string_view last, AutoStoryStats&, StoryGameHooks&);
std::string finish_story_verify(std::string_view id, const VerifyPolicy&, const VerifyReport&, StoryGameHooks&);
void log_story_failure(StoryGameHooks&);

A game lends only what differs: how it loads its save, how it checks where the save is, and what it rereads after a load. FROM_SAVE always loads the save before the first checkpoint, the same path every retry uses. Nothing in it closes or resets the game on failure: it logs "AutoStory failed: the game stays where it failed." and throws OperationFailedException with the same message in both games. Tested with the new Pokemon::StoryRun suite (start loads the save, wrong place, retry reload, failure leaves the game untouched, finish and verify lines) in the headless runner.

🤖 Generated with Claude Code

https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss

Start preparation, the runner's reload, and the finish of a run or a
verify run, written once for both games. A start at a checkpoint with a
save always loads that save first; a failure leaves the game where it
failed, with the same log lines in both games.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss
Pokemon_AutoStoryShell{,_Tests} -> Pokemon_StoryRun{,_Tests}; include
guards, header titles, test suite name and registration follow. No
behaviour change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss
@dayfine dayfine changed the title AutoStory: shared program shell for BDSP and FRLG AutoStory: shared story-run start and finish for BDSP and FRLG Nov 11, 2026
@dayfine
dayfine marked this pull request as ready for review November 11, 2026 20:30
@dayfine
dayfine merged commit d460243 into nav/grid-story-steps Nov 11, 2026
@dayfine
dayfine deleted the autostory/program-shell branch November 13, 2026 03:26
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