Skip to content

BDSP AutoStory: stop for Starter RNG at the Verity Lakefront - #437

Open
dayfine wants to merge 7 commits into
bdsp/autostory-v4from
bdsp/autostory-starter-rng-handoff
Open

dayfine wants to merge 7 commits into
bdsp/autostory-v4from
bdsp/autostory-starter-rng-handoff

Conversation

@dayfine

@dayfine dayfine commented Nov 12, 2026

Copy link
Copy Markdown
Owner

Base: bdsp/autostory-v4 (#128)

Adds a Stop for Starter RNG option (STOP_FOR_STARTER_RNG, off by default) to BDSP AutoStory so a playthrough can hand off to the standalone BDSP Starter RNG program (PokemonAutomation/Arduino-Source#1366) at the Verity Lakefront without coupling AutoStory to unmerged RNG code.

Why 00.01 -> 00.02 (Verity Lakefront)

  • 00.01 (Twinleaf -> Lakefront) ends at VerityLakefront (17, 14) facing north (1 tile south of the warp into Lake Verity), and 00.02 (Lake Verity) saves at its start (saves_in = true).
  • Upstream PR PokemonAutomation/Arduino-Source#1366 supports StartPoint::LAKEFRONT ("Saved outside the entrance to Lake Verity"), where StarterRng loads the save, calibrates player blinks at the Lakefront, walks up into Lake Verity, and manipulates the briefcase starter.
  • Unlike FRLG (where checkpoints save at their end), BDSP AutoStory checkpoints save at their start. When STOP_FOR_STARTER_RNG is enabled on a run covering 00.01, plan_story_run() truncates the run after 00.01, appends save_for_starter_rng (StoryStepKind::SAVE) at VerityLakefront (17, 14) facing north so 00.02's start save is on disk, and stops with instructions to run Starter RNG (Start point: Verity Lakefront) and resume AutoStory from 00.03 (Lake -> Sandgem -> Mom).

Changes

  • PokemonBDSP_AutoStory_StoryTable.{h,cpp}:
    • Added STARTER_RNG_HANDOFF_ROW = "00.01", StoryHandoff, StoryHandoffs, StoryRunPlan, and plan_story_run().
  • PokemonBDSP_AutoStory.{h,cpp}:
    • Added STOP_FOR_STARTER_RNG (BooleanCheckBoxOption, default false) and wired plan_story_run() into AutoStory::program().
  • PokemonBDSP_AutoStory_StoryTable_Tests.cpp & PokemonBDSP_AutoStory_StorySimulation_Tests.cpp:
    • Added unit and simulation tests verifying the 00.01 Lakefront handoff, appended save step, and no-op behavior when disabled or starting past 00.01.

Tests

  • PokemonBDSP::AutoStory - Story table: rows lint, variants known
  • PokemonBDSP::AutoStory - Story table: each row starts where the last one ends
  • PokemonBDSP::AutoStory - Starter RNG handoff: stops after 00.01 saved at the Verity Lakefront
  • PokemonBDSP::AutoStory - Simulation: start and end checkpoints

Adds a "Stop for Starter RNG" option (off by default) to BDSPAutoStory. When on, plan_story_run() stops after 00.01 saves at the Verity Lakefront (17, 14) facing north, where 00.02 and Starter RNG (PokemonAutomation#1366, Start point: Verity Lakefront) start. With it off, the table and run are unchanged.

@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.

Reviewed SHA: db63d7e

Verdict

APPROVED (LGTM_with_nits)

Base is bdsp/autostory-v4; independent of #438. Reviewed this PR's own diff (6 files, +174/-6).

Off by default leaves the story unchanged: confirmed. plan_story_run() with starter_rng = false copies rows first..last unchanged and stop = NONE. saved_before_the_run(plan.rows, 0, start) is the same as the old (checkpoints, first, start), and rows_that_stop, make_story_segment and start_story see the same rows. Rows are copied into plan, which outlives run_segment, so the &row captures in make_story_segment stay valid. The table test checks that the full table comes back with no stop. Programs boundary is clean: no Qt, std::thread, mutex or std::filesystem.

Findings

  1. (medium) The handoff save (save_for_starter_rng) has an empty action, so StoryExecutor::save takes the unchecked save_game() branch. Every other start save passes saves_in and checks the save card's place, and a mismatch is fatal. This is the one save the Starter RNG run will reload from, so it should be checked too. Give it action = "Verity Lakefront", which is 00.02's saves_in.
  2. (low) With the option on and Verify mode starting at 00.01, verify_story_checkpoint runs the extra save and overwrites the Lakefront save. Either reject the combination with a UserSetupError or skip the handoff in verify mode.
  3. (low) The handoff text is written twice: in the option label and in the handoff string in program(). Keep one constexpr string. The text also says to "let Rowan's scene finish out of the lake", but the standalone Starter RNG in #438 leaves the game on the Summary page by default. Say what state the user must restore before saving. The text claims a Start point: Verity Lakefront option that only exists once #438 lands, so the PR is unusable on its own.
  4. (nit) StoryRunPlan copies every row's step vector. Copying rows is fine here, but a comment saying why would stop a later "optimisation" to pointers.
  5. (nit, Code Health, advisory on fork PRs) 1 failure: StoryTable.h:68 has an undocumented namespace-scope header symbol. header_symbols=7 is advisory. Tests build their messages with +; use std::format.

Style (AGENTS.md control-flow rules, designated initialisers with defaults, std::string_view constants) is fine in the new code.

@dayfine

dayfine commented Nov 13, 2026

Copy link
Copy Markdown
Owner Author

Review fixes pushed (tip d141c1a): handoff save is named for the Verity Lakefront so the save-card check matches; handoff text deduplicated into one constant; tests check the card action.

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