Skip to content

PokemonFRLG: 10.01 to 10.06, the Pokemon Tower to Mr. Fuji - #405

Draft
dayfine wants to merge 50 commits into
frlg/stage8-rocktunnelfrom
frlg/stage9-tower
Draft

dayfine wants to merge 50 commits into
frlg/stage8-rocktunnelfrom
frlg/stage9-tower

Conversation

@dayfine

@dayfine dayfine commented Nov 12, 2026 •

Copy link
Copy Markdown
Owner

Depends on #293 (base frlg/stage8-rocktunnel; the diff shows only this change).

Checkpoints 09.03 to 10.06: the TEA and a Gift RNG Eevee in Celadon Mansion, then PokeGuy's way to Lavender and up the Pokemon Tower to Mr. Fuji and the POKE FLUTE.

  • 09.03/09.04 the TEA and the Eevee (Gift RNG); the Eevee stays in the party.
  • 10.01 rides the Department Store's lift to 5F (scripted as the Rocket Hideout's: same layout, the floor names pick the panel) and buys X Specials, X Speeds, X Accuracies and Guard Specs in that order at its money floor (10,712: 21 X Special, 6 X Speed, 1 X Accuracy), rides down, gets HM02 from Route 16's house, teaches Fly to the Pidgey found by its summary's species (Whirlwind read and replaced), and flies to Lavender.
  • 10.02 to 10.06: the Tower, the rival (X Specials, a Lv36 check first), the Channelers, the Marowak, the Grunts, Mr. Fuji.
  • The fault sweep now has both lifts' coded rooms, so 10.01 is swept again. One known-failing sweep: a scene-end tile-off after Mr. Fuji's warp.

Testing: FRLG AutoStory suites on the headless runner. The Tower/Teach/Hideout tests, the golden, the chain and the 10.x fault sweeps pass. The 15 failures are image/resource FileExceptions from the local setup. No console run.

🤖 Generated with Claude Code

https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss

dayfine and others added 18 commits November 11, 2026 19:49
…r to Mr. Fuji

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss
…e save card

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss
…td::format in them

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss
Two GAME steps for the checkpoints after Celadon: "fly" (party, the Fly
user's FLY, the town's cell on the fly map from pokefirered's Kanto
region map layout, landing on its heal location) and "surf" (face the
water, A, YES). Legs from the water are walked surfing, with a one-tile
leg off it as the planner makes. The overworld sim models Surf (onto the
water, surf pace, off onto land) and Fly (to a town's landing tile), and
the row sim plays both steps.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss
Pallet Town's pond lies in its Fat Man's wander box, which the planner
treats as standing room, so no leg crosses it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss
…on Mansion floors)

The story route plans still match the golden on the new maps.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss
…he Tower rival

A battle step's "use_items" lists items for the lead from the first turn,
before any attack: a Potion for HP not green comes first, none at red HP
or in a wild battle. An X item's USE skips the party list. The bag's
counts for items the story doesn't count take the pocket row away with
the last one used. The item reader knows the X items PokeGuy buys.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss
… test with the items tests

The Items pocket's count and row helpers move unchanged from
AutoStoryBattle.cpp to the .cpp of the header that declares them, with
spend_item() for the one use the battle file made of count_slot(); both
files are back under 1000 lines.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss
… to the Pidgey, Fly to Lavender

10.01 bikes from Celadon past Route 16's Cut tree and the north gate to
the house, takes HM02 from the wandering woman (a TALK named "wanderer":
A until she steps in front, up to 45 tries), teaches Fly to the Pidgey
over Whirlwind, and flies to Lavender's Center. Route 16, its north gate
and the house join the story's maps. The fault sweep counts a Fly as a
step the sim plays: it lands on its town's tile. The Department Store's
X items wait for its 2F..4F or lift maps.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss
…09.04); Gift RNG's handoff for any gift

Gift RNG's console steps take their target from the settings, and a
GIFT_RNG row names its gift ("gift": "magikarp" or "eevee"); the
AutoStory handoff runs the row's gift. The Eevee's in-game sequence
(4,000 ms, no gap) fits any Squirtle-timed target, so the RNG plan serves
it unchanged. 09.03 takes the TEA from Celadon Mansion 1F's old woman
(for the Saffron gate, 15.01) and saves facing the Eevee's ball in the
roof room; 09.04 is its live-start row after Gift RNG, as 04.03 is the
Magikarp's. 10.01 now starts there and leaves by the mansion's back door.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss
…the Tower rival

