Skip to content

AutoStory: breakpoints, pause before each step and leg - #448

Merged
dayfine merged 14 commits into
nav/sharedfrom
autostory/story-breakpoints
Nov 14, 2026
Merged

dayfine merged 14 commits into
nav/sharedfrom
autostory/story-breakpoints

Conversation

@dayfine

@dayfine dayfine commented Nov 13, 2026 •

Copy link
Copy Markdown
Owner

Depends on #332 (base autostory/engine; the diff shows only this change).

AutoStory can pause before each step, or before each leg of a walk too, so a person can look at the console and then continue (a debugger's breakpoints).

  • StoryGame::breakpoints and pause_point(label) hook; the engine calls it before each step with 12.03/5 pallet_shore, the shared walk action before each leg with ... leg 2/5 east 4 -> (10, 10). Default: off, no hook, no-op.
  • StoryRunOptions::BREAKPOINTS (off / steps / legs), so every game that uses the shared options gets it. The program sets game.breakpoints and game.pause_point = make_story_pause_hook(scope).
  • Logs [Break] <label>: paused and : continued. A normal build installs no wait (set_story_pause_wait()), so a pause never blocks; a lab build installs one that waits and ends with the scope.
  • BDSP and FRLG route runners have their own leg loops (not in this branch); they call StoryActionCall::pause.before_leg(...) the same way in follow-ups.

Testing: SerialProgramsTests --filter Pokemon::StoryEngine (70 passed): hook before each step and leg in order with labels, off and no-hook never pause, the installed wait gets label and scope. Code health 0 failures.

Update 2026-11-13 (b0f28bc, 21b8a73): merged the current autostory/engine; StoryPausePoints::step_label() moved here from FRLG's 0ac33f9, where a game PR had added it.

# Conflicts:
#	SerialPrograms/Source/Pokemon/AutoStory/Engine/Pokemon_StoryEngineRuns_Tests.cpp
dayfine and others added 7 commits November 13, 2026 14:56
Moved from the FRLG stack, where 0ac33f9 added it inside a game PR (FRLG
names its route screenshots by the step under way).

(cherry picked from commit 0ac33f9, Pokemon_StoryBreakpoints.h only)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss
TEXT_BOX -> DIALOG_BOX, BATTLE -> BATTLE_STARTED, CAN_MOVE ->
PLAYER_CAN_MOVE, STILL -> SCREEN_STILL; Pokemon:: screen event names
are now in PokemonAutomation (CommonTools/ScreenEvents).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss

@dayfine dayfine left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: mergeable on the fork
Reviewed SHA: fda56d1

Verdict

APPROVED

Correctness pass on git diff origin/autostory/engine...origin/autostory/story-breakpoints, then a style pass. CI green (Fork Draft CI, code health). No existing comments. No blocking findings.

Should-fix

  1. Engine/Pokemon_StoryEngine.cpp:42, :52 — RunnerExecutor builds its own step pause (m_pause, m_checkpoint, a name search for the index) next to the wrapper this PR adds in Pokemon_StoryStepExecutor.cpp:112. The engine already passes RunnerExecutor to build_story_checkpoint(), so set_pause_points(&pause) in its constructor would give the same pauses with the index the builder already has. As it is, there are two label derivations, and the engine one prints "/N+1" with an empty checkpoint id if begin_attempt() was not called first.
  2. Engine/Pokemon_StoryActionRegistry.h:63, :82 — mutable StoryPausePoints m_pause with a const accessor that returns a non-const reference puts per-run state inside the game's action registry (the comment says so). The engine can own the StoryPausePoints and hand it to the registry's dispatch(); then the mutable goes away.
  3. Options/Pokemon_StoryRunOptions.cpp:123 — BREAKPOINTS is a user-visible dropdown, but nothing on this branch reads breakpoints() into StoryGame, and only a lab build installs a wait. In a release build it never does anything. Either wire it in the game PRs before they leave the fork, or hide it outside developer mode.

Nits

  1. Types/Pokemon_StoryBreakpoints.h:46 — const std::optional<TilePos>&: take std::optional<TilePos> by value, per our C++ style rule (TotW #163).
  2. Types/Pokemon_StoryBreakpoints.h:65, :68 — before_leg() and pause() only read the label, so they should take std::string_view by value. before_step() stores it, so it should take std::string by value and move it.

dayfine and others added 2 commits November 14, 2026 13:56
…merged, review fixes

Conflict: the engine-runs test table takes the engine's case shape (name outside the input); the breakpoint rows are written in it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss
@dayfine
dayfine changed the base branch from autostory/engine to nav/shared November 14, 2026 22:06
@dayfine
dayfine merged commit b4a3c81 into nav/shared Nov 14, 2026
16 checks passed
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