Skip to content

PokemonLZA AutoStory: start load, launch, Confirm Choices and the zone gate walk - #562

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

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

Conversation

@dayfine

@dayfine dayfine commented Nov 15, 2026 •

Copy link
Copy Markdown
Owner

Depends on #561

Adds the steps around a checkpoint's start and Wild Zone 1's gate: loading the start save (or the backup save) and checking where it put the player, launching the game from HOME, picking Ready! on the new game's Confirm Choices, and the walk through the zone gate steered by the gate's pillars (ZoneGateReader). The story game in #568 calls them. Tested by PokemonLZA::AutoStoryStartLoad and PokemonLZA::AutoStoryZoneGateReader (console frames in CommandLineTests/PokemonLZA/AutoStoryDetectors/Zone1Gate/); the gate walk's tests read checkpoint 03.06 and come in #568.

@dayfine

dayfine commented Nov 15, 2026

Copy link
Copy Markdown
Owner Author

API review (claude-sonnet-5-5) at e385cc2: LGTM_with_nits

No bug or hard-rule violations found. The findings are comment content (a stale doc, history and lab-run talk, garbled text), a few unexplained literals, and one wasted final press in confirm_new_game_choices.

  • [style] SerialPrograms/Source/VideoGames/PokemonLZA/Programs/AutoStory/Actions/PokemonLZA_AutoStoryGateWalk.h:55 The doc says "gate_not_seen" fires when "the first second of looks shows no gate", but GATE_FIRST_SEEN_WITHIN is 3000 ms (the .cpp comment says 1 s missed the gate once). The documented contract disagrees with the code. Fix: Say "the first 3 s of walking", or better, refer to GATE_FIRST_SEEN_WITHIN so the number lives in one place.
  • [style] SerialPrograms/Source/VideoGames/PokemonLZA/Programs/AutoStory/Actions/PokemonLZA_AutoStoryGateWalk.h:9 Comments describe history and lab runs rather than what the code does: "Timed turns from the Pokemon Center ended pointing along the sidewalk, and a straight walk ran 10 s into the zone's wall", "walking on ran into the zone's wall", "1 s missed it once", "(a walk's miss beside the wall)" in the reader header and tests, and "NEEDS CONSOLE". This is PR/commit-message material. Fix: Keep the design rationale in one sentence, such as "steering by the gate keeps the walk from drifting into the wall". Move the lab history to the PR description and drop the "NEEDS CONSOLE" marker. State plainly that the 60-degree view angle is a tunable estimate.
  • [nit] SerialPrograms/Source/VideoGames/PokemonLZA/Programs/AutoStory/Actions/PokemonLZA_AutoStoryGateWalk.cpp:92 face_heading(..., 10.0) passes a bare tolerance with no name or reason, and the 2% dead-ahead / 60-degree constants are the only named ones nearby. Fix: Add a named constant such as constexpr double GATE_HEADING_TOLERANCE_DEGREES = 10.0; with a one-line why, or an argument-name comment at the call.
  • [nit] SerialPrograms/Source/VideoGames/PokemonLZA/Programs/AutoStory/Actions/PokemonLZA_AutoStoryConfirmChoices.cpp:62 The loop allows 6 DOWN presses, but the highlight read after the 6th press is never checked against CONFIRM_CHOICES_READY_ROW because the loop condition ends first. The 6th press is wasted and the function throws even if it landed on Ready!. The 6, 160ms, 500ms and 2000ms literals are also unexplained. Fix: Restructure so the cursor is checked after every read (for example, check the cursor at the top of each iteration and bound the number of DOWN presses separately). Name the limit, e.g. MAX_DOWN_PRESSES, with a why-comment.
  • [style] SerialPrograms/Source/VideoGames/PokemonLZA/Programs/AutoStory/PokemonLZA_AutoStoryLaunch.cpp:69 The comments in plza_launch_policy and above HOME_TILE_NAME are garbled and history-based. "Up, B and X held together: Up first, then B + X, only shows the title again and its A loads the latest save. Held together they open the BACKUP card..." and "A launch that took any tile opened FireRed once it had been played last..." contradict each other and say what happened once, not what the code does. Fix: Rewrite as: "Up+B+X held together on the title opens the backup-save card; the title's A then picks the backup." For the tile, say that the tile under the cursor is assumed to be PLZA's and that the HOME language is fixed to English. Drop the FireRed anecdote.
  • [nit] SerialPrograms/Source/VideoGames/PokemonLZA/Programs/AutoStory/PokemonLZA_AutoStoryLaunch.h:21 The plza_title doc has a stray comma starting a line ("//, and the overworld's prompts"), and ZoneGateReader.h has a stray "//." line after "~3 widths apart". Both are broken line-wraps. Fix: Rejoin the sentences, e.g. "...reads as one, and the overworld's prompts come with the party bar."
  • [nit] SerialPrograms/Source/VideoGames/PokemonLZA/Programs/AutoStory/Detectors/PokemonLZA_AutoStoryZoneGateReader.cpp:79 gate_pair and pillar_shaped use bare ratio literals (1.4, 1.33, 0.25, 1.5, 8, 0.10, 0.06, 2, 10) with no stated reason for each value. Only PILLAR_FILL is named and explained. Fix: Name them (e.g. MAX_WIDTH_RATIO, MAX_FOOT_OFFSET, MIN_GAP_WIDTHS, MAX_LIME_BETWEEN) and note on each the console measurement it comes from.
  • [nit] SerialPrograms/Source/VideoGames/PokemonLZA/Programs/AutoStory/PokemonLZA_AutoStoryStartLoad_Tests.cpp:88 while (actions.size() < 5) is an unexplained limit. using enum StartLoadAction; at anonymous-namespace scope also pulls generic names (START, STOP, RESUME) into the whole TU. Test_StartLaunch returns only "Unexpected launch request.", which hides which field differed. Fix: Name the cap (e.g. the maximum plausible number of steps) or derive it from checks.size() + 1. Limit the using enum to the table's scope or qualify the names. Include expected and actual save/running in the failure message.

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