Skip to content

FRLG AutoStory: run Gift RNG for the Magikarp after 00.12 - #192

Closed
dayfine wants to merge 29 commits into
frlg/autostory-route3from
frlg/autostory-gift-rng
Closed

dayfine wants to merge 29 commits into
frlg/autostory-route3from
frlg/autostory-gift-rng

Conversation

@dayfine

@dayfine dayfine commented Nov 3, 2026 •

Copy link
Copy Markdown
Owner

Depends on #191 and #189 (base frlg/autostory-route3, with frlg/gift-rng-callable-steps merged in, so the diff also shows #189's GiftRng* files; this change alone is commits 6701329, 72430b5, 5c37581 and ed05b85).

AutoStory can now buy the Magikarp from Route 4's salesman with Gift RNG in the program, the way it already runs Starter RNG, and save a shiny one.

  • New GIFT_RNG handoff on 00.12 (saved facing the salesman) and a Run Gift RNG in AutoStory option, off by default, so runs without it are unchanged.
  • The attempts are planned from the RNG plan's TID and SID just before 00.12 saves, so a planning failure keeps 00.11's save. Magikarp's English timings equal Starter RNG's (title, Continue Screen, 7,500 ms in game), so the plan reuses plan_starter_rng(); other languages are refused.
  • ConsoleGiftRngSteps runs GiftRngAttempts as the RNG plan loop's steps, mapping its outcomes onto the loop's.
  • New live-start row 00.12b leaves the summary (or HOME, after the Gift RNG program) and saves the shiny where 00.12 ended; the way back in after a by-hand Gift RNG run too.
  • Starting at 00.12b with the option on loads the save beside the salesman (checked as Route 4), runs the attempts there and goes on with 00.12b for a shiny, so a failed attempt or a hand-made save at 00.12's end can be retried without replaying 00.12. With the option off, 00.12b runs as before.
  • program() now runs its plan as a loop of handoffs, so a run with both Starter RNG and Gift RNG on goes from one to the other.
  • Gift RNG starts from the console's seed and CSF calibration and its own in-game offset (GIFT_INGAME, 0 until saved, not Starter RNG's), and saves each reset's calibration back, as Starter RNG does.

Testing

  • Syntax-checked every changed file with the build's flags (-Wall -Wextra -Werror); code health 0 failures against frlg/autostory-route3.

  • New and updated unit tests in the AutoStory and AutoStoryRngLoop suites: run plans with the Gift RNG handoff, rows after a shiny Squirtle (now on to Gift RNG's stop) and after a shiny Magikarp, the 00.12/00.12b rows, Gift RNG's messages and its outcomes in the RNG plan, and run plans started at 00.12b with and without Gift RNG. Not run locally; CI dispatched.

  • Not run on a console yet.

  • Gift RNG's resets get the same one-line overlay entry as Starter RNG's (Gift RNG try 28/50: seed 9cf3 = target, advance 1669 (target 1670, -1). Missed.); Gift RNG's attempts report their reads through on_read.

🤖 Generated with Claude Code

https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E

dayfine and others added 12 commits November 2, 2026 19:28
Move GiftRng::program's reset, calibrate and attempt loop into a
GiftRngAttempts class whose run() returns the outcome, so another
program (AutoStory) can run Gift RNG with its own options and displays.
GiftRng::program builds it from its options and keeps its behaviour.
The per-target base stats move into gift_rng_species(), tested along
with the shiny outcome.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
…to frlg/autostory-gift-rng

# Conflicts:
#	SerialPrograms/Source/VideoGames/PokemonFRLG/PokemonFRLG_Tests.cpp
Adds a GIFT_RNG handoff at 00.12, which saves facing Route 4's Magikarp
salesman, and a Run Gift RNG in AutoStory option (off by default). With it
on, AutoStory plans the attempts from the RNG plan's TID and SID before
00.12 saves, runs Gift RNG's attempts through the RNG plan loop, and on a
shiny runs the new live-start row 00.12b, which leaves the summary and
saves. The program now runs its plan as a loop of handoffs, so a run with
both Starter RNG and Gift RNG on goes from one to the other.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
…from the salesman save

A save beside the Magikarp salesman (00.12's end, or a failed Gift RNG run)
had no way back into the in-program handoff short of replaying 00.12. Now a
run started at 00.12b with Run Gift RNG in AutoStory on loads that save,
checks it is in Route 4, runs Gift RNG's attempts and, for a shiny, goes on
with 00.12b. With the option off, 00.12b stays the way back in after a
by-hand Gift RNG run.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
…op-construct

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
row_index() only compares and reports the id, and the Gift RNG case now
loops over its two ids as string_views rather than raw char pointers.

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.cpp
#	SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRngLoop.cpp
#	SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRngLoop_Tests.cpp
Gift RNG in AutoStory starts from the console's seed and CSF offsets in the
RNG plan's calibration, which Starter RNG may already have learned, and
its own in-game advances offset (GIFT_INGAME, 0 until saved): the
salesman's in-game offset isn't Starter RNG's. Each reset's calibration is
saved back as Starter RNG's is.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
dayfine and others added 5 commits November 2, 2026 21:09
Gift RNG's attempts report each reset's reads (on_read) as Starter RNG's
do, and AutoStory puts them on the overlay log as one line, as "Gift RNG
try 28/50: seed 9cf3 = target, advance 1669 (target 1670, -1). Missed."

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_AutoStoryTable.cpp
dayfine and others added 11 commits November 2, 2026 21:38
…nto frlg/autostory-gift-rng

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
…RUN in a dark cave) into frlg/autostory-gift-rng
…mpts out of step) into frlg/autostory-gift-rng
…g/autostory-gift-rng

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
…name) into frlg/autostory-gift-rng

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

dayfine commented Nov 3, 2026

Copy link
Copy Markdown
Owner Author

Superseded by #215 (FRLG stack consolidated into stage PRs; will be resplit for upstream).

@dayfine dayfine closed this Nov 3, 2026
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