A LEVEL step on the lead before the fight. pokeguy's Blastoise is Lv36
here, and PokemonSimulation's docs/battles/pokeguy-conditions.md sims
that entry (C2 setup, 38/114 HP: 630/700 wins, 90.0%); at his level or above those sims
stand for this fight, below it the run stops before the fight. A sim
test runs the step with a Lv36 and a Lv35 lead.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss
…F by its lift; Fly taught to the Pidgey by species

The lift_floor step rides the Department Store's lift as it rides the
Rocket Hideout's: the two lifts share one layout, so the same legs in and
out, and the floors' names pick the panel (5F..1F, EXIT; it wraps). The
store's lift is a coded room with its floors' exits for the sim; its 1F
and 5F join the story's maps (already in the pinned map pack). 10.01 rides
up from 1F, buys X Specials, X Speeds, X Accuracies and Guard Specs in
that order at its money floor, and rides back down before Route 16.

A TEACH step may name the member by species instead of a slot: the first
slot whose summary reads it. 10.01 teaches Fly to the Pidgey so, with the
Eevee kept in the party; Whirlwind is read among its moves before it is
forgotten, as before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss
…'s Department Store

sweep_maps() carries the two lifts' coded rooms and every sweep script
their floors, so a lift_floor step plays on the sim (as a Fly does) and
10.01 is swept again instead of failing clean at its lift. The golden
takes 10.01's new routes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss
The golden's segment 10 lines move to PokemonFRLG_AutoStoryPlanGolden10.h
(one file passed 1000 lines); the test reads both. The lift menus are
lift_menu()'s alone, find_party_species() is local to the teach step, and
the store lift's room is documented.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss
dayfine and others added 2 commits November 11, 2026 21:44
…on save (19,862)

The trainer card at the Celadon save read 19,862, so the floor buys
PokeGuy's whole list: 21 X Specials, 6 X Speeds, 5 X Accuracies and
2 Guard Specs (15,600).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss
dayfine added a commit that referenced this pull request Nov 12, 2026
Main.cpp: keep the lab's cleanup placement after test mode, add main's PA_SDL gamepad stop.
frlg-09.03.plan.json: take #405's new 09.03 (TEA and the Eevee), not the old dropped 09.03.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss
…un and log them

Each try made a fresh GiftRngStats/StarterRngStats and dropped it, so the
resets, shinies, non-shiny hits and errors never reached the log. The
console steps now own the stats for the whole RNG run and log them after
every try, also when the try throws ("Gift RNG stats: ...").

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss
dayfine and others added 2 commits November 11, 2026 23:33
…ck; Gift RNG's messages name the gift

console B, 2026-11-11: after a shiny Eevee from Gift RNG in AutoStory,
09.04 stopped at "save_at_start_pose" on the Eevee's summary, which the
start frame kept at 09.03's save never matches. A live-start row loads
no save, so it gets no start check (checked_start_pose()); the row
after Starter RNG (01.06) is now a live-start row too. Gift RNG's loop
messages named a Magikarp that 04.03 saves; they now name the gift and
the row that saves it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss
… way they are taken

The game turns a player arriving by a warp (pokefirered
GetAdjustedInitialDirection()): west off up/down-right stairs, east off
the left ones, north off a south exit mat. The planner and the sim took
the arrival as facing the way the player walked, so after Celadon
Mansion's 2F->1F stairs the walker's turn tap west was a step: "west 2"
ended on (1, 2) and "north 1" onto the back door met the wall (10.01
below_store_lift, console B 2026-11-11 23:40). ExitStairsMovement() only
slides the sprite: the player stays on the stairs tile.

arrival_facing() (tile rules) is used by the planner's warp transition,
predict_overworld_press() and the sim's warp step. 09.01 b3f_off_stairs
and 09.02 b2f_from_b3f end on stairs, so their targets now face west, as
the game leaves the player (a "face east" there would turn toward the
stairs). Golden: those two headers, and 10.04 off PokemonTower_3F's
stairs (4, 10) walks east first.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss
dayfine added a commit that referenced this pull request Nov 12, 2026
dayfine and others added 2 commits November 12, 2026 00:14
The fly step can name the Fly user's species instead of a slot
(FlyPlan::party_slot(), via find_party_species(), now shared with the
teach step). It came with 11.01 (#417); 10.01 is where Fly is first used,
so it lives here, and 10.01 flies with "species": "pidgey" in place of
slot 3, which held only while the party kept its order.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss
…ng as the game turns them

warp_press() took the facing after a warp as the way the press went, and
its end as the warp tile under the destination's name. It now uses the
planner's rule, arrival_facing(): off Celadon Mansion's 2F stairs (4, 2),
taken east, the player faces west on 1F's (4, 2) (10.01
below_store_lift), and out of a cave or a door the game walks them a
tile south, facing south.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss
dayfine added a commit that referenced this pull request Nov 12, 2026
dayfine and others added 5 commits November 12, 2026 01:16
…he Fly house's door

