Skip to content

FRLG League: one verify row per fight, console top-up, read-back save check - #645

Closed
dayfine wants to merge 7 commits into
frlg/e4-runnerfrom
frlg/e4-rows
Closed

dayfine wants to merge 7 commits into
frlg/e4-runnerfrom
frlg/e4-rows

Conversation

@dayfine

@dayfine dayfine commented Nov 17, 2026

Copy link
Copy Markdown
Owner

Depends on #642 (base frlg/e4-runner; the diff shows only this change).

The League was one checkpoint, so a lost fight or a short bag meant starting over from Lorelei. This splits 20.01 into five fight rows (20.01 Lorelei to 20.05 the Champion), each a verify row with the tries, min_pass and reset_budget from frlg-league-plan.json. A new league_top_up step runs first in each row and replaces league_between_fights. It reads the bag and the lead's HP (from the summary when the story has lost count), applies the heal rule (planned_between()) and checks the fight's entry contract. A short bag stops 20.01 at the Indigo Plateau Center and lists what to buy. A try is saved only when the bag, HP and Surf/Blizzard PP read off the console still meet the next fight's entry contract after its top-up. If any of those reads fails, nothing is saved and the loop stops. plan_league(), between_fight_action(), run_league_fight() and the League budget carry are removed.

Tested by unit tests only, CI to run them: the StoryVerifyRows engine cases (a failing postcondition blocks the save; an unreadable check stops the loop), a fake League through the engine in AutoStoryLeagueRows (caps, below min_pass, a short bag at 20.01, next-entry FR and PP shortfalls, a 200-seed random property test), the top-up branches, and the plan-vs-rows agreement in the League sim tests. Not run on console B. The summary's current-HP parse has no captured frames yet.

Note for #618, on its next merge: move "protected_slots": [6] onto each fight row (20.01 to 20.05), and put the hall_of_fame game_action at the end of the Champion row (20.05).

… check

20.01 splits into 20.01 Lorelei to 20.05 the Champion, each a verify row
with frlg-league-plan.json's figures. league_top_up replaces league_start
and league_between_fights: it reads the bag and the lead's HP, applies the
heal rule and checks the fight's entry contract (a short bag stops 20.01
at the Center). A try is saved only when the bag, HP and PP read off the
console meet the next fight's entry contract after its top-up; a read
that fails stops the loop with no save. plan_league(), between_fight_action(),
run_league_fight() and the League budget carry are removed.
VERIFY_UNREAD moves to Pokemon_StoryVerify.h (Pokemon_StorySegments.h was
at 9 public names). The verify-row, League-row and top-up cases drop the
"= {}" on their name/input/expectation fields, and the random League run
becomes a case table. check_league_save reads the bag and logs the read in
helpers; compare() takes its output last.

The entry check's HP floor (hp_sim.p10 over the sim lead's 171 max HP)
moves from a constant to frlg-league-plan.json's entry_hp, marked as
awaiting the user's confirmation.
…oints

FRLG's loader keeps a row's metadata out of the checkpoint, so
postconditions.position is never set and the chain check failed on 20.01a.
checkpoint_end_pose() falls back to the row's last declared pose (20.01a's
walk to the counter, (2, 7) facing west). The four fight rows 20.02 to 20.05
make the story 97 checkpoints.
@dayfine

dayfine commented Nov 18, 2026

Copy link
Copy Markdown
Owner Author

Superseded by #652 (frlg/lean), which continues from this branch's tip; the branch stays.

@dayfine dayfine closed this Nov 18, 2026
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