Repository navigation
AutoStory: shared launch from HOME to the overworld on a save - #477
Merged
Merged
Conversation
One driver for every game: a per-game StoryLaunchPolicy (HOME tile check, title, backup-save presses, prompts such as the license check, the overworld judge) and launch_story_game(), which looks, does one thing, counts each screen's presses and ends only on a settled overworld. It never starts a new game. No game uses it yet. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss
…after the launch The update prompt needs the cursor moved before A, and PLZA's title and dialog checks are loose enough to match the game in play, where a press would answer the story. StoryLaunchPrompt::before presses before the prompt's press; StoryLaunchPrompt::after_launch and StoryLaunchPolicy::title_after_launch read those screens only once the launch closed or launched the game. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss
dayfine
added a commit
that referenced
this pull request
Nov 14, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss
NintendoSwitch_HomeTileReader finds HOME's cyan frame on the game row and reads the game name HOME writes above the row. switch_home_tile_named() turns it into a launch policy's tile check, so a game names its tile instead of trusting whatever tile is selected (console B, 2026-11-14: a blind launch opened FireRed after the HOME order changed). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss
dayfine
added a commit
that referenced
this pull request
Nov 14, 2026
Brings the HOME tile reader; the CommandLineTests pin moves to eae469773, which adds the HomeTileReader frames on top of 95b9aa8b9. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss
dayfine
added a commit
that referenced
this pull request
Nov 14, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss
Pokemon_StorySwitchPrompts.{h,cpp} come unchanged from plza/story-engine
(723921b). The Close software dialog, the user select and the update
prompt are the same in every game, so the shared launch owns them and
FRLG, BDSP and PLZA use this one copy.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss
dayfine
added a commit
that referenced
this pull request
Nov 14, 2026
On console B (FRLG, 2026-11-14 02:41) HOME showed for about 1.5 s after the launch's A on the tile, and each look there pressed A again until the launch failed as stuck on HOME, while the game was booting. After that A, HOME now waits for up to the policy's launch_wait (30 s, as the FRLG RNG reset's wait for the boot) before another A, and moves no cursor in that time. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
dayfine
commented
Nov 14, 2026
dayfine
left a comment
Owner
Author
There was a problem hiding this comment.
Verdict: mergeable on the fork
Reviewed SHA: bb240f6
Verdict
APPROVED
Correctness pass on git diff origin/autostory/engine...origin/autostory/launch-from-home, then a style pass. CI green (it uses the fork's CommandLineTests at eae46977 for the HomeTileReader shots). No existing comments. I traced the driver through closed, suspended, title and overworld starts, KEEP and RESTART, and BACKUP, and found no wrong press. No blocking findings.
Should-fix
Engine/Pokemon_StoryLaunch.cpp:46withEngine/Pokemon_StoryLaunch.h:124—read_launch_look()classifiesSWITCH_HOME_MENUbefore the prompts. Thelaunch_waitdoc says HOME can still show with the user select in front of it. If so, the "user select" prompt (Pokemon_StorySwitchPrompts.cpp) is never answered while HOME is read: the driver waits outlaunch_wait(30 s), thentile_selectedis false (the reader's "user select over HOME" case has no frame), andmove_to_tile()(:134) presses Left/Right into the user select. Match prompts that can overlay HOME before the HOME check, or add a fake-backend case for the user select over HOME.Engine/Pokemon_StoryLaunch.cpp:154— the tile search hardcodesMilliseconds(80), Milliseconds(400). Use aStoryLaunchPress(its defaults are the same values) or a policy field, like every other press in the driver.
Nits
ComputerPrograms/ComputerPrograms_UnitTestRunner.cpp:71— this PR deletes an unrelated blank line, so a shared runner file shows a whitespace-only hunk.NintendoSwitch/Inference/NintendoSwitch_HomeTileReader.cpp:162—const std::vector<HomeTileCase> HOME_TILE_CASESis a namespace-scope global with a destructor. A plain array,const HomeTileCase HOME_TILE_CASES[], as the AutoStory test tables use, avoids that.
…merged, review fixes Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss
dayfine
added a commit
that referenced
this pull request
Nov 14, 2026
dayfine
added a commit
that referenced
this pull request
Nov 14, 2026
dayfine
added a commit
that referenced
this pull request
Nov 14, 2026
This was referenced Nov 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Depends on #332
Base
autostory/engine(#332); the diff shows only this change.Each game gets from HOME to its overworld in its own way, and none of them is a story event of its own: tonight console B needed hand presses on HOME, and a PLZA run failed in 20 s because the game was not open (the shared preflight only refuses HOME). This adds one shared launch step to the engine,
launch_story_game(backend, policy, request)inEngine/Pokemon_StoryLaunch.h: a per-gameStoryLaunchPolicysays how its screens look, and one driver looks, does one thing, counts each screen's presses, and ends only on an overworld that holds for 3 looks. It confirms the game's HOME tile before any A, never presses on a new-game screen, and fails aslaunch_failed(no reload, no recovery) on a missing tile, a screen that ignores its press, or no overworld aftermax_looks. No game uses it yet; adoption is one PR per game. A prompt can move the cursor first (before: the update prompt's Up, Up), and a prompt or the title can be read only after the launch closed or launched the game (after_launch,title_after_launch) when its check would also match the game in play. Tested withPokemon::StoryLaunch(16 cases on the scripted fake backend: closed on HOME, open on title, overworld kept and restarted, backup save, license check back to HOME, tile search, missing tile, stuck title, new game, black screen timeout, update prompt, loose title in front).On a Switch,
switch_home_tile_named(language, name)is the tile check:NintendoSwitch_HomeTileReaderfinds HOME's cyan frame on the game row and OCRs the game name above it, so a launch after the HOME order changed no longer presses A on whatever tile is first (console B, 2026-11-14: FireRed opened instead of PLZA). Tested withNintendoSwitch::HomeTileReaderon six console B frames (CommandLineTests eae469773: FireRed and Z-A on the first tile, Z-A on the second, the user select over HOME with no tile).What the three games do today:
plza/story-engine, #471)frlg/stage20-league)bdsp/story-engine)game.reload:go_home+reset_game_from_home(..., backup)load_save: in-gamesoft_reset(A+B+Select+Start); RNG:rng_reset_and_return_homeload_save:reset_game_from_home(...), assumes HOMEfrom_home_close_and_reopen_gamereopens the selected tileCheckOnlinepopup, black screenLoadMenu, A on Continuenext_start_load_action: latest, then backup when the start check fails; title Up, B+X; backup arrow → ABlueDialog→ BHow each game's policy would fill in:
tile_selectedtitle/title_pressbackup_savenew_gamepromptsCheckOnline(A), load menu Continue (A), recap (B, more presses)overworldPLAYER_CAN_MOVEfrom its backendPLAYER_CAN_MOVEPLAYER_CAN_MOVE(HOME is read first, so HOME's plain screen no longer passes)PLZA's latest-then-backup choice (
next_start_load_action) stays in PLZA and calls the launch once per save. The Switch prompts (close software, user select, update) are the same in every game, so this PR also carries their one shared helper,Pokemon::switch_launch_prompts(console)inPokemon_StorySwitchPrompts.h, moved unchanged from #335; each game's policy starts itspromptswith it. HOME is read before the prompts, and that stays safe for the user select:HomeMenuDetectordoes not fire on the user select over HOME (UserSelectOverHome.png: the dimmed top bar differs from the dialog's white bottom row by about 159, the limit is 20). Recommended adoption order: PLZA first (its run failed tonight and it already reloads from HOME, so the swap is direct), then BDSP (same reset-from-HOME shape, and it removes the intro's HOME refusal), then FRLG (its reload is an in-game soft reset and the license check needs the most screens; its RNG hard reset stays as is).🤖 Generated with Claude Code
https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss