Skip to content

PLZA AutoStory: 01.00 to 03.11 (lean branch) - #644

Draft
dayfine wants to merge 151 commits into
autostory/logic-testsfrom
plza/lean
Draft

dayfine wants to merge 151 commits into
autostory/logic-testsfrom
plza/lean

Conversation

@dayfine

@dayfine dayfine commented Nov 17, 2026 •

Copy link
Copy Markdown
Owner

Depends on #654

This branch replaces the linear PLZA chain #573 through #640 as the working branch for PLZA AutoStory 01.00 to 03.11: one commit carries the tree of plza/zone-by-map (#640), followed by a merge of the latest autostory/story-range-options-sv. Fixes land as new commits on this branch from now on. It will be split for review later, by layers and slices.

It now runs on the reworked shared core (#648, merged in): PLZA actions parse their own args at plan load, the plans were rewritten with rewrite_plan_actions.py --default scene=mash, PLZA reads its own execution block and keeps its autosave policy, and the console reload tells the engine which checkpoint start it landed on. The backup rewind (03.08 -> 03.06) and start signatures work as before. Golden tests now expect [Event] lines. Only the PLZA files were syntax-checked locally, because a console run was holding the build gate; the full build and tests run on fork CI.

Add-on: new game. Checkpoints 01.00a (new game from HOME: language, look, name) and 01.00b (Confirm Choices) and the Switch system keyboard ship apart from the story MVP, as their own PR after the story PRs. Their files: the plans StoryData/plza-01.00a.plan.json and plza-01.00b.plan.json; Actions/PokemonLZA_AutoStoryNewGame, NewGameChoices, ConfirmChoices and Detectors/PokemonLZA_AutoStoryIntroScreens, ConfirmChoicesReader (each .cpp/.h, with _Tests where they have them); NintendoSwitch/Inference/NintendoSwitch_SystemKeyboardDetector and NintendoSwitch/Programs/FastCodeEntry/NintendoSwitch_SystemKeyboardTyping, plus the keyboard edits in NintendoSwitch_KeyboardCodeEntry.h. Hook lines elsewhere: PokemonLZA_AutoStory.cpp/.h (the Game Language, Player Look and Player Name options, new_game_language_database(), check_new_game_choices(), the NewGameChoices in StoryEnv), PokemonLZA_AutoStoryConsoleBackend.h (StoryEnv::new_game), PokemonLZA_AutoStoryConsoleGame.cpp (new_game_handler() and the new_game_intro / confirm_new_game actions), PokemonLZA_AutoStoryGame.cpp (those two names in add_console_actions()), PokemonLZA_AutoStoryTable.cpp/.h (story_row_starts_without_save(), story_row_makes_new_game_choices()), and their lines in SourceFiles.cmake and the test registration. Actions/PokemonLZA_AutoStoryLaunch stays in the MVP: the backup save and the reload use it too.

Since 771b58d: Game_Tests keep one run case per outcome plus the console-failure cases (lint cases dropped); the catch, walking, map-reader and start-check tests keep their failure and branch cases; the plans' long why texts are shorter. The party bar's count is read once it holds 3 s (03.08 failed reading 4 of 5 before the last catch joined the bar). New evidence lines for later cuts: [SceneQuirk] <checkpoint>/<step> <field> fired, [PlusSkip] <checkpoint>/<step> pressed -> prompt|skipped|map|nothing, [Boundary] <id> end: ... / start: ..., and the dev setting Reload Probe After ([ReloadProbe]). Only the touched files were syntax-checked locally (console run on the build gate); fork CI builds and tests.

One commit with the tree of plza/zone-by-map (70fc06c), the tip of the
linear PLZA fork chain. It replaces fork PRs #573, #574, #575, #577, #580,
#582, #591, #595, #596, #598, #604, #610, #619, #620, #622, #623, #629-#637,
#639 and #640 as the working branch.
This was referenced Nov 17, 2026
…er without text

- 03.08: the map pin read at the start decides whether the player stands
  at Taunie's rocks (476, 224, every run there); the marker read after the
  leg is only a cross-check, used when the pin is unread. The French run
  (console B, 2026-11-17 02:41) read the pin but no marker digits.
- Backup card: found by white strips away from the title, the count read
  as the leading digits only (Japanese "3" + counter read 34 before); the
  last look is dumped when no card reads.
- 03.04 plan: the chained run failed along a wall; the walk needs a
  heading, to be read on console B.
dayfine and others added 30 commits November 19, 2026 01:30
Actions/ActionTable collects every action as one braced table per kind,
with names from ActionNames.h; console-only code moves to
Actions/ConsoleActions, turning and heading to Actions/Heading, the
platform wait to Actions/PlatformWait. PlzaStoryTools becomes
PlzaConsoleHooks; console actions, the battle runner and the run options'
callbacks are MoveOnlyFunction aliases. row/segment names become
checkpoint (run_plza_checkpoints, CheckpointRunOptions, MarkedCheckpoints).
The scene machine groups its timeline state into structs, defines its
log and runner methods out of class, and maps screens to names with an
EnumStringMap. Durations read in seconds. No behavior or log text change.
The 27 name constants were over the header symbol limit; one enum and
action_name() replace them. No behavior change.
Same patterns as the #644 review: callbacks in Launch, Zone1Map,
SpeciesCheck and NewGame take MoveOnlyFunction (FrameCheck alias); the
plan checks in Table.cpp compare PlzaAction names, not literals;
NewGame's limits read in seconds. No behavior or log change.
wait_for_frame takes a FrameCheck&, and a function name converts to a
temporary MoveOnlyFunction that cannot bind to it (GCC error).
The console backend runs a RUN stick 2.25x faster than its length, so the
last leg's 250 ms slices took ~111 ms each and 03.03 off_the_roof's 8000 ms
budget ended 3.6 s in, before the scene (2026-11-19, ES-LA). The held last
leg waits for an event, so it is a time budget: it is held until its time
has passed on the looks' clock as well as by its slices. Logs and end_after
still count the slices; the failure detail reports the time held.
set_text_speed_fast opens the menu with X, gives the tutorial card A when it
shows, sends the blind presses to the options' text speed and Fast (L, Up, A,
Down, Right), then B until the overworld holds two looks. 01.01 runs it after
the platform check. The menu screens count the platform as the overworld.
Adds a save_from_menu case for a menu with no tutorial card.
Map shots at 03.04's start (the map re-centres on the player; phase
correlation of the background) give walking 16.6 px/s and running
27.0 px/s, linear from 0.4 s to 4 s. The old 2.25 left every run leg
about 27% short: 03.04's into_pokemon_center stopped at the wall left
of the Pokemon Center 3 times out of 3.
Evidence: every lab-B log (11/13 to 11/19). [SceneQuirk] lines exist only
in the 11/19 ES-LA run; for earlier runs the per-look screen lines were
read instead (min_length can only hold an idle look that is past the quiet
time but under the minimum).