Red: the run-paced open leg after the gate overshoots the door on the
Bicycle, as on console B (2026-11-12 01:05), ending on Route16 (2, 5).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss
The gate keeps the rider on the Bicycle, so below_fly_woman is a bike
route: the open leg west to the door is tapped out at the Bicycle's pace.

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

The row sim walked every route at its walking pace. A BIKE_VARIANT step
now rides where the sim has the player on the Bicycle, as the console
does, so the Fly house's door test is green with the bike plan and red
with the old run plan.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss
dayfine added a commit that referenced this pull request Nov 12, 2026
dayfine added a commit that referenced this pull request Nov 12, 2026
… Fly forgets Sand-Attack without Whirlwind

10.01's teach_fly failed on console B (2026-11-12 01:38): the moves reader's
dictionary had no Pidgey moves, so SAND-ATTACK, QUICK ATTACK and WHIRLWIND
read as attract, attract and steel-wing, and "whirlwind, the move to
forget" wasn't found. MOVE_NAMES gets the Pidgey line's level-up moves
(red-first image test on the failure frame, Pidgey_KnownMoves_eng.png,
fork-only image).

The step also said "slot 1" for the Pidgey, the party's third: the party
menu didn't open on the lead, so slot 1's read showed the Pidgey. The
summary read taps LEFT first, which puts the cursor on the lead.

The teach step takes or_forget, moves to forget in order when it doesn't
know `forget`'s; 10.01 forgets Whirlwind, else Sand-Attack, which leaves
pokeguy's Fly, Gust, Quick Attack and Steel Wing.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss
dayfine added a commit that referenced this pull request Nov 12, 2026
dayfine added a commit that referenced this pull request Nov 12, 2026
10.03 blacked out at the Tower rival (console B, 2026-11-12): the Items
pocket was read one page deep, so the two X Specials below a MOON STONE,
a NUGGET and four more rows were never known and never used; and Bite
won every type tie, over Water Pulse against Pidgeotto, and Bubble over
Water Pulse against Growlithe.

