Skip to content

BDSP AutoStory: Starter RNG on the story engine - #526

Draft
dayfine wants to merge 30 commits into
bdsp/seam5-adoptfrom
bdsp/starter-rng-adopt
Draft

dayfine wants to merge 30 commits into
bdsp/seam5-adoptfrom
bdsp/starter-rng-adopt

Conversation

@dayfine

@dayfine dayfine commented Nov 15, 2026 •

Copy link
Copy Markdown
Owner

Depends on #549 (base bdsp/seam5-adopt); folds in #438 (Starter RNG port) and #437 (Lakefront handoff), so the diff shows those plus the engine hook. #581, #603 and #605 stack on it.

Starter RNG (#438) and the option to run it at 00.02's starter pick (#439) were built on bdsp/autostory-v4, so they could not run on the story-engine stack. This merges bdsp/starter-rng-callable into bdsp/story-engine and ports the hook onto the engine: StoryEnv gets run_starter_rng, the starter_rng event takes StoryEnv, the program runs ConsoleStory over plan_story_run()'s rows, and the Stop for Starter RNG save puts its card map in the saves_in arg. Since the RNG branch sits on autostory-v4, the merge also brings that stack's view-shift walk check and the MenuDetector cursor-glow fix. The changed files compile (syntax-checked locally); the BDSP AutoStory and StarterRng suites run on Fork Draft CI.

dayfine and others added 27 commits November 12, 2026 14:57
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.
Port the remaining Starter RNG files from PokemonAutomation#1366 (by theastrogoth) onto the merged BDSP RNG infrastructure:
- BdspRngFilterRow / BdspRngFilterTable / BdspRngFilterSnapshot
- RngAim, RngCalibration, RngExecution, RngTargets, RngTimeline, TargetSelection
- StarterNavigation, SummaryNavigation, StarterRng

Adapt to the upstreamed BlinkRecovery, BlinkScenes, AdvanceClock, and SingleSwitchProgramDescriptor APIs, and register StarterRng in PokemonBDSP_Panels.
Extract the Starter RNG attempt and reset loop out of StarterRng::program() into PokemonBDSP_StarterRngAttempts (run_starter_rng_attempts / run_starter_rng_attempt / resolve_starter_rng_step), parameterized by StarterRngSettings and StarterRngAttemptIO and returning StarterRngRunResult. Add finish_battle_on_shiny and close_summary_after_read options (with close_starter_summary in SummaryNavigation) so AutoStory can continue directly from Lake Verity or Verity Lakefront, and add unit tests for per-starter tables, bedroom skip buffer/landing math, aim calibration, and attempt loop outcome transitions.
Adds "Run Starter RNG in AutoStory" (off by default), "Starter RNG Maximum Resets", and "Starter RNG Stop Conditions" to BDSPAutoStory. When enabled, plan_story_run() replaces 00.02's Lake Verity steps (after 00.02's Verity Lakefront start save) with the starter_rng game action, which runs run_starter_rng_attempts() from VerityLakefront (17, 14) through the Starly battle and Rowan's scene, closes the menu on VerityLakefront (17, 14..15), and continues into 00.03.
…-rng-callable' into bdsp/autostory-starter-rng
…n failure, unsettled shiny stops, program split
…and shiny settle, constants in StoryTable.cpp)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss
Pokemon_StoryRngHandoff.h holds what every game's RNG handoff shares: the
OFF/STOP/RUN mode, the result an RNG program's call ends in, and
run_rng_handoff(), which logs a success and throws on a failure so no row
retry reruns the reset loop. BDSP's Starter RNG hook now runs through it.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss
Folded leaf PR #439; tree equals the leaf tip.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss
…de; its stop reports through the shared report

StoryHandoffs held two bools whose combination the plan decoded;
it holds the mode of the options now, as FRLG's program derives it.
The stop's log line, overlay line and notification text come from
Pokemon::report_rng_handoff_stop.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss
Brings Starter RNG (#438) and Run Starter RNG in 00.02 (#439) onto the
story engine. The story-engine structure wins: StoryEnv (StoryCheckpoint.h)
gains run_starter_rng, the starter_rng event takes StoryEnv&, the program
runs ConsoleStory over plan_story_run()'s rows, and the Stop for Starter
RNG handoff save carries its card map in SAVES_IN_ARG. The old
StoryExecutor.h stays deleted.
Conflict in PokemonBDSP_AutoStory_Walk_Tests.cpp includes: drop the duplicate
Utils/Walk.h include, as #375 resolved it.
dayfine added a commit that referenced this pull request Nov 17, 2026
Conflicts, both sides kept: SimWorldKnobs gets both still_taps and centers;
the 00.01 still-taps failure case moves to the named FailureCase form.
@dayfine
dayfine changed the base branch from bdsp/story-engine to bdsp/seam5-adopt November 17, 2026 16:50
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