Skip to content

FRLG AutoStory 16.03: the Silph rival by PokeGuy's C2 policy, Blizzard first - #554

Draft
dayfine wants to merge 16 commits into
frlg/stage20-leaguefrom
frlg/silph-rival-battle
Draft

dayfine wants to merge 16 commits into
frlg/stage20-leaguefrom
frlg/silph-rival-battle

Conversation

@dayfine

@dayfine dayfine commented Nov 15, 2026

Copy link
Copy Markdown
Owner

Base: frlg/stage20-league (after #514 and #548); the diff shows only this change.

Console B lost the Silph Co. 7F rival (16.03 run 6, 2026-11-15): the battle step had no policy, so the lead attacked from turn 1 without X items, and it arrived with Dig instead of the Blizzard 13.03 teaches; Venusaur put it to sleep and the back line fell one per turn. 16.03 now starts with TM14 Blizzard over Dig (does nothing if the lead knows it, skipped if the bag has no TM14) and fights the rival by PokeGuy's goal-based-setup with the doc's silph-rival goals and PokemonSimulation planning_risk() rows for console B's entry (Lv43, 136/136). PokemonSimulation sim of that entry: 12% as it ran (500 trials), 35% with C2 alone, 46% with Blizzard alone, 99.4% with both (500 trials). Tested with three new AutoStory Silph unit tests (policy and rows, the TEACH step, Blizzard picked against Venusaur); CI runs them.

dayfine and others added 16 commits November 15, 2026 01:41
…d first

Console B lost the 7F rival (2026-11-15, run 6): the step had no battle
policy, so the lead attacked from turn 1 with no X items, and it came with
Dig instead of 13.03's Blizzard; Venusaur slept it and the back line fell.

16.03 now starts with TM14 Blizzard over Dig (nothing if the lead knows it,
skipped without the TM), and fights the rival by goal-based-setup with the
doc's silph-rival goals and PokemonSimulation planning_risk() rows for
console B's entry (Lv43, 136/136). Sim of that entry: 12% as run, 35% with
C2 alone, 46% with Blizzard alone, 99.4% with both.
…ssing TM fails

13.03's teach_blizzard read only the five rows shown (HM01-HM04, TM06) and
skipped TM14 on the sixth. open_row() now steps DOWN to the list's end, then
UP to its top, until the rows shown have the target; only then NOT_IN_CASE.
A TM or HM the plan picked up but the case hasn't got now fails the step
(teach_no_item, red log, debug image) instead of skipping it.
…off its bottom row, as on console B

Console B, 16.03 (2026-11-15): the arrow stayed on the fourth row of five
while the rows moved up one per DOWN, so moving to BLIZZARD's row index ran
the cursor to CLOSE. The long-case tests go red on 249cad3.
…again in each view

The TM Case scrolls under a cursor that stays off its bottom row, so a fixed
row index walked the cursor past BLIZZARD to CLOSE (console B, 16.03). A is
pressed only once the row under the cursor reads as the target.
Console B lost the Silph rival (2026-11-15, 16.03 run 8) after teaching
Blizzard over Dig: the battles kept the lead's moves read when the save
loaded, so it attacked Pidgeot with Surf and Venusaur with Bite instead of
Blizzard, and Venusaur slept it. A learned TEACH to party slot 1 now puts
the move, at full PP, in the forgotten move's slot of the battles' lead.
At 16.05 (console B, 2026-11-15) a Silph Co. grunt was beaten and the
overworld at the map's edge, black below the player, passed for the
battle's text box: BattleDialogDetector's blue test matches black. The
loop held B for an evolution three times for 20 s with no START in
between and stopped. The same black before each step of 16.02 read as
a battle on its way (FrlgScreenObserver), and the loop looked for a
battle for 15 s.

The evolution check and the screen observer now read the box with its
gold and white frame (BattleTextBoxDetector), which the evolution scene
draws too (pret evolution_scene.c: LoadBattleTextboxAndBackground).
After a hold that runs out no other one starts, so START looks for the
overworld.
… tests

wait_out_evolution() reads through Pokemon::ReadingSource, so a test feeds
it ScriptedReadings (shared, Pokemon/AutoStory) on a virtual clock. The
battle loop's ConsoleTextReadings waits on the controller and reads a
snapshot as before. New suites: Pokemon::ScriptedReadings and
PokemonFRLG::AutoStoryEvolutionWait (text-black-overworld, an evolution,
no frame mid-evolution, 16.05's map-edge black as the text box and as the
frame check reads it); read_text_screen()'s text box on the 16.05 frame.
…AutoStory

The console's ReadingSource is generic (a wait on the controller, a frame
through a game's reader), so it moves to Pokemon_ConsoleReadings.h; the
wait is a method of EvolutionHold, and the test suite has its own header.
…walk test

OverworldSimWalker::run takes the facing the program believes, as the
console's walk_route() does. The new Silph case walks below_president from
where Giovanni's battle leaves the player, (5, 15) facing east
(SilphCo_11F_Movement_PlayerFaceGiovanni), from the giovanni step's
declared pose. Red: that pose says north, so the first hold turns the
player and the walk ends off (console B, 2026-11-15 13:02, 16.05).
He walks down to (6, 15) and the player turns to him
(SilphCo_11F_Movement_PlayerFaceGiovanni). With the pose saying north,
below_president held "north 5" with no turn tap: the hold turned the
player and went 4 tiles, "east 4" stopped on the table and the talk to
the president opened no message (console B, 2026-11-15 13:02).
When the game asks for the next member ("Choose a POKeMON." with the
lead's HP bar empty), the battle loop sends none and returns
BattleEnd::LEAD_FAINTED; a trainer step fails with "lead_fainted"
(class battle_lost), and the checkpoint reloads under its attempts.
Console B, 2026-11-15, 16.05: Blastoise fainted to Giovanni and the loop
pressed B at the party list for 60 s, then failed as operation_failed.

The party list is read first at every poll, battle confirmed or not, so
a step run again on that screen stops too. Sending the next member
(next_member_slot) is gone. Tests: a scripted-readings case (fainted
text, then the party list: a stop within a poll, no hold) and a frame
test on the 16.05 capture; CommandLineTests pin moved to 5ea4c10.
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