Skip to content

PokemonLZA AutoStory: catch plan, catch stop and the lock-on watch - #563

Draft
dayfine wants to merge 7 commits into
plza/upstream/p2-05from
plza/upstream/p3-01
Draft

dayfine wants to merge 7 commits into
plza/upstream/p2-05from
plza/upstream/p3-01

Conversation

@dayfine

@dayfine dayfine commented Nov 15, 2026 •

Copy link
Copy Markdown
Owner

Depends on #562

Adds the decisions of a Wild Zone 1 catch that need no console: which Pokemon to target and when to throw (CatchPlan, SpeciesCheck, the Zone 1 road positions), when a throw's result has been seen (CatchStop), and the lock-on watch. CatchStop needs the shared run_watched() and WatchLimits back in Pokemon_CoveredWatch.h: they were left out of #537 because nothing called them yet. The catches in #564 call all of it. Tested by PokemonLZA::AutoStoryCatchPlan and PokemonLZA::AutoStoryCatchStop, on recorded readings with no frames.

@dayfine

dayfine commented Nov 15, 2026

Copy link
Copy Markdown
Owner Author

API review (claude-sonnet-5-5) at 9ffeed3: LGTM_with_nits

No correctness bugs found. I traced the cycle, bracket watch, species tally, road stops and after-throw cases against the code and the tables agree with it. What remains is comment content: several comments cite lab runs and "the user", which the review guide says belong in the PR description, plus a few small readability nits.

  • [style] SerialPrograms/Source/VideoGames/PokemonLZA/Programs/AutoStory/Actions/PokemonLZA_AutoStoryBracketWatch.h:65 The BRACKET_SETTLE comment cites a lab run ("17:2x to 17:4x") and what "every look on the console saw". That is history of a test session, not a description of the code. Fix: Keep the reason (the Pokemon walks off while the watch waits, so lock on at the first brackets) and move the console timestamps to the PR description or commit message.
  • [style] SerialPrograms/Source/VideoGames/PokemonLZA/Programs/AutoStory/Actions/PokemonLZA_AutoStoryCatchPlan.h:64 Comments cite lab logs and a specific run ("03.08 stop 1", "A guess from the console's frames" on FAR_PLATE_Y). A later reader cannot resolve these references. Fix: State the observed behaviour directly (the capture can lag and the banner can be missed, so the plate is the fallback) and move the run references to the PR description. Do the same for the FAR_PLATE_Y comment.
  • [style] SerialPrograms/Source/VideoGames/PokemonLZA/Programs/AutoStory/Actions/PokemonLZA_AutoStoryCatchStop.h:52 The REGISTERED_BANNER_WATCH comment cites a run date ("03.08") and a 6.9 s anecdote. spot_visit() (line 37) cites "the user" as the source of a design choice. Fix: Keep the numbers that justify max_gap, tail and cap (banner shows about 2 s, hold 100 ms, frames up to 150 ms apart under load). Drop the run date and the "(the user)" attributions.
  • [style] SerialPrograms/Source/VideoGames/PokemonLZA/Programs/AutoStory/Actions/PokemonLZA_AutoStorySpeciesCheck.h:76 The party_has_species() comment quotes the user ("we are obviously done when we have 5 different icons in the party") and cites "208 frames ... the console". Both are conversation and session context, not documentation. Fix: Say why the party bar is authoritative (every throw targets an uncaught species, so each filled slot is a registered species, and the banner can be missed) and drop the quote and frame count.
  • [style] SerialPrograms/Source/VideoGames/PokemonLZA/Programs/AutoStory/Actions/PokemonLZA_AutoStoryZone1Road.h:38 ROAD_MIDDLE_STEP is an unverified guess ("NEEDS CONSOLE") and ROAD_STOP_SLACK (line 43) is never used. Neither is used anywhere in this PR, and road_stops_to_gate() does not use the slack. The file header also promises "where the checkpoint starts in the zone" and "03.08's walks", but nothing here provides the former. Fix: Add both constants in PokemonLZA AutoStory: catches in Wild Zone 1 and the objective marker walks #564, where they are used and can be tested. Otherwise drop them here and trim the file header to what the file contains.
  • [nit] SerialPrograms/Source/VideoGames/PokemonLZA/Programs/AutoStory/Actions/PokemonLZA_AutoStoryBracketWatch.h:93 A stray ';' at the start of the continuation line (//; the patrol facing along the road saw none.) breaks the sentence. Fix: Join the sentence: "...the camera turned right; the patrol facing along the road saw none."
  • [nit] SerialPrograms/Source/VideoGames/PokemonLZA/Programs/AutoStory/Actions/PokemonLZA_AutoStoryBracketWatch.cpp:57 camera_turn_toward() holds the numbers 0.06, 0.4, 4, 400 and 80 inline, and the same values are restated in the header comment. The two can drift apart. Fix: Name them (CAMERA_DEADZONE, CAMERA_STICK, CAMERA_MAX_TURN_MS, CAMERA_BASE_MS, and a TURN_FULL_AT_OFFSET for the 4) in an anonymous namespace so the comment can point at them.
  • [nit] SerialPrograms/Source/VideoGames/PokemonLZA/Programs/AutoStory/Actions/PokemonLZA_AutoStoryCatchPlan.cpp:92 flicks_to() uses C-style (int) casts and does not check that index is inside m_targets. An out-of-range index quietly returns a flick count to a target that does not exist. Fix: Use static_cast, and either assert/throw on index >= m_targets.size() or return std::optional.

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