Skip to content

FRLG League: the #115 plan as the one source, parity dump and a fake battle engine - #638

Closed
dayfine wants to merge 5 commits into
frlg/check-levelsfrom
frlg/league-plan
Closed

dayfine wants to merge 5 commits into
frlg/check-levelsfrom
frlg/league-plan

Conversation

@dayfine

@dayfine dayfine commented Nov 17, 2026

Copy link
Copy Markdown
Owner

Depends on #613 (based on frlg/check-levels, not #618: the League plan C++ lives only on check-levels, and #618 hasn't merged its 20.0x plan rewrite yet). Data from dayfine/PokemonSimulation#115 and dayfine/PokemonSimulation#116.

The C++ League policy was a port of the sim's #111 plan, so it was missing what the final plan (#115) added: foe move sequences, per-foe heal blocks, the one-heal rule between fights, item caps, and the reset and pass rules. This ships #115's plan.json unchanged as StoryData, extends the loader, ports those rows into the planned policy and its between-fight top-up, and adds league_early_reset() / league_try_passes(). The parity dump is regenerated against #115 (now with our attack count per foe slot), and every mismatch is printed with its decision line. A test-side fake battle engine feeds PlannedBattle the per-turn inputs the readers give it and plays ten League scenarios. The touched files compile locally; this branch has no headless test target and the app isn't run locally, so Fork Draft CI runs the parity and fake-battle tests.

…battle engine

StoryData/frlg-league-plan.json is PokemonSimulation #115's plan.json
unchanged. The loader reads its new rows: a foe's sequence (Lapras:
Strength, Bite, Bite) and heal block (Machamp, Dragonite: below 80 HP a
heal of at least 50), kill_order, between.heal "one", the item caps, the
reset rules (Roar/Whirlwind; Bruno's early reset after Onix #1) and the
pass figures. The planned policy ports #115's rows (foe_heal, sequence,
kill_order off with a sequence), the one-heal top-up between fights and
the spare-only Super Potion count; league_early_reset() and
league_try_passes() are the final plan's reset and accept rules.

The parity dump is regenerated for #115 (PokemonSimulation #116) with our
attacks per foe slot; every mismatch prints its decision line. A fake
battle engine feeds PlannedBattle the readers' per-turn inputs from a
scripted foe side and checks ten League scenarios.
PokemonFRLG_AutoStoryLeaguePlanData.h had 11 public names, over code
health's 8: the foe's plan (SlugCounts, its setup goals and heal block)
moves to PokemonFRLG_AutoStoryLeagueFoePlan.h, and parse_league_plan()
into the .cpp, which alone calls it.
dayfine added a commit that referenced this pull request Nov 17, 2026
The loop's fake-runner tests move out of #638's PlannedBattleFake_Tests.cpp
into PokemonFRLG_AutoStoryLeagueLoop_Tests.cpp, which this PR owns. Each
try's battle is now scripted as its end and the items it spent; the fake
battle engine file is back to #638's version.
…e Full Heals

Parity: the HP box shows BRN and FRZ as one icon, and the program took it
for a burn, so a frozen Blastoise went to the cure row where the sim's
sleep_cure takes it (chain 7, Lorelei turn 7). BattleTrack now keeps our
side's last "frozen solid" or "was burned" text, and the icon is a freeze
after the former.

The Dragonair fake battle started at +0 Sp. Atk, where Blizzard's low rolls
leave Dragonair in Lance's Full Restore range and kill_order rightly opens
with Strength; it now carries the plan's +2 from Gyarados. The approved
shopping test still had 2 Full Heals at 20.01a; the plan buys 4 (user,
2026-11-16).
@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