Repository navigation
Conversation
|
The offline battle work is now merged in PokemonSimulation. Use this single handoff on Interface direction: AutoStory owns each game plan. Replay that actual plan as semantic logs to produce its ordered battle history, entering conditions and versioned policies; PokemonSimulation validates/simulates that history and returns a quality report. The 69 Pokeguy fights are a reference fixture, not the list or route every plan must adopt. This also applies to future Fire/Grass starter plans that catch, train and evolve supporters. The proposed replay/result/quality contract is documented in PokemonSimulation PR #39. I reviewed this PR at 1. Move simulation/analysis ownership out of Arduino-Source Paths below are under
Arduino-Source owns the game plan and its console execution, and should export the history produced by its planning replay. PokemonSimulation owns battle-mechanics analysis, NPC simulation, reference-data generation and evaluation of the supplied history. A replay exporter, general history importer and quality grader still need implementation; the Markdown handoff is a reference specification, not an already-shipping C++ plan bundle. An optional runtime data export must not reverse ownership of the game plan. Runtime action selection must remain responsive to the actual battle, rather than treating an offline win rate or opening move as a button script. Update build/test registrations as the old modules are removed. 2. Replace LOW/HIGH policy selection with explicit per-fight plans
Give the actual AutoStory plan explicit fight records keyed by stable fight/trainer ID, connected to
The current executable action vocabulary is only RUN/POTION/ANTIDOTE/MOVE. Extend Track the active opponent and its current HP/status, player HP/status/PP, stages and relevant effects. For the currently implemented stage through Brock, the known lab rival, Liam and Brock entries are A-labeled with B-default execution; none requires C. The Forest route explicitly meets Rick, so do not silently assign him Sammy's benchmark. Use the handoff's complete per-fight labels for matching trainers, and mark additional/unmatched encounters as unvalidated. 3. Make hard-fight preconditions an entry gate Before starting a hard fight, verify trainer/variant, actual species and level, numeric HP/max HP and status, raw summary stats, moves and remaining PP, held item, earned badges and the full required battle bag. Log expected versus observed values and the plan revision. Nature/IV/EV assumptions must fit the actual starter: match visible summary stats/level and track earned EVs or a compatible profile range; IVs need not be directly OCR-readable. An unread value is not a successful check. If they differ, recover/re-read or stop for an offline estimate of the actual state rather than attaching the handoff's probability to it. Two concrete fixes are needed here:
The six adopted rests are Sammy, Liam, Brock, Josh, Cerulean rival and S.S. Anne rival. They restore HP/status/PP, never the bag. Later C full-heal alternatives remain pending; automatically healing every boss would change the measured Torrent/setup conditions. These are the current ten lowest prepared-variant point estimates; verify the complete card in the linked handoff, not just the abbreviated condition here:
Brock/Liam each had 120/120 wins in the full-rest samples without HP medicine in their entry bags; that is not proof of a 100% true win rate. Bruno is still C even though it is outside this top ten: preserve its opening Torrent/equivalent-power plan rather than applying a universal heal. The handoff includes simultaneous intervals, the known B finishing-hit priority limitation, and the unproven whole-League PP reserve. Evaluate the quality of the exported plan Make the quality profile configurable: a minimum per-fight success probability (for example 60% or 70%, not a selected default), the required fraction of fights at or above 90%, and an explicitly defined easy/near-certain quota. Return the weakest fights, fractions, trials/uncertainty, coverage/input failures and the AutoStory event that produced each condition. Grade with simultaneous bounds: pass when lower bounds certify a requirement, fail when upper bounds rule it out, otherwise sample further or report inconclusive. Stop against these criteria instead of spending a fixed 1,000 trials on every fight. Keep “zero losses in n samples,” a user-selected near-certain threshold such as 99%/99.9%, and a genuine guaranteed-100% result separate. Finite Monte Carlo cannot certify literal 100%; an exact quota needs a proof/exhaustive capability or an explicit change in its interpretation. The X/Y quota values remain unchosen. Export the whole party and real capture/training/evolution/item/EXP/EV history for supporter plans. Unknown policies, unsupported capture/team objectives and uncovered branches must be reported, not silently simplified to the solo lead. Separate required-story fights from optional/training battles when defining quota denominators. Independent entering-condition scores and carried full-route simulation are distinct scopes: random battle outcomes must eventually update HP/PP/bag/party before later replay steps, rather than a fake executor returning success and inventing fresh snapshots. Applicability and implementation order These numbers describe the LeafGreen Pokeguy profile (Mild; selected IVs 28/25/16/31/21/27 in HP/Atk/Def/SpA/SpD/Spe order, reconciled EVs/EXP). This PR describes FireRed, defaults simulation stats to Hardy/IV15/EV0, extrapolates summary stats, and explicitly fights wild Pokémon in the Forest. Its actual levels, EVs, HP and bag therefore need reconciliation before any probability transfer. Verify version/trainer identity and route differences; do not force the real starter into the benchmark profile by assumption. Suggested sequence: add a native AutoStory planning replay that emits its battle history/preconditions/policies; add a generic importer/validator and configurable quality report in PokemonSimulation; wire the producer's B-default/C-opt-in live decisions and verified item execution to that same contract; migrate old simulation callers and remove duplicated mechanics/Monte Carlo. Then add carried replay, branch coverage and full-party/capture support, and validate implemented console stages. Keep native controller regressions in Arduino-Source and mathematical/sampling tests here. Re-estimate any changed policy/profile in PokemonSimulation. The 69 independent rates do not yet prove a continuous full-route run, and the observed pre-Champion Elixir does not establish a sufficient stochastic PP budget. |
Depends on #122
FRLG AutoStory stage 1: the FireRed overworld walker (wild steps, obstacles, interrupted legs) and AutoStory from a new game to the Boulder Badge, with its battle logic. This is one squashed commit whose tree equals frlg/autostory-mvp; it replaces #117, #118, #119 and #120. The FRLG stack was consolidated into stage PRs so fixes need fewer merges, and will be split again for upstream.
🤖 Generated with Claude Code
https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E