Repository navigation
FRLG AutoStory: the table on the shared story steps, simulated end to end - #123
Merged
Merged
Conversation
A story checkpoint as a list of StorySteps (route, legs, step onto a trigger, talk, YES/NO, scene, battle, train, heal, shop, save, ready for a boss, and a game-only step), plain data, built into engine events by build_story_checkpoint(). Each event asks the game's StoryStepExecutor to do its step: one virtual per kind, failing as unsupported unless the game overrides it. Poses are the game's (TilePose); skip_if names conditions the executor answers. Tests run tables against a fake executor: event order, skip_if, pose propagation, failure naming, unsupported kinds, a segment with a reload, and lint. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
…426f74) into frlg/story-steps Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
The table's StoryStep, StoryStepKind and StoryLeg are now the shared ones (Pokemon/Navigation/Pokemon_StorySteps.h). FRLG's checkpoint adds its supplies and START menu to the shared StoryCheckpoint, and StoryExecutor does each kind on the console with the code run_step() had. The shop's items are in the table and mapped to Viridian Mart rows. Behaviour is unchanged; the route and chain tests read the table's poses back as one-tile StoryPoses, and a new test lints every checkpoint. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
SegmentPolicy is now where retries are set: attempts per checkpoint (default 3), stop at the first failure (no reload; the game stays where it failed), and in-place recoveries per event (SegmentHooks::recover, then the event again) before a checkpoint is reloaded, default 0. run_segment reports each checkpoint's attempts and recoveries and logs "[Checkpoint] 00.07: passed on attempt 2 (1 reset)" and "[Segment] 00: 2 of 3 checkpoints one-shot", so the one-shot rate can be tracked. StoryRunOptions is the program-option group both AutoStory programs embed: "Attempts per checkpoint" and "Stop at the first failure". A story step's skip_if condition is a run flag unless the game overrides holds(). Tests: the policy against the fake executor (attempts then fail, stop at first failure, recover in place, one-shot report). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
ATTEMPTS_PER_CHECKPOINT (default 2) is replaced by the shared StoryRunOptions group: attempts per checkpoint (default 3) and stop at the first failure, read into the segment's policy. The executor's own holds() goes: the table skips nothing, and the shared default reads run flags. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
build_story_checkpoint() calls StoryStepExecutor::begin_attempt() before building, once per attempt, so a game can start the attempt afresh (BDSP: the trainers who can see us again; the row's failure mode). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E # Conflicts: # SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStory_Tests.cpp
Test_AutoStorySimulation builds story_checkpoints() into a segment with the shared builder, saving at each end as the program does, and runs it with the shared runner and retry policy against a fake game that plans each route and fixed walk on the story maps (turning to a wall when the facing is unknown), steps onto triggers and passes the rest. It checks: new game to Brock in order, each checkpoint starting where the save before it stood; a start/end range; a failed walk in 00.07 reloading its save and passing on attempt 2; Brock lost every time stopping after 3 attempts. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
…bought) into frlg/story-steps Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
… the row bought viridian_mart_orders() turns the table's items into Mart rows (shop() uses it). The simulation's Mart keeps its cursor on the row just bought, moves it from there for each order, and fails on CANCEL or a wrong item; the whole-story test checks 00.07 buys 5 Potions, 3 Antidotes, 1 Parlyz Heal. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
…r Fast) StoryChecks: THOROUGH steps read the screen to confirm what they did (purchases, the Bag, status after battles, position); FAST trusts counts and timings. Each game decides what its steps check at each level. The executor carries it (checks(), set_checks(); THOROUGH by default), and StoryRunOptions gains a "Checks" dropdown, Thorough by default, read with checks(). Tests: the level reaches a step; the option group's defaults. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
Nothing reads it yet; #120's Mart and Bag checks will. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
… into frlg/story-steps #120's own StoryChecks enum and CHECKS/ATTEMPTS_PER_CHECKPOINT options meet the shared ones: StoryChecks is now an alias of Pokemon::StoryChecks, and the program shows only the shared StoryRunOptions group, whose Checks value goes to StoryEnv::checks and the executor. shop() keeps the table's items (viridian_mart_orders(), now with the reader's slug per row) and #120's read of the Items pocket after buying. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
…eed it StoryRunOptions gains "Game language" (any language the games have, English by default, never refused for lacking a reader), and the executor carries it (language(), set_language()) for the few reads that need text: item names in a shop or the Bag. The header states the rule: steps never match dialogue or menu text, and a game with no reader for the language falls back to language-free checks. Tests: the option's choices and the executor's language. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
… in Japanese The executor takes StoryRunOptions' language. No FRLG story step reads dialogue or menu text; the only text reads are #120's item names (read_item_list_name()), still English. The simulation runs its executor in Japanese, which no reader supports. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
Owner
Author
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 #120.
Folded into #120, which now holds the FRLG table on the shared story steps and the simulation tests; this branch is the same commit as #120, so the PR has no changes left and can be closed.
🤖 Generated with Claude Code
https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E