Deleted:
- 02.05/enter_room_202 min_length_ms 5000: ran 12 times with screen
  lines, 0 holds; the 11/19 run logged quiet and quiet_is_control, not
  min_length. Every run ends on quiet_end 3 s after the last fade, no idle
  look between the fade and the end.
- 03.01/lobby_scene min_length_ms 30000: ran 15 times, 0 holds; text boxes
  every <= 6 s from 12.8 s on in every run, so 20 s quiet cannot fall
  before 30 s. The 11/19 run logged text_button, quiet, quiet_is_control.

Kept (fired at that step in some run): 02.04/check_in all four;
02.05/arrive_2f quiet, min_length, quiet_is_control; 02.05/enter_room_202
quiet, quiet_is_control; 02.06/wake_up min_length (11/19) and quiet,
quiet_is_control (quiet_end at 20.2 s, 11/15); 03.01/leave_room_202
min_length (11/19) and quiet, quiet_is_control (quiet_end 11/15, 11/16);
03.01/lobby_scene quiet, quiet_is_control, text_button; 03.07/enter_zone_1
gap_press.
Kept without a fire: advance_with_a on the 02.05, 02.06, 03.01 choice
questions ([SceneQuirk] compares against A, which advance_with_a sets, so
it cannot log there; without it text_to_choice presses B, which closes the
talk); 03.09/lab_lobby scene_start_ms (0 of 15 runs, but it guards the
11/16 17:34 failure where lab_lobby ended in control with no scene).
Start signatures: none deleted; 03.03-03.09 were each START CHECKED or
pinned by minimap in some run, 03.04 guards its forced reload, 03.06 its
backup-save reload. Rows without a signature have nothing to delete.
No quirk kind lost its last plan, so no C++ change.
01.00b holds Plus once on the opening's first moving look, which skips it
to the platform (console B 2026-11-19: the opening waited 116 s with no
input). The scene machine's cutscene timer now counts still frames too, so
a still held 3 s after the last cue gets the Plus skip, except where quiet
is control (Plus there opens the map). The 2 s hold is one constant,
CUTSCENE_SKIP_HOLD, shared by both.
…rty bar ends the step; banner wait 5 s

02.06 wake_up and 03.01 leave_room_202 ended on the party bar (can_move)
in every run since 11/17; their quiet_ms/quiet_is_control no longer fire.
03.09 lab_lobby's scene_start_ms (start window) was used in 0 of 15 runs:
up_the_lab_steps ends on the A Enter prompt and press_through_prompt waits
for it to be taken. No plan sets scene_start_ms now, so its parse goes.

The banner wait after a scene: all 22 banners on console B stayed the full
10 s and went at the first A; 5 s covers the ~3 s banner that clears itself.
The opening's Plus skip fired 4 ms into the step, while the confirm screen
was still fading out, and did nothing (console B 2026-11-19); the opening
then showed a hold-to-skip prompt. The platform wait now holds Plus 0.75 s
after the picture fades in from black, once per fade-in, never during a
fade or once the autosave or platform shows.
… the 10 s quiet wait

