Skip to content

PokemonLZA AutoStory: screen readings, failure classes and screen events - #558

Draft
dayfine wants to merge 6 commits into
plza/upstream/p1-03from
plza/upstream/p2-01
Draft

dayfine wants to merge 6 commits into
plza/upstream/p1-03from
plza/upstream/p2-01

Conversation

@dayfine

@dayfine dayfine commented Nov 15, 2026 •

Copy link
Copy Markdown
Owner

Depends on #557

Adds what the PLZA backend reports to the shared story engine: the names of its screen readings, its failure classes (which part of a step failed, for the run report), and the adapter from its detectors to the shared screen events. This is the vocabulary the backend (#559) and the scene machine (#560) are written in. Tested by PokemonLZA::AutoStoryFailures and PokemonLZA::AutoStoryScreenEvents, the latter on console frames in CommandLineTests/PokemonLZA/AutoStoryDetectors/.

@dayfine

dayfine commented Nov 15, 2026

Copy link
Copy Markdown
Owner Author

API review (claude-sonnet-5-5) at 6bf83fe: LGTM_with_nits

No bugs or hard-rule violations found. The findings are comments written around lab runs and fixtures, a stale header reference, include order, and two small readability nits.

  • [style] SerialPrograms/Source/VideoGames/PokemonLZA/Programs/AutoStory/PokemonLZA_AutoStoryScreenEvents.h:115 Comments tell the story of particular runs and fixtures instead of what the code or screen does: '02.02 after the Brigitte battle ... pressed for 2 minutes', '02.07's first evening', 'Follow-up: ... Hotel Z's hall, za2_m3x'. The same pattern is in PokemonLZA_AutoStoryScreenEvents.cpp (the 'upstream's ... the sim runs it too' comment) and in PokemonLZA_AutoStoryFailures.cpp ('(03.08)'). This is run history and TODO tracking, and it goes stale. Fix: State the behavior and the reason in game terms, e.g. 'a walk that passes a scene's trigger shows no box, choice or battle, so the mash would otherwise press forever'. Move the run numbers, fixture names and the follow-up into the PR description or an issue.
  • [style] SerialPrograms/Source/VideoGames/PokemonLZA/Programs/AutoStory/PokemonLZA_AutoStoryScreenEvents.cpp:25 The INTERACT_PROMPT_BOX comment compares against 'upstream's' box and explains why walk_to_prompt() is routed through the backend ('so the sim runs it too'). That is branch and PR context, not a description of the box. It also takes a reader longer to follow than the 0.05 trim it explains. Fix: Reduce it to: where the prompt shows, over the scene and above the bottom hints; the bottom is cut short of BATTLE_HINT_BOX so battle frames do not read as prompts. Keep the integration rationale in the commit message.
  • [nit] SerialPrograms/Source/VideoGames/PokemonLZA/Programs/AutoStory/PokemonLZA_AutoStoryScreenEvents.h:5 The header comment names 'Pokemon_ScreenEvents.h', but the file actually included is CommonTools/ScreenEvents/ScreenEvents.h. The reference is stale or wrong. Fix: Point the comment at CommonTools/ScreenEvents/ScreenEvents.h.
  • [nit] SerialPrograms/Source/VideoGames/PokemonLZA/PokemonLZA_Tests.cpp:24 The new includes are out of sorted order. 'Programs/AutoStory/PokemonLZA_AutoStoryFailures.h' is placed before 'Programs/AutoStory/Detectors/...', and PokemonLZA_AutoStoryScreenEvents.h comes after them. Fix: Order the includes within Programs/AutoStory/ as Detectors/... first, then PokemonLZA_AutoStoryFailures.h, then PokemonLZA_AutoStoryScreenEvents.h.
  • [nit] SerialPrograms/Source/VideoGames/PokemonLZA/Programs/AutoStory/PokemonLZA_AutoStoryFailures.cpp:73 console_step_failure() is a hand-written if-chain from action name to failure name. It is a second lookup table next to plza_failures(), and it repeats the literal strings that plza_failures() and the tests use. Fix: Use a small constexpr table of {action, failure} pairs and loop over it, as plza_failures() does. Add the 'operation_failed' fallback once.
  • [nit] SerialPrograms/Source/VideoGames/PokemonLZA/Programs/AutoStory/PokemonLZA_AutoStoryScreenEvents_Tests.cpp:69 SCREEN_EVENTS_CASES is defined after the anonymous namespace closes. Every other test table in this PR sits inside the anonymous namespace next to its case type. Fix: Move the table inside the anonymous namespace, before add_tests_AutoStoryScreenEvents().

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