Skip to content

FRLG AutoStory stage 4: Cerulean City - #216

Draft
dayfine wants to merge 4 commits into
frlg/stage3-mtmoonfrom
frlg/stage4-cerulean
Draft

dayfine wants to merge 4 commits into
frlg/stage3-mtmoonfrom
frlg/stage4-cerulean

Conversation

@dayfine

@dayfine dayfine commented Nov 3, 2026 •

Copy link
Copy Markdown
Owner

Depends on #215

FRLG AutoStory stage 4: from Mt. Moon to Cerulean City, the Cerulean rival, Nugget Bridge, and Misty before the rival. The first commit is squashed, and its tree equals frlg/cerulean-gym. It replaces #211 and #212 and will be split again for upstream.

The second commit handles sleep. The rival's Sleep Powder showed as "a status" on console B. The battle now reads SLP and, in trainer battles, uses an Awakening while the lead can take the hit that turn costs. The sim follows the same rule, and the 00.15 Mart buys 2 Awakenings. Each turn also logs why a Potion was or wasn't used. Tested with the FRLG AutoStory suites (sim, decisions, items, Mart, run plan), with red tests first.

The third commit fixes Nugget Bridge, where the walk onto the bridge ended a tile short and Cale never saw the player ("no_battle" twice on console B): each step into a bridge trainer's line now goes a tile at a time, up to 3, until the trainer speaks. It also runs preparation once per save: a step marked once_per_save (TEACH, MART) that changed nothing is skipped on a retry or verify run from the same save, so those go from the reload to the battle; the bag is read once per save too. MIN_WIN_CHANCE drops to 50%, since the rival at a 56% sim chance passed verification 2 of 3. Tested with red-first story sim, runner and threshold tests, and the FRLG AutoStory and story-engine suites.

The fourth commit sizes the Potion on the foe AI's likely turn: the AI's move chances (its scores drawn 1000 times) mixed into a next-turn damage distribution, with a Potion when its 20 HP beats the 80th percentile (one constant) instead of the foe's biggest hit; console and sim share it, tested red-first with the FRLG AutoStory suites.

🤖 Generated with Claude Code

https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E

Squash of fork PRs #211 and #212 (frlg/cerulean-gym at 3ad4d24).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
dayfine and others added 3 commits November 3, 2026 10:00
The status badge read Sleep Powder's SLP as "a status" (console B, m56,
00.15b run 2). SLP is now its own StatusCondition, from the badge's mean
color on that run's turn 6 and 7 captures.

Awakenings are a counted supply (bag reader name, Supplies, bag read,
Mart count). In a trainer's battle the lead uses one when asleep, the
foe can hurt it, and it outlasts the hit the item's turn costs; the sim
plays the same rule (awakening_now()) and the win chance counts them.
00.15's Cerulean Mart step buys 3 Potions and 2 Awakenings within its
1500 floor.

The turn 7 move at 13/65 HP with 15 Potions was the Potion rule: the
last turn took 21 HP (Vine Whip and Leech Seed), more than a Potion
heals, and an item's turn doesn't count sleep down. Each turn now logs
why a Potion was or wasn't used.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
…win chance

Nugget Bridge (00.16) failed twice on console B with "bug_catcher_cale:
no_battle": the open leg onto the bridge ended on (11, 33), a tile short,
and the one step onto Cale's row reached only (11, 32), out of his sight.
A STEP of the new TRAINER_LINE_VARIANT (into_line() in the table) now
steps a tile at a time, at most 3, until a trainer's message or battle
shows (step_until_seen()), and the five bridge lines use it. The battle's
end pose stays the trainer's row. A story sim test walks the row on the
OverworldSim from the walk's end whole and a tile short; it failed with
the console's error before.

Preparation runs once per save. StoryStep::once_per_save marks a step
that a retry after a reload of the same save skips once it succeeded
changing nothing (the new Outcome::changed_nothing); one that changed the
game runs again, as the reload undid it. build_story_checkpoint() takes
the PreparedSteps memory, which FRLG keeps in StoryEnv across reloads and
empties on a save. TEACH and MART steps are once per save, and report
changed_nothing for a move already known, no TM, or nothing to buy. The
reload hook reads the bag only until one read is complete. Runner tests
cover a retry after a loss and verify mode's three runs.

MIN_WIN_CHANCE is 0.50: the Cerulean rival at a sim chance of 56% passed
console verification 2 of 3 (m56), and verify mode is the backstop for
HIGH battles. Tests that assumed 70% now use 50%.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
The Potion rule compared a Potion's 20 HP to the foe's biggest hit, so
against the Cerulean rival's Bulbasaur (Vine Whip, or Leech Seed, Sleep
Powder and Poison Powder) it rarely healed. The sim now draws the AI's
move scores 1000 times from a fixed seed for each move's chance, mixes
each move's rolls, crits and accuracy with the end-of-turn poison and
Leech Seed into the next turn's damage, and heals when a Potion's HP
beats its 80th percentile (POTION_COVER_PERCENTILE). The Awakening rule
uses the same figure and now comes before a Potion. The console battle
and the win-chance sim share the rule; the log names the percentile and
the move chances.

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