Repository navigation
Conversation
Starter RNG's reset, calibrate and attempt loop moves out of StarterRng::program() into StarterRngAttempts, which takes the target, settings, displays, notifications and stats from its caller and returns a StarterRngOutcome (shiny, target hit with the target's PID/nature/IVs, wild shiny, out of resets, no matches). StarterRng runs it with its own options and fires the same "no matches" error itself. SID Helper's naming-screen steps (set_sid_from_name_screen, finish_intro_animations) and its delay computation (sid_timing) move to PokemonFRLG_SidSteps. No behaviour change: same presses, waits, logs, stats and notifications. Long functions are split to stay under the code-health limits; the per-starter tables and the SID timing get unit tests. 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
Called after each reset with the resets so far and the calibration that reset was timed with, for a caller that logs the attempts (AutoStory, #184). StarterRng passes none, so it runs as before. Moved here from #184, which uses it, so that each PR owns its files. 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
A shiny after a reset ended the attempts as "shiny" without knowing whether it was the target or another advance; AutoStory (#184) needs to know before it uses the shiny to narrow the SID. With the new identify_shiny setting, StarterRngAttempts reads the shiny's summary and searches near the target as an attempt's first stage does, and ends as shiny_on_target (the target is among the states its stats match, with the target's PID, nature and IVs), shiny_off_target, or shiny when none match. StarterRng leaves it off and stops on the shiny as before. identify_shiny() is unit-tested in PokemonFRLG::RngSteps. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
dayfine
added a commit
that referenced
this pull request
Nov 3, 2026
…move on Starter RNG's attempts now tell whether a shiny was the target (identify_shiny, #183). Only a shiny on the target narrows the SIDs; one off it, or not known to be on it, ends the loop as SHINY_OFF_TARGET with no SID confirmed and no "RngPlan: confirmed" line. Its result line says outcome=shiny_off_target next=stop. Either shiny goes on with the story. The result line names a try that ran past its deadline attempt_deadline, apart from out_of_resets, no_matches and wild_shiny; all still count as a miss. An attempt missed more often than the retries allow moves on to the next one still shiny for a SID left (#182), and the run stops only when none is left (MISSED_EVERY_ATTEMPT_LEFT). A shiny for none of the SIDs left no longer says "one of" an empty list. 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
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
on_read hands a caller each reset's search hits and the state the calibration took as hit (reset_hit()), or the shiny's hits, so AutoStory can log one line per reset. 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
…callable-steps 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
…r RUN in a dark cave) into frlg/rng-callable-steps
…never showed) into frlg/rng-callable-steps
…rng-callable-steps
…mpts out of step) into frlg/rng-callable-steps
…rlg/rng-callable-steps
…lg/rng-callable-steps
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
…rlg/rng-callable-steps Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
…t name) into frlg/rng-callable-steps Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
Owner
Author
|
Superseded by #214 (FRLG stack consolidated into stage PRs; will be resplit for upstream). |
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 #182 (base
frlg/autostory-rng-plan; the diff shows only this change).AutoStory needs to run Starter RNG's attempt loop and SID Helper's naming-screen steps, but both lived inside their programs with the programs' own options. This prep refactor, with no behaviour change, moves the loop into
StarterRngAttempts(target, settings, displays, notifications and stats come from the caller;run()returns shiny / target hit with the target's PID, nature and IVs / wild shiny / out of resets / no matches) and movesset_sid_from_name_screen,finish_intro_animationsand the delay computation (sid_timing) intoPokemonFRLG_SidSteps. StarterRng and SidHelper now call these with the same presses, waits, logs, stats and notifications; StarterRng still fires the "no matches" error itself. Two additions for AutoStory are off for StarterRng, so it runs as before: anon_resethook called after each reset, andidentify_shiny, which reads a shiny starter's summary and searches near the target. With it on, a shiny comes back asshiny_on_targetorshiny_off_target.The bodies are moved unchanged except where long functions were split to pass code health (about 40% of changed lines show as moved):
git diff --color-moved=dimmed-zebra --color-moved-ws=allow-indentation-change frlg/autostory-rng-plan...frlg/rng-callable-steps.Tested by compiling the touched files locally with
-Wmissing-designated-field-initializersand code health (0 failures); newPokemonFRLG::RngStepsunit tests cover the SID timing per language, the per-starter tables andidentify_shiny(). All pass in a test runner linked against a local full build. Not run on a Switch.on_read(off for StarterRng): after each reset's reads, the attempts hand the caller the search hits and the state the calibration took as hit (reset_hit(), tested inPokemonFRLG::RngSteps), for AutoStory's one line per reset.🤖 Generated with Claude Code
https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E