Skip to content

FRLG battle sim: a setup and heal plan for the hard battles - #304

Draft
dayfine wants to merge 1 commit into
frlg/checkpoint-replayfrom
frlg/battle-strategy
Draft

dayfine wants to merge 1 commit into
frlg/checkpoint-replayfrom
frlg/battle-strategy

Conversation

@dayfine

@dayfine dayfine commented Nov 9, 2026

Copy link
Copy Markdown
Owner

Depends on #258. Base: frlg/checkpoint-replay; the diff shows only this change.

The battle sim's lead only knew Potions, Awakenings and Antidotes and never set up, so with Pokeguy's bags it lost almost every E4 and Champion fight.

  • BattleData/strategies.json: per-trainer setup goals (X Special stages, X Accuracy, outspeed) for the 12 setup fights, taken from PokemonSimulation's Pokeguy goals.
  • planned_turn(): setup turns with an HP reserve and a heal before them; no setup into Self-Destruct/Explosion, a one-hit KO from full, or a foe that is more likely than not to use a status move; Super Potion, Hyper Potion and Full Restore where a Potion would not pay. Trainers with no entry get the general policy plus the bigger heals.
  • The win-chance sim plays it. The battle loop doesn't use the new items yet (Supplies doesn't count them), so the story's own win chances don't change.

Win rates, Pokeguy's recorded lead and bag, 400 battles, seed 1, at full HP (before = own_turn() with its items, heals = whole bag without goals, plan = with goals):

Battle Before Heals Plan
Tower rival 97.8% 98.8% 100%
Koga 73.5% 93.8% 95.2%
Erika 94.2% 100% 99.5%
Silph rival 76.5% 97.8% 100%
Sabrina 95.5% 100% 100%
Route 22 rival 52.2% 52.0% 93.8%
Bruno 10.5% 65.8% 85.8%
Agatha 10.8% 45.8% 76.5%
Lance 0.0% 3.5% 80.2%
Champion 0.0% 0.5% 81.2%

Hideout Giovanni, Silph Giovanni, Blaine, Giovanni's gym and Lorelei are 97.8% to 100% with the plan at full HP. At Pokeguy's low entry HP the plan loses to heals-only at Koga (76.5% vs 87.2%) and Silph Giovanni (79.0% vs 88.2%). Without Blizzard (Dig in its slot) the plan drops to 38.5% for the Route 22 rival, 36.2% for Lance and 9.8% for the Champion.

Testing: the AutoStoryBattleStrategy, AutoStoryBattleSim and AutoStoryBattleData suites, and the other PokemonFRLG::AutoStory suites, pass in the headless runner (only the image tests that need CommandLineTests fail). ninja SerialPrograms builds.

🤖 Generated with Claude Code

https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss

The sim's lead only knew Potions, Awakenings and Antidotes, and never set
up, so it lost most E4 and Champion battles even with a full bag. Adds a
per-trainer plan as data (BattleData/strategies.json: X Special, X Speed
and X Accuracy goals from PokemonSimulation's measured Pokeguy setup
goals) and planned_turn(): C2-style setup turns with an HP reserve and a
heal before them, no setup into Self-Destruct, a one-hit KO or a likely
status move, and Super Potion / Hyper Potion / Full Restore where a
Potion would not pay. The win-chance sim plays it; the battle loop does
not use the new items yet, so the story's chances are unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss
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