Skip to content

FRLG AutoStory: capture and PC storage steps - #193

Closed
dayfine wants to merge 16 commits into
frlg/autostory-gift-rngfrom
frlg/autostory-capture-pc
Closed

dayfine wants to merge 16 commits into
frlg/autostory-gift-rngfrom
frlg/autostory-capture-pc

Conversation

@dayfine

@dayfine dayfine commented Nov 3, 2026 •

Copy link
Copy Markdown
Owner

Depends on #192 (base frlg/autostory-gift-rng; the diff shows only this change).

Adds two story capabilities the table can name as GAME steps: a bounded capture of a named species, and a PC deposit or withdrawal at a Pokemon Center.

  • capture_step() (capture rattata catches=1 encounters=20 balls=5 pace=east [move=1 turns=2]): steps back and forth in the patch, runs from other or unread species, weakens only from green HP with the named move, throws balls until caught, and stops at its encounter or ball cap or an empty bag. A catch goes to the party, or to the PC when the party is full.
  • A shiny of any species stops the program where it is (no RUN, no ball, no reload) so a person decides; other failures reload the checkpoint as usual.
  • pc_step() (pc deposit slot=2 box=1, pc withdraw box=1 slot=7) follows pokefirered's storage system: refuses to deposit the last Pokemon or the last one that can fight and to withdraw into a full party, and never moves the cursor on the STORE/WITHDRAW menu, which holds RELEASE.
  • The decisions run on injected steps (CaptureActions, PcStorageActions); the console side reuses handle_encounter(), flee_battle(), WildEncounterReader, the bag reader and the box detectors. No table rows yet; the first uses (Route 4 Rattata, Magikarp deposit) come with their checkpoints.
  • Needs a capture for the wild Pokemon's HP bar (follow-up); until then nothing is weakened on the console.
  • PC screens (2026-11-02): PcScreenReader reads every PC screen from console B's captures of two deposits: the PC list, the storage menu and a Pokemon's menu with their cursor rows, the party panel's slot under the hand, the box chooser's box, "Continue BOX operations?", messages and the overworld. The step waits for each screen before its press, since a press sent before a menu is drawn went to the message behind it; an overworld frame is confirmed on a second one and waited out while the PC boots. Image tests in PokemonFRLG/PcScreenReader/ (PokemonFRLG: ItemListReader, PlayerFacingReader, OptionMenuReader and SaveCardReader test images CommandLineTests#2, a FileException in CI). PcPartyMember is renamed from PartyMember, which clashed with FRLG: AutoStory, FireRed from a new game to the Boulder Badge #120's.

Testing

  • New suites PokemonFRLG::AutoStoryCapture (decisions per encounter, variants, messages, capture and PC steps in the shared segment runner: reloads vs. the shiny stop) and PokemonFRLG::AutoStoryPcStorage (deposits, withdrawals and refusals on a fake PC that follows pokefirered, other screens, variants). The deposit path matches the inputs that worked by hand on console B.
  • Syntax-checked locally with the Windows-Clang warning set and code health is clean; tests run in fork CI (not locally: the lab app is open). Not run on the console.

🤖 Generated with Claude Code

https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E

A capture step catches a named species where the player stands: it runs
from other species, weakens the target only from green HP with a move the
table names, throws Poke Balls, and stops after its encounter or ball cap
or when the bag is out of balls. A catch goes to the party, or to the PC
when the party is full. A shiny stops the program without running and
without a reload.

A PC step deposits a party member or withdraws one from a box, as
pokefirered's storage system runs it. It refuses to deposit the last
Pokemon, or the last one that can fight, and to withdraw into a full
party, and never moves the cursor on the menu that holds RELEASE.

Both are GAME steps the table names by variant, with their decisions on
injected game steps, tested against fakes and in the shared segment
runner. The PC's menus have no screen readers yet, so on the console the
PC step fails instead of pressing blind.

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 22:03
…lg/autostory-capture-pc-detectors

# Conflicts:
#	SerialPrograms/cmake/SourceFiles.cmake
…mber

The two structs met in one translation unit (AutoStoryEvents.cpp) once
#120's summary read was merged in.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
The PC step stopped at the first PC screen: nothing read the PC list,
the storage menu, the party panel, a Pokemon's menu, the box chooser or
"Continue BOX operations?", nor the overworld. PcScreenReader tells them
apart from one frame, with each menu's cursor row, the party panel's slot
under the hand and the chooser's box, measured on console B's captures of
two deposits. The step reads each screen before its press: a press sent
before a menu was drawn went to the message behind it (DOWN, A opened
WITHDRAW). An overworld frame is confirmed on a second one, and the
overworld right after A at the PC is waited out while the PC boots.

PcScreen and PcView move to the reader. Image tests for every screen of
the two deposits.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
The hand is drawn above the Pokemon it points at; the PKMN DATA panel
shows MAGIKARP. Renamed in CommandLineTests to cursor 0.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
PcTransfer::if_missing = PcMissing::SKIP (variant suffix " if_present")
makes a DEPOSIT whose party slot is empty end as SKIPPED, without
touching the PC, instead of REFUSED. For story row 00.12c, which stores
the Magikarp from Gift RNG: with Gift RNG off there is no second slot.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
dayfine and others added 10 commits November 3, 2026 01:40
…r RUN in a dark cave) into frlg/autostory-capture-pc
…never showed) into frlg/autostory-capture-pc
…autostory-capture-pc

# Conflicts:
#	SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryEvents.cpp
…mpts out of step) into frlg/autostory-capture-pc
…lg/autostory-capture-pc

# Conflicts:
#	SerialPrograms/cmake/SourceFiles.cmake
…rlg/autostory-capture-pc

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

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
@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