read_items_pocket() now scrolls the pocket a row at a time to its
CANCEL, and a row past the first page is checked where the scrolled list
shows it (item_shown_row(), from pokefirered's list menu). Water Pulse
heads the squirtle line's attacks.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss
dayfine added a commit that referenced this pull request Nov 12, 2026
dayfine added a commit that referenced this pull request Nov 12, 2026
dayfine and others added 3 commits November 12, 2026 03:21
…Tower stairs going east

10.04 tower_4f_stairs failed on console B (2026-11-12 03:08): the screen
check read the turn tap before "south 3" as a step, the legs ended on
Pokemon Tower 3F (18, 9), and the press east into the stairs' warp met the
wall. count_bike_taps() now counts a tap from a facing read another way as
a turn whatever the screen shows, and 10.04 steps onto the stairs (18, 10)
from (17, 10), going east, the way their warp is taken.

Tests: the sim fault SimScript::seen_turn_taps reproduces the run
(OverworldStairs), and a story check keeps legs that end on side stairs
or an exit mat going the warp's way (AutoStory).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss
A story check over the legs from 03.03 on: legs that end on side stairs
or an exit mat step onto them the way their warp is taken, or end at a
wall. 10.04's golden follows its new legs to (17, 10). 09.01's legs onto
B4F's stairs passed on the console and are left as they are: east onto
them fails the 09.01 simulation (no fade into B3F), a follow-up.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss
reads_step_tap_as_step() replaces hides_moved_step_tap() and the turn tap
count moves into SimState, keeping OverworldSim's public methods and file
length within code health's limits.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss
dayfine added a commit that referenced this pull request Nov 12, 2026
…wer 3F stairs going east

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss
10.05 tower_6f_stairs failed on console B (2026-11-12 03:41): the planned
"south 3 (open)" onto Pokemon Tower 5F's stairs (18, 10) ended a tile
short, and the presses east into the stairs' warp met the wall. Those
stairs have walls east and west, so no route steps onto them going east.

The planner now taps a leg that ends on side stairs or an exit mat going
another way than its warp is taken, and not at a wall, and taps the open
legs before it back to the route's start, a wall or a warp, so it starts
from a known tile. 16 golden lines gain [tapped] (02.01..10.06).

Tests: OverworldStairs reproduces 10.05 with a short hold and a turn tap
read as a step (red before the fix); the AutoStory story check now plans
every route from 03.03 on and checks its legs onto side stairs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss
dayfine added a commit that referenced this pull request Nov 12, 2026
dayfine and others added 11 commits November 12, 2026 04:21
10.05 refused its own save twice: on Pokemon Tower 5F the horizontal fog
(64 px, one pixel every 4 GBA frames, 4.3 s) had scrolled since the frame
was kept, and three frames a second apart differed in 76, 68 and 52 of 150
tiles. The console's check now tries 12 frames 400 ms apart, so one shows
the fog within 3 px of the kept frame. Thresholds are unchanged; a step
off in the same fog still fails.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss
10.05 still refused its own save after 614be52: all 12 frames over 4.8 s
differed from the kept frame in 52 to 77 of 150 tiles. The two frames
show the same pose; only Pokemon Tower's fog differs, 16 pixels lower
after the reload. The fog moves with the camera's offset since the map
loaded and with time, so waiting can't line it up.

A tile now counts as changed when its detail (each pixel less its 5x5
average, matched within 2 pixels) differs, or its colour changes more
than the fog can. The Tower 5F pair: 19 of 150 tiles (was 71); one step
off there: 49 to 67; one step off on Tower 3F to 5F, Celadon Department
Store, the Lavender house and Route 10's grass: 41 to 76 (Route 10's
grass and the Tower were 26 to 39 before, near or under the threshold).
The console check goes back to 3 frames a second apart.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss
…already facing

10.05 tower_rare_candy failed on console B (2026-11-12 04:39): after
Emilia the player faced west (FRLG doesn't turn the player to a trainer:
pokefirered trainer_see.c), the declared facing was north, so the turn tap
west took a step and "west 4 (open)" ended on Pokemon Tower 6F (4, 8);
"south 6" met the gravestone (4, 9) and A faced nothing. turn_to() now
reads the facing before its first tap and skips it if the player already
faces the way. The approach to the Rare Candy is walked a tap a tile from
(9, 8), each tap checked by the facing read before it.

Tests: AutoStory Tower sim case for the approach with both holds a tile
short.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss
…way into its line

FRLG doesn't turn the player to a trainer who sees them (pokefirered
trainer_see.c, the turn in TrainerSeeFunc_PrepareToEngage is commented
out), so the facing a battle after a trainer_line or trainer_wait step
declares is that step's direction. 22 battles declared the way to the
trainer instead (06.02 x3, 07.02 x3, 08.01 x8, 08.03, 10.04 x2, 10.05 x2,
10.06 x3); 10.05's after Emilia made the walk's turn tap a step (console
B, 2026-11-12 04:39). 10.05 starts facing south, as 10.04 ends after
Tammy.

Golden: six route starts change facing only (06.02 below_gym_tree,
07.02 below_conner_line, 08.01 b1f_south_ladder, 10.05 tower_6f_stairs,
10.05 tower_6f_east_of_emilia_line, 10.06 below_fuji); no leg changes.

Tests: new AutoStory check over every battle after a trainer's line.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss
A story check plans every ROUTE and LEGS run before a TALK (a person, an
item, a sign) and requires both axes of its end found: by a leg to a wall
or a spinner's stop along its way, a warp, or taps from there on. A held
open leg can end a tile short or long; 10.05's held approach to the Rare
Candy did (console B, 2026-11-12 04:39).

10.06's approach to Mr. Fuji held "north 3" from the door, open at
(4, 3): now a tap a tile, then turned north. Twelve approaches before
10.05 that passed their console runs as held legs are listed as such
(a follow-up to tap them).

Golden: 10.06 below_fuji_house leaves the route plans (now legs);
facing_fuji, a turn north, joins them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss
Conflicts: walk_and_watch() and turn_to() take the player's gender (incoming) and keep this branch's bike-through-warp rule and facing check before a turn tap.

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