Skip to content

PokemonLZA AutoStory: the story game and its table - #568

Draft
dayfine wants to merge 11 commits into
plza/upstream/m3-01from
plza/upstream/p4-01
Draft

dayfine wants to merge 11 commits into
plza/upstream/m3-01from
plza/upstream/p4-01

Conversation

@dayfine

@dayfine dayfine commented Nov 15, 2026

Copy link
Copy Markdown
Owner

Depends on #567

Adds the PLZA story game: every step name of the checkpoint plans mapped to its handler on the backend, the story table read from the plan files built into the program (cmake/EmbedTextFiles.cmake), and segment runs with their boundary reloads. PokemonLZA_AutoStoryGame.cpp is the one place that ties the actions of #559 to #564 to the plans, which is why this PR is over the size the rest of the chain keeps to. Tested by PokemonLZA::AutoStory_StoryTable (every checkpoint parses and lints, rows and saves as expected), AutoStoryEngine (each checkpoint's steps through a fake backend), AutoStorySceneMachine and AutoStoryGateWalk.

@dayfine

dayfine commented Nov 15, 2026

Copy link
Copy Markdown
Owner Author

API review (claude-sonnet-5-5) at 2d7259d: LGTM_with_nits

No correctness or hard-rule problems found. Brace style, the no-Qt, filesystem and concurrency rules, and the CMake source list all look fine. The remaining notes are comment hygiene, magic numbers, positional bools in test rows, duplicated test helpers and one test-registration placement. Line numbers are approximate.

  • [style] SerialPrograms/Source/VideoGames/PokemonLZA/Programs/AutoStory/PokemonLZA_AutoStoryEngine_Tests.cpp:357 The comment "01.01's ad : subtitles with no box..." sits above test_battle_area_ends_on_interact_prompt, next to that test's own comment, while test_arrival_presses_through_the_ad has none. A function comment must sit directly above its function. Fix: Move the ad comment to directly above test_arrival_presses_through_the_ad and keep only the battle-area comment above test_battle_area_ends_on_interact_prompt.
  • [style] SerialPrograms/Source/VideoGames/PokemonLZA/Programs/AutoStory/PokemonLZA_AutoStoryEngine_Tests.cpp:255 Test comments narrate history instead of describing the screen or behavior: "the run waited 100 s on it and failed platform_not_seen; one A by hand went on", "to_mable returned 0.4 s in, before its 3.5 s of legs", "it had passed at once", "Mable's box came over 5 s after the fade", "the old rule waited on the party bar". These belong in the commit message or PR description. Fix: Reword each as what the game does and what the test asserts (for example "the arrival text waits for A; one A, none while it is still up") and drop the lab-run and old-code references.
  • [style] SerialPrograms/Source/VideoGames/PokemonLZA/Programs/AutoStory/PokemonLZA_AutoStoryTable_Tests.cpp:455 Comments quote the reviewer and mark data with "(user)": "the end of 03.08 should be exit wild zone 1", "if this is the auto save, we should divide a checkpoint here", "(user)" on the 03.09, 03.10 and 03.05 notes, and "(user)" in test_production_rows. This is review chatter, not a statement about the code. Fix: State the fact ("03.09 ends on the Research Lab lobby's autosave") and remove the quotes and "(user)" markers.
  • [style] SerialPrograms/Source/VideoGames/PokemonLZA/Programs/AutoStory/PokemonLZA_AutoStoryGame.cpp:100 Unexplained literals at the console action call sites: fight_battle_in_progress(..., 120s), catch_tutorial(..., 6), battle_then_catch(..., 6), and the 90s/60s timeouts in the scene handlers. A reader cannot tell what 6 or 120s bounds. Fix: Give them named constants with a why-comment (for example MAX_CATCH_THROWS, STORY_BATTLE_TIMEOUT), or at least add argument-name comments like /max_throws=/6 at each call.
  • [style] SerialPrograms/Source/VideoGames/PokemonLZA/Programs/AutoStory/PokemonLZA_AutoStorySceneMachine_Tests.cpp:235 Read rows use positional aggregate init with up to five trailing bools, for example {20000ms, NOTHING, true, SceneScreen::MISSION_COMPLETE, false, false, true, true}. Which reading each true/false sets (hint, arrow, banner, complete, autosave) is unreadable. Fix: Use designated initializers for the optional readings (.banner = true, .complete = true), or give Read small named helpers or an enum set for the readings.
  • [style] SerialPrograms/Source/VideoGames/PokemonLZA/Programs/AutoStory/PokemonLZA_AutoStorySceneMachine.h:162 Test registration (add_tests_AutoStorySceneMachine plus the UnitTestDatabase.h include) is added to the production scene machine header. Every other new test module in this PR has its own _Tests.h, so production includers now pull in the test database header. Fix: Add PokemonLZA_AutoStorySceneMachine_Tests.h with the declaration and include that from PokemonLZA_Tests.cpp. Add it to SourceFiles.cmake and revert the SceneMachine.h change.
  • [style] SerialPrograms/Source/VideoGames/PokemonLZA/Programs/AutoStory/PokemonLZA_AutoStoryEngine_Tests.cpp:85 step_of() and joined() are duplicated between Engine_Tests and GateWalk_Tests with different signatures. The Engine_Tests version returns an empty StoryCheckpoint when the id or step is missing, which is a silent sentinel that can pass vacuously, while the GateWalk version returns std::optional. Fix: Share one test helper (the optional-returning one, with joined()) and have the engine tests fail explicitly when the step is missing.
  • [nit] SerialPrograms/Source/VideoGames/PokemonLZA/Programs/AutoStory/PokemonLZA_AutoStoryGame.h:61 The action list is stale: it says mash_to_move_hints takes (args min_length_ms, quiet_ms), but the spec also has press_a_first and quiet_is_control. The Table_Tests.h comment ("its autosave rows come first") also does not match what the tests check. Fix: List all four mash_to_move_hints args, or point to plza_story_action_specs() as the source of truth, and fix the Table_Tests.h description.

# Conflicts:
#	SerialPrograms/cmake/SourceFiles.cmake
… menu save behind a switch

MENU_SAVE_AT_CHECKPOINT_END stays off: the engine does not menu-save yet, as before (user decision). run_checkpoint() takes no save point.
"menu" is gone from the plans, so MENU_SAVE_AT_CHECKPOINT_END, the menu-save path of StoryGame::save and story_row_saves() go. A row that does not end on a seen autosave fails its save as "no_autosave" (as "menu_save_off" before). The table tests follow the plans: autosave rows as the run logs show them, unverified ones apart, reloads only on 02.07, 03.02 and 03.04.
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