Repository navigation
Conversation
…_name) Co-Authored-By: Claude Opus 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
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.
…ment, README counts Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss
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.
The README's prepare_parity.py command had no --publisher-revision, and the script's default pin was older than the workflow's, so following the README on the pinned checkout failed. The default now matches the workflow pin. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss
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.
…rter-rng-callable
…ostory-starter-rng-handoff
…-rng-callable' into bdsp/autostory-starter-rng
dayfine
left a comment
There was a problem hiding this comment.
Reviewed SHA: 651fbca
Verdict
APPROVED (LGTM_with_nits)
Base is bdsp/autostory-v4; independent of #437. The branch is three commits: the port (03bc3d446), the callable loop (874c46143) and a base merge. I compared against upstream PokemonAutomation#1366 head 464ea9ba4 (draft, read-only fetch).
Port faithfulness
- Byte-identical to upstream after CRLF normalisation: RngAim, RngCalibration, RngExecution, RngTargets, TargetSelection, SummaryNavigation, RngFilter.h.
- Reformatted only: RngFilter.cpp, where one-line
if (...) returnis braced per AGENTS.md. - Adapted: StarterRng.cpp gets
PanelQualityStanding::OFFICIAL_BETAin the descriptor, theDescriptoralias, and theBlinkScenes.hinclude, to fit the merged APIs. The upstreamRECOVERY_TIMEOUT_SECONDSandshared_ptreye templates are dropped, andAdvanceClockmoved to the existing header. - The port is of an earlier snapshot, not
464ea9ba4. Upstream has since added the bedroom fast-skip path, blink-UI polling tweaks and the recovery timeout. Say in the description which upstream commit the port tracks. OFFICIAL_BETAis a promotion upstream has not made for a still-draft program. Use the same standing as the other BDSP RNG panels, or name it in the description.
Refactor behaviour (original run_attempt + program loop vs run_starter_rng_attempt(s)). Preserved for the standalone path (reset_first=false, finish_battle_on_shiny=false, close_summary_after_read=false):
- Outcomes, stats increments (shiny does not count as a hit; the "passes the filter anyway" case counts a miss then Hit), the reset/
go_homesequence, and "Unverifiable continues the loop" are the same. - The reset-limit exit is the same, with a new
OUT_OF_RESETSresult. - Behaviour that differs:
FILTERS.make_snapshot()is now taken once per run, not once per attempt and once per bedroom skip. The table isUNLOCK_WHILE_RUNNING, so edits made while running used to apply to the next attempt and now do not. Keep per-attempt snapshots, or lock the table while running. - Behaviour that differs: the
wantedpredicate has three fallbacks (settings.wanted, thenfilters, then "any shiny"). The last is a silent default that matches nothing the caller configured. Require one of the first two.
Findings
- (medium)
run_starter_rng_attemptis 372 lines (limit 50; the original was already long). It is the refactor's seam, so it should be split at the points the code already marks: bedroom skip, lake blink recovery, target selection, execute, verify. Code Health reports it as a blocking failure. - (medium) The tests only cover the pure
resolve_starter_rng_step. Nothing exercises the loop (reset limit, abandoned attempt, hit mid-run). A fake attempt callable would make this testable; as written, "behaviour-preserving" is argued, not tested. - (medium)
close_starter_summaryis new, has no test, and the PR says nothing about trying it on the console. It presses B up to 6 times, waiting forMenuWatcherafter each press, so a Party screen could be mistaken for the X menu. It then presses X and does not confirm the overworld. #439 depends on this ending on the Lakefront overworld. Its doc comment says "B, B, X" in one place and 3rd page, party, X menu in another. - (low) The PR description names
StarterRngAttemptSpec,StarterRngAttemptOutcome,StarterRngAttemptResult,StarterRngAttemptCallbacksandresolve_starter_rng_attempt_outcome(). The code hasStarterRngSettings,StarterRngAttemptIO,StarterRngRunResult,BdspStarterAttemptResultandresolve_starter_rng_step(). Update the description. - (low)
StarterRngAttemptIOhas fivestd::functioncallbacks (on_reset,on_miss,on_hit,on_shiny,on_error). Onlyon_resetis used by the caller in #439. Remove the others until needed. Raw nullable pointers plus the three fallback displays built per attempt would be simpler as references. - (low) Two result structs (
BdspStarterAttemptResult,StarterRngRunResult) and two outcome enums with near-identical names. TheStarterRngSettingsdoc comment describes AutoStory behaviour inside a header the standalone program owns. - (Code Health, advisory on fork PRs, 167 findings) Mostly the ported files: missing
// namespace Xclosers and undocumented header symbols. Upstream's style differs, so decide whether to fix them here or leave the port verbatim and say so.
No Qt, std::thread, mutex or std::filesystem in the new code. Tests are registered in PokemonBDSP_Tests.cpp and the new files are in SourceFiles.cmake.
…ity Lakefront card
…doff text; no handoff in verify mode
…tandalone uses it
…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
|
Review fixes pushed (tip b0bb884): Starter RNG default filter row (shiny, any nature) moved into set_default_shiny_row and tested, so an empty table cannot loop forever; PR description names fixed. |
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
Moved unchanged from bdsp/autostory-starter-rng (7a46b79), so that BDSP and FRLG both build on it from the shared base. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss
FRLG's loop also ends where the user takes over (target hit but not shiny, attempts spent); that is a stop with a message, not an error. A shiny is a continuation whose rows the game builds, so the seam carries no rows. 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
Folded leaf PR #445; tree equals the leaf tip. 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
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
…ay and notification text 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
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
Base:
bdsp/autostory-v4(#128)Ports the BDSP Starter RNG program from upstream PR
PokemonAutomation/Arduino-Source#1366by@theastrogoth(the port tracks an earlier snapshot than that PR's current head464ea9ba4: no bedroom fast-skip, blink-UI polling tweaks or recovery timeout yet) and extracts its reset/attempt loop into a helper that both the standaloneStarterRngandBDSPAutoStorycan call.Changes
03bc3d446):PokemonBDSP/Options/PokemonBDSP_RngFilter.{h,cpp}andPokemonBDSP/Programs/RngManipulation/PokemonBDSP_{RngAim,RngCalibration,RngExecution,RngTargets,RngTimeline,StarterNavigation,StarterRng,SummaryNavigation,TargetSelection}.{h,cpp}, on top of the mergedPokemon_BdspRng,PokemonBDSP_AdvanceClock,PokemonBDSP_BlinkScenesandPokemonBDSP_BlinkRecovery.StarterRng_Descriptorregistered inPokemonBDSP_Panels.cpp.874c46143):PokemonBDSP_StarterRngAttempts.{h,cpp}:StarterRngSettings(what the caller wants),StarterRngAttemptIO(displays, notifications, stats, callbacks),StarterRngRunResultandStarterRngOutcome(the loop's result),BdspStarterAttemptResult(one attempt),resolve_starter_rng_step()andrun_starter_rng_attempts().close_starter_summary()inPokemonBDSP_SummaryNavigation.{h,cpp}: presses B (up to 6 times, waiting for the X menu after each) and then X, to leave the Summary page on the overworld.StarterRng::program()is now a thin wrapper aroundrun_starter_rng_attempts().set_default_shiny_row()(RngFilter) seeds the filter table with a shiny of any nature; the standalone program uses it, and a caller whose table is empty can seed the same row.Testing
PokemonBDSP::StarterRngsuites: per-starter tables and timings, bedroom skip buffer and landing math, aim offset and calibration bias, attempt loop outcome resolution, default filter row is shiny of any nature.close_starter_summary()and the loop have not been run on a console in this PR.