A walk waited 10 s of nothing busy before it took quiet as control where no
sign of control shows (Hotel Z), even right after a mash_to_move_hints step
with quiet_is_control had just ended that way (03.01 lobby_scene, then
03.02 to_hotel_front_door; also 02.04, 02.05 twice). That step's success
now marks PlzaConsoleHooks::quiet_control_step, and check_can_walk then
takes two looks with nothing busy as control (~0.25 s). Every step clears
the mark once it ends unless it set it, so only the step right after sees it.
not_free_control() returned "" for free control; ObjectiveMarker::distance
was -1 (or 0) when its digits did not read, and both callers tested > 0.
Both are std::optional now; behavior unchanged.
…aits

Literal arguments in calls of 3+ arguments get /*param=*/ comments
(run_scene_machine timeouts, plate(), shifted(), enough_species(),
pbf_controller_state()); strings built with + use std::format; the
story_battle start's 250 ms poll and 10 s wait are named constants; two
code-health allow tags no longer needed are dropped. Behavior unchanged.
01.01 failed 3/3 on console B (2026-11-19): the first menu's tutorial card
still read as a card while it faded out after A, got a second A on the main
menu, and the bag opened; no screen there was read, so the step waited 30 s.

Now X, 2 s, A on the card while it shows (1.5 s apart), the blind rows, then
B until the overworld. save_from_menu also waits 1.5 s after the card's A.
On console B, 02.06 to_bed started walking 1.2 s after 02.05's
enter_room_202 ended, where every earlier pass waited about 6.6 s (the
room's autosave badge shows then). The player ended up facing the wall
by the door and the walk found no A prompt. The 10 s wait is doing
real work after a room entry, so it comes back.
On console B the blind A landed before the prompt showed: the side street
leg now runs, so the player reached the ladder later than the walk timing
the blind sequence assumed. The player stood at the ladder with the prompt
up and off_the_roof failed with no scene. By hand, A on the prompt and
about 6 s of up reach the roof scene; the climb hold is 6.5 s.
…03.03b

The game autosaves in 03.03's rock pile scene, so a retry after a later
failure in 03.03 reloaded onto the side street, failed 03.03's start check
and stopped the run (2026-11-19, no backup save before 03.06). 03.03 now
ends at that autosave and 03.03b starts where the reload lands.
At running pace the side street leg stops left or right of the ladder
(2026-11-19: once beside it, once to its right), so the fixed sidestep
right missed it. The step now looks for the A prompt facing the wall,
steps left then right along it until the prompt shows, and fails as
ladder_not_found when none does.
…03.03c

The game also autosaves in the rooftop scene (2026-11-19, 33.8 s in), so a
retry of off_the_roof reloads onto the roof. 03.03b now ends at that
autosave and 03.03c (off the roof to Station Front) starts there.
A walk to an A prompt stops beside its target at run pace (03.04's Center
door, 03.03b's ladder; console B 2026-11-19). step_along_until_prompt()
sidesteps left then right past the start, facing the walk's heading again
after each step, until the prompt shows. climb_ladder uses it in place of
its own copy; a walk whose last leg only turns calls it before failing
walk_no_end.
Console B videos (2026-11-19): all 4 failures ran the -90 leg into the
wall left of the Center's opening (the poster wall) and never got inside;
both passes cleared that wall by about a body width and stopped against
the back wall at the counter's end, where the 90 turn faces the nurse.
The 20 leg runs 2200 ms, not 2000, to turn in clear of the wall.

The side steps after a last turn (d99fe4a) assumed the player stood
beside the target; here it stood outside and they walked it out of the
Center. A walk whose last turn shows no prompt fails again; climb_ladder
keeps step_along_until_prompt.
Straight from the rocks to the 100 spot (since 64e57f1 and the spot's
move in 51ac009) the player stops on an obstacle at about (467, 226):
3 of 5 runs since 2026-11-18 23:01, both runs on 2026-11-19 at running
pace failed leg_off_target there. Every run before went rocks -> road entry
(456, 231) -> spot and none stopped; from the road entry the heading to
the spot keeps south of the obstacle.
The 03.04 golden case's later 'party bar, A prompt' screen had no key, so
the case failed before it judged the walk. ZONE1_ROAD_ENTRY moves into
Catches.cpp, its only user, which keeps Zone1Map.h at the header symbol
limit.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
…ols 12 > 8)

One module for 01.00a: the choices' pure functions and their header comment
move unchanged into PokemonLZA_AutoStoryNewGame.{h,cpp}; includers updated.
The intro's cursor moves, IntroKey and the by-hand hint become internal to
NewGame.cpp; new_game_run_problem now also checks the choices, so
AutoStory.cpp makes one call; play_new_game_intro appends the hint to its
own failures, so ConsoleActions no longer passes one. Tests go through
new_game_run_problem only.
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