From 8b656d1a218d9c759b81fe85fe3e4f7ed16112a4 Mon Sep 17 00:00:00 2001 From: dayfine Date: Mon, 9 Nov 2026 10:20:41 -0800 Subject: [PATCH 01/79] FRLG story drafts 00.29-00.31: Lavender to the Silph Scope Unverified authored-checkpoint drafts, outside the embedded StoryData set: the Lavender Mart, Route 8, the Underground Path, a Pidgey for Fly, and the Rocket Hideout to Giovanni. The README lists the whole 00.29-00.51 draft, its conventions, the user's open decisions and the leg check. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss --- .../AutoStory/StoryData/Draft/README.md | 135 ++++++++++++++++++ .../StoryData/Draft/frlg-00.29.plan.json | 91 ++++++++++++ .../StoryData/Draft/frlg-00.30.plan.json | 86 +++++++++++ .../StoryData/Draft/frlg-00.31.plan.json | 105 ++++++++++++++ 4 files changed, 417 insertions(+) create mode 100644 SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/Draft/README.md create mode 100644 SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/Draft/frlg-00.29.plan.json create mode 100644 SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/Draft/frlg-00.30.plan.json create mode 100644 SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/Draft/frlg-00.31.plan.json diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/Draft/README.md b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/Draft/README.md new file mode 100644 index 0000000000..8046824952 --- /dev/null +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/Draft/README.md @@ -0,0 +1,135 @@ +# FRLG story drafts, 00.29 to the Hall of Fame + +**Every file here is an unverified draft.** None has run on a console, and the +story table doesn't load them: `pa_embed_text_files()` embeds only +`StoryData/*.json`, not this folder. The authored format has no status field, +so this README is where they are marked unverified. + +Each file is a `pokesim-authored-checkpoint/1` plan in the same format as +`../frlg-parcel-00.05.plan.json`. The order and the item stops follow PokeGuy's +LeafGreen run (PokemonSimulation `data/runs/pokeguy-leafgreen-15934/events.json` +and `external/pokeguy-notes.md`). They start where 00.28 (Rock Tunnel to +Lavender, on `frlg/stage8-rocktunnel`) is expected to end: at Lavender's nurse. + +| Id | Title | Events | +|---|---|---:| +| 00.29 | Lavender Mart, then west over Route 8: Gamer Rich, a Pidgey for Fly, the Underground Path to Celadon | 12 | +| 00.30 | Celadon Game Corner and the Rocket Hideout down to B4F: the poster guard, the Lift Key Grunt, the LIFT KEY and B3F's Rare Candy | 12 | +| 00.31 | Rocket Hideout: the lift to B4F, the two door guards, two Rare Candies, Blastoise, Giovanni and the SILPH SCOPE | 16 | +| 00.32 | Celadon: Department Store 5F battle items, HM02 Fly on Route 16 for the Pidgey, the Tea, then the Center | 20 | +| 00.32b | Celadon Mansion roof room: the Eevee (Gift RNG placeholder) | 4 | +| 00.33 | Fly to Lavender, the Center, Pokemon Tower 2F: the rival | 8 | +| 00.34 | Pokemon Tower 3F to 7F: Tammy, Jennifer, Emilia, the Marowak, three Grunts, Mr. Fuji | 21 | +| 00.35 | The POKE FLUTE, Fly to Celadon, Route 16's Snorlax, Cycling Road's Rare Candy and Max Elixir, Fuchsia | 16 | +| 00.36 | Safari Zone: a Full Restore, the GOLD TEETH, HM03 Surf from the Secret House | 12 | +| 00.37 | Fuchsia: Surf to the lead, Juggler Kirk, Koga, then HM04 Strength from the Warden | 14 | +| 00.38 | Fly to Pallet, Surf down Route 21 to Cinnabar, the Mansion: Elixir, TM14 Blizzard and the SECRET KEY | 15 | +| 00.38b | Cinnabar Lab: the Helix Fossil revived (Gift RNG placeholder) | 6 | +| 00.39 | Cinnabar Gym: the quiz doors, Blaine | 9 | +| 00.40 | Fly to Celadon: two Rare Candies, Blizzard, Celadon Gym: Tamia, Lori, Erika | 21 | +| 00.41 | East to Saffron: the TEA at the gate, the Fighting Dojo's Hitmonchan (Gift RNG placeholder), the Center | 13 | +| 00.42 | Silph Co.: the CARD KEY, the rival on 7F, the Lapras (Gift RNG placeholder) | 10 | +| 00.43 | Silph Co. 11F: the boardroom Grunt, Giovanni; then Sabrina | 13 | +| 00.44 | Fly to Viridian: Viridian Gym: Takashi, Warren, Giovanni | 14 | +| 00.45 | Route 22: the rival; Route 23's badge gates; Strength | 7 | +| 00.46 | Victory Road's boulders, Indigo Plateau: Full Restores, the nurse, the save | 8 | +| 00.47 | Lorelei | 4 | +| 00.48 | Bruno | 3 | +| 00.49 | Agatha | 3 | +| 00.50 | Lance | 3 | +| 00.51 | The Champion and the Hall of Fame | 4 | + +## Conventions + +- A `battle` event's `id` is the battle's id in PokemonSimulation + `docs/battles/pokeguy-trainers.json`, e.g. `route8-rich`, `koga`. Its strategy + belongs to the battle agent, not to these files. Two battles have no entry + there: `tower-marowak` (an `events.json` scripted fight) and + `dojo-karate-master` (not in PokeGuy's run). +- Shopping is a `mart ...` `game_action` with the quantities from + PokemonSimulation `docs/battles/pokeguy-conditions.md` bags and PokeGuy's + receipts: Lavender (4 Escape Ropes, 7 Super Repels), Celadon 5F (6 X Speed, + 21 X Special, 5 X Accuracy, 2 Guard Spec), Indigo Plateau (12 Full Restores). +- A pickup faces the ball and talks (A). Hidden items (Cycling Road's Rare Candy + and Max Elixir, the Mansion's Elixir) have no tile in the candidate maps. +- The story's shiny gifts are placeholders: a `party_room free=1` check, then a + `gift_rng ` handoff, for the Eevee (00.32b), the Omanyte from the Helix + Fossil (00.38b), the Hitmonchan (00.41) and the Lapras (00.42). The authored + format can't yet say `handoff`/`live_start` as 00.12/00.12b do in C++. +- New `game_action` variants that no executor has yet: `party_room`, + `gift_rng`, `use_item`, `fly`, `flee_wild`, `surf`, `strength_puzzle`, + `reenter_map`. The `mart` variants name Marts the Mart table doesn't list + yet (Lavender, Celadon 5F, Indigo Plateau). +- HMs and key items come in story order: LIFT KEY, SILPH SCOPE, HM02 Fly, TEA, + POKE FLUTE, HM03 Surf, GOLD TEETH, HM04 Strength, SECRET KEY, CARD KEY. + +## Decisions for the user + +- **A Pidgey for Fly.** PokeGuy flies everywhere from 1:03; the story party has + no flier. 00.29 catches a Pidgey in Route 7's grass (Route 8's grass is behind + two Cut trees). Without Fly, Cinnabar needs a long walk round to Pallet. +- **TM14 Blizzard over Mega Kick** (00.40) is a one-shot TM: it needs the team + plan first. +- **Strength over Water Pulse** (00.45) and **Surf over Water Gun** (00.37) + follow PokeGuy. +- **The Hitmonchan** needs the Dojo's Karate Master beaten, a fight PokeGuy + skipped. + +## Leg check + +Every `route` event was planned on PokemonSimulation `6c2f5c8` +(`data/games/frlg/maps/source-candidate`, plus `runtime` for the maps the +candidate set lacks) with `RuntimeWorld` and the shared `shortest_path()`, from +the previous event's pose. 74 legs plan; 36 are skipped, none fails. The +planner ignores trainer sight, Surf, Strength, spinner and quiz tiles, and holds +NPC wander boxes as walls. No map was edited. Where a leg crosses a map edge on +an open tile (Lavender to Route 8, Route 7 to Celadon), the executor should hold +it to a wall, because of the known off-by-one on unheld crossings. + +Two candidate maps look wrong; these are map questions for the user, not edits: +the Elite Four rooms' arrival points (e.g. Lorelei's `warp_0` (6, 12)) are +wall tiles, and Indigo Plateau's door glyph is at (11, 5) with its warp at +(11, 6). + +| Skipped leg | Why | +|---|---| +| 00.29/celadon_nurse | map not in source-candidate | +| 00.31/b2f_lift | B2F's lift corner is reached over arrow tiles the planner does not solve | +| 00.31/b4f_below_guards | RocketHideout_Elevator map not in source-candidate | +| 00.32/x_item_clerk | CeladonCity_DepartmentStore_Elevator map not in source-candidate | +| 00.32/route16_below_tree | CeladonCity_DepartmentStore_Elevator map not in source-candidate | +| 00.32/celadon_nurse | map not in source-candidate | +| 00.32b/eevee_ball | Condominiums 2F/3F/RoofRoom map not in source-candidate | +| 00.35/cycling_road_rare_candy | Route17 map not in source-candidate | +| 00.35/cycling_road_max_elixir | Route17 map not in source-candidate | +| 00.35/fuchsia_below_center | Route17 map not in source-candidate | +| 00.35/fuchsia_nurse | map not in source-candidate | +| 00.37/fuchsia_nurse | map not in source-candidate | +| 00.38/mansion_b1f | the statue-switch gates and the floor drop are not modeled | +| 00.38/hidden_elixir_spot | hidden item tiles are not in the candidate maps | +| 00.38/below_tm14 | the statue-switch gates are not modeled | +| 00.38/below_secret_key | the statue-switch gates are not modeled | +| 00.38/cinnabar_nurse | map not in source-candidate | +| 00.38b/fossil_scientist | CinnabarIsland_PokemonLab_* map not in source-candidate | +| 00.39/below_blaine | the quiz doors are not modeled | +| 00.40/celadon_nurse | map not in source-candidate | +| 00.41/karate_master | SaffronCity_Dojo map not in source-candidate | +| 00.41/hitmonchan_ball | SaffronCity_Dojo map not in source-candidate | +| 00.41/saffron_center_door | SaffronCity_Dojo map not in source-candidate | +| 00.41/saffron_nurse | map not in source-candidate | +| 00.43/below_sabrina | warp-tile room order not planned: check SaffronCity_Gym warps | +| 00.44/takashi_line | arrow tiles and trainer lines not planned | +| 00.44/warren_line | arrow tiles and trainer lines not planned | +| 00.44/below_gym_giovanni | start unknown | +| 00.45/victory_road_door | Surf legs between the gates are not planned | +| 00.46/indigo_door | Victory Road boulder states are not modeled | +| 00.46/indigo_clerk | the Plateau door (11, 6) does not lead in on the candidate maps (no door glyph under the credits NPCs) | +| 00.47/below_lorelei | E4 arrival: the room's arrival point is a wall tile in the candidate map (map question, not edited) | +| 00.48/below_bruno | E4 arrival: the room's arrival point is a wall tile in the candidate map (map question, not edited) | +| 00.49/below_agatha | E4 arrival: the room's arrival point is a wall tile in the candidate map (map question, not edited) | +| 00.50/below_lance | E4 arrival: the room's arrival point is a wall tile in the candidate map (map question, not edited) | +| 00.51/below_champion | E4 arrival: the room's arrival point is a wall tile in the candidate map (map question, not edited) | + +The native codec (`Pokemon::read_authored_checkpoint()`, built alone from the +story-data-tests sources) and PokemonSimulation's `read_authored_checkpoint()` +both read all 25 files. diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/Draft/frlg-00.29.plan.json b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/Draft/frlg-00.29.plan.json new file mode 100644 index 0000000000..135608d5d2 --- /dev/null +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/Draft/frlg-00.29.plan.json @@ -0,0 +1,91 @@ +{ + "format": "pokesim-authored-checkpoint/1", + "game": "frlg", + "checkpoint": { + "id": "00.29", + "title": "Lavender Mart, then west over Route 8: Gamer Rich, a Pidgey for Fly, the Underground Path to Celadon", + "start": {"certainty": "tile", "map": "LavenderTown_PokemonCenter_1F", "where": {"facing": "north", "kind": "tiles", "tiles": [[7, 4]]}}, + "events": [ + { + "id": "lavender_mart_clerk", + "kind": "route", + "target": {"certainty": "tile", "map": "LavenderTown_Mart", "where": {"facing": "west", "kind": "tiles", "tiles": [[4, 3]]}}, + "variant": "run", + "why": "out of the Center, east along row 6 and down to the Mart (20, 15), to its clerk" + }, + { + "id": "buy_ropes_and_super_repels", + "kind": "game_action", + "variant": "mart LavenderTown_Mart budget=5700 floor=9000 escape-rope=4 super-repel=7", + "why": "pokeguy 54:18: 4 Escape Ropes and 7 Super Repels" + }, + { + "id": "east_of_rich_line", + "kind": "route", + "target": {"certainty": "tile", "map": "Route8", "where": {"facing": "west", "kind": "tiles", "tiles": [[56, 18]]}}, + "variant": "run", + "why": "west out of Lavender onto Route 8, down column 64 east of Julia (62, 14) and west along row 18" + }, + { + "id": "rich_line", + "kind": "step", + "direction": "west", + "variant": "trainer_line", + "why": "onto (55, 18), the end of Rich's line (55, 16..18): he walks down to (55, 17)" + }, + { + "id": "route8-rich", + "kind": "battle", + "declared_after": {"certainty": "tile", "map": "Route8", "where": {"facing": "north", "kind": "tiles", "tiles": [[55, 18]]}}, + "why": "Gamer Rich (TRAINER_GAMER_RICH): Growlithe, Vulpix Lv24" + }, + { + "id": "below_underground_door", + "kind": "route", + "target": {"certainty": "tile", "map": "Route8", "where": {"facing": "north", "kind": "tiles", "tiles": [[13, 5]]}}, + "variant": "run", + "why": "west along rows 14..18, up column 14 east of Aidan's line (10..13, 6), to below the Underground Path door (13, 4)" + }, + { + "id": "route7_underground_exit", + "kind": "route", + "target": {"certainty": "tile", "map": "Route7", "where": {"facing": "south", "kind": "tiles", "tiles": [[7, 15]]}}, + "variant": "run", + "why": "through the door, the east entrance, the east-west tunnel and the west entrance, out onto Route 7" + }, + { + "id": "pidgey_grass", + "kind": "route", + "target": {"certainty": "tile", "map": "Route7", "where": {"facing": "east", "kind": "tiles", "tiles": [[14, 5]]}}, + "variant": "run", + "why": "north round the ledges into Route 7's grass (11..16, 2..5), a grass tile east of it free; Route 8's grass is behind two Cut trees" + }, + { + "id": "catch_pidgey", + "kind": "game_action", + "variant": "capture pidgey catches=1 encounters=30 balls=5 pace=east", + "why": "a Pidgey to carry HM02 Fly (pokeguy flies with a Pidgey from 1:03 on); the party has no other flier" + }, + { + "id": "celadon_below_center", + "kind": "route", + "target": {"certainty": "tile", "map": "CeladonCity", "where": {"facing": "north", "kind": "tiles", "tiles": [[48, 12]]}}, + "variant": "run", + "why": "north round the grass, west onto Celadon (row 12..15) and along row 12 to below the Center door (48, 11)" + }, + { + "id": "celadon_nurse", + "kind": "route", + "target": {"certainty": "tile", "map": "CeladonCity_PokemonCenter_1F", "where": {"facing": "north", "kind": "tiles", "tiles": [[7, 4]]}}, + "variant": "run", + "why": "into the Center, to the nurse" + }, + { + "id": "heal_celadon", + "kind": "heal", + "why": "the nurse heals the party" + } + ] + }, + "execution": {"menu": "full"} +} diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/Draft/frlg-00.30.plan.json b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/Draft/frlg-00.30.plan.json new file mode 100644 index 0000000000..0b256ee6be --- /dev/null +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/Draft/frlg-00.30.plan.json @@ -0,0 +1,86 @@ +{ + "format": "pokesim-authored-checkpoint/1", + "game": "frlg", + "checkpoint": { + "id": "00.30", + "title": "Celadon Game Corner and the Rocket Hideout down to B4F: the poster guard, the Lift Key Grunt, the LIFT KEY and B3F's Rare Candy", + "start": {"certainty": "tile", "map": "CeladonCity_PokemonCenter_1F", "where": {"facing": "north", "kind": "tiles", "tiles": [[7, 4]]}}, + "events": [ + { + "id": "celadon_below_game_corner", + "kind": "route", + "target": {"certainty": "tile", "map": "CeladonCity", "where": {"facing": "north", "kind": "tiles", "tiles": [[34, 22]]}}, + "variant": "run", + "why": "out of the Center, west along row 12, down column 41..43 to row 22, west to below the Game Corner (34, 21)" + }, + { + "id": "below_poster_guard", + "kind": "route", + "target": {"certainty": "tile", "map": "CeladonCity_GameCorner", "where": {"facing": "north", "kind": "tiles", "tiles": [[11, 3]]}}, + "variant": "run", + "why": "into the Game Corner, up the slot rows to below the Grunt (11, 2) in front of the poster" + }, + { + "id": "talk_poster_guard", + "kind": "talk", + "why": "the Grunt guarding the poster" + }, + { + "id": "hideout-poster-guard", + "kind": "battle", + "declared_after": {"certainty": "tile", "map": "CeladonCity_GameCorner", "where": {"facing": "north", "kind": "tiles", "tiles": [[11, 3]]}}, + "why": "Rocket Grunt (TRAINER_TEAM_ROCKET_GRUNT_7): Raticate, Zubat Lv20; he runs off" + }, + { + "id": "poster_switch", + "kind": "talk", + "why": "the poster (11, 1): the switch opens the stairs (15, 2)" + }, + { + "id": "hideout_b4f_west", + "kind": "route", + "target": {"certainty": "tile", "map": "RocketHideout_B4F", "where": {"facing": "west", "kind": "tiles", "tiles": [[5, 3]]}}, + "variant": "run", + "why": "the stairs (15, 2) down to B1F, B1F to B2F (17, 2), B2F's arrow tiles to B3F (21, 2), B3F to B4F (15, 18), round to (5, 3), east of the tile below the Grunt (4, 2)" + }, + { + "id": "key_grunt_line", + "kind": "step", + "direction": "west", + "variant": "trainer_line", + "why": "onto (4, 3), in the Grunt's line (sight 1)" + }, + { + "id": "hideout-key-grunt", + "kind": "battle", + "declared_after": {"certainty": "tile", "map": "RocketHideout_B4F", "where": {"facing": "west", "kind": "tiles", "tiles": [[4, 3]]}}, + "why": "Rocket Grunt (TRAINER_TEAM_ROCKET_GRUNT_18): Koffing, Zubat Lv21; he drops the LIFT KEY" + }, + { + "id": "below_lift_key", + "kind": "route", + "target": {"certainty": "tile", "map": "RocketHideout_B4F", "where": {"facing": "north", "kind": "tiles", "tiles": [[3, 3]]}}, + "variant": "run", + "why": "a tile west, below the LIFT KEY (3, 2)" + }, + { + "id": "lift_key", + "kind": "talk", + "why": "pick up the LIFT KEY (pokeguy 57:33)" + }, + { + "id": "beside_b3f_rare_candy", + "kind": "route", + "target": {"certainty": "tile", "map": "RocketHideout_B3F", "where": {"facing": "north", "kind": "tiles", "tiles": [[12, 13]]}}, + "variant": "run", + "why": "back up the stairs to B3F, below the Rare Candy (12, 12) beside the arrow tiles" + }, + { + "id": "b3f_rare_candy", + "kind": "talk", + "why": "pick up the Rare Candy: two, with Route 9's" + } + ] + }, + "execution": {"menu": "full"} +} diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/Draft/frlg-00.31.plan.json b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/Draft/frlg-00.31.plan.json new file mode 100644 index 0000000000..e040f84d88 --- /dev/null +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/Draft/frlg-00.31.plan.json @@ -0,0 +1,105 @@ +{ + "format": "pokesim-authored-checkpoint/1", + "game": "frlg", + "checkpoint": { + "id": "00.31", + "title": "Rocket Hideout: the lift to B4F, the two door guards, two Rare Candies, Blastoise, Giovanni and the SILPH SCOPE", + "start": {"certainty": "tile", "map": "RocketHideout_B3F", "where": {"facing": "north", "kind": "tiles", "tiles": [[12, 13]]}}, + "events": [ + { + "id": "b2f_lift", + "kind": "route", + "target": {"certainty": "tile", "map": "RocketHideout_B2F", "where": {"facing": "north", "kind": "tiles", "tiles": [[28, 17]]}}, + "variant": "run", + "why": "up to B2F, along the arrow tiles to the lift (28..29, 16)" + }, + { + "id": "lift_to_b4f", + "kind": "scene", + "why": "the LIFT KEY works the lift: B4F" + }, + { + "id": "b4f_below_guards", + "kind": "route", + "target": {"certainty": "tile", "map": "RocketHideout_B4F", "where": {"facing": "north", "kind": "tiles", "tiles": [[17, 16]]}}, + "variant": "run", + "why": "out of the lift to below the two Grunts (16, 14) and (19, 14)" + }, + { + "id": "talk_left_guard", + "kind": "talk", + "why": "the left door guard" + }, + { + "id": "hideout-left-guard", + "kind": "battle", + "declared_after": {"certainty": "tile", "map": "RocketHideout_B4F", "where": {"facing": "north", "kind": "tiles", "tiles": [[17, 16]]}}, + "why": "Rocket Grunt (TRAINER_TEAM_ROCKET_GRUNT_16): Sandshrew, Sandslash, Ekans Lv23" + }, + { + "id": "talk_right_guard", + "kind": "talk", + "why": "the right door guard" + }, + { + "id": "hideout-right-guard", + "kind": "battle", + "declared_after": {"certainty": "tile", "map": "RocketHideout_B4F", "where": {"facing": "north", "kind": "tiles", "tiles": [[17, 16]]}}, + "why": "Rocket Grunt (TRAINER_TEAM_ROCKET_GRUNT_17): Ekans, Sandshrew, Arbok Lv23; the door opens" + }, + { + "id": "rare_candy_1", + "kind": "game_action", + "variant": "use_item rare-candy slot=1", + "why": "Rare Candy: Lv35 (pokeguy 1:00:25)" + }, + { + "id": "rare_candy_2", + "kind": "game_action", + "variant": "use_item rare-candy slot=1", + "why": "Rare Candy: Lv36, Wartortle evolves" + }, + { + "id": "evolve_blastoise", + "kind": "scene", + "why": "Wartortle evolves into Blastoise; do not press B" + }, + { + "id": "below_giovanni", + "kind": "route", + "target": {"certainty": "tile", "map": "RocketHideout_B4F", "where": {"facing": "north", "kind": "tiles", "tiles": [[19, 5]]}}, + "why": "through the door to below Giovanni (19, 4)" + }, + { + "id": "talk_giovanni", + "kind": "talk", + "why": "Giovanni" + }, + { + "id": "hideout-giovanni", + "kind": "battle", + "declared_after": {"certainty": "tile", "map": "RocketHideout_B4F", "where": {"facing": "north", "kind": "tiles", "tiles": [[19, 5]]}}, + "why": "Giovanni (TRAINER_BOSS_GIOVANNI): Onix, Rhyhorn, Kangaskhan" + }, + { + "id": "beside_silph_scope", + "kind": "route", + "target": {"certainty": "tile", "map": "RocketHideout_B4F", "where": {"facing": "west", "kind": "tiles", "tiles": [[21, 5]]}}, + "why": "round to east of the SILPH SCOPE (20, 5)" + }, + { + "id": "silph_scope", + "kind": "talk", + "why": "pick up the SILPH SCOPE" + }, + { + "id": "escape_rope_hideout", + "kind": "game_action", + "declared_after": {"certainty": "tile", "map": "CeladonCity", "where": {"facing": "south", "kind": "tiles", "tiles": [[34, 22]]}}, + "variant": "use_item escape-rope", + "why": "out to the Game Corner's door (pokeguy 1:02:10)" + } + ] + }, + "execution": {"menu": "full"} +} From 5a1c77026f5565a1943fee4a496db55199207acf Mon Sep 17 00:00:00 2001 From: dayfine Date: Mon, 9 Nov 2026 17:00:04 -0800 Subject: [PATCH 02/79] FRLG drafts: drop the 00.29 draft for #293's row; say why 00.30-00.31 aren't rows #293's 00.29 (Route 10 to Lavender's nurse) passed on the console, so the draft that reused the id is dropped. The README says what blocks 00.30 and 00.31 from becoming table rows: no Celadon or Rocket Hideout maps in the locked runtime pack, no row to Celadon's Center, no spinner or lift step. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss --- .../AutoStory/StoryData/Draft/README.md | 29 ++++-- .../StoryData/Draft/frlg-00.29.plan.json | 91 ------------------- 2 files changed, 23 insertions(+), 97 deletions(-) delete mode 100644 SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/Draft/frlg-00.29.plan.json diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/Draft/README.md b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/Draft/README.md index 8046824952..bff9a09871 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/Draft/README.md +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/Draft/README.md @@ -1,4 +1,4 @@ -# FRLG story drafts, 00.29 to the Hall of Fame +# FRLG story drafts, 00.30 to the Hall of Fame **Every file here is an unverified draft.** None has run on a console, and the story table doesn't load them: `pa_embed_text_files()` embeds only @@ -8,12 +8,14 @@ so this README is where they are marked unverified. Each file is a `pokesim-authored-checkpoint/1` plan in the same format as `../frlg-parcel-00.05.plan.json`. The order and the item stops follow PokeGuy's LeafGreen run (PokemonSimulation `data/runs/pokeguy-leafgreen-15934/events.json` -and `external/pokeguy-notes.md`). They start where 00.28 (Rock Tunnel to -Lavender, on `frlg/stage8-rocktunnel`) is expected to end: at Lavender's nurse. +and `external/pokeguy-notes.md`). 00.28 and 00.29 are table rows on +`frlg/stage8-rocktunnel` (#293), not drafts: 00.29 ends at Lavender's nurse. +The draft that also used the id 00.29 (Lavender Mart, Route 8, the Underground +Path to Celadon's Center) was dropped in favour of #293's row, so nothing here +covers Lavender's nurse to Celadon's yet; its events are in commit 8b656d1a2. | Id | Title | Events | |---|---|---:| -| 00.29 | Lavender Mart, then west over Route 8: Gamer Rich, a Pidgey for Fly, the Underground Path to Celadon | 12 | | 00.30 | Celadon Game Corner and the Rocket Hideout down to B4F: the poster guard, the Lift Key Grunt, the LIFT KEY and B3F's Rare Candy | 12 | | 00.31 | Rocket Hideout: the lift to B4F, the two door guards, two Rare Candies, Blastoise, Giovanni and the SILPH SCOPE | 16 | | 00.32 | Celadon: Department Store 5F battle items, HM02 Fly on Route 16 for the Pidgey, the Tea, then the Center | 20 | @@ -39,6 +41,22 @@ Lavender, on `frlg/stage8-rocktunnel`) is expected to end: at Lavender's nurse. | 00.50 | Lance | 3 | | 00.51 | The Champion and the Hall of Fame | 4 | +## Why 00.30 and 00.31 are not table rows yet + +They can't run or be simulated on this branch's data: + +- The map resource lock (PokemonSimulation `6c2f5c8`, `runtime-manifest.json`) + has none of CeladonCity, CeladonCity_GameCorner or RocketHideout_B1F..B4F; + they exist only in `source-candidate`. CeladonCity_PokemonCenter_1F (00.30's + start) and RocketHideout_Elevator (00.31's lift) are in neither. Adding them + to the runtime pack is a PokemonSimulation publish and a lock bump. +- 00.30's start, Celadon's nurse, isn't reached by any row: 00.29 ends in + Lavender. +- The walker has no spinner (arrow) tiles, which B2F and B3F need, and no + step for the lift's floor menu or the poster switch. +- `STORY_TRAINERS` names none of the hideout's Grunts or Giovanni yet; + their parties are in `BattleData/`. + ## Conventions - A `battle` event's `id` is the battle's id in PokemonSimulation @@ -66,7 +84,7 @@ Lavender, on `frlg/stage8-rocktunnel`) is expected to end: at Lavender's nurse. ## Decisions for the user - **A Pidgey for Fly.** PokeGuy flies everywhere from 1:03; the story party has - no flier. 00.29 catches a Pidgey in Route 7's grass (Route 8's grass is behind + no flier. The dropped Lavender-to-Celadon draft caught a Pidgey in Route 7's grass (Route 8's grass is behind two Cut trees). Without Fly, Cinnabar needs a long walk round to Pallet. - **TM14 Blizzard over Mega Kick** (00.40) is a one-shot TM: it needs the team plan first. @@ -93,7 +111,6 @@ wall tiles, and Indigo Plateau's door glyph is at (11, 5) with its warp at | Skipped leg | Why | |---|---| -| 00.29/celadon_nurse | map not in source-candidate | | 00.31/b2f_lift | B2F's lift corner is reached over arrow tiles the planner does not solve | | 00.31/b4f_below_guards | RocketHideout_Elevator map not in source-candidate | | 00.32/x_item_clerk | CeladonCity_DepartmentStore_Elevator map not in source-candidate | diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/Draft/frlg-00.29.plan.json b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/Draft/frlg-00.29.plan.json deleted file mode 100644 index 135608d5d2..0000000000 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/Draft/frlg-00.29.plan.json +++ /dev/null @@ -1,91 +0,0 @@ -{ - "format": "pokesim-authored-checkpoint/1", - "game": "frlg", - "checkpoint": { - "id": "00.29", - "title": "Lavender Mart, then west over Route 8: Gamer Rich, a Pidgey for Fly, the Underground Path to Celadon", - "start": {"certainty": "tile", "map": "LavenderTown_PokemonCenter_1F", "where": {"facing": "north", "kind": "tiles", "tiles": [[7, 4]]}}, - "events": [ - { - "id": "lavender_mart_clerk", - "kind": "route", - "target": {"certainty": "tile", "map": "LavenderTown_Mart", "where": {"facing": "west", "kind": "tiles", "tiles": [[4, 3]]}}, - "variant": "run", - "why": "out of the Center, east along row 6 and down to the Mart (20, 15), to its clerk" - }, - { - "id": "buy_ropes_and_super_repels", - "kind": "game_action", - "variant": "mart LavenderTown_Mart budget=5700 floor=9000 escape-rope=4 super-repel=7", - "why": "pokeguy 54:18: 4 Escape Ropes and 7 Super Repels" - }, - { - "id": "east_of_rich_line", - "kind": "route", - "target": {"certainty": "tile", "map": "Route8", "where": {"facing": "west", "kind": "tiles", "tiles": [[56, 18]]}}, - "variant": "run", - "why": "west out of Lavender onto Route 8, down column 64 east of Julia (62, 14) and west along row 18" - }, - { - "id": "rich_line", - "kind": "step", - "direction": "west", - "variant": "trainer_line", - "why": "onto (55, 18), the end of Rich's line (55, 16..18): he walks down to (55, 17)" - }, - { - "id": "route8-rich", - "kind": "battle", - "declared_after": {"certainty": "tile", "map": "Route8", "where": {"facing": "north", "kind": "tiles", "tiles": [[55, 18]]}}, - "why": "Gamer Rich (TRAINER_GAMER_RICH): Growlithe, Vulpix Lv24" - }, - { - "id": "below_underground_door", - "kind": "route", - "target": {"certainty": "tile", "map": "Route8", "where": {"facing": "north", "kind": "tiles", "tiles": [[13, 5]]}}, - "variant": "run", - "why": "west along rows 14..18, up column 14 east of Aidan's line (10..13, 6), to below the Underground Path door (13, 4)" - }, - { - "id": "route7_underground_exit", - "kind": "route", - "target": {"certainty": "tile", "map": "Route7", "where": {"facing": "south", "kind": "tiles", "tiles": [[7, 15]]}}, - "variant": "run", - "why": "through the door, the east entrance, the east-west tunnel and the west entrance, out onto Route 7" - }, - { - "id": "pidgey_grass", - "kind": "route", - "target": {"certainty": "tile", "map": "Route7", "where": {"facing": "east", "kind": "tiles", "tiles": [[14, 5]]}}, - "variant": "run", - "why": "north round the ledges into Route 7's grass (11..16, 2..5), a grass tile east of it free; Route 8's grass is behind two Cut trees" - }, - { - "id": "catch_pidgey", - "kind": "game_action", - "variant": "capture pidgey catches=1 encounters=30 balls=5 pace=east", - "why": "a Pidgey to carry HM02 Fly (pokeguy flies with a Pidgey from 1:03 on); the party has no other flier" - }, - { - "id": "celadon_below_center", - "kind": "route", - "target": {"certainty": "tile", "map": "CeladonCity", "where": {"facing": "north", "kind": "tiles", "tiles": [[48, 12]]}}, - "variant": "run", - "why": "north round the grass, west onto Celadon (row 12..15) and along row 12 to below the Center door (48, 11)" - }, - { - "id": "celadon_nurse", - "kind": "route", - "target": {"certainty": "tile", "map": "CeladonCity_PokemonCenter_1F", "where": {"facing": "north", "kind": "tiles", "tiles": [[7, 4]]}}, - "variant": "run", - "why": "into the Center, to the nurse" - }, - { - "id": "heal_celadon", - "kind": "heal", - "why": "the nurse heals the party" - } - ] - }, - "execution": {"menu": "full"} -} From cf9400fb38c88d4d2b126ac6c4c46da781aebb58 Mon Sep 17 00:00:00 2001 From: dayfine Date: Mon, 9 Nov 2026 17:12:55 -0800 Subject: [PATCH 03/79] FRLG overworld: spinner tiles, the lift's floor and the poster switch on the sim Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss --- .../Overworld/PokemonFRLG_MovementMechanics.h | 7 + .../Overworld/PokemonFRLG_OverworldMap.cpp | 62 ++++ .../Overworld/PokemonFRLG_OverworldMap.h | 31 ++ .../Overworld/PokemonFRLG_OverworldRoute.cpp | 45 ++- .../Overworld/PokemonFRLG_OverworldRoute.h | 4 + .../PokemonFRLG_OverworldRouteStrings.cpp | 3 + .../Overworld/PokemonFRLG_OverworldSim.cpp | 61 +++- .../Overworld/PokemonFRLG_OverworldSim.h | 24 ++ .../PokemonFRLG_OverworldSim_Tests.cpp | 1 + .../PokemonFRLG_OverworldSpin_Tests.cpp | 279 ++++++++++++++++++ .../Overworld/PokemonFRLG_OverworldWalk.cpp | 4 + SerialPrograms/cmake/SourceFiles.cmake | 1 + 12 files changed, 516 insertions(+), 6 deletions(-) create mode 100644 SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSpin_Tests.cpp diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_MovementMechanics.h b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_MovementMechanics.h index f7062858bc..0a20f37a7a 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_MovementMechanics.h +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_MovementMechanics.h @@ -62,6 +62,10 @@ inline constexpr Milliseconds STEP_TAP_SPACING_WORKED(666); // the D-pad this long. Not measured: pokefirered's fade from black is 16 // frames, then the field takes input; a tap sent at once was lost. inline constexpr Milliseconds BATTLE_EXIT_LOCKOUT(500); +// A spinner tile (Rocket Hideout, Viridian Gym) slides the player a tile +// per 8 frames (pokefirered PlayerGoSpin(): MOVE_SPEED_FAST_1). Not +// measured on the console. +inline constexpr Milliseconds SPIN_TILE_TIME(133); // The walker's presses. @@ -87,6 +91,9 @@ inline constexpr Milliseconds STEP_TAP_RELEASE(700); // How long the overworld must show nothing (no box, fade or battle) after // a battle before the next tap: twice the lockout. inline constexpr Milliseconds AFTER_BATTLE_QUIET(1000); +// The wait after a slide's last tile before the next press: the spin's +// last frames and the facing it leaves. Not measured. +inline constexpr Milliseconds SPIN_STOP_SETTLE(300); static_assert(TURN_TAP <= LONGEST_TAP && FACE_HOLD <= LONGEST_TAP && STEP_TAP <= LONGEST_TAP); static_assert(STEP_TAP + STEP_TAP_RELEASE > STEP_TAP_SPACING_WORKED); diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldMap.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldMap.cpp index 03efa4db3f..fb2317c92a 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldMap.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldMap.cpp @@ -230,6 +230,68 @@ StepKind classify_step_onto( return StepKind::WALK; } +const char SPIN_NORTH_REGION[] = "spin_north"; +const char SPIN_SOUTH_REGION[] = "spin_south"; +const char SPIN_WEST_REGION[] = "spin_west"; +const char SPIN_EAST_REGION[] = "spin_east"; +const char SPIN_STOP_REGION[] = "spin_stop"; + +namespace{ + +bool in_region(const MapData& map, const char* region, const TilePos& point){ + const auto tiles = map.regions.find(region); + return tiles != map.regions.end() && std::find(tiles->second.begin(), tiles->second.end(), point) != tiles->second.end(); +} + +} // namespace + +std::optional spin_direction(const MapData& map, const TilePos& point){ + static const std::pair ARROWS[] = { + {SPIN_NORTH_REGION, Direction::NORTH}, + {SPIN_SOUTH_REGION, Direction::SOUTH}, + {SPIN_WEST_REGION, Direction::WEST}, + {SPIN_EAST_REGION, Direction::EAST}, + }; + for (const auto& [region, direction] : ARROWS){ + if (in_region(map, region, point)){ + return direction; + } + } + return std::nullopt; +} +bool stops_spinning(const MapData& map, const TilePos& point){ + return in_region(map, SPIN_STOP_REGION, point); +} + +std::optional spin_slide(const MapData& map, const PlayerState& state){ + std::optional arrow = spin_direction(map, state.position); + if (!arrow){ + return std::nullopt; + } + SpinSlide slide{state, *arrow, 0}; + // A slide longer than the map has tiles has gone round a loop. + const int max_tiles = map.tiles.width * map.tiles.height; + while (slide.tiles <= max_tiles){ + const StepKind kind = classify_step(map, slide.end, slide.facing); + if (kind != StepKind::WALK){ + return slide; + } + slide.end = after_step(map, slide.end, slide.facing, kind); + slide.tiles++; + if (warp_at(map, slide.end.position) != nullptr){ + return std::nullopt; + } + if (stops_spinning(map, slide.end.position)){ + return slide; + } + arrow = spin_direction(map, slide.end.position); + if (arrow){ + slide.facing = *arrow; + } + } + return std::nullopt; +} + PlayerState after_step(const MapData& map, const PlayerState& state, Direction direction, StepKind kind){ return after_step_onto(map, state, map, state.position.next(direction), kind); } diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldMap.h b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldMap.h index 7e1935b643..e6d7490370 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldMap.h +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldMap.h @@ -160,6 +160,37 @@ PlayerState after_step_onto( ); +// Spinner tiles (Rocket Hideout B2F and B3F, Viridian Gym): pokefirered's +// MB_SPIN_UP, MB_SPIN_DOWN, MB_SPIN_LEFT, MB_SPIN_RIGHT and +// MB_STOP_SPINNING. The tile glyphs can't say so, so a map lists them in +// these regions, as it does WILD_REGION. +extern const char SPIN_NORTH_REGION[]; +extern const char SPIN_SOUTH_REGION[]; +extern const char SPIN_WEST_REGION[]; +extern const char SPIN_EAST_REGION[]; +extern const char SPIN_STOP_REGION[]; +// The way the arrow on this tile slides the player, if it is a spinner. +std::optional spin_direction(const MapData& map, const TilePos& point); +// Whether this tile ends a slide (MB_STOP_SPINNING). +bool stops_spinning(const MapData& map, const TilePos& point); + +// Where a slide leaves the player, the way it last moved them, and how +// many tiles it took. +struct SpinSlide{ + PlayerState end; + Direction facing = Direction::NORTH; + int tiles = 0; +}; +// The slide of a player who has just stepped onto the spinner `state` +// stands on (pokefirered TryUpdatePlayerSpinDirection()): a tile at a +// time the last arrow's way, turned by each arrow on the way, until a stop +// tile, or a step the step rules refuse (a wall, a person: the game's +// collision ends the forced movement there). Nothing if `state` isn't on a +// spinner, if the arrows turn the player round in a loop, or if the slide +// crosses a warp, which isn't modelled. +std::optional spin_slide(const MapData& map, const PlayerState& state); + + } // namespace PokemonFRLG } // namespace NintendoSwitch diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldRoute.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldRoute.cpp index 8556442dd0..cdea398515 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldRoute.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldRoute.cpp @@ -81,6 +81,9 @@ struct Transition{ bool warped = false; bool walked_out = false; // the warp ended with the game walking the player out bool dismounted = false; // stepped off the water onto land + // The step landed on a spinner, which slid the player on: how far, + // and the way they last moved. + std::optional spin; }; // The player taking `warp`, or nothing if it leads off the loaded maps. @@ -182,6 +185,13 @@ std::optional press(const std::vector& maps, const Located& if (transition.action == RouteAction::WALK && warps_on_step(map, landed) && warp_at(map, landed) != nullptr){ return take_warp(maps, warp_at(map, landed)); } + if (transition.action == RouteAction::WALK && spin_direction(map, landed)){ + transition.spin = spin_slide(map, transition.next.state); + if (!transition.spin){ + return std::nullopt; + } + transition.next.state = transition.spin->end; + } return transition; } @@ -268,9 +278,14 @@ class StepModel{ step.action = transition->action == RouteAction::SURF ? ACTION_SURF : 0; // Leaving the water: the player walks at half the speed from here. step.starts_leg = transition->dismounted; - step.ends_leg = transition->warped || transition->dismounted; + // A slide ends the leg: the hold must let go on the spinner. + step.ends_leg = transition->warped || transition->dismounted || transition->spin; step.warped = transition->warped; step.facing = transition->walked_out ? Direction::SOUTH : direction; + if (transition->spin){ + step.facing = transition->spin->facing; + step.extra_cost += transition->spin->tiles * route_cost(m_costs, RouteCost::TILE); + } if (transition->action == RouteAction::SURF){ step.extra_cost += route_cost(m_costs, RouteCost::SURF); } @@ -306,6 +321,24 @@ Pokemon::LegCosts to_leg_costs(const RouteCosts& costs){ return leg_costs; } +// The tiles the slide at the end of WALK `leg` takes, if it ends on a +// spinner: only a leg's last step can slide (StepModel ends the leg). +std::optional last_spin_tiles(const std::vector& maps, const Pokemon::Leg& leg){ + Located player = leg.start; + std::optional transition; + for (int c = 0; c < leg.tiles; c++){ + transition = press(maps, player, leg.direction); + if (!transition){ + return std::nullopt; + } + player = transition->next; + } + if (!transition || !transition->spin){ + return std::nullopt; + } + return transition->spin->tiles; +} + RouteStep to_route_step(const std::vector& maps, const Pokemon::Leg& leg){ RouteStep step; switch (leg.kind){ @@ -333,6 +366,10 @@ RouteStep to_route_step(const std::vector& maps, const Pokemon::Leg tiles = leg_tiles(maps, MapPosition{maps[leg.start.map].name, leg.start.state.position}, step); for (int c : std::views::iota(1, (int)tiles.size()) | std::views::filter([&](int n){ return tiles[n].map != tiles[n - 1].map; })){ step.connection_steps.push_back(c); @@ -361,7 +398,7 @@ std::optional predict_overworld_press( .position = {maps[next->next.map].name, next->next.state.position}, .elevation = next->next.state.elevation, .surfing = next->next.state.surfing, - .facing = next->walked_out ? Direction::SOUTH : direction, + .facing = next->spin ? next->spin->facing : next->walked_out ? Direction::SOUTH : direction, }, .warped = next->warped, }; @@ -424,7 +461,7 @@ std::optional locate(const std::vector& maps, const MapPositio // A plain step: no warp, no Surf, no getting off the water. std::optional plain_step(const std::vector& maps, const Located& player, Direction direction){ const std::optional transition = press(maps, player, direction); - if (!transition || transition->warped || transition->dismounted || transition->action != RouteAction::WALK){ + if (!transition || transition->warped || transition->dismounted || transition->spin || transition->action != RouteAction::WALK){ return std::nullopt; } return transition->next; @@ -473,7 +510,7 @@ std::vector leg_tiles( ){ std::vector tiles{start}; std::optional player = locate(maps, start, step.surfing); - const int along = step.tiles - (step.warps ? 1 : 0); + const int along = step.tiles - (step.warps || step.spin_tiles ? 1 : 0); for (int c = 0; player && c < along; c++){ player = plain_step(maps, *player, step.direction); if (player){ diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldRoute.h b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldRoute.h index 82a9d65676..2d5f45f8e4 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldRoute.h +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldRoute.h @@ -76,6 +76,10 @@ struct RouteStep{ // WALK: a wall stops the player at the end, so the leg can be held for // longer than it takes and still ends on its tile. bool to_wall = false; + // WALK: the last tile is a spinner, which slides the player this many + // tiles on, to `end` (spin_slide()). The hold must end on the spinner: + // held on, the player walks on after the slide. + std::optional spin_tiles; // WALK, SURF: a wild Pokemon can appear on the way: the step crosses // tall grass or water. Elsewhere (indoors, streets) no wild battle can // start, so the walker doesn't watch for one. diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldRouteStrings.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldRouteStrings.cpp index 4c082f2c76..8b7175b066 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldRouteStrings.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldRouteStrings.cpp @@ -21,6 +21,9 @@ std::string to_string(const RouteStep& step){ if (step.to_wall){ text += " (to wall)"; } + if (step.spin_tiles){ + text += std::format(" (spins {})", *step.spin_tiles); + } break; case RouteAction::SURF: text = "surf " + std::string(direction_name(step.direction)); diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSim.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSim.cpp index e8625e13b3..0b9483bf2c 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSim.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSim.cpp @@ -243,7 +243,19 @@ std::optional OverworldSim::watch_until(const std::vector& std::optional OverworldSim::take_warp(int map_index, const TilePos& tile) const{ const MapWarp* warp = warp_at(m_maps[map_index], tile); - if (warp == nullptr || !warp->to){ + if (warp == nullptr){ + return std::nullopt; + } + const auto lift = m_script.lift_floors.find(m_maps[map_index].name); + if (lift != m_script.lift_floors.end() && m_lift_floor){ + const MapPosition& out = lift->second[*m_lift_floor]; + const int destination = find_map(m_maps, out.map); + if (destination < 0){ + return std::nullopt; + } + return Step{destination, PlayerState{out.point, elevation_at(m_maps[destination], out.point), false}, true, false, false}; + } + if (!warp->to){ return std::nullopt; } const int destination = find_map(m_maps, warp->to->map); @@ -309,10 +321,17 @@ std::optional OverworldSim::press(Direction direction) const if (kind != StepKind::WALK){ return std::nullopt; } - const Step step{m_map, after_step_onto(map(), m_player, map(), ahead, kind), false, false, false}; + Step step{m_map, after_step_onto(map(), m_player, map(), ahead, kind), false, false, false}; if (warps_on_step(map(), ahead)){ return take_warp(m_map, ahead); } + if (spin_direction(map(), ahead)){ + step.spin = spin_slide(map(), step.player); + if (!step.spin){ + return std::nullopt; + } + step.player = step.spin->end; + } return step; } @@ -491,6 +510,13 @@ void OverworldSim::take_steps(Direction direction, Milliseconds pressed, Millise if (step->walked_out){ m_state.facing = Direction::SOUTH; } + if (step->spin){ + // The game moves the player through the slide; the hold, if + // it goes on, walks on from its end. + m_state.facing = step->spin->facing; + note(std::format("slid {} tile(s) to {}.", step->spin->tiles, to_string(step->spin->end.position))); + pressed += MovementMechanics::SPIN_TILE_TIME * step->spin->tiles; + } if (after_step(*step, pressed)){ return; } @@ -669,6 +695,34 @@ bool OverworldSim::cut_tree(){ return false; } +bool OverworldSim::choose_lift_floor(size_t floor){ + const auto lift = m_script.lift_floors.find(map().name); + if (lift == m_script.lift_floors.end() || floor >= lift->second.size() || m_frozen){ + violation("no lift panel on " + to_string(m_state.position) + " with a floor " + std::to_string(floor) + "."); + return false; + } + m_lift_floor = floor; + advance_to(m_now + m_script.timing.message); + note("the lift goes to " + to_string(lift->second[floor]) + "."); + return true; +} + +bool OverworldSim::push_poster_switch(){ + std::vector& objects = m_maps[m_map].objects; + const TilePos ahead = m_player.position.next(m_state.facing); + const auto poster = std::find_if(objects.begin(), objects.end(), [&](const MapObject& object){ + return object.name == "poster" && object.x == ahead.x && object.y == ahead.y; + }); + if (poster == objects.end() || m_state.screen != SimScreen::OVERWORLD || m_frozen){ + violation("no poster " + std::string(direction_name(m_state.facing)) + " of " + to_string(m_state.position) + "."); + return false; + } + std::erase_if(objects, [](const MapObject& object){ return object.name == "poster_stairs"; }); + advance_to(m_now + m_script.timing.message); + note("pushed the switch behind the poster: the stairs are open."); + return true; +} + // @@ -846,6 +900,9 @@ std::optional OverworldSimWalker::walk_step(const RouteStep& step, if (result.stopped){ return dark_stop(step, walked_near(step, result.tiles, TILE_TIME)); } + if (step.spin_tiles){ + m_sim.watch({}, SPIN_TILE_TIME * *step.spin_tiles + SPIN_STOP_SETTLE); + } const Milliseconds fade_watched_from = m_rules.watch_fade_along_hold ? m_leg_start : m_sim.state().time; if (step.warps && !after_warp(step, warps_before, fade_watched_from)){ if (!m_rules.find_player_after_warp_battle){ diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSim.h b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSim.h index 21038720d4..4eb0884abc 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSim.h +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSim.h @@ -137,6 +137,11 @@ struct SimScript{ // check and screen observer read as a battle on its way (console B, // 2026-11-09, 00.28), unless SimWalkerRules::dark_cave_not_battle. std::set dark_maps; + // A lift's map, and where its door lets the player out for each floor + // on its panel's menu, top first (pokefirered setdynamicwarp in + // RocketHideout_Elevator's scripts): the door's own warp is the + // game's placeholder. + std::map> lift_floors = {}; SimTiming timing; }; @@ -255,6 +260,18 @@ class OverworldSim{ // as its hide flag is a FLAG_TEMP. Returns whether there was one. bool cut_tree(); + // A on the panel of the lift the player stands in (SimScript:: + // lift_floors) and floor `floor` picked: the lift's door now lets out + // there. Returns whether there was such a lift and floor. + bool choose_lift_floor(size_t floor); + + // A on the poster the player faces (an object named "poster"): the + // switch behind it opens the stairs, which takes away the objects + // named "poster_stairs" for good (pokefirered + // CeladonCity_GameCorner_EventScript_Poster's setmetatile). Returns + // whether there was a poster. + bool push_poster_switch(); + private: // A screen that shows at `at`; `unfreeze`: the player can move again. struct Pending{ @@ -269,6 +286,8 @@ class OverworldSim{ bool warped = false; bool walked_out = false; // the warp ended with the game walking the player a tile south bool ledge = false; + // The step landed on a spinner, which slid the player to `player`. + std::optional spin = {}; }; void advance_to(Milliseconds time); @@ -323,6 +342,8 @@ class OverworldSim{ std::optional m_trainer; // The trees cut since the last warp, and their maps. std::vector> m_cut_trees; + // The floor picked on the lift's panel, if any. + std::optional m_lift_floor; int m_grass_steps = 0; // The game's wild encounter state (SimScript::encounter_rates). std::mt19937 m_encounter_rng; @@ -515,6 +536,9 @@ class OverworldSimWalker{ void add_tests_OverworldSim(UnitTestDatabase& database); // Register the tests of a warp's fade over before the hold onto it ends. void add_tests_OverworldWarpFade(UnitTestDatabase& database); +// Register the tests of spinner tiles, the lift's panel and the poster +// switch on made-up maps. +void add_tests_OverworldSpin(UnitTestDatabase& database); diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSim_Tests.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSim_Tests.cpp index 7b7fb39c46..ce0f2054ae 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSim_Tests.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSim_Tests.cpp @@ -986,6 +986,7 @@ void add_tests_OverworldSim(UnitTestDatabase& database){ } add_tests_OverworldLateBattle(database); add_tests_OverworldWarpFade(database); + add_tests_OverworldSpin(database); } diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSpin_Tests.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSpin_Tests.cpp new file mode 100644 index 0000000000..afabcff1dd --- /dev/null +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSpin_Tests.cpp @@ -0,0 +1,279 @@ +/* Overworld Spinner, Lift and Poster Tests + * + * From: https://github.com/PokemonAutomation/ + * + * The Rocket Hideout's walking on small made-up maps: spinner tiles that + * slide the player (the map functions, the planner, the sim and its + * walker), the lift's floor panel and the Game Corner's poster switch + * on the sim. + * + */ + +#include +#include +#include +#include +#include "Common/Cpp/Exceptions.h" +#include "Common/Cpp/TestRunners/UnitTest.h" +#include "PokemonFRLG_MovementMechanics.h" +#include "PokemonFRLG_OverworldMaps.h" +#include "PokemonFRLG_OverworldRecovery.h" +#include "PokemonFRLG_OverworldRoute.h" +#include "PokemonFRLG_OverworldSim.h" + +namespace PokemonAutomation{ +namespace NintendoSwitch{ +namespace PokemonFRLG{ + + +namespace{ + +class Test_OverworldSpin : public UnitTest{ +public: + Test_OverworldSpin(std::string name, std::function body) + : UnitTest("PokemonFRLG::OverworldSpin - " + std::move(name)) + , m_body(std::move(body)) + {} + virtual UnitTestResult run(Logger&, CancellableScope&) const override{ + try{ + return m_body(); + }catch (Exception& e){ + return std::string(e.name()) + ": " + e.message(); + } + } + +private: + std::function m_body; +}; + +// A room with spinners: +// - (3, 3) north, up a dead end to (3, 1) against the wall; (3, 2) is only +// ever slid over; +// - (5, 4) east onto (6, 4), which turns the slide south to (6, 5); +// - (7, 3) west, onto the stop tile (5, 3). +const MapData& spinner_room(){ + static const MapData MAP = parse_map(R"({ + "name": "Spinners", "source": {"decomp_file": "", "revision": "test", "date": "2026-11-09"}, + "allow_running": false, + "tiles": ["#########", "###.#####", "###.#####", "#.......#", "#.......#", "#.......#", "#########"], + "regions": { + "spin_north": [[3, 3]], "spin_east": [[5, 4]], "spin_south": [[6, 4]], + "spin_west": [[7, 3]], "spin_stop": [[5, 3]] + } + })", "Spinners"); + return MAP; +} + +// Two arrows that face each other. +const MapData& spinner_loop(){ + static const MapData MAP = parse_map(R"({ + "name": "SpinLoop", "source": {"decomp_file": "", "revision": "test", "date": "2026-11-09"}, + "tiles": ["####", "#..#", "####"], + "regions": {"spin_east": [[1, 1]], "spin_west": [[2, 1]]} + })", "SpinLoop"); + return MAP; +} + +std::string describe(const std::vector& route){ + std::string text; + for (const RouteStep& step : route){ + text += "\n " + to_string(step); + } + return text; +} + +UnitTestResult check_slide(const TilePos& from, const TilePos& end, Direction facing, int tiles){ + const std::optional slide = spin_slide(spinner_room(), PlayerState{from, ELEVATION_GROUND, false}); + if (!slide){ + return "No slide from " + to_string(from) + "."; + } + if (!(slide->end.position == end) || slide->facing != facing || slide->tiles != tiles){ + return std::format( + "From {}: slid {} tile(s) to {} facing {}; expected {} to {} facing {}.", + to_string(from), slide->tiles, to_string(slide->end.position), direction_name(slide->facing), + tiles, to_string(end), direction_name(facing) + ); + } + return true; +} + +UnitTestResult test_slide_into_wall(){ + return check_slide({3, 3}, {3, 1}, Direction::NORTH, 2); +} +UnitTestResult test_slide_turned_by_arrow(){ + return check_slide({5, 4}, {6, 5}, Direction::SOUTH, 2); +} +UnitTestResult test_slide_to_stop_tile(){ + return check_slide({7, 3}, {5, 3}, Direction::WEST, 2); +} +UnitTestResult test_slide_loop(){ + if (spin_slide(spinner_loop(), PlayerState{{1, 1}, ELEVATION_GROUND, false})){ + return "A slide round two arrows that face each other stopped."; + } + if (spin_slide(spinner_room(), PlayerState{{1, 3}, ELEVATION_GROUND, false})){ + return "A slide from a tile with no arrow."; + } + return true; +} + +const MapPosition SPIN_START{"Spinners", {1, 5}}; +const MapPosition DEAD_END{"Spinners", {3, 1}}; + +UnitTestResult test_route_ends_on_slide(){ + const std::vector maps{spinner_room()}; + const auto route = plan_overworld_route(maps, SPIN_START, RouteGoal{DEAD_END, std::nullopt}); + if (!route || route->empty()){ + return std::string("No route to the dead end, which only a slide reaches."); + } + const RouteStep& last = route->back(); + if (last.spin_tiles != 2 || last.to_wall || !(last.end == DEAD_END)){ + return "Expected a last leg onto (3, 3) that slides 2 tiles:" + describe(*route); + } + const MapPosition end = follow_overworld_route(maps, SPIN_START, *route); + if (!(end == DEAD_END)){ + return "The route replays to " + to_string(end) + ":" + describe(*route); + } + return true; +} + +UnitTestResult test_no_stop_mid_slide(){ + const std::vector maps{spinner_room()}; + const auto route = plan_overworld_route(maps, SPIN_START, RouteGoal{MapPosition{"Spinners", {3, 2}}, std::nullopt}); + if (route){ + return "Planned a stop on (3, 2), which a slide only passes:" + describe(*route); + } + return true; +} + +UnitTestResult test_sim_slides(){ + OverworldSim sim({spinner_room()}, MapPosition{"Spinners", {3, 4}}, Direction::NORTH); + sim.hold(Direction::NORTH, MovementMechanics::TILE_TIME, MovementMechanics::STEP_RELEASE, MovementMechanics::TILE_TIME, {}); + if (!(sim.state().position == DEAD_END)){ + return "One step north onto (3, 3) ended on " + to_string(sim.state().position) + "."; + } + if (sim.state().facing != Direction::NORTH){ + return std::string("The slide left the player facing ") + direction_name(sim.state().facing) + "."; + } + return true; +} + +UnitTestResult test_sim_walker_walks_slide(){ + const std::vector maps{spinner_room()}; + const auto route = plan_overworld_route(maps, SPIN_START, RouteGoal{DEAD_END, std::nullopt}); + if (!route){ + return std::string("No route."); + } + OverworldSim sim(maps, SPIN_START, Direction::NORTH); + OverworldSimWalker walker(sim); + const RoutePlanning planning{.maps = &maps, .costs = default_route_costs(), .start = SPIN_START, .label = "Sim"}; + const std::string failure = walker.run(*route, planning); + if (!failure.empty() || !(sim.state().position == DEAD_END)){ + std::string log; + for (const std::string& line : walker.log()){ + log += "\n " + line; + } + return "Walked to " + to_string(sim.state().position) + ", failure \"" + failure + "\":" + describe(*route) + log; + } + return true; +} + + +// A lift whose door, the exit mat (1, 2), lets out on the floor picked. +std::vector lift_maps(){ + const char* FLOOR = R"({ + "name": "%s", "source": {"decomp_file": "", "revision": "test", "date": "2026-11-09"}, + "tiles": ["###", "#.#", "###"] + })"; + std::vector maps; + maps.push_back(parse_map(R"({ + "name": "Lift", "source": {"decomp_file": "", "revision": "test", "date": "2026-11-09"}, + "tiles": ["###", "#.#", "#.#", "###"], + "warps": [{"x": 1, "y": 2, "enter": "walk_south"}] + })", "Lift")); + for (const char* name : {"FloorA", "FloorB"}){ + std::string json = FLOOR; + json.replace(json.find("%s"), 2, name); + maps.push_back(parse_map(json, name)); + } + return maps; +} + +UnitTestResult lift_ride(bool pick, const MapPosition& expected){ + SimScript script; + script.lift_floors["Lift"] = {MapPosition{"FloorA", {1, 1}}, MapPosition{"FloorB", {1, 1}}}; + OverworldSim sim(lift_maps(), MapPosition{"Lift", {1, 2}}, Direction::SOUTH, script); + if (pick && !sim.choose_lift_floor(1)){ + return std::string("No floor 1 on the lift's panel."); + } + sim.hold(Direction::SOUTH, MovementMechanics::TILE_TIME, MovementMechanics::STEP_RELEASE, std::chrono::milliseconds(3000), {}); + if (!(sim.state().position == expected)){ + return "Expected " + to_string(expected) + ", ended on " + to_string(sim.state().position) + "."; + } + return true; +} +UnitTestResult test_lift_floor(){ + return lift_ride(true, MapPosition{"FloorB", {1, 1}}); +} +UnitTestResult test_lift_no_floor(){ + return lift_ride(false, MapPosition{"Lift", {1, 2}}); +} + + +// The poster (2, 1) north of the player; the stairs behind it, (3, 1), +// closed until its switch is pushed. +const MapData& poster_room(){ + static const MapData MAP = parse_map(R"({ + "name": "Corner", "source": {"decomp_file": "", "revision": "test", "date": "2026-11-09"}, + "tiles": ["#####", "#...#", "#...#", "#####"], + "objects": [ + {"name": "poster", "kind": "sign", "x": 2, "y": 1}, + {"name": "poster_stairs", "kind": "npc", "x": 3, "y": 1} + ] + })", "Corner"); + return MAP; +} + +MapPosition poster_walk(bool push){ + OverworldSim sim({poster_room()}, MapPosition{"Corner", {2, 2}}, Direction::NORTH); + if (push){ + sim.push_poster_switch(); + } + const Milliseconds tile = MovementMechanics::TILE_TIME; + sim.hold(Direction::EAST, tile, MovementMechanics::STEP_RELEASE, tile, {}); + sim.hold(Direction::NORTH, tile * 2, MovementMechanics::STEP_RELEASE, tile * 2, {}); + return sim.state().position; +} +UnitTestResult test_poster_opens_stairs(){ + const MapPosition shut = poster_walk(false); + if (!(shut == MapPosition{"Corner", {3, 2}})){ + return "Before the switch, walked onto " + to_string(shut) + "."; + } + const MapPosition open = poster_walk(true); + if (!(open == MapPosition{"Corner", {3, 1}})){ + return "After the switch, walked onto " + to_string(open) + ", not the stairs."; + } + return true; +} + +} // namespace + + +void add_tests_OverworldSpin(UnitTestDatabase& database){ + database.add("slide up to a wall", test_slide_into_wall); + database.add("slide turned by an arrow", test_slide_turned_by_arrow); + database.add("slide to a stop tile", test_slide_to_stop_tile); + database.add("arrows in a loop never stop", test_slide_loop); + database.add("route ends with a slide", test_route_ends_on_slide); + database.add("no stop in the middle of a slide", test_no_stop_mid_slide); + database.add("sim slides the player", test_sim_slides); + database.add("sim walker walks a slide", test_sim_walker_walks_slide); + database.add("lift lets out on the floor picked", test_lift_floor); + database.add("lift with no floor picked stays", test_lift_no_floor); + database.add("poster switch opens the stairs", test_poster_opens_stairs); +} + + + +} // namespace PokemonFRLG +} // namespace NintendoSwitch +} // namespace PokemonAutomation diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldWalk.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldWalk.cpp index 80cf4de310..80c8d798f6 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldWalk.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldWalk.cpp @@ -536,6 +536,10 @@ void walk_step_leg( console, context, leg_mover(step, speed), step.wild ? interrupts.wild : interrupts.other, leg_spec(step, speed), MAX_INTERRUPTIONS_PER_LEG, warp_hold_watchers(step, fade) ); + if (step.spin_tiles){ + // The hold let go on the spinner; the game slides the player on. + pbf_wait(context, SPIN_TILE_TIME * *step.spin_tiles + SPIN_STOP_SETTLE); + } if (!step.warps){ return; } diff --git a/SerialPrograms/cmake/SourceFiles.cmake b/SerialPrograms/cmake/SourceFiles.cmake index 976060be1f..08e57e3244 100644 --- a/SerialPrograms/cmake/SourceFiles.cmake +++ b/SerialPrograms/cmake/SourceFiles.cmake @@ -1869,6 +1869,7 @@ file(GLOB LIBRARY_SOURCES Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSim.cpp Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSim.h Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSim_Tests.cpp + Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSpin_Tests.cpp Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldWalk.cpp Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldWalk.h Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldWalk_Tests.cpp From 5ca3d8f6030591e5b23ae80d85e3b63831eec699 Mon Sep 17 00:00:00 2001 From: dayfine Date: Mon, 9 Nov 2026 17:18:16 -0800 Subject: [PATCH 04/79] FRLG AutoStory: lift floor and poster switch steps; the Rocket Hideout's trainers Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss --- .../PokemonFRLG_OverworldSpin_Tests.cpp | 13 +- .../PokemonFRLG/PokemonFRLG_Tests.cpp | 2 + .../PokemonFRLG_AutoStoryBattleData.cpp | 10 + .../PokemonFRLG_AutoStoryBattleData_Tests.cpp | 36 +++ .../AutoStory/PokemonFRLG_AutoStoryEvents.cpp | 10 + .../PokemonFRLG_AutoStoryHideout.cpp | 116 ++++++++++ .../AutoStory/PokemonFRLG_AutoStoryHideout.h | 86 ++++++++ .../PokemonFRLG_AutoStoryHideout_Tests.cpp | 207 ++++++++++++++++++ .../AutoStory/PokemonFRLG_AutoStoryRowSim.cpp | 30 +++ .../AutoStory/PokemonFRLG_AutoStoryRowSim.h | 2 + .../PokemonFRLG_AutoStoryTableSteps.cpp | 13 ++ .../PokemonFRLG_AutoStoryTableSteps.h | 7 + SerialPrograms/cmake/SourceFiles.cmake | 3 + 13 files changed, 530 insertions(+), 5 deletions(-) create mode 100644 SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryHideout.cpp create mode 100644 SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryHideout.h create mode 100644 SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryHideout_Tests.cpp diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSpin_Tests.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSpin_Tests.cpp index afabcff1dd..298e3cb156 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSpin_Tests.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSpin_Tests.cpp @@ -136,11 +136,13 @@ UnitTestResult test_route_ends_on_slide(){ return true; } -UnitTestResult test_no_stop_mid_slide(){ +// Walking back down from the dead end steps onto (3, 3), which slides the +// player north again: there is no way out. +UnitTestResult test_dead_end_traps(){ const std::vector maps{spinner_room()}; - const auto route = plan_overworld_route(maps, SPIN_START, RouteGoal{MapPosition{"Spinners", {3, 2}}, std::nullopt}); + const auto route = plan_overworld_route(maps, DEAD_END, RouteGoal{SPIN_START, std::nullopt}); if (route){ - return "Planned a stop on (3, 2), which a slide only passes:" + describe(*route); + return "Planned a way out past the spinner that slides back in:" + describe(*route); } return true; } @@ -239,7 +241,8 @@ MapPosition poster_walk(bool push){ sim.push_poster_switch(); } const Milliseconds tile = MovementMechanics::TILE_TIME; - sim.hold(Direction::EAST, tile, MovementMechanics::STEP_RELEASE, tile, {}); + // Each hold turns the player first, which costs a tile's time. + sim.hold(Direction::EAST, tile * 2, MovementMechanics::STEP_RELEASE, tile * 2, {}); sim.hold(Direction::NORTH, tile * 2, MovementMechanics::STEP_RELEASE, tile * 2, {}); return sim.state().position; } @@ -264,7 +267,7 @@ void add_tests_OverworldSpin(UnitTestDatabase& database){ database.add("slide to a stop tile", test_slide_to_stop_tile); database.add("arrows in a loop never stop", test_slide_loop); database.add("route ends with a slide", test_route_ends_on_slide); - database.add("no stop in the middle of a slide", test_no_stop_mid_slide); + database.add("a spinner back into a dead end traps", test_dead_end_traps); database.add("sim slides the player", test_sim_slides); database.add("sim walker walks a slide", test_sim_walker_walks_slide); database.add("lift lets out on the floor picked", test_lift_floor); diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/PokemonFRLG_Tests.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/PokemonFRLG_Tests.cpp index 2bf7183092..916b0837a2 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/PokemonFRLG_Tests.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/PokemonFRLG_Tests.cpp @@ -48,6 +48,7 @@ #include "Programs/AutoStory/PokemonFRLG_AutoStoryAbilities.h" #include "Programs/AutoStory/PokemonFRLG_AutoStoryBattle.h" #include "Programs/AutoStory/PokemonFRLG_AutoStoryCapture.h" +#include "Programs/AutoStory/PokemonFRLG_AutoStoryHideout.h" #include "Programs/AutoStory/PokemonFRLG_AutoStoryPaceSim.h" #include "Programs/AutoStory/PokemonFRLG_AutoStoryPcStorage.h" #include "Programs/AutoStory/PokemonFRLG_AutoStoryRngLoop.h" @@ -938,6 +939,7 @@ void add_tests(UnitTestDatabase& database){ add_tests_AutoStorySimulation(database); add_tests_AutoStoryRows(database); add_tests_AutoStoryTrashCans(database); + add_tests_AutoStoryHideout(database); add_tests_AutoStoryPaceSim(database); add_tests_AutoStoryItems(database); add_tests_AutoStoryRngLoop(database); diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryBattleData.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryBattleData.cpp index 0deab3ef7c..17281e2e83 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryBattleData.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryBattleData.cpp @@ -86,6 +86,16 @@ constexpr StoryTrainer STORY_TRAINERS[] = { {.map = "RockTunnel_B1F", .battle = "hiker_dudley", .trainer = "TRAINER_HIKER_DUDLEY"}, {.map = "RockTunnel_B1F", .battle = "pokemaniac_cooper", .trainer = "TRAINER_POKEMANIAC_COOPER"}, {.map = "RockTunnel_1F", .battle = "picnicker_dana", .trainer = "TRAINER_PICNICKER_DANA"}, + // The Rocket Hideout, as PokeGuy's run fights it (the 00.31 and 00.32 + // drafts): the Grunt at the Game Corner's poster (11, 2) + // (CeladonCity_GameCorner_EventScript_RocketGrunt); on B4F, Grunt1 at + // (4, 2), who drops the LIFT KEY, the door guards Grunt2 (16, 14) and + // Grunt3 (19, 14), and Giovanni (19, 4) (RocketHideout_B4F scripts.inc). + {.map = "CeladonCity_GameCorner", .battle = "rocket_grunt", .trainer = "TRAINER_TEAM_ROCKET_GRUNT_7"}, + {.map = "RocketHideout_B4F", .battle = "lift_key_grunt", .trainer = "TRAINER_TEAM_ROCKET_GRUNT_18"}, + {.map = "RocketHideout_B4F", .battle = "left_guard", .trainer = "TRAINER_TEAM_ROCKET_GRUNT_16"}, + {.map = "RocketHideout_B4F", .battle = "right_guard", .trainer = "TRAINER_TEAM_ROCKET_GRUNT_17"}, + {.map = "RocketHideout_B4F", .battle = "giovanni", .trainer = "TRAINER_BOSS_GIOVANNI"}, }; using JsonTable = std::map>; diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryBattleData_Tests.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryBattleData_Tests.cpp index d2e1cda312..f9e53a5779 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryBattleData_Tests.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryBattleData_Tests.cpp @@ -140,6 +140,38 @@ UnitTestResult test_story_trainers(){ return true; } +// The Rocket Hideout's battles, which no table row fights yet (the +// 00.31 and 00.32 drafts): each names its map's trainer, with pret's +// party. +UnitTestResult test_hideout_trainers(){ + struct Expected{ + const char* map; + const char* battle; + std::vector party; + }; + const Expected EXPECTED[] = { + {"CeladonCity_GameCorner", "rocket_grunt", {"raticate", "zubat"}}, + {"RocketHideout_B4F", "lift_key_grunt", {"koffing", "zubat"}}, + {"RocketHideout_B4F", "left_guard", {"sandshrew", "ekans", "sandslash"}}, + {"RocketHideout_B4F", "right_guard", {"ekans", "sandshrew", "arbok"}}, + {"RocketHideout_B4F", "giovanni", {"onix", "rhyhorn", "kangaskhan"}}, + }; + for (const Expected& expected : EXPECTED){ + const std::optional trainer = story_trainer(expected.map, expected.battle); + if (!trainer){ + return std::format("{} on {}: no trainer.", expected.battle, expected.map); + } + const std::vector on_map = map_trainers(expected.map); + if (std::find(on_map.begin(), on_map.end(), *trainer) == on_map.end()){ + return std::format("{} on {}: {} isn't one of the map's trainers.", expected.battle, expected.map, *trainer); + } + if (trainer_party(*trainer) != expected.party){ + return std::format("{} on {}: {} hasn't the expected party.", expected.battle, expected.map, *trainer); + } + } + return true; +} + // Mt. Moon: Super Nerd Miguel's Grimer (Poison) takes Water Gun, with or // without Bite known: Bite (60, Dark) ties Water Gun (40 x 1.5 STAB), both // special, and the tie goes to the plan's Water Gun. @@ -208,6 +240,10 @@ const AutoStoryBattleDataTestCase AUTO_STORY_BATTLE_DATA_CASES[] = { .input = {.name = "every story battle fights a trainer with a party", .body = test_story_trainers}, .expectation = {.description = "ensures all scripted story battles encounter valid teams"}, }, + { + .input = {.name = "the Rocket Hideout's Grunts and Giovanni", .body = test_hideout_trainers}, + .expectation = {.description = "names each hideout battle's trainer and party"}, + }, { .input = {.name = "Miguel's Grimer: Water Gun", .body = test_miguel_grimer}, .expectation = {.description = "verifies move matchup choice against Miguel Grimer"}, diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryEvents.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryEvents.cpp index 13a39e6cae..12ace02fe6 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryEvents.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryEvents.cpp @@ -22,6 +22,7 @@ #include "PokemonFRLG_AutoStoryCapture.h" #include "PokemonFRLG_AutoStoryEvents.h" #include "PokemonFRLG_AutoStoryGrind.h" +#include "PokemonFRLG_AutoStoryHideout.h" #include "PokemonFRLG_AutoStoryScreenEvents.h" #include "PokemonFRLG_AutoStorySummary.h" #include "PokemonFRLG_AutoStoryTable.h" @@ -684,6 +685,15 @@ Outcome open_gym_door(StoryEnv& env, RunState& state, const StoryStep& step){ // The GAME steps without a row of their own: a capture or a PC deposit or // withdrawal, a MART, TEACH, LEVEL, GRIND or fossil CHOICE. Outcome other_game_step(StoryEnv& env, RunState& state, const StoryStep& step){ + // The Rocket Hideout's steps leave the player where they stand. + if (const std::optional ride = parse_lift_floor_variant(step.variant)){ + ride_lift(env.console, env.context, *ride); + return Pokemon::outcome_ok(); + } + if (step.variant == POSTER_SWITCH_VARIANT){ + push_poster_switch(env.console, env.context); + return Pokemon::outcome_ok(); + } const Pokemon::Pose patch = state.pose; ConsoleCaptureActions capture(env.console, env.context, env.language, [&]{ pace_trainer_battle(env, state, step, patch); diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryHideout.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryHideout.cpp new file mode 100644 index 0000000000..f1208ac841 --- /dev/null +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryHideout.cpp @@ -0,0 +1,116 @@ +/* AutoStory Rocket Hideout Steps + * + * From: https://github.com/PokemonAutomation/ + * + */ + +#include +#include "NintendoSwitch/Commands/NintendoSwitch_Commands_PushButtons.h" +#include "PokemonFRLG_AutoStoryActions.h" +#include "PokemonFRLG_AutoStoryHideout.h" + +namespace PokemonAutomation{ +namespace NintendoSwitch{ +namespace PokemonFRLG{ + + +using namespace std::chrono_literals; + + +const std::vector& rocket_hideout_lift_menu(){ + static const std::vector MENU{"B1F", "B2F", "B4F", "EXIT"}; + return MENU; +} + +std::string lift_floor_variant(std::string_view from, std::string_view to){ + return std::string(LIFT_FLOOR_PREFIX) + std::string(from) + " " + std::string(to); +} + +namespace{ + +// The row of `floor` on the panel's menu, if it is a floor (not EXIT). +std::optional floor_row(std::string_view floor){ + const std::vector& menu = rocket_hideout_lift_menu(); + for (size_t row = 0; row + 1 < menu.size(); row++){ + if (menu[row] == floor){ + return row; + } + } + return std::nullopt; +} + +} // namespace + +std::optional parse_lift_floor_variant(std::string_view variant){ + if (!variant.starts_with(LIFT_FLOOR_PREFIX)){ + return std::nullopt; + } + const std::string_view floors = variant.substr(LIFT_FLOOR_PREFIX.size()); + const size_t space = floors.find(' '); + if (space == std::string_view::npos){ + return std::nullopt; + } + const std::optional from = floor_row(floors.substr(0, space)); + const std::optional to = floor_row(floors.substr(space + 1)); + if (!from || !to){ + return std::nullopt; + } + return LiftRide{*from, *to}; +} + +MenuPresses lift_menu_presses(const LiftRide& ride, size_t entries){ + const size_t down = (ride.to + entries - ride.from) % entries; + const size_t up = (ride.from + entries - ride.to) % entries; + if (entries <= 3){ + // No wrap: the cursor goes straight there. + return ride.to >= ride.from + ? MenuPresses{Pokemon::Direction::SOUTH, ride.to - ride.from} + : MenuPresses{Pokemon::Direction::NORTH, ride.from - ride.to}; + } + return down <= up ? MenuPresses{Pokemon::Direction::SOUTH, down} : MenuPresses{Pokemon::Direction::NORTH, up}; +} + +bool is_hideout_variant(std::string_view variant){ + return variant == POSTER_SWITCH_VARIANT || parse_lift_floor_variant(variant).has_value(); +} + + +namespace{ + +// How long a message and its menu take to show on fast text, before the +// menu takes the D-pad. Not measured on the console. +constexpr Milliseconds LIFT_MENU_WAIT = 1500ms; +constexpr Milliseconds MENU_TAP = 80ms; +constexpr Milliseconds MENU_TAP_RELEASE = 240ms; +// The lift's shake and the doors, then the overworld, A press to the end. +constexpr Milliseconds HIDEOUT_SCENE_TIMEOUT = 30000ms; + +} // namespace + +void ride_lift(ConsoleHandle& console, ProControllerContext& context, const LiftRide& ride){ + const MenuPresses presses = lift_menu_presses(ride, rocket_hideout_lift_menu().size()); + console.log( + "Story: lift from " + rocket_hideout_lift_menu()[ride.from] + " to " + rocket_hideout_lift_menu()[ride.to] + + ": " + std::to_string(presses.presses) + " press(es) " + Pokemon::direction_name(presses.direction) + "." + ); + pbf_press_button(context, BUTTON_A, 160ms, LIFT_MENU_WAIT); + const DpadPosition dpad = presses.direction == Pokemon::Direction::SOUTH ? DPAD_DOWN : DPAD_UP; + for (size_t c = 0; c < presses.presses; c++){ + pbf_press_dpad(context, dpad, MENU_TAP, MENU_TAP_RELEASE); + } + pbf_press_button(context, BUTTON_A, 160ms, 800ms); + // B during the ride does nothing; the menu took the A. + mash_until_overworld(console, context, HIDEOUT_SCENE_TIMEOUT); +} + +void push_poster_switch(ConsoleHandle& console, ProControllerContext& context){ + console.log("Story: the switch behind the poster."); + pbf_press_button(context, BUTTON_A, 160ms, 800ms); + mash_until_overworld(console, context, HIDEOUT_SCENE_TIMEOUT); +} + + + +} // namespace PokemonFRLG +} // namespace NintendoSwitch +} // namespace PokemonAutomation diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryHideout.h b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryHideout.h new file mode 100644 index 0000000000..4e4249af77 --- /dev/null +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryHideout.h @@ -0,0 +1,86 @@ +/* AutoStory Rocket Hideout Steps + * + * From: https://github.com/PokemonAutomation/ + * + * The two story steps the Rocket Hideout needs that no other place does: + * the switch behind the Celadon Game Corner's poster, which opens the + * stairs down, and the lift's floor panel. Both are GAME steps named by + * their variant, as the draft plans write them (StoryData/Draft). + * + */ + +#ifndef PokemonAutomation_PokemonFRLG_AutoStoryHideout_H +#define PokemonAutomation_PokemonFRLG_AutoStoryHideout_H + +#include +#include +#include +#include +#include +#include "Common/Cpp/TestRunners/UnitTestDatabase.h" +#include "NintendoSwitch/Controllers/Procon/NintendoSwitch_ProController.h" +#include "NintendoSwitch/NintendoSwitch_ConsoleHandle.h" +#include "Pokemon/Navigation/Pokemon_Grid.h" + +namespace PokemonAutomation{ +namespace NintendoSwitch{ +namespace PokemonFRLG{ + + +// The GAME step that pushes the switch behind the Game Corner's poster, +// the player facing it (pokefirered CeladonCity_GameCorner_EventScript_ +// Poster): A, "Hey! A switch behind the POSTER!? Let's push it!", and the +// stairs (15..17, 2..3) open for good. The Grunt in front of it must be +// beaten first. +inline const std::string POSTER_SWITCH_VARIANT = "poster_switch"; + +// The GAME step that rides the Rocket Hideout's lift, the player facing +// its panel with the LIFT KEY: "lift_floor ", floors as the +// panel names them (B1F, B2F, B4F). `from` is the floor the lift stands +// at, where the panel's cursor starts. +inline constexpr std::string_view LIFT_FLOOR_PREFIX = "lift_floor "; + +// The lift panel's menu, top first (pokefirered +// sMultichoiceList_RocketHideoutElevator): B1F, B2F, B4F, EXIT. +const std::vector& rocket_hideout_lift_menu(); + +// A ride: the menu rows the cursor starts on and is moved to. +struct LiftRide{ + size_t from = 0; + size_t to = 0; +}; +// The variant for a ride from floor `from` to `to`. +std::string lift_floor_variant(std::string_view from, std::string_view to); +// The ride a "lift_floor " variant names, or nothing if it is +// not one, or names a floor the panel hasn't. +std::optional parse_lift_floor_variant(std::string_view variant); + +// The fewest presses that move the cursor from `ride.from` to `ride.to` +// on a menu of `entries` rows. A multichoice of more than three rows +// wraps round (pokefirered DrawVerticalMultichoiceMenu()). +struct MenuPresses{ + Pokemon::Direction direction = Pokemon::Direction::SOUTH; + size_t presses = 0; +}; +MenuPresses lift_menu_presses(const LiftRide& ride, size_t entries); + +// Whether `variant` is one of this file's steps. +bool is_hideout_variant(std::string_view variant); + +// On the console: A on the panel, the floor picked, the ride waited out +// back to the overworld, the player still in the lift. +void ride_lift(ConsoleHandle& console, ProControllerContext& context, const LiftRide& ride); +// On the console: A on the poster, its message closed back to the +// overworld. +void push_poster_switch(ConsoleHandle& console, ProControllerContext& context); + + +// Registers the hideout steps' tests. +void add_tests_AutoStoryHideout(UnitTestDatabase& database); + + + +} // namespace PokemonFRLG +} // namespace NintendoSwitch +} // namespace PokemonAutomation +#endif diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryHideout_Tests.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryHideout_Tests.cpp new file mode 100644 index 0000000000..a9518e3890 --- /dev/null +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryHideout_Tests.cpp @@ -0,0 +1,207 @@ +/* AutoStory Rocket Hideout Steps Tests + * + * From: https://github.com/PokemonAutomation/ + * + */ + +#include +#include +#include +#include "Common/Cpp/TestRunners/UnitTest.h" +#include "VideoGames/PokemonFRLG/Overworld/PokemonFRLG_MovementMechanics.h" +#include "VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldMaps.h" +#include "VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSim.h" +#include "PokemonFRLG_AutoStoryHideout.h" +#include "PokemonFRLG_AutoStoryRowSim.h" +#include "PokemonFRLG_AutoStoryTableSteps.h" + +namespace PokemonAutomation{ +namespace NintendoSwitch{ +namespace PokemonFRLG{ + + +namespace{ + +struct LiftInput{ + std::string name; + std::string variant; +}; +struct LiftExpectation{ + // Nothing: the variant isn't a ride. + std::optional presses; +}; +struct LiftCase{ + LiftInput input; + LiftExpectation expectation; +}; + +class Test_AutoStoryHideout : public UnitTest{ +public: + explicit Test_AutoStoryHideout(LiftCase test_case) + : UnitTest("PokemonFRLG::AutoStoryHideout - " + test_case.input.name) + , m_case(std::move(test_case)) + {} + virtual UnitTestResult run(Logger&, CancellableScope&) const override{ + const std::optional ride = parse_lift_floor_variant(m_case.input.variant); + const std::optional& expected = m_case.expectation.presses; + if (!ride || !expected){ + if (ride.has_value() != expected.has_value()){ + return std::format("\"{}\": a ride {}, expected {}.", m_case.input.variant, ride.has_value(), expected.has_value()); + } + return true; + } + const MenuPresses got = lift_menu_presses(*ride, rocket_hideout_lift_menu().size()); + if (got.direction != expected->direction || got.presses != expected->presses){ + return std::format( + "\"{}\": {} press(es) {}, expected {} {}.", m_case.input.variant, + got.presses, Pokemon::direction_name(got.direction), expected->presses, Pokemon::direction_name(expected->direction) + ); + } + if (!is_hideout_variant(m_case.input.variant)){ + return "A ride that isn't a hideout variant."; + } + return true; + } + +private: + LiftCase m_case; +}; + +class Test_AutoStoryHideoutVariants : public UnitTest{ +public: + Test_AutoStoryHideoutVariants() + : UnitTest("PokemonFRLG::AutoStoryHideout - the poster and lift variants") + {} + virtual UnitTestResult run(Logger&, CancellableScope&) const override{ + if (!is_hideout_variant(POSTER_SWITCH_VARIANT) || is_hideout_variant("cut_tree") || is_hideout_variant("")){ + return "Expected only the poster switch and lift rides as hideout variants."; + } + if (lift_floor_variant("B2F", "B4F") != "lift_floor B2F B4F"){ + return "Expected \"lift_floor B2F B4F\", got \"" + lift_floor_variant("B2F", "B4F") + "\"."; + } + // A three-row menu doesn't wrap. + const MenuPresses no_wrap = lift_menu_presses(LiftRide{0, 2}, 3); + if (no_wrap.direction != Pokemon::Direction::SOUTH || no_wrap.presses != 2){ + return "Expected 2 down on a three-row menu."; + } + return true; + } +}; + +// The table's steps, run as a row runs them on the sim: the poster's +// switch opens the stairs north-east of it, and the lift lets out on the +// floor picked. +class Test_AutoStoryHideoutSim : public UnitTest{ +public: + Test_AutoStoryHideoutSim() + : UnitTest("PokemonFRLG::AutoStoryHideout - table steps on the sim") + {} + virtual UnitTestResult run(Logger&, CancellableScope&) const override{ + const std::string poster = poster_on_sim(); + if (!poster.empty()){ + return poster; + } + return lift_on_sim(); + } + +private: + static std::string poster_on_sim(){ + const MapData room = parse_map(R"({ + "name": "Corner", "source": {"decomp_file": "", "revision": "test", "date": "2026-11-09"}, + "tiles": ["#####", "#...#", "#...#", "#####"], + "objects": [ + {"name": "poster", "kind": "sign", "x": 2, "y": 1}, + {"name": "poster_stairs", "kind": "npc", "x": 3, "y": 1} + ] + })", "Corner"); + OverworldSim sim({room}, MapPosition{"Corner", {2, 2}}, Direction::NORTH); + StoryPose at{"Corner", {2, 2}, Direction::NORTH}; + const std::string failure = row_step_on_sim(sim, at, StoryTable::poster_switch("poster_switch", "test"), "00.31"); + if (!failure.empty()){ + return failure; + } + const Milliseconds tile = MovementMechanics::TILE_TIME; + sim.hold(Direction::EAST, tile * 2, MovementMechanics::STEP_RELEASE, tile * 2, {}); + sim.hold(Direction::NORTH, tile * 2, MovementMechanics::STEP_RELEASE, tile * 2, {}); + if (!(sim.state().position == MapPosition{"Corner", {3, 1}})){ + return "After the poster step, walked onto " + to_string(sim.state().position) + ", not the stairs."; + } + return ""; + } + static std::string lift_on_sim(){ + std::vector maps; + maps.push_back(parse_map(R"({ + "name": "Lift", "source": {"decomp_file": "", "revision": "test", "date": "2026-11-09"}, + "tiles": ["###", "#.#", "#.#", "###"], + "warps": [{"x": 1, "y": 2, "enter": "walk_south"}] + })", "Lift")); + maps.push_back(parse_map(R"({ + "name": "B4F", "source": {"decomp_file": "", "revision": "test", "date": "2026-11-09"}, + "tiles": ["###", "#.#", "###"] + })", "B4F")); + SimScript script; + const MapPosition b4f{"B4F", {1, 1}}; + script.lift_floors["Lift"] = {MapPosition{"Lift", {1, 1}}, MapPosition{"Lift", {1, 1}}, b4f}; + OverworldSim sim(maps, MapPosition{"Lift", {1, 2}}, Direction::SOUTH, script); + StoryPose at{"Lift", {1, 2}, Direction::SOUTH}; + const std::string failure = row_step_on_sim(sim, at, StoryTable::lift_floor("lift_to_b4f", "B2F", "B4F", "test"), "00.32"); + if (!failure.empty()){ + return failure; + } + sim.hold(Direction::SOUTH, MovementMechanics::TILE_TIME, MovementMechanics::STEP_RELEASE, std::chrono::milliseconds(3000), {}); + if (!(sim.state().position == b4f)){ + return "After the lift step, the door let out on " + to_string(sim.state().position) + "."; + } + return ""; + } +}; + +const LiftCase LIFT_CASES[] = { + { + .input = {.name = "B2F to B4F: one down", .variant = "lift_floor B2F B4F"}, + .expectation = {.presses = MenuPresses{Pokemon::Direction::SOUTH, 1}}, + }, + { + .input = {.name = "B4F to B1F: two up", .variant = "lift_floor B4F B1F"}, + .expectation = {.presses = MenuPresses{Pokemon::Direction::NORTH, 2}}, + }, + { + // B1F up past the top wraps to EXIT, then B4F: two up equal two + // down; down is taken. + .input = {.name = "B1F to B4F: two down", .variant = "lift_floor B1F B4F"}, + .expectation = {.presses = MenuPresses{Pokemon::Direction::SOUTH, 2}}, + }, + { + .input = {.name = "the lift's own floor: no press", .variant = "lift_floor B4F B4F"}, + .expectation = {.presses = MenuPresses{Pokemon::Direction::SOUTH, 0}}, + }, + { + .input = {.name = "no B3F on the panel", .variant = "lift_floor B2F B3F"}, + .expectation = {.presses = std::nullopt}, + }, + { + .input = {.name = "EXIT is no floor", .variant = "lift_floor B2F EXIT"}, + .expectation = {.presses = std::nullopt}, + }, + { + .input = {.name = "one floor only", .variant = "lift_floor B2F"}, + .expectation = {.presses = std::nullopt}, + }, +}; + +} // namespace + + +void add_tests_AutoStoryHideout(UnitTestDatabase& database){ + for (const LiftCase& item : LIFT_CASES){ + database.add(item); + } + database.add(); + database.add(); +} + + + +} // namespace PokemonFRLG +} // namespace NintendoSwitch +} // namespace PokemonAutomation diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRowSim.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRowSim.cpp index ff86b55359..adf518879f 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRowSim.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRowSim.cpp @@ -15,6 +15,7 @@ #include "Pokemon/AutoStory/Pokemon_TilePose.h" #include "PokemonFRLG_AutoStoryActions.h" #include "PokemonFRLG_AutoStoryBattleDecisions.h" +#include "PokemonFRLG_AutoStoryHideout.h" #include "PokemonFRLG_AutoStoryRowSim.h" namespace PokemonAutomation{ @@ -370,6 +371,8 @@ Pokemon::StoryAction OverworldStepSim::action(StoryActionId id){ case StoryActionId::BATTLE: body = &OverworldStepSim::battle; break; + case StoryActionId::GAME: + return hideout_or_stub(); default: return m_stubs.stub(); } @@ -519,6 +522,33 @@ std::string OverworldStepSim::cut(const StoryStep& step){ return ""; } +// A Rocket Hideout GAME step on the sim: the poster's switch, or the +// lift's floor (SimScript::lift_floors, rows as on the panel); any other +// GAME step is stubbed. +Pokemon::StoryAction OverworldStepSim::hideout_or_stub(){ + Pokemon::StoryAction stub = m_stubs.stub(); + Pokemon::StoryAction sim = played([this](RunState&, const StoryStep& step){ + const std::string failure = hideout(step); + return failure.empty() ? Pokemon::outcome_ok() : Pokemon::outcome_failed("sim_failure", failure); + }); + sim.act = [stub, played_act = sim.act](RunState& state, const StoryStep& step){ + return is_hideout_variant(step.variant) ? played_act(state, step) : stub.act(state, step); + }; + sim.needs_console = stub.needs_console; + return sim; +} + +std::string OverworldStepSim::hideout(const StoryStep& step){ + if (step.variant == POSTER_SWITCH_VARIANT){ + return m_sim.push_poster_switch() ? "" : "no poster ahead."; + } + const std::optional ride = parse_lift_floor_variant(step.variant); + if (!ride || !m_sim.choose_lift_floor(ride->to)){ + return "no lift panel for \"" + step.variant + "\"."; + } + return ""; +} + // A battle from the trainer's message, which must be up, ending where the // table says, the battle loop's end played on the overworld after it. std::string OverworldStepSim::battle(const StoryStep& step){ diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRowSim.h b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRowSim.h index 15655a8162..aa36f4f023 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRowSim.h +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRowSim.h @@ -183,6 +183,8 @@ class OverworldStepSim : public Pokemon::TableExecutor{ std::string step_onto(const StoryStep& step); std::string cut(const StoryStep& step); std::string battle(const StoryStep& step); + Pokemon::StoryAction hideout_or_stub(); + std::string hideout(const StoryStep& step); OverworldSim& m_sim; StoryPose m_at; diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryTableSteps.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryTableSteps.cpp index acd9a79de8..372aa1ed5e 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryTableSteps.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryTableSteps.cpp @@ -4,6 +4,7 @@ * */ +#include "PokemonFRLG_AutoStoryHideout.h" #include "PokemonFRLG_AutoStoryTableSteps.h" namespace PokemonAutomation{ @@ -154,6 +155,18 @@ StoryStep cut_tree(std::string name, Pokemon::Pose tree, std::string why){ return step; } +StoryStep poster_switch(std::string name, std::string why){ + StoryStep step = make(StoryStepKind::GAME, std::move(name), std::move(why)); + step.variant = POSTER_SWITCH_VARIANT; + return step; +} + +StoryStep lift_floor(std::string name, std::string_view from, std::string_view to, std::string why){ + StoryStep step = make(StoryStepKind::GAME, std::move(name), std::move(why)); + step.variant = lift_floor_variant(from, to); + return step; +} + } // namespace StoryTable diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryTableSteps.h b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryTableSteps.h index d0a314a2ac..d8e92f3d45 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryTableSteps.h +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryTableSteps.h @@ -13,6 +13,7 @@ #include #include +#include #include #include "PokemonFRLG_AutoStoryEvents.h" @@ -182,6 +183,12 @@ StoryStep options_step(); // Cuts the tree the player faces (CUT_TREE_VARIANT) and steps onto its // tile, `tree`, facing the way the step goes. StoryStep cut_tree(std::string name, Pokemon::Pose tree, std::string why); +// Pushes the switch behind the Game Corner's poster the player faces +// (POSTER_SWITCH_VARIANT). +StoryStep poster_switch(std::string name, std::string why); +// Rides the Rocket Hideout's lift, the player facing its panel, from the +// floor it stands at to `to` (lift_floor_variant()): "B1F", "B2F", "B4F". +StoryStep lift_floor(std::string name, std::string_view from, std::string_view to, std::string why); // Rows in files of their own (PokemonFRLG_AutoStoryTableVermilionGym.cpp, diff --git a/SerialPrograms/cmake/SourceFiles.cmake b/SerialPrograms/cmake/SourceFiles.cmake index 08e57e3244..36df2c5b96 100644 --- a/SerialPrograms/cmake/SourceFiles.cmake +++ b/SerialPrograms/cmake/SourceFiles.cmake @@ -1917,6 +1917,9 @@ file(GLOB LIBRARY_SOURCES Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryGrind.cpp Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryGrind.h Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryGrind_Tests.cpp + Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryHideout.cpp + Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryHideout.h + Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryHideout_Tests.cpp Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryItems_Tests.cpp Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryFaultSweep_Tests.cpp Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryFaultSweep_Tests.h From cf123e733a97d99ae7ecc77021808c2fca407d08 Mon Sep 17 00:00:00 2001 From: dayfine Date: Mon, 9 Nov 2026 17:22:16 -0800 Subject: [PATCH 05/79] FRLG AutoStory: use items from the bag, renew a Repel, ride the Bicycle Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss --- .../Menus/PokemonFRLG_ItemListReader.cpp | 5 + .../Menus/PokemonFRLG_ItemListReader.h | 3 +- .../Overworld/PokemonFRLG_MovementMechanics.h | 4 + .../Overworld/PokemonFRLG_OverworldWalk.cpp | 12 +- .../Overworld/PokemonFRLG_OverworldWalk.h | 2 + .../PokemonFRLG/PokemonFRLG_Tests.cpp | 2 + .../AutoStory/PokemonFRLG_AutoStoryEvents.cpp | 14 ++ .../AutoStory/PokemonFRLG_AutoStoryEvents.h | 7 +- .../PokemonFRLG_AutoStoryHideout_Tests.cpp | 16 +- .../PokemonFRLG_AutoStoryItemUse.cpp | 165 +++++++++++++ .../AutoStory/PokemonFRLG_AutoStoryItemUse.h | 127 ++++++++++ .../PokemonFRLG_AutoStoryItemUse_Tests.cpp | 223 ++++++++++++++++++ .../PokemonFRLG_AutoStoryTableSteps.cpp | 14 ++ .../PokemonFRLG_AutoStoryTableSteps.h | 5 + SerialPrograms/cmake/SourceFiles.cmake | 3 + 15 files changed, 596 insertions(+), 6 deletions(-) create mode 100644 SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryItemUse.cpp create mode 100644 SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryItemUse.h create mode 100644 SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryItemUse_Tests.cpp diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Inference/Menus/PokemonFRLG_ItemListReader.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Inference/Menus/PokemonFRLG_ItemListReader.cpp index 4c89385dbb..9b8a5c1212 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Inference/Menus/PokemonFRLG_ItemListReader.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Inference/Menus/PokemonFRLG_ItemListReader.cpp @@ -70,6 +70,11 @@ class ItemNameMatcher : public OCR::SmallDictionaryMatcher{ {"parlyz-heal", "Parlyz Heal"}, {"awakening", "Awakening"}, {"poke-ball", "Poke Ball"}, + {"repel", "Repel"}, + {"super-repel", "Super Repel"}, + {"max-repel", "Max Repel"}, + {"escape-rope", "Escape Rope"}, + {"bicycle", "Bicycle"}, {"cancel", "Cancel"}, }){ JsonArray names; diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Inference/Menus/PokemonFRLG_ItemListReader.h b/SerialPrograms/Source/VideoGames/PokemonFRLG/Inference/Menus/PokemonFRLG_ItemListReader.h index 0b36e39959..6565fcbfdd 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Inference/Menus/PokemonFRLG_ItemListReader.h +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Inference/Menus/PokemonFRLG_ItemListReader.h @@ -36,7 +36,8 @@ ImageFloatBox item_list_name_box(int row); ImageFloatBox bag_item_count_box(int row); // The item named in row `row`: a slug such as "potion", "antidote", -// "parlyz-heal", "awakening", "poke-ball", or "cancel" for the list's last row, in a +// "parlyz-heal", "awakening", "poke-ball", "repel", +// "super-repel", "max-repel", "escape-rope", "bicycle", or "cancel" for the list's last row, in a // game in `language`; empty if it can't be read, as in a language the // reader has no names for. std::string read_item_list_name(Logger& logger, Language language, const ImageViewRGB32& screen, int row); diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_MovementMechanics.h b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_MovementMechanics.h index 0a20f37a7a..d2f761596c 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_MovementMechanics.h +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_MovementMechanics.h @@ -48,6 +48,10 @@ inline constexpr Milliseconds TILE_TIME(267); inline constexpr Milliseconds RUN_TILE_TIME(133); // Surfing: a tile per 8 frames. inline constexpr Milliseconds SURF_TILE_TIME(133); +// Riding the Bicycle: a tile per 4 frames (pokefirered bike.c, +// PlayerRideWaterCurrent(): MOVE_SPEED_FAST_2). An estimate from the +// decompilation, not measured on the console. +inline constexpr Milliseconds BIKE_TILE_TIME(67); // The longest tap measured to only turn a player facing another way, and // to take exactly one step for one facing its way. inline constexpr Milliseconds LONGEST_TAP(133); diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldWalk.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldWalk.cpp index 80c8d798f6..35214508be 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldWalk.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldWalk.cpp @@ -191,7 +191,15 @@ Milliseconds tile_time(const RouteStep& step, MoveSpeed speed){ if (step.surfing){ return SURF_TILE_TIME; } - return step_speed(step, speed) == MoveSpeed::RUN ? RUN_TILE_TIME : TILE_TIME; + switch (step_speed(step, speed)){ + case MoveSpeed::RUN: + return RUN_TILE_TIME; + case MoveSpeed::BIKE: + return BIKE_TILE_TIME; + case MoveSpeed::WALK: + break; + } + return TILE_TIME; } Pokemon::LegMover leg_mover(const RouteStep& step, MoveSpeed speed){ @@ -469,6 +477,8 @@ const char* move_speed_name(MoveSpeed speed){ return "walk"; case MoveSpeed::RUN: return "run"; + case MoveSpeed::BIKE: + return "bike"; } return "?"; } diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldWalk.h b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldWalk.h index d2120b8e04..22eb2eea05 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldWalk.h +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldWalk.h @@ -77,6 +77,8 @@ void use_max_repel_from_bag(ConsoleHandle& console, ProControllerContext& contex enum class MoveSpeed{ WALK, RUN, + // On the Bicycle, already mounted (MovementMechanics::BIKE_TILE_TIME). + BIKE, }; // Name of a movement speed. const char* move_speed_name(MoveSpeed speed); diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/PokemonFRLG_Tests.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/PokemonFRLG_Tests.cpp index 916b0837a2..28816b82aa 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/PokemonFRLG_Tests.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/PokemonFRLG_Tests.cpp @@ -49,6 +49,7 @@ #include "Programs/AutoStory/PokemonFRLG_AutoStoryBattle.h" #include "Programs/AutoStory/PokemonFRLG_AutoStoryCapture.h" #include "Programs/AutoStory/PokemonFRLG_AutoStoryHideout.h" +#include "Programs/AutoStory/PokemonFRLG_AutoStoryItemUse.h" #include "Programs/AutoStory/PokemonFRLG_AutoStoryPaceSim.h" #include "Programs/AutoStory/PokemonFRLG_AutoStoryPcStorage.h" #include "Programs/AutoStory/PokemonFRLG_AutoStoryRngLoop.h" @@ -940,6 +941,7 @@ void add_tests(UnitTestDatabase& database){ add_tests_AutoStoryRows(database); add_tests_AutoStoryTrashCans(database); add_tests_AutoStoryHideout(database); + add_tests_AutoStoryItemUse(database); add_tests_AutoStoryPaceSim(database); add_tests_AutoStoryItems(database); add_tests_AutoStoryRngLoop(database); diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryEvents.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryEvents.cpp index 12ace02fe6..b3bb43b2ec 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryEvents.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryEvents.cpp @@ -23,6 +23,7 @@ #include "PokemonFRLG_AutoStoryEvents.h" #include "PokemonFRLG_AutoStoryGrind.h" #include "PokemonFRLG_AutoStoryHideout.h" +#include "PokemonFRLG_AutoStoryItemUse.h" #include "PokemonFRLG_AutoStoryScreenEvents.h" #include "PokemonFRLG_AutoStorySummary.h" #include "PokemonFRLG_AutoStoryTable.h" @@ -366,6 +367,9 @@ const std::vector& story_maps(){ } MoveSpeed move_speed(const StoryStep& step){ + if (step.variant == BIKE_VARIANT){ + return MoveSpeed::BIKE; + } return step.variant == RUN_VARIANT ? MoveSpeed::RUN : MoveSpeed::WALK; } @@ -694,6 +698,16 @@ Outcome other_game_step(StoryEnv& env, RunState& state, const StoryStep& step){ push_poster_switch(env.console, env.context); return Pokemon::outcome_ok(); } + // An item from the bag; an Escape Rope ends where the table says. + if (is_item_use_variant(step.variant)){ + const std::string item = parse_use_item_variant(step.variant).value_or("bicycle"); + ConsoleItemUseActions bag(env.console, env.context, env.language); + const ItemUseEnd end = use_item_from_bag(env.console.logger(), bag, item); + if (end != ItemUseEnd::USED){ + return Pokemon::outcome_failed(std::string("use_item_") + item_use_end_name(end), step.variant); + } + return step.pose_after ? Pokemon::outcome_ok(*step.pose_after) : Pokemon::outcome_ok(); + } const Pokemon::Pose patch = state.pose; ConsoleCaptureActions capture(env.console, env.context, env.language, [&]{ pace_trainer_battle(env, state, step, patch); diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryEvents.h b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryEvents.h index 9e089b767c..4ecbd72ab7 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryEvents.h +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryEvents.h @@ -63,6 +63,10 @@ struct StoryPose{ // The variant of a ROUTE or LEGS step that runs, with B held: the player // has the Running Shoes (00.10 on). inline const std::string RUN_VARIANT = "run"; +// The variant of a ROUTE or LEGS step ridden on the Bicycle, mounted by a +// RIDE_BIKE_VARIANT step before it (PokemonFRLG_AutoStoryItemUse.h). +// Indoors, where the game doesn't let the player ride, it walks. +inline const std::string BIKE_VARIANT = "bike"; // The variant of a STEP into a trainer's line: a tile at a time, at most // TRAINER_LINE_TILES, until the trainer sees the player @@ -101,7 +105,8 @@ inline const std::string CLOSE_TRAINER_CARD = "close_trainer_card"; // the overworld. inline const std::string LEAVE_GIFT_SUMMARY = "leave_gift_summary"; -// How `step`, a ROUTE or LEGS, moves the player: RUN_VARIANT runs. +// How `step`, a ROUTE or LEGS, moves the player: RUN_VARIANT runs, +// BIKE_VARIANT rides. MoveSpeed move_speed(const StoryStep& step); diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryHideout_Tests.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryHideout_Tests.cpp index a9518e3890..0c29251b6a 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryHideout_Tests.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryHideout_Tests.cpp @@ -101,7 +101,11 @@ class Test_AutoStoryHideoutSim : public UnitTest{ if (!poster.empty()){ return poster; } - return lift_on_sim(); + const std::string lift = lift_on_sim(); + if (!lift.empty()){ + return lift; + } + return true; } private: @@ -162,8 +166,14 @@ const LiftCase LIFT_CASES[] = { .expectation = {.presses = MenuPresses{Pokemon::Direction::SOUTH, 1}}, }, { - .input = {.name = "B4F to B1F: two up", .variant = "lift_floor B4F B1F"}, - .expectation = {.presses = MenuPresses{Pokemon::Direction::NORTH, 2}}, + // Down past EXIT wraps to B1F: as few presses as up, and down is + // taken. + .input = {.name = "B4F to B1F: two down past EXIT", .variant = "lift_floor B4F B1F"}, + .expectation = {.presses = MenuPresses{Pokemon::Direction::SOUTH, 2}}, + }, + { + .input = {.name = "B4F to B2F: one up", .variant = "lift_floor B4F B2F"}, + .expectation = {.presses = MenuPresses{Pokemon::Direction::NORTH, 1}}, }, { // B1F up past the top wraps to EXIT, then B4F: two up equal two diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryItemUse.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryItemUse.cpp new file mode 100644 index 0000000000..d0a719798d --- /dev/null +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryItemUse.cpp @@ -0,0 +1,165 @@ +/* AutoStory Item Use + * + * From: https://github.com/PokemonAutomation/ + * + */ + +#include "CommonFramework/VideoPipeline/VideoFeed.h" +#include "NintendoSwitch/Commands/NintendoSwitch_Commands_PushButtons.h" +#include "VideoGames/PokemonFRLG/PokemonFRLG_Navigation.h" +#include "PokemonFRLG_AutoStoryActions.h" +#include "PokemonFRLG_AutoStoryItemUse.h" + +namespace PokemonAutomation{ +namespace NintendoSwitch{ +namespace PokemonFRLG{ + + +using namespace std::chrono_literals; + + +std::optional usable_item_pocket(std::string_view item){ + if (is_repel(item) || item == "escape-rope"){ + return BagPocket::ITEMS; + } + if (item == "bicycle"){ + return BagPocket::KEY_ITEMS; + } + return std::nullopt; +} +bool is_repel(std::string_view item){ + return item == "repel" || item == "super-repel" || item == "max-repel"; +} + +std::string use_item_variant(std::string_view item){ + return std::string(USE_ITEM_PREFIX) + std::string(item); +} +std::optional parse_use_item_variant(std::string_view variant){ + if (!variant.starts_with(USE_ITEM_PREFIX)){ + return std::nullopt; + } + const std::string_view item = variant.substr(USE_ITEM_PREFIX.size()); + if (!usable_item_pocket(item)){ + return std::nullopt; + } + return std::string(item); +} +bool is_item_use_variant(std::string_view variant){ + return variant == RIDE_BIKE_VARIANT || parse_use_item_variant(variant).has_value(); +} + +std::optional bag_row_of(const std::vector& rows, std::string_view item){ + for (size_t row = 0; row < rows.size(); row++){ + if (rows[row].item == item && rows[row].count != 0){ + return row; + } + } + return std::nullopt; +} + +const char* item_use_end_name(ItemUseEnd end){ + switch (end){ + case ItemUseEnd::USED: + return "used"; + case ItemUseEnd::NONE_LEFT: + return "none_left"; + case ItemUseEnd::NO_BAG: + return "no_bag"; + case ItemUseEnd::UNKNOWN_ITEM: + return "unknown_item"; + } + return "?"; +} + +ItemUseEnd use_item_from_bag(Logger& logger, ItemUseActions& actions, std::string_view item){ + const std::optional pocket = usable_item_pocket(item); + if (!pocket){ + return ItemUseEnd::UNKNOWN_ITEM; + } + if (!actions.open_pocket(*pocket)){ + logger.log("Bag: the bag didn't open."); + return ItemUseEnd::NO_BAG; + } + const std::optional row = bag_row_of(actions.read_pocket(), item); + if (!row){ + logger.log("Bag: no " + std::string(item) + " left."); + actions.close_bag(); + return ItemUseEnd::NONE_LEFT; + } + logger.log("Bag: using the " + std::string(item) + " on row " + std::to_string(*row + 1) + "."); + actions.use_row(*row); + actions.close_bag(); + return ItemUseEnd::USED; +} + +ItemUseEnd renew_repel(Logger& logger, ItemUseActions& actions, std::string_view item){ + if (!is_repel(item)){ + return ItemUseEnd::UNKNOWN_ITEM; + } + logger.log("Bag: the " + std::string(item) + " wore off."); + return use_item_from_bag(logger, actions, item); +} + + +namespace{ + +// The bag slides in, and ignores presses until it is done (as +// use_max_repel_from_bag()). +constexpr Milliseconds BAG_SLIDE_IN = 1000ms; +// Out of the bag and its messages, or the Escape Rope's warp. +constexpr Milliseconds BAG_CLOSE_TIMEOUT = 30000ms; + +} // namespace + +ConsoleItemUseActions::ConsoleItemUseActions(ConsoleHandle& console, ProControllerContext& context, Language language) + : m_console(console) + , m_context(context) + , m_language(language) +{} + +bool ConsoleItemUseActions::open_pocket(BagPocket pocket){ + open_bag_from_overworld(m_console, m_context); + pbf_wait(m_context, BAG_SLIDE_IN); + // Left to the Items pocket, which doesn't wrap, then right to `pocket`. + for (int c = 0; c < 3; c++){ + pbf_press_dpad(m_context, DPAD_LEFT, 100ms, 600ms); + } + for (int c = 0; c < (int)pocket; c++){ + pbf_press_dpad(m_context, DPAD_RIGHT, 100ms, 600ms); + } + for (int c = 0; c < 20; c++){ + pbf_press_dpad(m_context, DPAD_UP, 100ms, 100ms); + } + return true; +} + +std::vector ConsoleItemUseActions::read_pocket(){ + m_context.wait_for_all_requests(); + VideoSnapshot screen = m_console.video().snapshot(); + if (!screen){ + return {}; + } + return read_bag_pocket(m_console.logger(), m_language, screen); +} + +void ConsoleItemUseActions::use_row(size_t row){ + for (size_t c = 0; c < row; c++){ + pbf_press_dpad(m_context, DPAD_DOWN, 100ms, 300ms); + } + // The item's menu, USE on top. + pbf_press_button(m_context, BUTTON_A, 160ms, 800ms); + pbf_press_button(m_context, BUTTON_A, 160ms, 1500ms); +} + +void ConsoleItemUseActions::close_bag(){ + // B until the overworld: past " used the REPEL.", out of the + // bag and the START menu. The Escape Rope and the Bicycle leave the + // bag by themselves. + mash_until_overworld(m_console, m_context, BAG_CLOSE_TIMEOUT); +} + + + +} // namespace PokemonFRLG +} // namespace NintendoSwitch +} // namespace PokemonAutomation diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryItemUse.h b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryItemUse.h new file mode 100644 index 0000000000..bf0a5c86c7 --- /dev/null +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryItemUse.h @@ -0,0 +1,127 @@ +/* AutoStory Item Use + * + * From: https://github.com/PokemonAutomation/ + * + * Items the story uses from the bag on the overworld, as PokeGuy's run + * does: a Repel or Super Repel before long walks through grass and caves, + * renewed when it wears off; an Escape Rope out of the Rocket Hideout; + * and the Bicycle. The bag is read with read_bag_pocket(), so the step + * finds its item wherever the pocket keeps it. + * + */ + +#ifndef PokemonAutomation_PokemonFRLG_AutoStoryItemUse_H +#define PokemonAutomation_PokemonFRLG_AutoStoryItemUse_H + +#include +#include +#include +#include +#include +#include "Common/Cpp/Logging/AbstractLogger.h" +#include "Common/Cpp/TestRunners/UnitTestDatabase.h" +#include "CommonFramework/Language.h" +#include "NintendoSwitch/Controllers/Procon/NintendoSwitch_ProController.h" +#include "NintendoSwitch/NintendoSwitch_ConsoleHandle.h" +#include "VideoGames/PokemonFRLG/Inference/Menus/PokemonFRLG_ItemListReader.h" + +namespace PokemonAutomation{ +namespace NintendoSwitch{ +namespace PokemonFRLG{ + + +// The GAME step that uses an item from the bag on the overworld: +// "use_item ", the slug as read_item_list_name() names it. +inline constexpr std::string_view USE_ITEM_PREFIX = "use_item "; +// The GAME step that gets on the Bicycle (the Key Items pocket's BICYCLE, +// USE). The ROUTE steps after it ride (BIKE_VARIANT). +inline const std::string RIDE_BIKE_VARIANT = "ride_bike"; + +// The bag's pockets, in the order LEFT and RIGHT go through them. +enum class BagPocket{ + ITEMS, + KEY_ITEMS, + POKE_BALLS, +}; + +// The pocket of an item the story uses from the bag: repel, super-repel, +// max-repel, escape-rope (Items) or bicycle (Key Items); nothing for +// another. +std::optional usable_item_pocket(std::string_view item); +// Whether `item` is a Repel of any kind. +bool is_repel(std::string_view item); + +// The variant that uses `item`. +std::string use_item_variant(std::string_view item); +// The item a "use_item " variant uses, or nothing if it isn't one +// or the item isn't one the story uses from the bag. +std::optional parse_use_item_variant(std::string_view variant); +// Whether `variant` is one of this file's steps. +bool is_item_use_variant(std::string_view variant); + +// The row of `item` in `rows` (read_bag_pocket()'s, from the top), if it +// has one left: a count of -1 (unread) counts as some. +std::optional bag_row_of(const std::vector& rows, std::string_view item); + + +// The bag, as use_item_from_bag() drives it: the console's, or a test's. +class ItemUseActions{ +public: + virtual ~ItemUseActions() = default; + // From the overworld, opens the bag on `pocket`, scrolled to its top. + virtual bool open_pocket(BagPocket pocket) = 0; + // The open pocket's rows, from the top. + virtual std::vector read_pocket() = 0; + // Moves to row `row`, USE, and through what the item says. + virtual void use_row(size_t row) = 0; + // Back to the overworld (nothing to do if the item closed the bag). + virtual void close_bag() = 0; +}; + +enum class ItemUseEnd{ + USED, + // The pocket has none left (or the name isn't read). + NONE_LEFT, + // The bag didn't open. + NO_BAG, + // Not an item the story uses from the bag. + UNKNOWN_ITEM, +}; +const char* item_use_end_name(ItemUseEnd end); + +// Opens the item's pocket, finds it and uses it, then back to the +// overworld. +ItemUseEnd use_item_from_bag(Logger& logger, ItemUseActions& actions, std::string_view item); + +// After "REPEL's effect wore off..." has closed: FRLG asks nothing, so +// another of the same Repel is used if the bag has one. NONE_LEFT is no +// failure: the walk goes on without. +ItemUseEnd renew_repel(Logger& logger, ItemUseActions& actions, std::string_view item); + + +// The console's bag. +class ConsoleItemUseActions : public ItemUseActions{ +public: + ConsoleItemUseActions(ConsoleHandle& console, ProControllerContext& context, Language language); + + virtual bool open_pocket(BagPocket pocket) override; + virtual std::vector read_pocket() override; + virtual void use_row(size_t row) override; + virtual void close_bag() override; + +private: + ConsoleHandle& m_console; + ProControllerContext& m_context; + Language m_language; +}; + + +// Registers the item use tests. +void add_tests_AutoStoryItemUse(UnitTestDatabase& database); + + + +} // namespace PokemonFRLG +} // namespace NintendoSwitch +} // namespace PokemonAutomation +#endif diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryItemUse_Tests.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryItemUse_Tests.cpp new file mode 100644 index 0000000000..391644a4cf --- /dev/null +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryItemUse_Tests.cpp @@ -0,0 +1,223 @@ +/* AutoStory Item Use Tests + * + * From: https://github.com/PokemonAutomation/ + * + * use_item_from_bag() and renew_repel() on a made-up bag, and the bike's + * pace. + * + */ + +#include +#include +#include +#include +#include "Common/Cpp/Logging/AbstractLogger.h" +#include "Common/Cpp/TestRunners/UnitTest.h" +#include "VideoGames/PokemonFRLG/Overworld/PokemonFRLG_MovementMechanics.h" +#include "VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldWalk.h" +#include "PokemonFRLG_AutoStoryEvents.h" +#include "PokemonFRLG_AutoStoryItemUse.h" + +namespace PokemonAutomation{ +namespace NintendoSwitch{ +namespace PokemonFRLG{ + + +namespace{ + +// A bag on the sim: its pockets, each item used takes one, a bag that may +// not open. +class SimBag : public ItemUseActions{ +public: + std::map> pockets; + bool opens = true; + std::vector used; + bool open = false; + + virtual bool open_pocket(BagPocket pocket) override{ + m_pocket = pocket; + open = opens; + return opens; + } + virtual std::vector read_pocket() override{ + return pockets[m_pocket]; + } + virtual void use_row(size_t row){ + BagRow& item = pockets[m_pocket][row]; + used.push_back(item.item); + if (item.count > 0){ + item.count--; + } + } + virtual void close_bag() override{ + open = false; + } + +private: + BagPocket m_pocket = BagPocket::ITEMS; +}; + +struct ItemUseInput{ + std::string name; + std::string variant; + std::vector items; + std::vector key_items; + bool opens = true; + // renew_repel() instead of use_item_from_bag(). + bool renew = false; +}; +struct ItemUseExpectation{ + ItemUseEnd end; + std::vector used; +}; +struct ItemUseCase{ + ItemUseInput input; + ItemUseExpectation expectation; +}; + +class Test_AutoStoryItemUse : public UnitTest{ +public: + explicit Test_AutoStoryItemUse(ItemUseCase test_case) + : UnitTest("PokemonFRLG::AutoStoryItemUse - " + test_case.input.name) + , m_case(std::move(test_case)) + {} + virtual UnitTestResult run(Logger& logger, CancellableScope&) const override{ + SimBag bag; + bag.pockets[BagPocket::ITEMS] = m_case.input.items; + bag.pockets[BagPocket::KEY_ITEMS] = m_case.input.key_items; + bag.opens = m_case.input.opens; + const std::string variant = m_case.input.variant; + const std::string item = variant == RIDE_BIKE_VARIANT ? "bicycle" : parse_use_item_variant(variant).value_or(variant); + const ItemUseEnd end = m_case.input.renew ? renew_repel(logger, bag, item) : use_item_from_bag(logger, bag, item); + if (end != m_case.expectation.end || bag.used != m_case.expectation.used || bag.open){ + return std::format( + "\"{}\": {} using {} item(s), bag {}; expected {} using {}.", variant, + item_use_end_name(end), bag.used.size(), bag.open ? "open" : "closed", + item_use_end_name(m_case.expectation.end), m_case.expectation.used.size() + ); + } + return true; + } + +private: + ItemUseCase m_case; +}; + +const ItemUseCase ITEM_USE_CASES[] = { + { + .input = { + .name = "a Repel below the Potions", + .variant = "use_item repel", + .items = {{"potion", 15}, {"repel", 5}, {"escape-rope", 2}}, + }, + .expectation = {.end = ItemUseEnd::USED, .used = {"repel"}}, + }, + { + .input = { + .name = "the Escape Rope with its count unread", + .variant = "use_item escape-rope", + .items = {{"potion", 15}, {"", -1}, {"escape-rope", -1}}, + }, + .expectation = {.end = ItemUseEnd::USED, .used = {"escape-rope"}}, + }, + { + .input = { + .name = "no Super Repel bought", + .variant = "use_item super-repel", + .items = {{"potion", 15}, {"repel", 5}}, + }, + .expectation = {.end = ItemUseEnd::NONE_LEFT, .used = {}}, + }, + { + .input = { + .name = "the bag doesn't open", + .variant = "use_item repel", + .items = {{"repel", 5}}, + .opens = false, + }, + .expectation = {.end = ItemUseEnd::NO_BAG, .used = {}}, + }, + { + .input = { + .name = "the Bicycle from the Key Items", + .variant = "ride_bike", + .items = {{"bicycle", 1}}, + .key_items = {{"", -1}, {"bicycle", -1}}, + }, + .expectation = {.end = ItemUseEnd::USED, .used = {"bicycle"}}, + }, + { + .input = { + .name = "a Repel wore off: another used", + .variant = "use_item repel", + .items = {{"repel", 1}}, + .renew = true, + }, + .expectation = {.end = ItemUseEnd::USED, .used = {"repel"}}, + }, + { + .input = { + .name = "the last Repel wore off: none left", + .variant = "use_item repel", + .items = {{"repel", 0}}, + .renew = true, + }, + .expectation = {.end = ItemUseEnd::NONE_LEFT, .used = {}}, + }, + { + .input = { + .name = "an Escape Rope is no Repel to renew", + .variant = "use_item escape-rope", + .items = {{"escape-rope", 2}}, + .renew = true, + }, + .expectation = {.end = ItemUseEnd::UNKNOWN_ITEM, .used = {}}, + }, +}; + +class Test_AutoStoryItemUseVariants : public UnitTest{ +public: + Test_AutoStoryItemUseVariants() + : UnitTest("PokemonFRLG::AutoStoryItemUse - variants and the bike's pace") + {} + virtual UnitTestResult run(Logger&, CancellableScope&) const override{ + if (parse_use_item_variant("use_item potion") || parse_use_item_variant("use_item") || !parse_use_item_variant(use_item_variant("super-repel"))){ + return "Expected only the story's bag items as use_item variants."; + } + if (!is_item_use_variant(RIDE_BIKE_VARIANT) || is_item_use_variant("poster_switch")){ + return "Expected ride_bike, not poster_switch, as an item use."; + } + StoryStep ride; + ride.kind = Pokemon::StoryStepKind::ROUTE; + ride.variant = BIKE_VARIANT; + if (move_speed(ride) != MoveSpeed::BIKE){ + return "A bike ROUTE isn't ridden."; + } + RouteStep outdoors; + outdoors.tiles = 10; + RouteStep indoors = outdoors; + indoors.walk_only = true; + if (OverworldWalkSteps::tile_time(outdoors, MoveSpeed::BIKE) != MovementMechanics::BIKE_TILE_TIME + || OverworldWalkSteps::tile_time(indoors, MoveSpeed::BIKE) != MovementMechanics::TILE_TIME + ){ + return "Expected the bike's pace outdoors and a walk indoors."; + } + return true; + } +}; + +} // namespace + + +void add_tests_AutoStoryItemUse(UnitTestDatabase& database){ + for (const ItemUseCase& item : ITEM_USE_CASES){ + database.add(item); + } + database.add(); +} + + + +} // namespace PokemonFRLG +} // namespace NintendoSwitch +} // namespace PokemonAutomation diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryTableSteps.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryTableSteps.cpp index 372aa1ed5e..81140d3520 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryTableSteps.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryTableSteps.cpp @@ -5,6 +5,7 @@ */ #include "PokemonFRLG_AutoStoryHideout.h" +#include "PokemonFRLG_AutoStoryItemUse.h" #include "PokemonFRLG_AutoStoryTableSteps.h" namespace PokemonAutomation{ @@ -167,6 +168,19 @@ StoryStep lift_floor(std::string name, std::string_view from, std::string_view t return step; } +StoryStep use_item(std::string name, std::string_view item, std::string why, std::optional pose_after){ + StoryStep step = make(StoryStepKind::GAME, std::move(name), std::move(why)); + step.variant = use_item_variant(item); + step.pose_after = std::move(pose_after); + return step; +} + +StoryStep ride_bike(std::string name, std::string why){ + StoryStep step = make(StoryStepKind::GAME, std::move(name), std::move(why)); + step.variant = RIDE_BIKE_VARIANT; + return step; +} + } // namespace StoryTable diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryTableSteps.h b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryTableSteps.h index d8e92f3d45..0e28ad3048 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryTableSteps.h +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryTableSteps.h @@ -189,6 +189,11 @@ StoryStep poster_switch(std::string name, std::string why); // Rides the Rocket Hideout's lift, the player facing its panel, from the // floor it stands at to `to` (lift_floor_variant()): "B1F", "B2F", "B4F". StoryStep lift_floor(std::string name, std::string_view from, std::string_view to, std::string why); +// Uses `item` from the bag on the overworld (use_item_variant()): a +// Repel, or an Escape Rope, which leaves the player on `pose_after`. +StoryStep use_item(std::string name, std::string_view item, std::string why, std::optional pose_after = std::nullopt); +// Gets on the Bicycle (RIDE_BIKE_VARIANT). +StoryStep ride_bike(std::string name, std::string why); // Rows in files of their own (PokemonFRLG_AutoStoryTableVermilionGym.cpp, diff --git a/SerialPrograms/cmake/SourceFiles.cmake b/SerialPrograms/cmake/SourceFiles.cmake index 36df2c5b96..9de4d7fee3 100644 --- a/SerialPrograms/cmake/SourceFiles.cmake +++ b/SerialPrograms/cmake/SourceFiles.cmake @@ -1920,6 +1920,9 @@ file(GLOB LIBRARY_SOURCES Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryHideout.cpp Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryHideout.h Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryHideout_Tests.cpp + Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryItemUse.cpp + Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryItemUse.h + Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryItemUse_Tests.cpp Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryItems_Tests.cpp Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryFaultSweep_Tests.cpp Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryFaultSweep_Tests.h From a078ce6c5dec2f80624625399ec7b35027a13641 Mon Sep 17 00:00:00 2001 From: dayfine Date: Mon, 9 Nov 2026 17:22:52 -0800 Subject: [PATCH 06/79] FRLG AutoStory: mark the sim bag's use_row override Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss --- .../Programs/AutoStory/PokemonFRLG_AutoStoryItemUse_Tests.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryItemUse_Tests.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryItemUse_Tests.cpp index 391644a4cf..2ea359f252 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryItemUse_Tests.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryItemUse_Tests.cpp @@ -42,7 +42,7 @@ class SimBag : public ItemUseActions{ virtual std::vector read_pocket() override{ return pockets[m_pocket]; } - virtual void use_row(size_t row){ + virtual void use_row(size_t row) override{ BagRow& item = pockets[m_pocket][row]; used.push_back(item.item); if (item.count > 0){ From 620d6ceca27bed1f776c0af380da2b63faaf3b8a Mon Sep 17 00:00:00 2001 From: dayfine Date: Mon, 9 Nov 2026 17:28:43 -0800 Subject: [PATCH 07/79] FRLG: code health: field actions in their own file, route tests in a case table Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss --- .../Overworld/PokemonFRLG_OverworldMap.h | 5 + .../Overworld/PokemonFRLG_OverworldRoute.cpp | 466 --------------- .../PokemonFRLG_OverworldRoute_Tests.cpp | 552 ++++++++++++++++++ .../Overworld/PokemonFRLG_OverworldSim.cpp | 83 +-- .../Overworld/PokemonFRLG_OverworldSim.h | 62 +- .../PokemonFRLG_OverworldSimField.cpp | 125 ++++ .../PokemonFRLG_OverworldSpin_Tests.cpp | 88 ++- .../PokemonFRLG/PokemonFRLG_Tests.cpp | 4 - .../AutoStory/PokemonFRLG_AutoStoryEvents.cpp | 32 +- .../PokemonFRLG_AutoStoryHideout.cpp | 24 + .../AutoStory/PokemonFRLG_AutoStoryHideout.h | 18 +- .../PokemonFRLG_AutoStoryHideout_Tests.cpp | 193 +++--- .../PokemonFRLG_AutoStoryItemUse.cpp | 8 + .../AutoStory/PokemonFRLG_AutoStoryItemUse.h | 2 + .../PokemonFRLG_AutoStoryItemUse_Tests.cpp | 81 ++- .../AutoStory/PokemonFRLG_AutoStoryRowSim.cpp | 6 +- .../PokemonFRLG_AutoStoryStepTable_Tests.cpp | 5 + ...okemonFRLG_AutoStoryVermilionGym_Tests.cpp | 2 +- SerialPrograms/cmake/SourceFiles.cmake | 2 + 19 files changed, 1032 insertions(+), 726 deletions(-) create mode 100644 SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldRoute_Tests.cpp create mode 100644 SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSimField.cpp diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldMap.h b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldMap.h index e6d7490370..84bf33ea49 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldMap.h +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldMap.h @@ -164,10 +164,15 @@ PlayerState after_step_onto( // MB_SPIN_UP, MB_SPIN_DOWN, MB_SPIN_LEFT, MB_SPIN_RIGHT and // MB_STOP_SPINNING. The tile glyphs can't say so, so a map lists them in // these regions, as it does WILD_REGION. +// "spin_north": MB_SPIN_UP. extern const char SPIN_NORTH_REGION[]; +// "spin_south": MB_SPIN_DOWN. extern const char SPIN_SOUTH_REGION[]; +// "spin_west": MB_SPIN_LEFT. extern const char SPIN_WEST_REGION[]; +// "spin_east": MB_SPIN_RIGHT. extern const char SPIN_EAST_REGION[]; +// "spin_stop": MB_STOP_SPINNING. extern const char SPIN_STOP_REGION[]; // The way the arrow on this tile slides the player, if it is a spinner. std::optional spin_direction(const MapData& map, const TilePos& point); diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldRoute.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldRoute.cpp index cdea398515..d16f0ca592 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldRoute.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldRoute.cpp @@ -561,472 +561,6 @@ MapPosition follow_overworld_route( -namespace{ - -class Test_OverworldRoute : public UnitTest{ -public: - Test_OverworldRoute(std::string name, std::function body) - : UnitTest("PokemonFRLG::OverworldRoute - " + std::move(name)) - , m_body(std::move(body)) - {} - virtual UnitTestResult run(Logger&, CancellableScope&) const override{ - try{ - return m_body(); - }catch (Exception& e){ - return std::string(e.name()) + ": " + e.message(); - } - } - -private: - std::function m_body; -}; - -std::string describe(const std::vector& route){ - std::string text; - for (const RouteStep& step : route){ - text += "\n " + to_string(step); - } - return text; -} - -// A 5x4 map for the step rules: a pond, a raised ledge reached by a stair -// tile, and a tile that can't be entered moving south. -const MapData& small_map(){ - static const MapData MAP = parse_map(R"({ - "name": "Small", "source": {"decomp_file": "", "revision": "test", "date": "2026-10-31"}, - "tiles": ["#####", "#.8.#", "#.w.#", "#####"], - "elevation": ["33333", "33403", "33133", "33333"] - })", "Small"); - return MAP; -} - -UnitTestResult test_step_rules(){ - const MapData& map = small_map(); - PlayerState state{{1, 1}, 3, false}; - if (classify_step(map, state, Direction::EAST) != StepKind::BLOCKED){ - return "Walked from elevation 3 onto elevation 4."; - } - if (classify_step(map, PlayerState{{2, 0}, 3, false}, Direction::SOUTH) != StepKind::BLOCKED){ - return "Entered a north-blocked tile moving south."; - } - state = PlayerState{{1, 2}, 3, false}; - if (classify_step(map, state, Direction::EAST) != StepKind::START_SURF){ - return "Can't start surfing onto the pond."; - } - state = after_step(map, state, Direction::EAST, StepKind::START_SURF); - if (!state.surfing || state.elevation != 1){ - return "Surfing didn't put the player on the water."; - } - if (classify_step(map, state, Direction::EAST) != StepKind::STOP_SURFING){ - return "Can't land from the pond."; - } - if (classify_step(map, PlayerState{{3, 2}, 3, false}, Direction::NORTH) != StepKind::WALK){ - return "Can't step from elevation 3 onto the elevation-0 stair."; - } - return true; -} - -// The maps after the Hall of Fame, which clears the way to Cerulean Cave. -std::vector post_game_maps(){ - return overworld_maps(map_flag_set(overworld_maps(), "after_hall_of_fame")); -} - -MapPosition point_on(const std::vector& maps, const std::string& map, const std::string& point){ - return MapPosition{map, map_point(maps, map, point)}; -} - -const MapData* map_named(const std::vector& maps, const std::string& name){ - const int index = find_map(maps, name); - return index < 0 ? nullptr : &maps[index]; -} - -UnitTestResult test_maps(){ - const std::vector maps = post_game_maps(); - const MapData* b1f = map_named(maps, "CeruleanCave_B1F"); - const MapData* city = map_named(maps, "CeruleanCity"); - if (b1f == nullptr || city == nullptr || map_named(maps, "CeruleanCity_PokemonCenter_1F") == nullptr){ - return "Missing a map."; - } - if (b1f->tiles.width != 40 || b1f->tiles.height != 23 || city->tiles.width != 48 || city->tiles.height != 40){ - return "Unexpected map size."; - } - const TilePos mewtwo_tile = map_point(maps, "CeruleanCave_B1F", "mewtwo"); - const MapObject* mewtwo = object_at(*b1f, mewtwo_tile); - if (mewtwo == nullptr || mewtwo->name != "mewtwo"){ - return "Mewtwo is not on B1F at " + to_string(mewtwo_tile) + "."; - } - if (object_at(*city, {1, 13}) != nullptr){ - return "The cave guard is still there after the Hall of Fame."; - } - if (object_at(*map_named(overworld_maps(), "CeruleanCity"), {1, 13}) == nullptr){ - return "The cave guard is missing before the Hall of Fame."; - } - return true; -} - -// Plans `start` to `goal`, replays it with the step rules and checks where it ends. -UnitTestResult check_route( - const std::vector& maps, - const MapPosition& start, const RouteGoal& goal, - std::vector& route -){ - const std::optional> planned = plan_overworld_route(maps, start, goal); - if (!planned){ - return "No route from " + to_string(start) + " to " + to_string(goal.position) + "."; - } - route = *planned; - const MapPosition end = follow_overworld_route(maps, start, route); - if (!(end == goal.position)){ - return "Route ends at " + to_string(end) + ":" + describe(route); - } - if (goal.facing && route.back().direction != *goal.facing){ - return "Doesn't end facing " + std::string(direction_name(*goal.facing)) + ":" + describe(route); - } - return true; -} - -// Below Mewtwo, facing it, to talk to it. -RouteGoal facing_mewtwo(const std::vector& maps){ - const TilePos mewtwo = map_point(maps, "CeruleanCave_B1F", "mewtwo"); - return RouteGoal{{"CeruleanCave_B1F", mewtwo.next(Direction::SOUTH)}, Direction::NORTH}; -} - -UnitTestResult test_entrance_to_mewtwo(){ - const std::vector maps = post_game_maps(); - std::vector route; - UnitTestResult result = check_route(maps, point_on(maps, "CeruleanCave_1F", "entrance"), facing_mewtwo(maps), route); - if (result.result != UnitTestResult::PASSED){ - return result; - } - bool surfs = false; - bool reaches_b1f = false; - for (const RouteStep& step : route){ - surfs |= step.action == RouteAction::SURF; - reaches_b1f |= step.warps && step.end.map == "CeruleanCave_B1F"; - } - if (!surfs || !reaches_b1f){ - return "Expected to take the ladder to B1F and to surf:" + describe(route); - } - return true; -} - -UnitTestResult test_pokemon_center_to_mewtwo(){ - const std::vector maps = post_game_maps(); - std::vector route; - UnitTestResult result = check_route( - maps, point_on(maps, "CeruleanCity_PokemonCenter_1F", "pc"), facing_mewtwo(maps), route - ); - if (result.result != UnitTestResult::PASSED){ - return result; - } - // Out through the exit mat, onto the city's step below the door, and - // into the cave by its entrance. - std::vector maps_in_order; - for (const RouteStep& step : route){ - if (step.warps){ - maps_in_order.push_back(step.end.map); - } - } - if (maps_in_order.size() < 2 || maps_in_order[0] != "CeruleanCity" || maps_in_order[1] != "CeruleanCave_1F"){ - return "Expected to leave by the mat and enter the cave next:" + describe(route); - } - if (!(route[0].end.map == "CeruleanCity_PokemonCenter_1F" || route[0].warps)){ - return "Unexpected first step:" + describe(route); - } - return true; -} - -UnitTestResult test_cave_guard_blocks(){ - // Before the Hall of Fame the guard stands in the cave entrance. - const std::vector maps = overworld_maps(); - if (plan_overworld_route(maps, point_on(maps, "CeruleanCity_PokemonCenter_1F", "pc"), facing_mewtwo(maps))){ - return "Planned past the cave guard."; - } - return true; -} - -UnitTestResult test_mewtwo_tile_unreachable(){ - const std::vector maps = post_game_maps(); - const std::optional> route = plan_overworld_route( - maps, - point_on(maps, "CeruleanCave_1F", "entrance"), - {point_on(maps, "CeruleanCave_B1F", "mewtwo"), std::nullopt} - ); - if (route){ - return "Planned a route onto Mewtwo itself:" + describe(*route); - } - return true; -} - -UnitTestResult test_story_maps(){ - const std::vector maps = overworld_maps(); - for (const char* name : { - "PalletTown_PlayersHouse_2F", "PalletTown_ProfessorOaksLab", "Route1", "ViridianCity_Mart", - "Route22", "Route2", "ViridianForest", "PewterCity", "PewterCity_Museum_1F", "PewterCity_Gym", - }){ - if (map_named(maps, name) == nullptr){ - return std::string("Missing map ") + name + "."; - } - } - return true; -} - -// Which maps `route` warps into, in order. -std::vector maps_warped_into(const std::vector& route){ - std::vector maps; - for (const RouteStep& step : route){ - if (step.warps){ - maps.push_back(step.end.map); - } - } - return maps; -} - -UnitTestResult test_bedroom_to_oaks_lab(){ - const std::vector maps = overworld_maps(); - std::vector route; - UnitTestResult result = check_route( - maps, point_on(maps, "PalletTown_PlayersHouse_2F", "start"), - {point_on(maps, "PalletTown", "oaks_lab_front"), Direction::NORTH}, route - ); - if (result.result != UnitTestResult::PASSED){ - return result; - } - const std::vector warped = maps_warped_into(route); - if (warped != std::vector{"PalletTown_PlayersHouse_1F", "PalletTown"}){ - return "Expected to take the stairs and leave by the front door:" + describe(route); - } - return true; -} - -UnitTestResult test_viridian_mart_to_pewter_gym(){ - const std::vector maps = overworld_maps(); - std::vector route; - UnitTestResult result = check_route( - maps, point_on(maps, "ViridianCity_Mart", "clerk_front"), - {point_on(maps, "PewterCity", "gym_front"), Direction::NORTH}, route - ); - if (result.result != UnitTestResult::PASSED){ - return result; - } - const std::vector warped = maps_warped_into(route); - if (std::find(warped.begin(), warped.end(), "ViridianForest") == warped.end()){ - return "Expected to go through Viridian Forest:" + describe(route); - } - return true; -} - -// A room with a sign on its north wall, above the third column. -const char* const TEST_SIGN_ROOM_JSON = R"({ - "name": "SignRoom", "source": {"decomp_file": "", "revision": "test", "date": "2026-10-31"}, - "tiles": ["##S##", "#...#", "#...#", "#...#", "#####"], - "elevation": ["33333", "33333", "33333", "33333", "33333"] -})"; - -// Walking north under a sign stops by counting tiles, never by holding into -// the sign; under the wall beside it, the wall stops the player. -UnitTestResult test_no_hold_into_sign(){ - const std::vector maps{parse_map(TEST_SIGN_ROOM_JSON, "SignRoom")}; - std::vector route; - UnitTestResult result = check_route(maps, {"SignRoom", {2, 3}}, {{"SignRoom", {2, 1}}, std::nullopt}, route); - if (result.result != UnitTestResult::PASSED){ - return result; - } - for (const RouteStep& step : route){ - if (step.to_wall && step.end.point == TilePos{2, 1}){ - return "Expected no hold into the sign:" + describe(route); - } - } - route.clear(); - result = check_route(maps, {"SignRoom", {1, 3}}, {{"SignRoom", {1, 1}}, std::nullopt}, route); - if (result.result != UnitTestResult::PASSED){ - return result; - } - if (route.empty() || !route.back().to_wall){ - return "Expected the wall to stop the player beside the sign:" + describe(route); - } - return true; -} - -// A yard with a row of ledges across it. -const char* const TEST_LEDGE_YARD_JSON = R"({ - "name": "LedgeYard", "source": {"decomp_file": "", "revision": "test", "date": "2026-10-31"}, - "tiles": ["#####", "#...#", "#...#", "#vvv#", "#...#", "#####"], - "elevation": ["33333", "33333", "33333", "33333", "33333", "33333"] -})"; - -// A ledge isn't a wall to hold into: moving the way it faces the player -// would hop it, and routes don't hop ledges. Viridian City, -// from the Pokemon Center's door south to the row above the ledge. -UnitTestResult test_no_hold_into_ledge(){ - const std::vector maps{parse_map(TEST_LEDGE_YARD_JSON, "LedgeYard")}; - std::vector route; - UnitTestResult result = check_route(maps, {"LedgeYard", {2, 1}}, {{"LedgeYard", {2, 2}}, std::nullopt}, route); - if (result.result != UnitTestResult::PASSED){ - return result; - } - for (const RouteStep& step : route){ - if (step.to_wall){ - return "Expected no hold into the ledge:" + describe(route); - } - } - route.clear(); - const std::vector world = overworld_maps(); - result = check_route(world, {"ViridianCity", {26, 27}}, {{"ViridianCity", {26, 29}}, std::nullopt}, route); - if (result.result != UnitTestResult::PASSED){ - return result; - } - for (const RouteStep& step : route){ - if (step.to_wall && step.end.point == TilePos{26, 29}){ - return "Expected no hold into the ledge below the Pokemon Center:" + describe(route); - } - } - return true; -} - -// Two small maps that don't need the map files: a room left by the exit mat -// at its bottom, onto the door of a yard, out of which the game walks the -// player. -// No wild battle can start between the bedroom and Oak's Lab: Pallet Town's -// streets have no tall grass. Route 2 and Viridian Forest do. -UnitTestResult test_wild_steps(){ - const std::vector maps = overworld_maps(); - std::vector route; - UnitTestResult result = check_route( - maps, point_on(maps, "PalletTown_PlayersHouse_2F", "start"), - {point_on(maps, "PalletTown", "oaks_lab_front"), Direction::NORTH}, route - ); - if (result.result != UnitTestResult::PASSED){ - return result; - } - for (const RouteStep& step : route){ - if (step.wild){ - return "Expected no wild step from the bedroom to Oak's Lab, got " + to_string(step) + ":" + describe(route); - } - } - route.clear(); - result = check_route( - maps, point_on(maps, "ViridianCity_Mart", "clerk_front"), - {point_on(maps, "PewterCity", "gym_front"), Direction::NORTH}, route - ); - if (result.result != UnitTestResult::PASSED){ - return result; - } - bool forest = false; - for (const RouteStep& step : route){ - forest = forest || (step.wild && step.end.map == "ViridianForest"); - } - if (!forest){ - return "Expected a wild step in Viridian Forest:" + describe(route); - } - // The leg from Pallet Town north onto Route 1 crosses Route 1's grass - // after the map's edge. - route.clear(); - result = check_route( - maps, point_on(maps, "PalletTown", "oaks_lab_front"), - {point_on(maps, "ViridianCity_Mart", "clerk_front"), std::nullopt}, route - ); - if (result.result != UnitTestResult::PASSED){ - return result; - } - for (const RouteStep& step : route){ - if (step.end.map == "Route1" && step.direction == Direction::NORTH && step.tiles > 14 && !step.wild){ - return "Expected the leg from Pallet Town onto Route 1 to be wild, got " + to_string(step) + ":" + describe(route); - } - } - return true; -} - -const char* const TEST_ROOM_JSON = R"({ - "name": "Room", "source": {"decomp_file": "", "revision": "test", "date": "2026-10-31"}, - "tiles": ["#####", "#...#", "#...#", "##.##"], - "elevation": ["33333", "33333", "33333", "33333"], - "points": {"warp_0": [2, 3]}, - "warps": [{"x": 2, "y": 3, "enter": "walk_south", "to_map": "Yard", "to_point": "warp_0"}] -})"; -const char* const TEST_YARD_JSON = R"({ - "name": "Yard", "source": {"decomp_file": "", "revision": "test", "date": "2026-10-31"}, - "tiles": ["#####", "##D##", "#...#", "#####"], - "elevation": ["33333", "33333", "33333", "33333"], - "points": {"warp_0": [2, 1]}, - "warps": [{"x": 2, "y": 1, "enter": "walk_into", "to_map": "Room", "to_point": "warp_0"}] -})"; - -UnitTestResult test_route_through_warp(){ - const std::vector maps{ - parse_map(TEST_ROOM_JSON, "Room"), - parse_map(TEST_YARD_JSON, "Yard"), - }; - std::vector route; - UnitTestResult result = check_route(maps, {"Room", {2, 1}}, {{"Yard", {1, 2}}, std::nullopt}, route); - if (result.result != UnitTestResult::PASSED){ - return result; - } - for (const RouteStep& step : route){ - if (step.warps && step.end.map == "Yard"){ - return true; - } - } - return "Expected to warp into the yard:" + describe(route); -} - -// `json` with its elevation grid replaced by `rows`, or left out if empty. -std::string with_elevation(std::string json, const std::string& rows){ - const size_t begin = json.find("\"elevation\""); - const size_t end = json.find("\n", begin); - json.erase(begin, end - begin + 1); - if (!rows.empty()){ - json.insert(begin, "\"elevation\": " + rows + ",\n"); - } - return json; -} - -// Room and yard as the decompilation writes them, their walls and the -// door at elevation 0, plan the same as with no elevation grid, which -// frlg_maps.py leaves out when every tile the player can stand on is ground. -UnitTestResult test_ground_only_elevation_left_out(){ - const std::vector written{ - parse_map(with_elevation(TEST_ROOM_JSON, R"(["00000", "03330", "03330", "00300"])"), "Room"), - parse_map(with_elevation(TEST_YARD_JSON, R"(["00000", "00000", "03330", "00000"])"), "Yard"), - }; - const std::vector left_out{ - parse_map(with_elevation(TEST_ROOM_JSON, ""), "Room"), - parse_map(with_elevation(TEST_YARD_JSON, ""), "Yard"), - }; - for (const MapPosition& start : {MapPosition{"Room", {1, 1}}, MapPosition{"Room", {3, 2}}}){ - for (const MapPosition& goal : {MapPosition{"Yard", {1, 2}}, MapPosition{"Yard", {3, 2}}, MapPosition{"Room", {2, 2}}}){ - const std::optional> a = plan_overworld_route(written, start, {goal, std::nullopt}); - const std::optional> b = plan_overworld_route(left_out, start, {goal, std::nullopt}); - if (!a || !b || describe(*a) != describe(*b)){ - return "Plans differ from " + to_string(start) + " to " + to_string(goal) + ":" - + (a ? describe(*a) : " none") + "\nwithout elevation:" + (b ? describe(*b) : " none"); - } - } - } - return true; -} - -} // namespace - -void add_tests_OverworldRoute(UnitTestDatabase& database){ - database.add("route through a warp", test_route_through_warp); - database.add("ground-only elevation left out", test_ground_only_elevation_left_out); - database.add("maps to Brock", test_story_maps); - database.add("bedroom to Oak's Lab", test_bedroom_to_oaks_lab); - database.add("Viridian Mart to Pewter Gym", test_viridian_mart_to_pewter_gym); - database.add("wild steps", test_wild_steps); - database.add("no hold into a sign", test_no_hold_into_sign); - database.add("no hold into a ledge", test_no_hold_into_ledge); - database.add("step rules", test_step_rules); - database.add("maps", test_maps); - database.add("Cerulean Cave entrance to Mewtwo", test_entrance_to_mewtwo); - database.add("Cerulean Pokemon Center to Mewtwo", test_pokemon_center_to_mewtwo); - database.add("cave guard blocks the way", test_cave_guard_blocks); - database.add("Mewtwo's tile is blocked", test_mewtwo_tile_unreachable); -} - - - } // namespace PokemonFRLG } // namespace NintendoSwitch } // namespace PokemonAutomation diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldRoute_Tests.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldRoute_Tests.cpp new file mode 100644 index 0000000000..419fe87757 --- /dev/null +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldRoute_Tests.cpp @@ -0,0 +1,552 @@ +/* Overworld Route Tests + * + * From: https://github.com/PokemonAutomation/ + * + * Moved from PokemonFRLG_OverworldRoute.cpp, the tests registered from a + * table of cases. + * + */ + +#include +#include +#include +#include +#include "Common/Cpp/Exceptions.h" +#include "Common/Cpp/TestRunners/UnitTest.h" +#include "PokemonFRLG_OverworldMaps.h" +#include "PokemonFRLG_OverworldRoute.h" + +namespace PokemonAutomation{ +namespace NintendoSwitch{ +namespace PokemonFRLG{ + + +namespace{ + +struct RouteTestInput{ + std::string name; + UnitTestResult (*body)(); +}; +struct RouteTestExpectation{ + const char* description; +}; +struct RouteTestCase{ + RouteTestInput input; + RouteTestExpectation expectation; +}; + +class Test_OverworldRoute : public UnitTest{ +public: + explicit Test_OverworldRoute(RouteTestCase test_case) + : UnitTest("PokemonFRLG::OverworldRoute - " + test_case.input.name) + , m_case(std::move(test_case)) + {} + virtual UnitTestResult run(Logger&, CancellableScope&) const override{ + try{ + return m_case.input.body(); + }catch (Exception& e){ + return std::string(e.name()) + ": " + e.message(); + } + } + +private: + RouteTestCase m_case; +}; + +std::string describe(const std::vector& route){ + std::string text; + for (const RouteStep& step : route){ + text += "\n " + to_string(step); + } + return text; +} + +// A 5x4 map for the step rules: a pond, a raised ledge reached by a stair +// tile, and a tile that can't be entered moving south. +const MapData& small_map(){ + static const MapData MAP = parse_map(R"({ + "name": "Small", "source": {"decomp_file": "", "revision": "test", "date": "2026-10-31"}, + "tiles": ["#####", "#.8.#", "#.w.#", "#####"], + "elevation": ["33333", "33403", "33133", "33333"] + })", "Small"); + return MAP; +} + +UnitTestResult test_step_rules(){ + const MapData& map = small_map(); + PlayerState state{{1, 1}, 3, false}; + if (classify_step(map, state, Direction::EAST) != StepKind::BLOCKED){ + return "Walked from elevation 3 onto elevation 4."; + } + if (classify_step(map, PlayerState{{2, 0}, 3, false}, Direction::SOUTH) != StepKind::BLOCKED){ + return "Entered a north-blocked tile moving south."; + } + state = PlayerState{{1, 2}, 3, false}; + if (classify_step(map, state, Direction::EAST) != StepKind::START_SURF){ + return "Can't start surfing onto the pond."; + } + state = after_step(map, state, Direction::EAST, StepKind::START_SURF); + if (!state.surfing || state.elevation != 1){ + return "Surfing didn't put the player on the water."; + } + if (classify_step(map, state, Direction::EAST) != StepKind::STOP_SURFING){ + return "Can't land from the pond."; + } + if (classify_step(map, PlayerState{{3, 2}, 3, false}, Direction::NORTH) != StepKind::WALK){ + return "Can't step from elevation 3 onto the elevation-0 stair."; + } + return true; +} + +// The maps after the Hall of Fame, which clears the way to Cerulean Cave. +std::vector post_game_maps(){ + return overworld_maps(map_flag_set(overworld_maps(), "after_hall_of_fame")); +} + +MapPosition point_on(const std::vector& maps, const std::string& map, const std::string& point){ + return MapPosition{map, map_point(maps, map, point)}; +} + +const MapData* map_named(const std::vector& maps, const std::string& name){ + const int index = find_map(maps, name); + return index < 0 ? nullptr : &maps[index]; +} + +UnitTestResult test_maps(){ + const std::vector maps = post_game_maps(); + const MapData* b1f = map_named(maps, "CeruleanCave_B1F"); + const MapData* city = map_named(maps, "CeruleanCity"); + if (b1f == nullptr || city == nullptr || map_named(maps, "CeruleanCity_PokemonCenter_1F") == nullptr){ + return "Missing a map."; + } + if (b1f->tiles.width != 40 || b1f->tiles.height != 23 || city->tiles.width != 48 || city->tiles.height != 40){ + return "Unexpected map size."; + } + const TilePos mewtwo_tile = map_point(maps, "CeruleanCave_B1F", "mewtwo"); + const MapObject* mewtwo = object_at(*b1f, mewtwo_tile); + if (mewtwo == nullptr || mewtwo->name != "mewtwo"){ + return "Mewtwo is not on B1F at " + to_string(mewtwo_tile) + "."; + } + if (object_at(*city, {1, 13}) != nullptr){ + return "The cave guard is still there after the Hall of Fame."; + } + if (object_at(*map_named(overworld_maps(), "CeruleanCity"), {1, 13}) == nullptr){ + return "The cave guard is missing before the Hall of Fame."; + } + return true; +} + +// Plans `start` to `goal`, replays it with the step rules and checks where it ends. +UnitTestResult check_route( + const std::vector& maps, + const MapPosition& start, const RouteGoal& goal, + std::vector& route +){ + const std::optional> planned = plan_overworld_route(maps, start, goal); + if (!planned){ + return "No route from " + to_string(start) + " to " + to_string(goal.position) + "."; + } + route = *planned; + const MapPosition end = follow_overworld_route(maps, start, route); + if (!(end == goal.position)){ + return "Route ends at " + to_string(end) + ":" + describe(route); + } + if (goal.facing && route.back().direction != *goal.facing){ + return "Doesn't end facing " + std::string(direction_name(*goal.facing)) + ":" + describe(route); + } + return true; +} + +// Below Mewtwo, facing it, to talk to it. +RouteGoal facing_mewtwo(const std::vector& maps){ + const TilePos mewtwo = map_point(maps, "CeruleanCave_B1F", "mewtwo"); + return RouteGoal{{"CeruleanCave_B1F", mewtwo.next(Direction::SOUTH)}, Direction::NORTH}; +} + +UnitTestResult test_entrance_to_mewtwo(){ + const std::vector maps = post_game_maps(); + std::vector route; + UnitTestResult result = check_route(maps, point_on(maps, "CeruleanCave_1F", "entrance"), facing_mewtwo(maps), route); + if (result.result != UnitTestResult::PASSED){ + return result; + } + bool surfs = false; + bool reaches_b1f = false; + for (const RouteStep& step : route){ + surfs |= step.action == RouteAction::SURF; + reaches_b1f |= step.warps && step.end.map == "CeruleanCave_B1F"; + } + if (!surfs || !reaches_b1f){ + return "Expected to take the ladder to B1F and to surf:" + describe(route); + } + return true; +} + +UnitTestResult test_pokemon_center_to_mewtwo(){ + const std::vector maps = post_game_maps(); + std::vector route; + UnitTestResult result = check_route( + maps, point_on(maps, "CeruleanCity_PokemonCenter_1F", "pc"), facing_mewtwo(maps), route + ); + if (result.result != UnitTestResult::PASSED){ + return result; + } + // Out through the exit mat, onto the city's step below the door, and + // into the cave by its entrance. + std::vector maps_in_order; + for (const RouteStep& step : route){ + if (step.warps){ + maps_in_order.push_back(step.end.map); + } + } + if (maps_in_order.size() < 2 || maps_in_order[0] != "CeruleanCity" || maps_in_order[1] != "CeruleanCave_1F"){ + return "Expected to leave by the mat and enter the cave next:" + describe(route); + } + if (!(route[0].end.map == "CeruleanCity_PokemonCenter_1F" || route[0].warps)){ + return "Unexpected first step:" + describe(route); + } + return true; +} + +UnitTestResult test_cave_guard_blocks(){ + // Before the Hall of Fame the guard stands in the cave entrance. + const std::vector maps = overworld_maps(); + if (plan_overworld_route(maps, point_on(maps, "CeruleanCity_PokemonCenter_1F", "pc"), facing_mewtwo(maps))){ + return "Planned past the cave guard."; + } + return true; +} + +UnitTestResult test_mewtwo_tile_unreachable(){ + const std::vector maps = post_game_maps(); + const std::optional> route = plan_overworld_route( + maps, + point_on(maps, "CeruleanCave_1F", "entrance"), + {point_on(maps, "CeruleanCave_B1F", "mewtwo"), std::nullopt} + ); + if (route){ + return "Planned a route onto Mewtwo itself:" + describe(*route); + } + return true; +} + +UnitTestResult test_story_maps(){ + const std::vector maps = overworld_maps(); + for (const char* name : { + "PalletTown_PlayersHouse_2F", "PalletTown_ProfessorOaksLab", "Route1", "ViridianCity_Mart", + "Route22", "Route2", "ViridianForest", "PewterCity", "PewterCity_Museum_1F", "PewterCity_Gym", + }){ + if (map_named(maps, name) == nullptr){ + return std::string("Missing map ") + name + "."; + } + } + return true; +} + +// Which maps `route` warps into, in order. +std::vector maps_warped_into(const std::vector& route){ + std::vector maps; + for (const RouteStep& step : route){ + if (step.warps){ + maps.push_back(step.end.map); + } + } + return maps; +} + +UnitTestResult test_bedroom_to_oaks_lab(){ + const std::vector maps = overworld_maps(); + std::vector route; + UnitTestResult result = check_route( + maps, point_on(maps, "PalletTown_PlayersHouse_2F", "start"), + {point_on(maps, "PalletTown", "oaks_lab_front"), Direction::NORTH}, route + ); + if (result.result != UnitTestResult::PASSED){ + return result; + } + const std::vector warped = maps_warped_into(route); + if (warped != std::vector{"PalletTown_PlayersHouse_1F", "PalletTown"}){ + return "Expected to take the stairs and leave by the front door:" + describe(route); + } + return true; +} + +UnitTestResult test_viridian_mart_to_pewter_gym(){ + const std::vector maps = overworld_maps(); + std::vector route; + UnitTestResult result = check_route( + maps, point_on(maps, "ViridianCity_Mart", "clerk_front"), + {point_on(maps, "PewterCity", "gym_front"), Direction::NORTH}, route + ); + if (result.result != UnitTestResult::PASSED){ + return result; + } + const std::vector warped = maps_warped_into(route); + if (std::find(warped.begin(), warped.end(), "ViridianForest") == warped.end()){ + return "Expected to go through Viridian Forest:" + describe(route); + } + return true; +} + +// A room with a sign on its north wall, above the third column. +const char* const TEST_SIGN_ROOM_JSON = R"({ + "name": "SignRoom", "source": {"decomp_file": "", "revision": "test", "date": "2026-10-31"}, + "tiles": ["##S##", "#...#", "#...#", "#...#", "#####"], + "elevation": ["33333", "33333", "33333", "33333", "33333"] +})"; + +// Walking north under a sign stops by counting tiles, never by holding into +// the sign; under the wall beside it, the wall stops the player. +UnitTestResult test_no_hold_into_sign(){ + const std::vector maps{parse_map(TEST_SIGN_ROOM_JSON, "SignRoom")}; + std::vector route; + UnitTestResult result = check_route(maps, {"SignRoom", {2, 3}}, {{"SignRoom", {2, 1}}, std::nullopt}, route); + if (result.result != UnitTestResult::PASSED){ + return result; + } + for (const RouteStep& step : route){ + if (step.to_wall && step.end.point == TilePos{2, 1}){ + return "Expected no hold into the sign:" + describe(route); + } + } + route.clear(); + result = check_route(maps, {"SignRoom", {1, 3}}, {{"SignRoom", {1, 1}}, std::nullopt}, route); + if (result.result != UnitTestResult::PASSED){ + return result; + } + if (route.empty() || !route.back().to_wall){ + return "Expected the wall to stop the player beside the sign:" + describe(route); + } + return true; +} + +// A yard with a row of ledges across it. +const char* const TEST_LEDGE_YARD_JSON = R"({ + "name": "LedgeYard", "source": {"decomp_file": "", "revision": "test", "date": "2026-10-31"}, + "tiles": ["#####", "#...#", "#...#", "#vvv#", "#...#", "#####"], + "elevation": ["33333", "33333", "33333", "33333", "33333", "33333"] +})"; + +// A ledge isn't a wall to hold into: moving the way it faces the player +// would hop it, and routes don't hop ledges. Viridian City, +// from the Pokemon Center's door south to the row above the ledge. +UnitTestResult test_no_hold_into_ledge(){ + const std::vector maps{parse_map(TEST_LEDGE_YARD_JSON, "LedgeYard")}; + std::vector route; + UnitTestResult result = check_route(maps, {"LedgeYard", {2, 1}}, {{"LedgeYard", {2, 2}}, std::nullopt}, route); + if (result.result != UnitTestResult::PASSED){ + return result; + } + for (const RouteStep& step : route){ + if (step.to_wall){ + return "Expected no hold into the ledge:" + describe(route); + } + } + route.clear(); + const std::vector world = overworld_maps(); + result = check_route(world, {"ViridianCity", {26, 27}}, {{"ViridianCity", {26, 29}}, std::nullopt}, route); + if (result.result != UnitTestResult::PASSED){ + return result; + } + for (const RouteStep& step : route){ + if (step.to_wall && step.end.point == TilePos{26, 29}){ + return "Expected no hold into the ledge below the Pokemon Center:" + describe(route); + } + } + return true; +} + +// Two small maps that don't need the map files: a room left by the exit mat +// at its bottom, onto the door of a yard, out of which the game walks the +// player. +// No wild battle can start between the bedroom and Oak's Lab: Pallet Town's +// streets have no tall grass. Route 2 and Viridian Forest do. +UnitTestResult test_wild_steps(){ + const std::vector maps = overworld_maps(); + std::vector route; + UnitTestResult result = check_route( + maps, point_on(maps, "PalletTown_PlayersHouse_2F", "start"), + {point_on(maps, "PalletTown", "oaks_lab_front"), Direction::NORTH}, route + ); + if (result.result != UnitTestResult::PASSED){ + return result; + } + for (const RouteStep& step : route){ + if (step.wild){ + return "Expected no wild step from the bedroom to Oak's Lab, got " + to_string(step) + ":" + describe(route); + } + } + route.clear(); + result = check_route( + maps, point_on(maps, "ViridianCity_Mart", "clerk_front"), + {point_on(maps, "PewterCity", "gym_front"), Direction::NORTH}, route + ); + if (result.result != UnitTestResult::PASSED){ + return result; + } + bool forest = false; + for (const RouteStep& step : route){ + forest = forest || (step.wild && step.end.map == "ViridianForest"); + } + if (!forest){ + return "Expected a wild step in Viridian Forest:" + describe(route); + } + // The leg from Pallet Town north onto Route 1 crosses Route 1's grass + // after the map's edge. + route.clear(); + result = check_route( + maps, point_on(maps, "PalletTown", "oaks_lab_front"), + {point_on(maps, "ViridianCity_Mart", "clerk_front"), std::nullopt}, route + ); + if (result.result != UnitTestResult::PASSED){ + return result; + } + for (const RouteStep& step : route){ + if (step.end.map == "Route1" && step.direction == Direction::NORTH && step.tiles > 14 && !step.wild){ + return "Expected the leg from Pallet Town onto Route 1 to be wild, got " + to_string(step) + ":" + describe(route); + } + } + return true; +} + +const char* const TEST_ROOM_JSON = R"({ + "name": "Room", "source": {"decomp_file": "", "revision": "test", "date": "2026-10-31"}, + "tiles": ["#####", "#...#", "#...#", "##.##"], + "elevation": ["33333", "33333", "33333", "33333"], + "points": {"warp_0": [2, 3]}, + "warps": [{"x": 2, "y": 3, "enter": "walk_south", "to_map": "Yard", "to_point": "warp_0"}] +})"; +const char* const TEST_YARD_JSON = R"({ + "name": "Yard", "source": {"decomp_file": "", "revision": "test", "date": "2026-10-31"}, + "tiles": ["#####", "##D##", "#...#", "#####"], + "elevation": ["33333", "33333", "33333", "33333"], + "points": {"warp_0": [2, 1]}, + "warps": [{"x": 2, "y": 1, "enter": "walk_into", "to_map": "Room", "to_point": "warp_0"}] +})"; + +UnitTestResult test_route_through_warp(){ + const std::vector maps{ + parse_map(TEST_ROOM_JSON, "Room"), + parse_map(TEST_YARD_JSON, "Yard"), + }; + std::vector route; + UnitTestResult result = check_route(maps, {"Room", {2, 1}}, {{"Yard", {1, 2}}, std::nullopt}, route); + if (result.result != UnitTestResult::PASSED){ + return result; + } + for (const RouteStep& step : route){ + if (step.warps && step.end.map == "Yard"){ + return true; + } + } + return "Expected to warp into the yard:" + describe(route); +} + +// `json` with its elevation grid replaced by `rows`, or left out if empty. +std::string with_elevation(std::string json, const std::string& rows){ + const size_t begin = json.find("\"elevation\""); + const size_t end = json.find("\n", begin); + json.erase(begin, end - begin + 1); + if (!rows.empty()){ + json.insert(begin, "\"elevation\": " + rows + ",\n"); + } + return json; +} + +// Room and yard as the decompilation writes them, their walls and the +// door at elevation 0, plan the same as with no elevation grid, which +// frlg_maps.py leaves out when every tile the player can stand on is ground. +UnitTestResult test_ground_only_elevation_left_out(){ + const std::vector written{ + parse_map(with_elevation(TEST_ROOM_JSON, R"(["00000", "03330", "03330", "00300"])"), "Room"), + parse_map(with_elevation(TEST_YARD_JSON, R"(["00000", "00000", "03330", "00000"])"), "Yard"), + }; + const std::vector left_out{ + parse_map(with_elevation(TEST_ROOM_JSON, ""), "Room"), + parse_map(with_elevation(TEST_YARD_JSON, ""), "Yard"), + }; + for (const MapPosition& start : {MapPosition{"Room", {1, 1}}, MapPosition{"Room", {3, 2}}}){ + for (const MapPosition& goal : {MapPosition{"Yard", {1, 2}}, MapPosition{"Yard", {3, 2}}, MapPosition{"Room", {2, 2}}}){ + const std::optional> a = plan_overworld_route(written, start, {goal, std::nullopt}); + const std::optional> b = plan_overworld_route(left_out, start, {goal, std::nullopt}); + if (!a || !b || describe(*a) != describe(*b)){ + return "Plans differ from " + to_string(start) + " to " + to_string(goal) + ":" + + (a ? describe(*a) : " none") + "\nwithout elevation:" + (b ? describe(*b) : " none"); + } + } + } + return true; +} + +const RouteTestCase ROUTE_CASES[] = { + { + .input = {.name = "route through a warp", .body = test_route_through_warp}, + .expectation = {.description = "route through a warp"}, + }, + { + .input = {.name = "ground-only elevation left out", .body = test_ground_only_elevation_left_out}, + .expectation = {.description = "ground-only elevation left out"}, + }, + { + .input = {.name = "maps to Brock", .body = test_story_maps}, + .expectation = {.description = "maps to Brock"}, + }, + { + .input = {.name = "bedroom to Oak's Lab", .body = test_bedroom_to_oaks_lab}, + .expectation = {.description = "bedroom to Oak's Lab"}, + }, + { + .input = {.name = "Viridian Mart to Pewter Gym", .body = test_viridian_mart_to_pewter_gym}, + .expectation = {.description = "Viridian Mart to Pewter Gym"}, + }, + { + .input = {.name = "wild steps", .body = test_wild_steps}, + .expectation = {.description = "wild steps"}, + }, + { + .input = {.name = "no hold into a sign", .body = test_no_hold_into_sign}, + .expectation = {.description = "no hold into a sign"}, + }, + { + .input = {.name = "no hold into a ledge", .body = test_no_hold_into_ledge}, + .expectation = {.description = "no hold into a ledge"}, + }, + { + .input = {.name = "step rules", .body = test_step_rules}, + .expectation = {.description = "step rules"}, + }, + { + .input = {.name = "maps", .body = test_maps}, + .expectation = {.description = "maps"}, + }, + { + .input = {.name = "Cerulean Cave entrance to Mewtwo", .body = test_entrance_to_mewtwo}, + .expectation = {.description = "Cerulean Cave entrance to Mewtwo"}, + }, + { + .input = {.name = "Cerulean Pokemon Center to Mewtwo", .body = test_pokemon_center_to_mewtwo}, + .expectation = {.description = "Cerulean Pokemon Center to Mewtwo"}, + }, + { + .input = {.name = "cave guard blocks the way", .body = test_cave_guard_blocks}, + .expectation = {.description = "cave guard blocks the way"}, + }, + { + .input = {.name = "Mewtwo's tile is blocked", .body = test_mewtwo_tile_unreachable}, + .expectation = {.description = "Mewtwo's tile is blocked"}, + }, +}; + +} // namespace + +void add_tests_OverworldRoute(UnitTestDatabase& database){ + for (const RouteTestCase& item : ROUTE_CASES){ + database.add(item); + } +} + + + +} // namespace PokemonFRLG +} // namespace NintendoSwitch +} // namespace PokemonAutomation diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSim.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSim.cpp index 0b9483bf2c..b0cd746e07 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSim.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSim.cpp @@ -96,8 +96,6 @@ namespace{ constexpr Milliseconds NO_BATTLE_WAIT(15000); constexpr Milliseconds BATTLE_TIME(10000); constexpr Milliseconds MESSAGE_CLOSE(1000); -// The questions, " used CUT!" and the tree falling. -constexpr Milliseconds CUT_TIME(4000); // Rows of black below a small room, seen from this near its bottom. constexpr int BLACK_BELOW_ROWS = 5; constexpr int SMALL_ROOM_ROWS = 20; @@ -246,14 +244,8 @@ std::optional OverworldSim::take_warp(int map_index, const T if (warp == nullptr){ return std::nullopt; } - const auto lift = m_script.lift_floors.find(m_maps[map_index].name); - if (lift != m_script.lift_floors.end() && m_lift_floor){ - const MapPosition& out = lift->second[*m_lift_floor]; - const int destination = find_map(m_maps, out.map); - if (destination < 0){ - return std::nullopt; - } - return Step{destination, PlayerState{out.point, elevation_at(m_maps[destination], out.point), false}, true, false, false}; + if (m_lift_floor && m_script.lift_floors.contains(m_maps[map_index].name)){ + return lift_warp(map_index); } if (!warp->to){ return std::nullopt; @@ -325,12 +317,8 @@ std::optional OverworldSim::press(Direction direction) const if (warps_on_step(map(), ahead)){ return take_warp(m_map, ahead); } - if (spin_direction(map(), ahead)){ - step.spin = spin_slide(map(), step.player); - if (!step.spin){ - return std::nullopt; - } - step.player = step.spin->end; + if (!slide_on(step)){ + return std::nullopt; } return step; } @@ -510,13 +498,7 @@ void OverworldSim::take_steps(Direction direction, Milliseconds pressed, Millise if (step->walked_out){ m_state.facing = Direction::SOUTH; } - if (step->spin){ - // The game moves the player through the slide; the hold, if - // it goes on, walks on from its end. - m_state.facing = step->spin->facing; - note(std::format("slid {} tile(s) to {}.", step->spin->tiles, to_string(step->spin->end.position))); - pressed += MovementMechanics::SPIN_TILE_TIME * step->spin->tiles; - } + pressed += after_slide(*step); if (after_step(*step, pressed)){ return; } @@ -677,51 +659,6 @@ bool OverworldSim::close_message(){ return true; } -bool OverworldSim::cut_tree(){ - std::vector& objects = m_maps[m_map].objects; - const TilePos ahead = m_player.position.next(m_state.facing); - for (size_t c = 0; c < objects.size(); c++){ - if (objects[c].name == "cut_tree" && objects[c].x == ahead.x && objects[c].y == ahead.y - && m_state.screen == SimScreen::OVERWORLD && !m_frozen - ){ - m_cut_trees.emplace_back(m_map, objects[c]); - objects.erase(objects.begin() + c); - advance_to(m_now + CUT_TIME); - note("cut the tree on " + to_string(MapPosition{map().name, ahead}) + "."); - return true; - } - } - violation("no tree to cut " + std::string(direction_name(m_state.facing)) + " of " + to_string(m_state.position) + "."); - return false; -} - -bool OverworldSim::choose_lift_floor(size_t floor){ - const auto lift = m_script.lift_floors.find(map().name); - if (lift == m_script.lift_floors.end() || floor >= lift->second.size() || m_frozen){ - violation("no lift panel on " + to_string(m_state.position) + " with a floor " + std::to_string(floor) + "."); - return false; - } - m_lift_floor = floor; - advance_to(m_now + m_script.timing.message); - note("the lift goes to " + to_string(lift->second[floor]) + "."); - return true; -} - -bool OverworldSim::push_poster_switch(){ - std::vector& objects = m_maps[m_map].objects; - const TilePos ahead = m_player.position.next(m_state.facing); - const auto poster = std::find_if(objects.begin(), objects.end(), [&](const MapObject& object){ - return object.name == "poster" && object.x == ahead.x && object.y == ahead.y; - }); - if (poster == objects.end() || m_state.screen != SimScreen::OVERWORLD || m_frozen){ - violation("no poster " + std::string(direction_name(m_state.facing)) + " of " + to_string(m_state.position) + "."); - return false; - } - std::erase_if(objects, [](const MapObject& object){ return object.name == "poster_stairs"; }); - advance_to(m_now + m_script.timing.message); - note("pushed the switch behind the poster: the stairs are open."); - return true; -} @@ -813,6 +750,12 @@ size_t OverworldSimWalker::clear_late(const std::vector& interrupts, } } +void OverworldSimWalker::wait_out_slide(const RouteStep& step){ + if (step.spin_tiles){ + m_sim.watch({}, SPIN_TILE_TIME * *step.spin_tiles + SPIN_STOP_SETTLE); + } +} + void OverworldSimWalker::check_overworld(const RouteStep& step){ const SimScreen screen = m_sim.state().screen; if (m_rules.check_overworld && (screen == SimScreen::START_MENU || screen == SimScreen::MESSAGE)){ @@ -900,9 +843,7 @@ std::optional OverworldSimWalker::walk_step(const RouteStep& step, if (result.stopped){ return dark_stop(step, walked_near(step, result.tiles, TILE_TIME)); } - if (step.spin_tiles){ - m_sim.watch({}, SPIN_TILE_TIME * *step.spin_tiles + SPIN_STOP_SETTLE); - } + wait_out_slide(step); const Milliseconds fade_watched_from = m_rules.watch_fade_along_hold ? m_leg_start : m_sim.state().time; if (step.warps && !after_warp(step, warps_before, fade_watched_from)){ if (!m_rules.find_player_after_warp_battle){ diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSim.h b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSim.h index 4eb0884abc..f2dc04326b 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSim.h +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSim.h @@ -60,7 +60,7 @@ enum class SimScreen{ BATTLE, // a battle's text box with the HP boxes FADE, // a warp's fade out and in }; -// The human-readable name of a simulated screen. +// The human-readable name of a simulated screen. const char* sim_screen_name(SimScreen screen); // What the walker watches the screen with. @@ -206,14 +206,30 @@ enum class SimBattleChoice{ RUN, FIGHT, }; -// How a simulated battle concluded. +// How a simulated battle concluded. enum class SimBattleEnd{ ENDED, CANT_RUN, // a trainer's battle: "No! There's no running from a TRAINER battle!" NO_BATTLE, // there was none, on screen or about to show }; -// Simulates overworld movement, encounters and dialogs. +// What A does on the overworld, facing something (OverworldSim::use_field()). +enum class SimField{ + // Cuts the tree the player faces (an object named "cut_tree") with + // YES to the game's question: it is gone until the player next warps, + // as its hide flag is a FLAG_TEMP. + CUT_TREE, + // The poster the player faces (an object named "poster"): the switch + // behind it opens the stairs, which takes away the objects named + // "poster_stairs" for good (pokefirered + // CeladonCity_GameCorner_EventScript_Poster's setmetatile). + POSTER_SWITCH, + // The panel of the lift the player stands in (SimScript::lift_floors): + // the floor picked, the lift's door now lets out there. + LIFT_FLOOR, +}; + +// Simulates overworld movement, encounters and dialogs. class OverworldSim{ public: OverworldSim(std::vector maps, MapPosition start, Direction facing, SimScript script = {}); @@ -255,22 +271,9 @@ class OverworldSim{ // battle follows it. bool close_message(); - // Cuts the tree the player faces (an object named "cut_tree") with - // YES to the game's question: it is gone until the player next warps, - // as its hide flag is a FLAG_TEMP. Returns whether there was one. - bool cut_tree(); - - // A on the panel of the lift the player stands in (SimScript:: - // lift_floors) and floor `floor` picked: the lift's door now lets out - // there. Returns whether there was such a lift and floor. - bool choose_lift_floor(size_t floor); - - // A on the poster the player faces (an object named "poster"): the - // switch behind it opens the stairs, which takes away the objects - // named "poster_stairs" for good (pokefirered - // CeladonCity_GameCorner_EventScript_Poster's setmetatile). Returns - // whether there was a poster. - bool push_poster_switch(); + // A on what the player faces, as `field` says (`floor`: the lift's). + // Returns whether it was there. (PokemonFRLG_OverworldSimField.cpp) + bool use_field(SimField field, size_t floor = 0); private: // A screen that shows at `at`; `unfreeze`: the player can move again. @@ -314,6 +317,17 @@ class OverworldSim{ std::optional press(Direction direction) const; std::optional take_warp(int map_index, const TilePos& tile) const; std::optional cross_edge(Direction direction) const; + // The lift's door to the floor picked, if `map_index` is a lift and + // one was picked. + std::optional lift_warp(int map_index) const; + // A step that landed on a spinner slides on to the slide's end; false + // if the slide never stops. + bool slide_on(Step& step) const; + // The slide's time after `step`, and its facing; 0 for no slide. + Milliseconds after_slide(const Step& step); + bool cut_tree(); + bool choose_lift_floor(size_t floor); + bool push_poster_switch(); bool after_step(const Step& step, Milliseconds pressed); bool wild_battle(Milliseconds pressed); std::optional next_encounter(); @@ -516,6 +530,8 @@ class OverworldSimWalker{ StepEnd watch_for_trainer(const RouteStep& step, int approach_tiles); bool moved_past_wall(const RouteStep& step); void check_overworld(const RouteStep& step); + // After a leg onto a spinner: the slide's time. + void wait_out_slide(const RouteStep& step); const std::vector& interrupts(const RouteStep& step) const; std::vector watchers(const std::vector& interrupts) const; [[noreturn]] void fail(const std::string& message); @@ -532,7 +548,7 @@ class OverworldSimWalker{ }; -// Register overworld simulation unit tests. +// Register overworld simulation unit tests. void add_tests_OverworldSim(UnitTestDatabase& database); // Register the tests of a warp's fade over before the hold onto it ends. void add_tests_OverworldWarpFade(UnitTestDatabase& database); @@ -542,7 +558,7 @@ void add_tests_OverworldSpin(UnitTestDatabase& database); -} // namespace PokemonFRLG -} // namespace NintendoSwitch -} // namespace PokemonAutomation +} // namespace PokemonFRLG +} // namespace NintendoSwitch +} // namespace PokemonAutomation #endif diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSimField.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSimField.cpp new file mode 100644 index 0000000000..2f657677a6 --- /dev/null +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSimField.cpp @@ -0,0 +1,125 @@ +/* Overworld Sim: the Field + * + * From: https://github.com/PokemonAutomation/ + * + * What A does on the sim's overworld, facing something: a tree to cut, + * the Game Corner's poster, the lift's panel (OverworldSim::use_field()). + * + */ + +#include +#include +#include "PokemonFRLG_OverworldSim.h" + +namespace PokemonAutomation{ +namespace NintendoSwitch{ +namespace PokemonFRLG{ + + +namespace{ + +// The questions, " used CUT!" and the tree falling. +constexpr Milliseconds CUT_TIME(4000); + +} // namespace + + +bool OverworldSim::use_field(SimField field, size_t floor){ + switch (field){ + case SimField::CUT_TREE: + return cut_tree(); + case SimField::POSTER_SWITCH: + return push_poster_switch(); + case SimField::LIFT_FLOOR: + return choose_lift_floor(floor); + } + return false; +} + +bool OverworldSim::slide_on(Step& step) const{ + if (!spin_direction(m_maps[step.map], step.player.position)){ + return true; + } + step.spin = spin_slide(m_maps[step.map], step.player); + if (!step.spin){ + return false; + } + step.player = step.spin->end; + return true; +} + +Milliseconds OverworldSim::after_slide(const Step& step){ + if (!step.spin){ + return Milliseconds(0); + } + // The game moves the player through the slide; the hold, if it goes + // on, walks on from its end. + m_state.facing = step.spin->facing; + note(std::format("slid {} tile(s) to {}.", step.spin->tiles, to_string(step.spin->end.position))); + return MovementMechanics::SPIN_TILE_TIME * step.spin->tiles; +} + +std::optional OverworldSim::lift_warp(int map_index) const{ + const auto lift = m_script.lift_floors.find(m_maps[map_index].name); + if (lift == m_script.lift_floors.end() || !m_lift_floor){ + return std::nullopt; + } + const MapPosition& out = lift->second[*m_lift_floor]; + const auto to = std::find_if(m_maps.begin(), m_maps.end(), [&](const MapData& map){ return map.name == out.map; }); + if (to == m_maps.end()){ + return std::nullopt; + } + return Step{(int)(to - m_maps.begin()), PlayerState{out.point, elevation_at(*to, out.point), false}, true, false, false}; +} + +bool OverworldSim::cut_tree(){ + std::vector& objects = m_maps[m_map].objects; + const TilePos ahead = m_player.position.next(m_state.facing); + for (size_t c = 0; c < objects.size(); c++){ + if (objects[c].name == "cut_tree" && objects[c].x == ahead.x && objects[c].y == ahead.y + && m_state.screen == SimScreen::OVERWORLD && !m_frozen + ){ + m_cut_trees.emplace_back(m_map, objects[c]); + objects.erase(objects.begin() + c); + advance_to(m_now + CUT_TIME); + note("cut the tree on " + to_string(MapPosition{map().name, ahead}) + "."); + return true; + } + } + violation("no tree to cut " + std::string(direction_name(m_state.facing)) + " of " + to_string(m_state.position) + "."); + return false; +} + +bool OverworldSim::choose_lift_floor(size_t floor){ + const auto lift = m_script.lift_floors.find(map().name); + if (lift == m_script.lift_floors.end() || floor >= lift->second.size() || m_frozen){ + violation("no lift panel on " + to_string(m_state.position) + " with a floor " + std::to_string(floor) + "."); + return false; + } + m_lift_floor = floor; + advance_to(m_now + m_script.timing.message); + note("the lift goes to " + to_string(lift->second[floor]) + "."); + return true; +} + +bool OverworldSim::push_poster_switch(){ + std::vector& objects = m_maps[m_map].objects; + const TilePos ahead = m_player.position.next(m_state.facing); + const auto poster = std::find_if(objects.begin(), objects.end(), [&](const MapObject& object){ + return object.name == "poster" && object.x == ahead.x && object.y == ahead.y; + }); + if (poster == objects.end() || m_state.screen != SimScreen::OVERWORLD || m_frozen){ + violation("no poster " + std::string(direction_name(m_state.facing)) + " of " + to_string(m_state.position) + "."); + return false; + } + std::erase_if(objects, [](const MapObject& object){ return object.name == "poster_stairs"; }); + advance_to(m_now + m_script.timing.message); + note("pushed the switch behind the poster: the stairs are open."); + return true; +} + + + +} // namespace PokemonFRLG +} // namespace NintendoSwitch +} // namespace PokemonAutomation diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSpin_Tests.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSpin_Tests.cpp index 298e3cb156..afe24a3f8b 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSpin_Tests.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSpin_Tests.cpp @@ -10,7 +10,6 @@ */ #include -#include #include #include #include "Common/Cpp/Exceptions.h" @@ -28,22 +27,34 @@ namespace PokemonFRLG{ namespace{ +struct SpinInput{ + std::string name; + UnitTestResult (*body)(); +}; +struct SpinExpectation{ + const char* description; +}; +struct SpinCase{ + SpinInput input; + SpinExpectation expectation; +}; + class Test_OverworldSpin : public UnitTest{ public: - Test_OverworldSpin(std::string name, std::function body) - : UnitTest("PokemonFRLG::OverworldSpin - " + std::move(name)) - , m_body(std::move(body)) + explicit Test_OverworldSpin(SpinCase test_case) + : UnitTest("PokemonFRLG::OverworldSpin - " + test_case.input.name) + , m_case(std::move(test_case)) {} virtual UnitTestResult run(Logger&, CancellableScope&) const override{ try{ - return m_body(); + return m_case.input.body(); }catch (Exception& e){ return std::string(e.name()) + ": " + e.message(); } } private: - std::function m_body; + SpinCase m_case; }; // A room with spinners: @@ -204,7 +215,7 @@ UnitTestResult lift_ride(bool pick, const MapPosition& expected){ SimScript script; script.lift_floors["Lift"] = {MapPosition{"FloorA", {1, 1}}, MapPosition{"FloorB", {1, 1}}}; OverworldSim sim(lift_maps(), MapPosition{"Lift", {1, 2}}, Direction::SOUTH, script); - if (pick && !sim.choose_lift_floor(1)){ + if (pick && !sim.use_field(SimField::LIFT_FLOOR, 1)){ return std::string("No floor 1 on the lift's panel."); } sim.hold(Direction::SOUTH, MovementMechanics::TILE_TIME, MovementMechanics::STEP_RELEASE, std::chrono::milliseconds(3000), {}); @@ -238,7 +249,7 @@ const MapData& poster_room(){ MapPosition poster_walk(bool push){ OverworldSim sim({poster_room()}, MapPosition{"Corner", {2, 2}}, Direction::NORTH); if (push){ - sim.push_poster_switch(); + sim.use_field(SimField::POSTER_SWITCH); } const Milliseconds tile = MovementMechanics::TILE_TIME; // Each hold turns the player first, which costs a tile's time. @@ -258,21 +269,60 @@ UnitTestResult test_poster_opens_stairs(){ return true; } +const SpinCase SPIN_CASES[] = { + { + .input = {.name = "slide up to a wall", .body = test_slide_into_wall}, + .expectation = {.description = "slide up to a wall"}, + }, + { + .input = {.name = "slide turned by an arrow", .body = test_slide_turned_by_arrow}, + .expectation = {.description = "slide turned by an arrow"}, + }, + { + .input = {.name = "slide to a stop tile", .body = test_slide_to_stop_tile}, + .expectation = {.description = "slide to a stop tile"}, + }, + { + .input = {.name = "arrows in a loop never stop", .body = test_slide_loop}, + .expectation = {.description = "arrows in a loop never stop"}, + }, + { + .input = {.name = "route ends with a slide", .body = test_route_ends_on_slide}, + .expectation = {.description = "route ends with a slide"}, + }, + { + .input = {.name = "a spinner back into a dead end traps", .body = test_dead_end_traps}, + .expectation = {.description = "a spinner back into a dead end traps"}, + }, + { + .input = {.name = "sim slides the player", .body = test_sim_slides}, + .expectation = {.description = "sim slides the player"}, + }, + { + .input = {.name = "sim walker walks a slide", .body = test_sim_walker_walks_slide}, + .expectation = {.description = "sim walker walks a slide"}, + }, + { + .input = {.name = "lift lets out on the floor picked", .body = test_lift_floor}, + .expectation = {.description = "lift lets out on the floor picked"}, + }, + { + .input = {.name = "lift with no floor picked stays", .body = test_lift_no_floor}, + .expectation = {.description = "lift with no floor picked stays"}, + }, + { + .input = {.name = "poster switch opens the stairs", .body = test_poster_opens_stairs}, + .expectation = {.description = "poster switch opens the stairs"}, + }, +}; + } // namespace void add_tests_OverworldSpin(UnitTestDatabase& database){ - database.add("slide up to a wall", test_slide_into_wall); - database.add("slide turned by an arrow", test_slide_turned_by_arrow); - database.add("slide to a stop tile", test_slide_to_stop_tile); - database.add("arrows in a loop never stop", test_slide_loop); - database.add("route ends with a slide", test_route_ends_on_slide); - database.add("a spinner back into a dead end traps", test_dead_end_traps); - database.add("sim slides the player", test_sim_slides); - database.add("sim walker walks a slide", test_sim_walker_walks_slide); - database.add("lift lets out on the floor picked", test_lift_floor); - database.add("lift with no floor picked stays", test_lift_no_floor); - database.add("poster switch opens the stairs", test_poster_opens_stairs); + for (const SpinCase& item : SPIN_CASES){ + database.add(item); + } } diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/PokemonFRLG_Tests.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/PokemonFRLG_Tests.cpp index 28816b82aa..2bf7183092 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/PokemonFRLG_Tests.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/PokemonFRLG_Tests.cpp @@ -48,8 +48,6 @@ #include "Programs/AutoStory/PokemonFRLG_AutoStoryAbilities.h" #include "Programs/AutoStory/PokemonFRLG_AutoStoryBattle.h" #include "Programs/AutoStory/PokemonFRLG_AutoStoryCapture.h" -#include "Programs/AutoStory/PokemonFRLG_AutoStoryHideout.h" -#include "Programs/AutoStory/PokemonFRLG_AutoStoryItemUse.h" #include "Programs/AutoStory/PokemonFRLG_AutoStoryPaceSim.h" #include "Programs/AutoStory/PokemonFRLG_AutoStoryPcStorage.h" #include "Programs/AutoStory/PokemonFRLG_AutoStoryRngLoop.h" @@ -940,8 +938,6 @@ void add_tests(UnitTestDatabase& database){ add_tests_AutoStorySimulation(database); add_tests_AutoStoryRows(database); add_tests_AutoStoryTrashCans(database); - add_tests_AutoStoryHideout(database); - add_tests_AutoStoryItemUse(database); add_tests_AutoStoryPaceSim(database); add_tests_AutoStoryItems(database); add_tests_AutoStoryRngLoop(database); diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryEvents.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryEvents.cpp index b3bb43b2ec..e62adfbf53 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryEvents.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryEvents.cpp @@ -23,7 +23,6 @@ #include "PokemonFRLG_AutoStoryEvents.h" #include "PokemonFRLG_AutoStoryGrind.h" #include "PokemonFRLG_AutoStoryHideout.h" -#include "PokemonFRLG_AutoStoryItemUse.h" #include "PokemonFRLG_AutoStoryScreenEvents.h" #include "PokemonFRLG_AutoStorySummary.h" #include "PokemonFRLG_AutoStoryTable.h" @@ -366,13 +365,6 @@ const std::vector& story_maps(){ return maps; } -MoveSpeed move_speed(const StoryStep& step){ - if (step.variant == BIKE_VARIANT){ - return MoveSpeed::BIKE; - } - return step.variant == RUN_VARIANT ? MoveSpeed::RUN : MoveSpeed::WALK; -} - Pokemon::Pose to_pose(const StoryPose& pose){ return Pokemon::tile_pose(pose.map, {pose.tile}, pose.facing); } @@ -689,31 +681,15 @@ Outcome open_gym_door(StoryEnv& env, RunState& state, const StoryStep& step){ // The GAME steps without a row of their own: a capture or a PC deposit or // withdrawal, a MART, TEACH, LEVEL, GRIND or fossil CHOICE. Outcome other_game_step(StoryEnv& env, RunState& state, const StoryStep& step){ - // The Rocket Hideout's steps leave the player where they stand. - if (const std::optional ride = parse_lift_floor_variant(step.variant)){ - ride_lift(env.console, env.context, *ride); - return Pokemon::outcome_ok(); - } - if (step.variant == POSTER_SWITCH_VARIANT){ - push_poster_switch(env.console, env.context); - return Pokemon::outcome_ok(); - } - // An item from the bag; an Escape Rope ends where the table says. - if (is_item_use_variant(step.variant)){ - const std::string item = parse_use_item_variant(step.variant).value_or("bicycle"); - ConsoleItemUseActions bag(env.console, env.context, env.language); - const ItemUseEnd end = use_item_from_bag(env.console.logger(), bag, item); - if (end != ItemUseEnd::USED){ - return Pokemon::outcome_failed(std::string("use_item_") + item_use_end_name(end), step.variant); - } - return step.pose_after ? Pokemon::outcome_ok(*step.pose_after) : Pokemon::outcome_ok(); - } const Pokemon::Pose patch = state.pose; ConsoleCaptureActions capture(env.console, env.context, env.language, [&]{ pace_trainer_battle(env, state, step, patch); }); ConsolePcStorageActions pc(env.console, env.context); - std::optional done = run_storage_game_step(env.console.logger(), &env.console, step, capture, pc); + std::optional done = run_field_game_step(env.console, env.context, env.language, step); + if (!done){ + done = run_storage_game_step(env.console.logger(), &env.console, step, capture, pc); + } if (!done){ done = run_abilities(env, state, step); } diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryHideout.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryHideout.cpp index f1208ac841..3726c116a4 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryHideout.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryHideout.cpp @@ -8,6 +8,7 @@ #include "NintendoSwitch/Commands/NintendoSwitch_Commands_PushButtons.h" #include "PokemonFRLG_AutoStoryActions.h" #include "PokemonFRLG_AutoStoryHideout.h" +#include "PokemonFRLG_AutoStoryItemUse.h" namespace PokemonAutomation{ namespace NintendoSwitch{ @@ -109,6 +110,29 @@ void push_poster_switch(ConsoleHandle& console, ProControllerContext& context){ mash_until_overworld(console, context, HIDEOUT_SCENE_TIMEOUT); } +std::optional run_field_game_step( + ConsoleHandle& console, ProControllerContext& context, Language language, const Pokemon::StoryStep& step +){ + if (const std::optional ride = parse_lift_floor_variant(step.variant)){ + ride_lift(console, context, *ride); + return Pokemon::outcome_ok(); + } + if (step.variant == POSTER_SWITCH_VARIANT){ + push_poster_switch(console, context); + return Pokemon::outcome_ok(); + } + if (!is_item_use_variant(step.variant)){ + return std::nullopt; + } + const std::string item = parse_use_item_variant(step.variant).value_or("bicycle"); + ConsoleItemUseActions bag(console, context, language); + const ItemUseEnd end = use_item_from_bag(console.logger(), bag, item); + if (end != ItemUseEnd::USED){ + return Pokemon::outcome_failed(std::string("use_item_") + item_use_end_name(end), step.variant); + } + return step.pose_after ? Pokemon::outcome_ok(*step.pose_after) : Pokemon::outcome_ok(); +} + } // namespace PokemonFRLG diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryHideout.h b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryHideout.h index 4e4249af77..1282c2d880 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryHideout.h +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryHideout.h @@ -20,6 +20,9 @@ #include "Common/Cpp/TestRunners/UnitTestDatabase.h" #include "NintendoSwitch/Controllers/Procon/NintendoSwitch_ProController.h" #include "NintendoSwitch/NintendoSwitch_ConsoleHandle.h" +#include "CommonFramework/Language.h" +#include "Pokemon/AutoStory/Pokemon_StoryEvents.h" +#include "Pokemon/AutoStory/Pokemon_StorySteps.h" #include "Pokemon/Navigation/Pokemon_Grid.h" namespace PokemonAutomation{ @@ -55,13 +58,14 @@ std::string lift_floor_variant(std::string_view from, std::string_view to); // not one, or names a floor the panel hasn't. std::optional parse_lift_floor_variant(std::string_view variant); -// The fewest presses that move the cursor from `ride.from` to `ride.to` -// on a menu of `entries` rows. A multichoice of more than three rows -// wraps round (pokefirered DrawVerticalMultichoiceMenu()). +// Presses of the D-pad on a menu: which way, how many. struct MenuPresses{ Pokemon::Direction direction = Pokemon::Direction::SOUTH; size_t presses = 0; }; +// The fewest presses that move the cursor from `ride.from` to `ride.to` +// on a menu of `entries` rows. A multichoice of more than three rows +// wraps round (pokefirered DrawVerticalMultichoiceMenu()). MenuPresses lift_menu_presses(const LiftRide& ride, size_t entries); // Whether `variant` is one of this file's steps. @@ -74,6 +78,14 @@ void ride_lift(ConsoleHandle& console, ProControllerContext& context, const Lift // overworld. void push_poster_switch(ConsoleHandle& console, ProControllerContext& context); +// On the console, a GAME step of this file's or an item from the bag +// (is_item_use_variant()); nothing for another GAME step. The hideout's +// steps leave the player where they stand; an item used ends on the +// step's pose_after (an Escape Rope's), if it has one. +std::optional run_field_game_step( + ConsoleHandle& console, ProControllerContext& context, Language language, const Pokemon::StoryStep& step +); + // Registers the hideout steps' tests. void add_tests_AutoStoryHideout(UnitTestDatabase& database); diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryHideout_Tests.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryHideout_Tests.cpp index 0c29251b6a..12db0549e2 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryHideout_Tests.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryHideout_Tests.cpp @@ -67,97 +67,125 @@ class Test_AutoStoryHideout : public UnitTest{ LiftCase m_case; }; -class Test_AutoStoryHideoutVariants : public UnitTest{ -public: - Test_AutoStoryHideoutVariants() - : UnitTest("PokemonFRLG::AutoStoryHideout - the poster and lift variants") - {} - virtual UnitTestResult run(Logger&, CancellableScope&) const override{ - if (!is_hideout_variant(POSTER_SWITCH_VARIANT) || is_hideout_variant("cut_tree") || is_hideout_variant("")){ - return "Expected only the poster switch and lift rides as hideout variants."; - } - if (lift_floor_variant("B2F", "B4F") != "lift_floor B2F B4F"){ - return "Expected \"lift_floor B2F B4F\", got \"" + lift_floor_variant("B2F", "B4F") + "\"."; - } - // A three-row menu doesn't wrap. - const MenuPresses no_wrap = lift_menu_presses(LiftRide{0, 2}, 3); - if (no_wrap.direction != Pokemon::Direction::SOUTH || no_wrap.presses != 2){ - return "Expected 2 down on a three-row menu."; - } - return true; +UnitTestResult test_variants(){ + if (!is_hideout_variant(POSTER_SWITCH_VARIANT) || is_hideout_variant("cut_tree") || is_hideout_variant("")){ + return "Expected only the poster switch and lift rides as hideout variants."; } -}; + if (lift_floor_variant("B2F", "B4F") != "lift_floor B2F B4F"){ + return "Expected \"lift_floor B2F B4F\", got \"" + lift_floor_variant("B2F", "B4F") + "\"."; + } + // A three-row menu doesn't wrap. + const MenuPresses no_wrap = lift_menu_presses(LiftRide{0, 2}, 3); + if (no_wrap.direction != Pokemon::Direction::SOUTH || no_wrap.presses != 2){ + return "Expected 2 down on a three-row menu."; + } + return true; +} // The table's steps, run as a row runs them on the sim: the poster's // switch opens the stairs north-east of it, and the lift lets out on the // floor picked. -class Test_AutoStoryHideoutSim : public UnitTest{ +std::string poster_on_sim(); +std::string lift_on_sim(); + +UnitTestResult test_steps_on_sim(){ + const std::string poster = poster_on_sim(); + if (!poster.empty()){ + return poster; + } + const std::string lift = lift_on_sim(); + if (!lift.empty()){ + return lift; + } + return true; +} + +std::string poster_on_sim(){ + const MapData room = parse_map(R"({ + "name": "Corner", "source": {"decomp_file": "", "revision": "test", "date": "2026-11-09"}, + "tiles": ["#####", "#...#", "#...#", "#####"], + "objects": [ + {"name": "poster", "kind": "sign", "x": 2, "y": 1}, + {"name": "poster_stairs", "kind": "npc", "x": 3, "y": 1} + ] + })", "Corner"); + OverworldSim sim({room}, MapPosition{"Corner", {2, 2}}, Direction::NORTH); + StoryPose at{"Corner", {2, 2}, Direction::NORTH}; + const std::string failure = row_step_on_sim(sim, at, StoryTable::poster_switch("poster_switch", "test"), "00.31"); + if (!failure.empty()){ + return failure; + } + const Milliseconds tile = MovementMechanics::TILE_TIME; + sim.hold(Direction::EAST, tile * 2, MovementMechanics::STEP_RELEASE, tile * 2, {}); + sim.hold(Direction::NORTH, tile * 2, MovementMechanics::STEP_RELEASE, tile * 2, {}); + if (!(sim.state().position == MapPosition{"Corner", {3, 1}})){ + return "After the poster step, walked onto " + to_string(sim.state().position) + ", not the stairs."; + } + return ""; +} + +std::string lift_on_sim(){ + std::vector maps; + maps.push_back(parse_map(R"({ + "name": "Lift", "source": {"decomp_file": "", "revision": "test", "date": "2026-11-09"}, + "tiles": ["###", "#.#", "#.#", "###"], + "warps": [{"x": 1, "y": 2, "enter": "walk_south"}] + })", "Lift")); + maps.push_back(parse_map(R"({ + "name": "B4F", "source": {"decomp_file": "", "revision": "test", "date": "2026-11-09"}, + "tiles": ["###", "#.#", "###"] + })", "B4F")); + SimScript script; + const MapPosition b4f{"B4F", {1, 1}}; + script.lift_floors["Lift"] = {MapPosition{"Lift", {1, 1}}, MapPosition{"Lift", {1, 1}}, b4f}; + OverworldSim sim(maps, MapPosition{"Lift", {1, 2}}, Direction::SOUTH, script); + StoryPose at{"Lift", {1, 2}, Direction::SOUTH}; + const std::string failure = row_step_on_sim(sim, at, StoryTable::lift_floor("lift_to_b4f", "B2F", "B4F", "test"), "00.32"); + if (!failure.empty()){ + return failure; + } + sim.hold(Direction::SOUTH, MovementMechanics::TILE_TIME, MovementMechanics::STEP_RELEASE, std::chrono::milliseconds(3000), {}); + if (!(sim.state().position == b4f)){ + return "After the lift step, the door let out on " + to_string(sim.state().position) + "."; + } + return ""; +} + +struct AutoStoryHideoutBodyInput{ + std::string name; + UnitTestResult (*body)(); +}; +struct AutoStoryHideoutBodyExpectation{ + const char* description; +}; +struct AutoStoryHideoutBodyCase{ + AutoStoryHideoutBodyInput input; + AutoStoryHideoutBodyExpectation expectation; +}; + +class Test_AutoStoryHideoutBody : public UnitTest{ public: - Test_AutoStoryHideoutSim() - : UnitTest("PokemonFRLG::AutoStoryHideout - table steps on the sim") + explicit Test_AutoStoryHideoutBody(AutoStoryHideoutBodyCase test_case) + : UnitTest("PokemonFRLG::AutoStoryHideout - " + test_case.input.name) + , m_case(std::move(test_case)) {} virtual UnitTestResult run(Logger&, CancellableScope&) const override{ - const std::string poster = poster_on_sim(); - if (!poster.empty()){ - return poster; - } - const std::string lift = lift_on_sim(); - if (!lift.empty()){ - return lift; - } - return true; + return m_case.input.body(); } private: - static std::string poster_on_sim(){ - const MapData room = parse_map(R"({ - "name": "Corner", "source": {"decomp_file": "", "revision": "test", "date": "2026-11-09"}, - "tiles": ["#####", "#...#", "#...#", "#####"], - "objects": [ - {"name": "poster", "kind": "sign", "x": 2, "y": 1}, - {"name": "poster_stairs", "kind": "npc", "x": 3, "y": 1} - ] - })", "Corner"); - OverworldSim sim({room}, MapPosition{"Corner", {2, 2}}, Direction::NORTH); - StoryPose at{"Corner", {2, 2}, Direction::NORTH}; - const std::string failure = row_step_on_sim(sim, at, StoryTable::poster_switch("poster_switch", "test"), "00.31"); - if (!failure.empty()){ - return failure; - } - const Milliseconds tile = MovementMechanics::TILE_TIME; - sim.hold(Direction::EAST, tile * 2, MovementMechanics::STEP_RELEASE, tile * 2, {}); - sim.hold(Direction::NORTH, tile * 2, MovementMechanics::STEP_RELEASE, tile * 2, {}); - if (!(sim.state().position == MapPosition{"Corner", {3, 1}})){ - return "After the poster step, walked onto " + to_string(sim.state().position) + ", not the stairs."; - } - return ""; - } - static std::string lift_on_sim(){ - std::vector maps; - maps.push_back(parse_map(R"({ - "name": "Lift", "source": {"decomp_file": "", "revision": "test", "date": "2026-11-09"}, - "tiles": ["###", "#.#", "#.#", "###"], - "warps": [{"x": 1, "y": 2, "enter": "walk_south"}] - })", "Lift")); - maps.push_back(parse_map(R"({ - "name": "B4F", "source": {"decomp_file": "", "revision": "test", "date": "2026-11-09"}, - "tiles": ["###", "#.#", "###"] - })", "B4F")); - SimScript script; - const MapPosition b4f{"B4F", {1, 1}}; - script.lift_floors["Lift"] = {MapPosition{"Lift", {1, 1}}, MapPosition{"Lift", {1, 1}}, b4f}; - OverworldSim sim(maps, MapPosition{"Lift", {1, 2}}, Direction::SOUTH, script); - StoryPose at{"Lift", {1, 2}, Direction::SOUTH}; - const std::string failure = row_step_on_sim(sim, at, StoryTable::lift_floor("lift_to_b4f", "B2F", "B4F", "test"), "00.32"); - if (!failure.empty()){ - return failure; - } - sim.hold(Direction::SOUTH, MovementMechanics::TILE_TIME, MovementMechanics::STEP_RELEASE, std::chrono::milliseconds(3000), {}); - if (!(sim.state().position == b4f)){ - return "After the lift step, the door let out on " + to_string(sim.state().position) + "."; - } - return ""; - } + AutoStoryHideoutBodyCase m_case; +}; + +const AutoStoryHideoutBodyCase HIDEOUT_BODY_CASES[] = { + { + .input = {.name = "the poster and lift variants", .body = test_variants}, + .expectation = {.description = "only the poster switch and lift rides are hideout steps"}, + }, + { + .input = {.name = "table steps on the sim", .body = test_steps_on_sim}, + .expectation = {.description = "the poster opens the stairs; the lift lets out on the floor picked"}, + }, }; const LiftCase LIFT_CASES[] = { @@ -206,8 +234,9 @@ void add_tests_AutoStoryHideout(UnitTestDatabase& database){ for (const LiftCase& item : LIFT_CASES){ database.add(item); } - database.add(); - database.add(); + for (const AutoStoryHideoutBodyCase& item : HIDEOUT_BODY_CASES){ + database.add(item); + } } diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryItemUse.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryItemUse.cpp index d0a719798d..1f0c4bdeb9 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryItemUse.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryItemUse.cpp @@ -8,6 +8,7 @@ #include "NintendoSwitch/Commands/NintendoSwitch_Commands_PushButtons.h" #include "VideoGames/PokemonFRLG/PokemonFRLG_Navigation.h" #include "PokemonFRLG_AutoStoryActions.h" +#include "PokemonFRLG_AutoStoryEvents.h" #include "PokemonFRLG_AutoStoryItemUse.h" namespace PokemonAutomation{ @@ -18,6 +19,13 @@ namespace PokemonFRLG{ using namespace std::chrono_literals; +MoveSpeed move_speed(const StoryStep& step){ + if (step.variant == BIKE_VARIANT){ + return MoveSpeed::BIKE; + } + return step.variant == RUN_VARIANT ? MoveSpeed::RUN : MoveSpeed::WALK; +} + std::optional usable_item_pocket(std::string_view item){ if (is_repel(item) || item == "escape-rope"){ return BagPocket::ITEMS; diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryItemUse.h b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryItemUse.h index bf0a5c86c7..3836b7a78a 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryItemUse.h +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryItemUse.h @@ -78,6 +78,7 @@ class ItemUseActions{ virtual void close_bag() = 0; }; +// How use_item_from_bag() ended. enum class ItemUseEnd{ USED, // The pocket has none left (or the name isn't read). @@ -87,6 +88,7 @@ enum class ItemUseEnd{ // Not an item the story uses from the bag. UNKNOWN_ITEM, }; +// "used", "none_left": the end's name in logs and failures. const char* item_use_end_name(ItemUseEnd end); // Opens the item's pocket, finds it and uses it, then back to the diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryItemUse_Tests.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryItemUse_Tests.cpp index 2ea359f252..ab33b1a43c 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryItemUse_Tests.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryItemUse_Tests.cpp @@ -175,35 +175,62 @@ const ItemUseCase ITEM_USE_CASES[] = { }, }; -class Test_AutoStoryItemUseVariants : public UnitTest{ +UnitTestResult test_variants_and_bike(){ + if (parse_use_item_variant("use_item potion") || parse_use_item_variant("use_item") || !parse_use_item_variant(use_item_variant("super-repel"))){ + return "Expected only the story's bag items as use_item variants."; + } + if (!is_item_use_variant(RIDE_BIKE_VARIANT) || is_item_use_variant("poster_switch")){ + return "Expected ride_bike, not poster_switch, as an item use."; + } + StoryStep ride; + ride.kind = Pokemon::StoryStepKind::ROUTE; + ride.variant = BIKE_VARIANT; + if (move_speed(ride) != MoveSpeed::BIKE){ + return "A bike ROUTE isn't ridden."; + } + RouteStep outdoors; + outdoors.tiles = 10; + RouteStep indoors = outdoors; + indoors.walk_only = true; + if (OverworldWalkSteps::tile_time(outdoors, MoveSpeed::BIKE) != MovementMechanics::BIKE_TILE_TIME + || OverworldWalkSteps::tile_time(indoors, MoveSpeed::BIKE) != MovementMechanics::TILE_TIME + ){ + return "Expected the bike's pace outdoors and a walk indoors."; + } + return true; +} + +struct AutoStoryItemUseBodyInput{ + std::string name; + UnitTestResult (*body)(); +}; +struct AutoStoryItemUseBodyExpectation{ + const char* description; +}; +struct AutoStoryItemUseBodyCase{ + AutoStoryItemUseBodyInput input; + AutoStoryItemUseBodyExpectation expectation; +}; + +class Test_AutoStoryItemUseBody : public UnitTest{ public: - Test_AutoStoryItemUseVariants() - : UnitTest("PokemonFRLG::AutoStoryItemUse - variants and the bike's pace") + explicit Test_AutoStoryItemUseBody(AutoStoryItemUseBodyCase test_case) + : UnitTest("PokemonFRLG::AutoStoryItemUse - " + test_case.input.name) + , m_case(std::move(test_case)) {} virtual UnitTestResult run(Logger&, CancellableScope&) const override{ - if (parse_use_item_variant("use_item potion") || parse_use_item_variant("use_item") || !parse_use_item_variant(use_item_variant("super-repel"))){ - return "Expected only the story's bag items as use_item variants."; - } - if (!is_item_use_variant(RIDE_BIKE_VARIANT) || is_item_use_variant("poster_switch")){ - return "Expected ride_bike, not poster_switch, as an item use."; - } - StoryStep ride; - ride.kind = Pokemon::StoryStepKind::ROUTE; - ride.variant = BIKE_VARIANT; - if (move_speed(ride) != MoveSpeed::BIKE){ - return "A bike ROUTE isn't ridden."; - } - RouteStep outdoors; - outdoors.tiles = 10; - RouteStep indoors = outdoors; - indoors.walk_only = true; - if (OverworldWalkSteps::tile_time(outdoors, MoveSpeed::BIKE) != MovementMechanics::BIKE_TILE_TIME - || OverworldWalkSteps::tile_time(indoors, MoveSpeed::BIKE) != MovementMechanics::TILE_TIME - ){ - return "Expected the bike's pace outdoors and a walk indoors."; - } - return true; + return m_case.input.body(); } + +private: + AutoStoryItemUseBodyCase m_case; +}; + +const AutoStoryItemUseBodyCase ITEM_USE_BODY_CASES[] = { + { + .input = {.name = "variants and the bike's pace", .body = test_variants_and_bike}, + .expectation = {.description = "the story's bag items, ride_bike, and the bike's pace outdoors only"}, + }, }; } // namespace @@ -213,7 +240,9 @@ void add_tests_AutoStoryItemUse(UnitTestDatabase& database){ for (const ItemUseCase& item : ITEM_USE_CASES){ database.add(item); } - database.add(); + for (const AutoStoryItemUseBodyCase& item : ITEM_USE_BODY_CASES){ + database.add(item); + } } diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRowSim.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRowSim.cpp index adf518879f..936d342526 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRowSim.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRowSim.cpp @@ -511,7 +511,7 @@ std::string OverworldStepSim::cut(const StoryStep& step){ if (m_sim.state().facing != step.direction){ sim_turn_to(m_sim, step.direction); } - if (!m_sim.cut_tree()){ + if (!m_sim.use_field(SimField::CUT_TREE)){ return "no tree to cut."; } sim_step_once(m_sim, step.direction); @@ -540,10 +540,10 @@ Pokemon::StoryAction OverworldStepSim::hideout_or_stub(){ std::string OverworldStepSim::hideout(const StoryStep& step){ if (step.variant == POSTER_SWITCH_VARIANT){ - return m_sim.push_poster_switch() ? "" : "no poster ahead."; + return m_sim.use_field(SimField::POSTER_SWITCH) ? "" : "no poster ahead."; } const std::optional ride = parse_lift_floor_variant(step.variant); - if (!ride || !m_sim.choose_lift_floor(ride->to)){ + if (!ride || !m_sim.use_field(SimField::LIFT_FLOOR, ride->to)){ return "no lift panel for \"" + step.variant + "\"."; } return ""; diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryStepTable_Tests.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryStepTable_Tests.cpp index 33302b794b..8eeb70211c 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryStepTable_Tests.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryStepTable_Tests.cpp @@ -19,6 +19,8 @@ #include "PokemonFRLG_AutoStoryStepInterrupts.h" #include "PokemonFRLG_AutoStoryStepTable.h" #include "PokemonFRLG_AutoStoryEvents.h" +#include "PokemonFRLG_AutoStoryHideout.h" +#include "PokemonFRLG_AutoStoryItemUse.h" #include "PokemonFRLG_AutoStoryTable.h" #include "PokemonFRLG_AutoStoryTrashCans.h" @@ -249,6 +251,9 @@ void add_tests_AutoStoryStepTable(UnitTestDatabase& database){ database.add(scenario); } add_tests_AutoStoryStepInterrupts(database); + // The GAME variants with logic of their own. + add_tests_AutoStoryHideout(database); + add_tests_AutoStoryItemUse(database); } diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryVermilionGym_Tests.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryVermilionGym_Tests.cpp index b59faf6d75..3188bb3189 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryVermilionGym_Tests.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryVermilionGym_Tests.cpp @@ -325,7 +325,7 @@ UnitTestResult test_tree_shuts_the_yard(){ // The sim: no step onto the tree; cut, it's gone; a warp grows it back. OverworldSim sim(story_maps(), MapPosition{StoryTable::VERMILION, {19, 23}}, Direction::SOUTH); sim.tap(Direction::SOUTH); - if (!(sim.state().position == MapPosition{StoryTable::VERMILION, {19, 23}}) || !sim.cut_tree()){ + if (!(sim.state().position == MapPosition{StoryTable::VERMILION, {19, 23}}) || !sim.use_field(SimField::CUT_TREE)){ return "Expected the tree to stop the player, then be cut."; } sim.tap(Direction::SOUTH); diff --git a/SerialPrograms/cmake/SourceFiles.cmake b/SerialPrograms/cmake/SourceFiles.cmake index 9de4d7fee3..3b38e8424d 100644 --- a/SerialPrograms/cmake/SourceFiles.cmake +++ b/SerialPrograms/cmake/SourceFiles.cmake @@ -1866,8 +1866,10 @@ file(GLOB LIBRARY_SOURCES Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldRoute.cpp Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldRouteStrings.cpp Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldRoute.h + Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldRoute_Tests.cpp Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSim.cpp Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSim.h + Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSimField.cpp Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSim_Tests.cpp Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSpin_Tests.cpp Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldWalk.cpp From ce645d1600df281b494eb593e45c972a4a6c038e Mon Sep 17 00:00:00 2001 From: dayfine Date: Mon, 9 Nov 2026 17:29:09 -0800 Subject: [PATCH 08/79] FRLG: route tests find maps without the route's internals Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss --- .../Overworld/PokemonFRLG_OverworldRoute_Tests.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldRoute_Tests.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldRoute_Tests.cpp index 419fe87757..0f9fcb753a 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldRoute_Tests.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldRoute_Tests.cpp @@ -108,8 +108,8 @@ MapPosition point_on(const std::vector& maps, const std::string& map, c } const MapData* map_named(const std::vector& maps, const std::string& name){ - const int index = find_map(maps, name); - return index < 0 ? nullptr : &maps[index]; + const auto map = std::find_if(maps.begin(), maps.end(), [&](const MapData& item){ return item.name == name; }); + return map == maps.end() ? nullptr : &*map; } UnitTestResult test_maps(){ From fd9f6b904a7371484c1daf79bb856a1b3874398a Mon Sep 17 00:00:00 2001 From: dayfine Date: Mon, 9 Nov 2026 17:32:55 -0800 Subject: [PATCH 09/79] FRLG drafts: restore Lavender to Celadon as 00.30, hideout as 00.31-00.32; the steps and maps they need Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss --- .../AutoStory/StoryData/Draft/README.md | 133 +++++++++++------- .../StoryData/Draft/frlg-00.30.plan.json | 103 ++++++++------ .../StoryData/Draft/frlg-00.31.plan.json | 104 ++++++-------- .../StoryData/Draft/frlg-00.32.plan.json | 106 ++++++++++++++ 4 files changed, 291 insertions(+), 155 deletions(-) create mode 100644 SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/Draft/frlg-00.32.plan.json diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/Draft/README.md b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/Draft/README.md index bff9a09871..532ef68bfa 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/Draft/README.md +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/Draft/README.md @@ -9,53 +9,80 @@ Each file is a `pokesim-authored-checkpoint/1` plan in the same format as `../frlg-parcel-00.05.plan.json`. The order and the item stops follow PokeGuy's LeafGreen run (PokemonSimulation `data/runs/pokeguy-leafgreen-15934/events.json` and `external/pokeguy-notes.md`). 00.28 and 00.29 are table rows on -`frlg/stage8-rocktunnel` (#293), not drafts: 00.29 ends at Lavender's nurse. -The draft that also used the id 00.29 (Lavender Mart, Route 8, the Underground -Path to Celadon's Center) was dropped in favour of #293's row, so nothing here -covers Lavender's nurse to Celadon's yet; its events are in commit 8b656d1a2. +`frlg/stage8-rocktunnel` (#293); 00.29 ends at Lavender's nurse, where 00.30 +starts. | Id | Title | Events | |---|---|---:| -| 00.30 | Celadon Game Corner and the Rocket Hideout down to B4F: the poster guard, the Lift Key Grunt, the LIFT KEY and B3F's Rare Candy | 12 | -| 00.31 | Rocket Hideout: the lift to B4F, the two door guards, two Rare Candies, Blastoise, Giovanni and the SILPH SCOPE | 16 | -| 00.32 | Celadon: Department Store 5F battle items, HM02 Fly on Route 16 for the Pidgey, the Tea, then the Center | 20 | -| 00.32b | Celadon Mansion roof room: the Eevee (Gift RNG placeholder) | 4 | -| 00.33 | Fly to Lavender, the Center, Pokemon Tower 2F: the rival | 8 | -| 00.34 | Pokemon Tower 3F to 7F: Tammy, Jennifer, Emilia, the Marowak, three Grunts, Mr. Fuji | 21 | -| 00.35 | The POKE FLUTE, Fly to Celadon, Route 16's Snorlax, Cycling Road's Rare Candy and Max Elixir, Fuchsia | 16 | -| 00.36 | Safari Zone: a Full Restore, the GOLD TEETH, HM03 Surf from the Secret House | 12 | -| 00.37 | Fuchsia: Surf to the lead, Juggler Kirk, Koga, then HM04 Strength from the Warden | 14 | -| 00.38 | Fly to Pallet, Surf down Route 21 to Cinnabar, the Mansion: Elixir, TM14 Blizzard and the SECRET KEY | 15 | -| 00.38b | Cinnabar Lab: the Helix Fossil revived (Gift RNG placeholder) | 6 | -| 00.39 | Cinnabar Gym: the quiz doors, Blaine | 9 | -| 00.40 | Fly to Celadon: two Rare Candies, Blizzard, Celadon Gym: Tamia, Lori, Erika | 21 | -| 00.41 | East to Saffron: the TEA at the gate, the Fighting Dojo's Hitmonchan (Gift RNG placeholder), the Center | 13 | -| 00.42 | Silph Co.: the CARD KEY, the rival on 7F, the Lapras (Gift RNG placeholder) | 10 | -| 00.43 | Silph Co. 11F: the boardroom Grunt, Giovanni; then Sabrina | 13 | -| 00.44 | Fly to Viridian: Viridian Gym: Takashi, Warren, Giovanni | 14 | -| 00.45 | Route 22: the rival; Route 23's badge gates; Strength | 7 | -| 00.46 | Victory Road's boulders, Indigo Plateau: Full Restores, the nurse, the save | 8 | -| 00.47 | Lorelei | 4 | -| 00.48 | Bruno | 3 | -| 00.49 | Agatha | 3 | -| 00.50 | Lance | 3 | -| 00.51 | The Champion and the Hall of Fame | 4 | - -## Why 00.30 and 00.31 are not table rows yet - -They can't run or be simulated on this branch's data: - -- The map resource lock (PokemonSimulation `6c2f5c8`, `runtime-manifest.json`) - has none of CeladonCity, CeladonCity_GameCorner or RocketHideout_B1F..B4F; - they exist only in `source-candidate`. CeladonCity_PokemonCenter_1F (00.30's - start) and RocketHideout_Elevator (00.31's lift) are in neither. Adding them - to the runtime pack is a PokemonSimulation publish and a lock bump. -- 00.30's start, Celadon's nurse, isn't reached by any row: 00.29 ends in - Lavender. -- The walker has no spinner (arrow) tiles, which B2F and B3F need, and no - step for the lift's floor menu or the poster switch. -- `STORY_TRAINERS` names none of the hideout's Grunts or Giovanni yet; - their parties are in `BattleData/`. +| 00.30 | Lavender Mart, then west over Route 8 on the Bicycle under a Repel: Gamer Rich, a Pidgey for Fly, the Underground Path to Celadon's Pokemon Center | 14 | +| 00.31 | Celadon Game Corner and the Rocket Hideout down to B4F: the poster guard, the poster switch, the Lift Key Grunt, the LIFT KEY and B3F's Rare Candy | 12 | +| 00.32 | Rocket Hideout: the lift to B4F, the two door guards, two Rare Candies, Giovanni, the SILPH SCOPE, an Escape Rope out | 16 | + +The later drafts (Celadon Department Store to the Hall of Fame) are on +`frlg/draft-story-50-51` (#303) under the ids 00.32 to 00.51; with 00.30 +restored here they each move up by one when that stack takes this one in. + +## Story order after the hideout + +As PokeGuy plays it: the Celadon Department Store 5F (6 X Speed, 21 X Special, +5 X Accuracy, 2 Guard Spec), then Pokemon Tower (a Super Repel on 3F to 7F, +the floors with wild Pokemon), Route 16's Snorlax, Fuchsia and Koga, the +Pokemon Mansion and Blaine, Erika, Silph Co., Sabrina, Viridian's Giovanni, and +the Elite Four. + +Items from the bag, as PokeGuy uses them: a Repel over Route 8 and the +Underground Path (00.30; 5 bought in 00.26), renewed when "REPEL's effect wore +off" shows (`renew_repel()`); Super Repels in Pokemon Tower; an Escape Rope out +of the hideout after Giovanni (00.32), which puts the player at the Game +Corner's door, CeladonCity (34, 22) (pokefirered `UpdateEscapeWarp()`: the last +outdoor door, a tile south). The Rocket Hideout has no wild Pokemon +(`wild_encounters.json` lists none of its floors), so no Repel is used there. +The BICYCLE (00.26) is ridden on Route 8's open legs (`bike`); it is +`BIKE_TILE_TIME`, an estimate from the decompilation, until measured. + +## The maps each draft needs + +The story can't run or simulate these drafts until their maps are in the map +resource lock (PokemonSimulation `6c2f5c8`, `data/maps/runtime-manifest.json`). +Status there, in PokemonSimulation's `data/games/frlg/maps/source-candidate`, +or neither: + +| Map | Draft | Status | +|---|---|---| +| LavenderTown | 00.30 | published | +| LavenderTown_Mart | 00.30 | candidate | +| Route8 | 00.30 | candidate | +| UndergroundPath_EastEntrance | 00.30 | candidate | +| UndergroundPath_EastWestTunnel | 00.30 | candidate | +| UndergroundPath_WestEntrance | 00.30 | candidate | +| Route7 | 00.30 | candidate | +| CeladonCity | 00.30 to 00.32 | candidate | +| CeladonCity_PokemonCenter_1F | 00.30, 00.31 | missing | +| CeladonCity_GameCorner | 00.31, 00.32 | candidate | +| RocketHideout_B1F | 00.31, 00.32 | candidate | +| RocketHideout_B2F | 00.31, 00.32 | candidate | +| RocketHideout_B3F | 00.31 | candidate | +| RocketHideout_B4F | 00.31, 00.32 | candidate | +| RocketHideout_Elevator | 00.32 | missing | + +Beyond publishing (a PokemonSimulation publish and a lock bump, which need the +user's approval), the code added for these drafts reads three things the +candidate maps don't carry yet: + +- B2F's and B3F's spinner tiles as regions `spin_north`, `spin_south`, + `spin_west`, `spin_east` and `spin_stop` (pokefirered `MB_SPIN_*`, + `MB_STOP_SPINNING`; `spin_slide()` in PokemonFRLG_OverworldMap.h); +- the Game Corner's poster as an object `poster` at (11, 1), and its stairs + (16..17, 2..3) as objects `poster_stairs`, which the switch removes + (`SimField::POSTER_SWITCH`); +- the lift's floors: its door is a dynamic warp (`setdynamicwarp`), so the sim + is told where each floor lets out (`SimScript::lift_floors`: B1F (24, 25), + B2F (28, 16), B4F (20, 23)) and the planner can't route through it yet. + +`STORY_TRAINERS` names the battles these drafts fight: CeladonCity_GameCorner +`rocket_grunt` (GRUNT_7), and on RocketHideout_B4F `lift_key_grunt` (GRUNT_18), +`left_guard` (GRUNT_16), `right_guard` (GRUNT_17) and `giovanni`. When the +drafts become table rows, their battle steps take those names. ## Conventions @@ -74,9 +101,13 @@ They can't run or be simulated on this branch's data: `gift_rng ` handoff, for the Eevee (00.32b), the Omanyte from the Helix Fossil (00.38b), the Hitmonchan (00.41) and the Lapras (00.42). The authored format can't yet say `handoff`/`live_start` as 00.12/00.12b do in C++. -- New `game_action` variants that no executor has yet: `party_room`, - `gift_rng`, `use_item`, `fly`, `flee_wild`, `surf`, `strength_puzzle`, - `reenter_map`. The `mart` variants name Marts the Mart table doesn't list +- `game_action` variants the C++ executor now has (no console run yet): + `poster_switch`, `lift_floor ` (PokemonFRLG_AutoStoryHideout.h), + `use_item ` and `ride_bike` + (PokemonFRLG_AutoStoryItemUse.h), and the `bike` route variant. Variants + that no executor has yet: `party_room`, `gift_rng`, `use_item rare-candy + slot=N` (an item used on a party member), `fly`, `flee_wild`, `surf`, + `strength_puzzle`, `reenter_map`. The `mart` variants name Marts the Mart table doesn't list yet (Lavender, Celadon 5F, Indigo Plateau). - HMs and key items come in story order: LIFT KEY, SILPH SCOPE, HM02 Fly, TEA, POKE FLUTE, HM03 Surf, GOLD TEETH, HM04 Strength, SECRET KEY, CARD KEY. @@ -84,8 +115,8 @@ They can't run or be simulated on this branch's data: ## Decisions for the user - **A Pidgey for Fly.** PokeGuy flies everywhere from 1:03; the story party has - no flier. The dropped Lavender-to-Celadon draft caught a Pidgey in Route 7's grass (Route 8's grass is behind - two Cut trees). Without Fly, Cinnabar needs a long walk round to Pallet. + no flier. 00.30 catches a Pidgey in Route 7's grass (Route 8's grass is + behind two Cut trees). Without Fly, Cinnabar needs a long walk round to Pallet. - **TM14 Blizzard over Mega Kick** (00.40) is a one-shot TM: it needs the team plan first. - **Strength over Water Pulse** (00.45) and **Surf over Water Gun** (00.37) @@ -111,8 +142,8 @@ wall tiles, and Indigo Plateau's door glyph is at (11, 5) with its warp at | Skipped leg | Why | |---|---| -| 00.31/b2f_lift | B2F's lift corner is reached over arrow tiles the planner does not solve | -| 00.31/b4f_below_guards | RocketHideout_Elevator map not in source-candidate | +| 00.32/b2f_lift | B2F's lift corner is reached over arrow tiles: the planner solves them now, but the candidate map has no `spin_*` regions | +| 00.32/b4f_below_guards | RocketHideout_Elevator map not in source-candidate | | 00.32/x_item_clerk | CeladonCity_DepartmentStore_Elevator map not in source-candidate | | 00.32/route16_below_tree | CeladonCity_DepartmentStore_Elevator map not in source-candidate | | 00.32/celadon_nurse | map not in source-candidate | diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/Draft/frlg-00.30.plan.json b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/Draft/frlg-00.30.plan.json index 0b256ee6be..4e01206a12 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/Draft/frlg-00.30.plan.json +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/Draft/frlg-00.30.plan.json @@ -3,82 +3,99 @@ "game": "frlg", "checkpoint": { "id": "00.30", - "title": "Celadon Game Corner and the Rocket Hideout down to B4F: the poster guard, the Lift Key Grunt, the LIFT KEY and B3F's Rare Candy", - "start": {"certainty": "tile", "map": "CeladonCity_PokemonCenter_1F", "where": {"facing": "north", "kind": "tiles", "tiles": [[7, 4]]}}, + "title": "Lavender Mart, then west over Route 8: Gamer Rich, a Pidgey for Fly, the Underground Path to Celadon", + "start": {"certainty": "tile", "map": "LavenderTown_PokemonCenter_1F", "where": {"facing": "north", "kind": "tiles", "tiles": [[7, 4]]}}, "events": [ { - "id": "celadon_below_game_corner", + "id": "lavender_mart_clerk", "kind": "route", - "target": {"certainty": "tile", "map": "CeladonCity", "where": {"facing": "north", "kind": "tiles", "tiles": [[34, 22]]}}, + "target": {"certainty": "tile", "map": "LavenderTown_Mart", "where": {"facing": "west", "kind": "tiles", "tiles": [[4, 3]]}}, "variant": "run", - "why": "out of the Center, west along row 12, down column 41..43 to row 22, west to below the Game Corner (34, 21)" + "why": "out of the Center, east along row 6 and down to the Mart (20, 15), to its clerk" }, { - "id": "below_poster_guard", - "kind": "route", - "target": {"certainty": "tile", "map": "CeladonCity_GameCorner", "where": {"facing": "north", "kind": "tiles", "tiles": [[11, 3]]}}, - "variant": "run", - "why": "into the Game Corner, up the slot rows to below the Grunt (11, 2) in front of the poster" + "id": "buy_ropes_and_super_repels", + "kind": "game_action", + "variant": "mart LavenderTown_Mart budget=5700 floor=9000 escape-rope=4 super-repel=7", + "why": "pokeguy 54:18: 4 Escape Ropes and 7 Super Repels" }, { - "id": "talk_poster_guard", - "kind": "talk", - "why": "the Grunt guarding the poster" - }, - { - "id": "hideout-poster-guard", - "kind": "battle", - "declared_after": {"certainty": "tile", "map": "CeladonCity_GameCorner", "where": {"facing": "north", "kind": "tiles", "tiles": [[11, 3]]}}, - "why": "Rocket Grunt (TRAINER_TEAM_ROCKET_GRUNT_7): Raticate, Zubat Lv20; he runs off" + "id": "repel_route8", + "kind": "game_action", + "variant": "use_item repel", + "why": "a Repel (5 bought in 00.26) for Route 8's grass and the Underground Path; renewed when it wears off" }, { - "id": "poster_switch", - "kind": "talk", - "why": "the poster (11, 1): the switch opens the stairs (15, 2)" + "id": "ride_bike", + "kind": "game_action", + "variant": "ride_bike", + "why": "on the BICYCLE (00.26) for Route 8; the Underground Path's gate, indoors, gets the player off" }, { - "id": "hideout_b4f_west", + "id": "east_of_rich_line", "kind": "route", - "target": {"certainty": "tile", "map": "RocketHideout_B4F", "where": {"facing": "west", "kind": "tiles", "tiles": [[5, 3]]}}, - "variant": "run", - "why": "the stairs (15, 2) down to B1F, B1F to B2F (17, 2), B2F's arrow tiles to B3F (21, 2), B3F to B4F (15, 18), round to (5, 3), east of the tile below the Grunt (4, 2)" + "target": {"certainty": "tile", "map": "Route8", "where": {"facing": "west", "kind": "tiles", "tiles": [[56, 18]]}}, + "variant": "bike", + "why": "west out of Lavender onto Route 8, down column 64 east of Julia (62, 14) and west along row 18" }, { - "id": "key_grunt_line", + "id": "rich_line", "kind": "step", "direction": "west", "variant": "trainer_line", - "why": "onto (4, 3), in the Grunt's line (sight 1)" + "why": "onto (55, 18), the end of Rich's line (55, 16..18): he walks down to (55, 17)" }, { - "id": "hideout-key-grunt", + "id": "route8-rich", "kind": "battle", - "declared_after": {"certainty": "tile", "map": "RocketHideout_B4F", "where": {"facing": "west", "kind": "tiles", "tiles": [[4, 3]]}}, - "why": "Rocket Grunt (TRAINER_TEAM_ROCKET_GRUNT_18): Koffing, Zubat Lv21; he drops the LIFT KEY" + "declared_after": {"certainty": "tile", "map": "Route8", "where": {"facing": "north", "kind": "tiles", "tiles": [[55, 18]]}}, + "why": "Gamer Rich (TRAINER_GAMER_RICH): Growlithe, Vulpix Lv24" + }, + { + "id": "below_underground_door", + "kind": "route", + "target": {"certainty": "tile", "map": "Route8", "where": {"facing": "north", "kind": "tiles", "tiles": [[13, 5]]}}, + "variant": "bike", + "why": "west along rows 14..18, up column 14 east of Aidan's line (10..13, 6), to below the Underground Path door (13, 4)" }, { - "id": "below_lift_key", + "id": "route7_underground_exit", "kind": "route", - "target": {"certainty": "tile", "map": "RocketHideout_B4F", "where": {"facing": "north", "kind": "tiles", "tiles": [[3, 3]]}}, + "target": {"certainty": "tile", "map": "Route7", "where": {"facing": "south", "kind": "tiles", "tiles": [[7, 15]]}}, "variant": "run", - "why": "a tile west, below the LIFT KEY (3, 2)" + "why": "through the door, the east entrance, the east-west tunnel and the west entrance, out onto Route 7" }, { - "id": "lift_key", - "kind": "talk", - "why": "pick up the LIFT KEY (pokeguy 57:33)" + "id": "pidgey_grass", + "kind": "route", + "target": {"certainty": "tile", "map": "Route7", "where": {"facing": "east", "kind": "tiles", "tiles": [[14, 5]]}}, + "variant": "run", + "why": "north round the ledges into Route 7's grass (11..16, 2..5), a grass tile east of it free; Route 8's grass is behind two Cut trees" + }, + { + "id": "catch_pidgey", + "kind": "game_action", + "variant": "capture pidgey catches=1 encounters=30 balls=5 pace=east", + "why": "a Pidgey to carry HM02 Fly (pokeguy flies with a Pidgey from 1:03 on); the party has no other flier" + }, + { + "id": "celadon_below_center", + "kind": "route", + "target": {"certainty": "tile", "map": "CeladonCity", "where": {"facing": "north", "kind": "tiles", "tiles": [[48, 12]]}}, + "variant": "run", + "why": "north round the grass, west onto Celadon (row 12..15) and along row 12 to below the Center door (48, 11)" }, { - "id": "beside_b3f_rare_candy", + "id": "celadon_nurse", "kind": "route", - "target": {"certainty": "tile", "map": "RocketHideout_B3F", "where": {"facing": "north", "kind": "tiles", "tiles": [[12, 13]]}}, + "target": {"certainty": "tile", "map": "CeladonCity_PokemonCenter_1F", "where": {"facing": "north", "kind": "tiles", "tiles": [[7, 4]]}}, "variant": "run", - "why": "back up the stairs to B3F, below the Rare Candy (12, 12) beside the arrow tiles" + "why": "into the Center, to the nurse" }, { - "id": "b3f_rare_candy", - "kind": "talk", - "why": "pick up the Rare Candy: two, with Route 9's" + "id": "heal_celadon", + "kind": "heal", + "why": "the nurse heals the party" } ] }, diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/Draft/frlg-00.31.plan.json b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/Draft/frlg-00.31.plan.json index e040f84d88..bef003ddb2 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/Draft/frlg-00.31.plan.json +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/Draft/frlg-00.31.plan.json @@ -3,101 +3,83 @@ "game": "frlg", "checkpoint": { "id": "00.31", - "title": "Rocket Hideout: the lift to B4F, the two door guards, two Rare Candies, Blastoise, Giovanni and the SILPH SCOPE", - "start": {"certainty": "tile", "map": "RocketHideout_B3F", "where": {"facing": "north", "kind": "tiles", "tiles": [[12, 13]]}}, + "title": "Celadon Game Corner and the Rocket Hideout down to B4F: the poster guard, the Lift Key Grunt, the LIFT KEY and B3F's Rare Candy", + "start": {"certainty": "tile", "map": "CeladonCity_PokemonCenter_1F", "where": {"facing": "north", "kind": "tiles", "tiles": [[7, 4]]}}, "events": [ { - "id": "b2f_lift", + "id": "celadon_below_game_corner", "kind": "route", - "target": {"certainty": "tile", "map": "RocketHideout_B2F", "where": {"facing": "north", "kind": "tiles", "tiles": [[28, 17]]}}, + "target": {"certainty": "tile", "map": "CeladonCity", "where": {"facing": "north", "kind": "tiles", "tiles": [[34, 22]]}}, "variant": "run", - "why": "up to B2F, along the arrow tiles to the lift (28..29, 16)" + "why": "out of the Center, west along row 12, down column 41..43 to row 22, west to below the Game Corner (34, 21)" }, { - "id": "lift_to_b4f", - "kind": "scene", - "why": "the LIFT KEY works the lift: B4F" - }, - { - "id": "b4f_below_guards", + "id": "below_poster_guard", "kind": "route", - "target": {"certainty": "tile", "map": "RocketHideout_B4F", "where": {"facing": "north", "kind": "tiles", "tiles": [[17, 16]]}}, + "target": {"certainty": "tile", "map": "CeladonCity_GameCorner", "where": {"facing": "north", "kind": "tiles", "tiles": [[11, 3]]}}, "variant": "run", - "why": "out of the lift to below the two Grunts (16, 14) and (19, 14)" + "why": "into the Game Corner, up the slot rows to below the Grunt (11, 2) in front of the poster" }, { - "id": "talk_left_guard", + "id": "talk_poster_guard", "kind": "talk", - "why": "the left door guard" + "why": "the Grunt guarding the poster" }, { - "id": "hideout-left-guard", + "id": "hideout-poster-guard", "kind": "battle", - "declared_after": {"certainty": "tile", "map": "RocketHideout_B4F", "where": {"facing": "north", "kind": "tiles", "tiles": [[17, 16]]}}, - "why": "Rocket Grunt (TRAINER_TEAM_ROCKET_GRUNT_16): Sandshrew, Sandslash, Ekans Lv23" - }, - { - "id": "talk_right_guard", - "kind": "talk", - "why": "the right door guard" + "declared_after": {"certainty": "tile", "map": "CeladonCity_GameCorner", "where": {"facing": "north", "kind": "tiles", "tiles": [[11, 3]]}}, + "why": "Rocket Grunt (TRAINER_TEAM_ROCKET_GRUNT_7): Raticate, Zubat Lv20; he runs off" }, { - "id": "hideout-right-guard", - "kind": "battle", - "declared_after": {"certainty": "tile", "map": "RocketHideout_B4F", "where": {"facing": "north", "kind": "tiles", "tiles": [[17, 16]]}}, - "why": "Rocket Grunt (TRAINER_TEAM_ROCKET_GRUNT_17): Ekans, Sandshrew, Arbok Lv23; the door opens" + "id": "poster_switch", + "kind": "game_action", + "variant": "poster_switch", + "why": "the poster (11, 1): the switch opens the stairs (15, 2)" }, { - "id": "rare_candy_1", - "kind": "game_action", - "variant": "use_item rare-candy slot=1", - "why": "Rare Candy: Lv35 (pokeguy 1:00:25)" + "id": "hideout_b4f_west", + "kind": "route", + "target": {"certainty": "tile", "map": "RocketHideout_B4F", "where": {"facing": "west", "kind": "tiles", "tiles": [[5, 3]]}}, + "variant": "run", + "why": "the stairs (15, 2) down to B1F, B1F to B2F (17, 2), B2F's arrow tiles to B3F (21, 2), B3F to B4F (15, 18), round to (5, 3), east of the tile below the Grunt (4, 2)" }, { - "id": "rare_candy_2", - "kind": "game_action", - "variant": "use_item rare-candy slot=1", - "why": "Rare Candy: Lv36, Wartortle evolves" + "id": "key_grunt_line", + "kind": "step", + "direction": "west", + "variant": "trainer_line", + "why": "onto (4, 3), in the Grunt's line (sight 1)" }, { - "id": "evolve_blastoise", - "kind": "scene", - "why": "Wartortle evolves into Blastoise; do not press B" + "id": "hideout-key-grunt", + "kind": "battle", + "declared_after": {"certainty": "tile", "map": "RocketHideout_B4F", "where": {"facing": "west", "kind": "tiles", "tiles": [[4, 3]]}}, + "why": "Rocket Grunt (TRAINER_TEAM_ROCKET_GRUNT_18): Koffing, Zubat Lv21; he drops the LIFT KEY" }, { - "id": "below_giovanni", + "id": "below_lift_key", "kind": "route", - "target": {"certainty": "tile", "map": "RocketHideout_B4F", "where": {"facing": "north", "kind": "tiles", "tiles": [[19, 5]]}}, - "why": "through the door to below Giovanni (19, 4)" + "target": {"certainty": "tile", "map": "RocketHideout_B4F", "where": {"facing": "north", "kind": "tiles", "tiles": [[3, 3]]}}, + "variant": "run", + "why": "a tile west, below the LIFT KEY (3, 2)" }, { - "id": "talk_giovanni", + "id": "lift_key", "kind": "talk", - "why": "Giovanni" - }, - { - "id": "hideout-giovanni", - "kind": "battle", - "declared_after": {"certainty": "tile", "map": "RocketHideout_B4F", "where": {"facing": "north", "kind": "tiles", "tiles": [[19, 5]]}}, - "why": "Giovanni (TRAINER_BOSS_GIOVANNI): Onix, Rhyhorn, Kangaskhan" + "why": "pick up the LIFT KEY (pokeguy 57:33)" }, { - "id": "beside_silph_scope", + "id": "beside_b3f_rare_candy", "kind": "route", - "target": {"certainty": "tile", "map": "RocketHideout_B4F", "where": {"facing": "west", "kind": "tiles", "tiles": [[21, 5]]}}, - "why": "round to east of the SILPH SCOPE (20, 5)" + "target": {"certainty": "tile", "map": "RocketHideout_B3F", "where": {"facing": "north", "kind": "tiles", "tiles": [[12, 13]]}}, + "variant": "run", + "why": "back up the stairs to B3F, below the Rare Candy (12, 12) beside the arrow tiles" }, { - "id": "silph_scope", + "id": "b3f_rare_candy", "kind": "talk", - "why": "pick up the SILPH SCOPE" - }, - { - "id": "escape_rope_hideout", - "kind": "game_action", - "declared_after": {"certainty": "tile", "map": "CeladonCity", "where": {"facing": "south", "kind": "tiles", "tiles": [[34, 22]]}}, - "variant": "use_item escape-rope", - "why": "out to the Game Corner's door (pokeguy 1:02:10)" + "why": "pick up the Rare Candy: two, with Route 9's" } ] }, diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/Draft/frlg-00.32.plan.json b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/Draft/frlg-00.32.plan.json new file mode 100644 index 0000000000..4351f396c4 --- /dev/null +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/Draft/frlg-00.32.plan.json @@ -0,0 +1,106 @@ +{ + "format": "pokesim-authored-checkpoint/1", + "game": "frlg", + "checkpoint": { + "id": "00.32", + "title": "Rocket Hideout: the lift to B4F, the two door guards, two Rare Candies, Blastoise, Giovanni and the SILPH SCOPE", + "start": {"certainty": "tile", "map": "RocketHideout_B3F", "where": {"facing": "north", "kind": "tiles", "tiles": [[12, 13]]}}, + "events": [ + { + "id": "b2f_lift", + "kind": "route", + "target": {"certainty": "tile", "map": "RocketHideout_B2F", "where": {"facing": "north", "kind": "tiles", "tiles": [[28, 17]]}}, + "variant": "run", + "why": "up to B2F, along the arrow tiles to the lift (28..29, 16)" + }, + { + "id": "lift_to_b4f", + "kind": "game_action", + "variant": "lift_floor B2F B4F", + "why": "the LIFT KEY works the lift: B4F" + }, + { + "id": "b4f_below_guards", + "kind": "route", + "target": {"certainty": "tile", "map": "RocketHideout_B4F", "where": {"facing": "north", "kind": "tiles", "tiles": [[17, 16]]}}, + "variant": "run", + "why": "out of the lift to below the two Grunts (16, 14) and (19, 14)" + }, + { + "id": "talk_left_guard", + "kind": "talk", + "why": "the left door guard" + }, + { + "id": "hideout-left-guard", + "kind": "battle", + "declared_after": {"certainty": "tile", "map": "RocketHideout_B4F", "where": {"facing": "north", "kind": "tiles", "tiles": [[17, 16]]}}, + "why": "Rocket Grunt (TRAINER_TEAM_ROCKET_GRUNT_16): Sandshrew, Sandslash, Ekans Lv23" + }, + { + "id": "talk_right_guard", + "kind": "talk", + "why": "the right door guard" + }, + { + "id": "hideout-right-guard", + "kind": "battle", + "declared_after": {"certainty": "tile", "map": "RocketHideout_B4F", "where": {"facing": "north", "kind": "tiles", "tiles": [[17, 16]]}}, + "why": "Rocket Grunt (TRAINER_TEAM_ROCKET_GRUNT_17): Ekans, Sandshrew, Arbok Lv23; the door opens" + }, + { + "id": "rare_candy_1", + "kind": "game_action", + "variant": "use_item rare-candy slot=1", + "why": "Rare Candy: Lv35 (pokeguy 1:00:25)" + }, + { + "id": "rare_candy_2", + "kind": "game_action", + "variant": "use_item rare-candy slot=1", + "why": "Rare Candy: Lv36, Wartortle evolves" + }, + { + "id": "evolve_blastoise", + "kind": "scene", + "why": "Wartortle evolves into Blastoise; do not press B" + }, + { + "id": "below_giovanni", + "kind": "route", + "target": {"certainty": "tile", "map": "RocketHideout_B4F", "where": {"facing": "north", "kind": "tiles", "tiles": [[19, 5]]}}, + "why": "through the door to below Giovanni (19, 4)" + }, + { + "id": "talk_giovanni", + "kind": "talk", + "why": "Giovanni" + }, + { + "id": "hideout-giovanni", + "kind": "battle", + "declared_after": {"certainty": "tile", "map": "RocketHideout_B4F", "where": {"facing": "north", "kind": "tiles", "tiles": [[19, 5]]}}, + "why": "Giovanni (TRAINER_BOSS_GIOVANNI): Onix, Rhyhorn, Kangaskhan" + }, + { + "id": "beside_silph_scope", + "kind": "route", + "target": {"certainty": "tile", "map": "RocketHideout_B4F", "where": {"facing": "west", "kind": "tiles", "tiles": [[21, 5]]}}, + "why": "round to east of the SILPH SCOPE (20, 5)" + }, + { + "id": "silph_scope", + "kind": "talk", + "why": "pick up the SILPH SCOPE" + }, + { + "id": "escape_rope_hideout", + "kind": "game_action", + "declared_after": {"certainty": "tile", "map": "CeladonCity", "where": {"facing": "south", "kind": "tiles", "tiles": [[34, 22]]}}, + "variant": "use_item escape-rope", + "why": "out to the Game Corner's door (pokeguy 1:02:10)" + } + ] + }, + "execution": {"menu": "full"} +} From 8ebc21b3c7b3b109bd052caeea7e718e777aa0c2 Mon Sep 17 00:00:00 2001 From: dayfine Date: Mon, 9 Nov 2026 18:02:19 -0800 Subject: [PATCH 10/79] FRLG: script Pokemon Centers and the hideout lift; code spinners and the poster Centers share one layout and the lift is 5x7 tiles, so the story walks them by fixed taps (center_enter, center_exit, lift_floor from below the door to the destination's door) and the sim builds their rooms from code read off pokefirered. B2F/B3F spinner tiles and the Game Corner poster and stairs are coded too, so the candidate maps need no extra regions or objects. Bike pace and bag waits from console B (2026-11-09). Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss --- .../Overworld/PokemonFRLG_CodedRooms.cpp | 211 ++++++++++++++++++ .../Overworld/PokemonFRLG_CodedRooms.h | 96 ++++++++ .../Overworld/PokemonFRLG_MovementMechanics.h | 10 +- .../Overworld/PokemonFRLG_OverworldMap.cpp | 6 +- .../Overworld/PokemonFRLG_OverworldMap.h | 5 +- .../Overworld/PokemonFRLG_OverworldSim.cpp | 1 + .../Overworld/PokemonFRLG_OverworldSim.h | 8 +- .../PokemonFRLG_OverworldSimField.cpp | 7 + .../PokemonFRLG_AutoStoryHideout.cpp | 21 +- .../AutoStory/PokemonFRLG_AutoStoryHideout.h | 21 +- .../PokemonFRLG_AutoStoryHideout_Tests.cpp | 107 ++++++--- .../PokemonFRLG_AutoStoryItemUse.cpp | 20 +- .../AutoStory/PokemonFRLG_AutoStoryRooms.cpp | 91 ++++++++ .../AutoStory/PokemonFRLG_AutoStoryRooms.h | 81 +++++++ .../PokemonFRLG_AutoStoryRooms_Tests.cpp | 125 +++++++++++ .../AutoStory/PokemonFRLG_AutoStoryRowSim.cpp | 59 ++++- .../AutoStory/PokemonFRLG_AutoStoryRowSim.h | 1 + .../PokemonFRLG_AutoStoryStepTable_Tests.cpp | 2 + .../PokemonFRLG_AutoStoryTableSteps.cpp | 20 ++ .../PokemonFRLG_AutoStoryTableSteps.h | 12 +- .../AutoStory/StoryData/Draft/README.md | 60 +++-- .../StoryData/Draft/frlg-00.30.plan.json | 17 +- .../StoryData/Draft/frlg-00.31.plan.json | 9 +- .../StoryData/Draft/frlg-00.32.plan.json | 5 +- SerialPrograms/cmake/SourceFiles.cmake | 5 + 25 files changed, 910 insertions(+), 90 deletions(-) create mode 100644 SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_CodedRooms.cpp create mode 100644 SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_CodedRooms.h create mode 100644 SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRooms.cpp create mode 100644 SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRooms.h create mode 100644 SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRooms_Tests.cpp diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_CodedRooms.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_CodedRooms.cpp new file mode 100644 index 0000000000..64a103cf0a --- /dev/null +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_CodedRooms.cpp @@ -0,0 +1,211 @@ +/* Coded Rooms and Tiles + * + * From: https://github.com/PokemonAutomation/ + * + */ + +#include +#include +#include "PokemonFRLG_CodedRooms.h" +#include "PokemonFRLG_OverworldMaps.h" + +namespace PokemonAutomation{ +namespace NintendoSwitch{ +namespace PokemonFRLG{ + + +namespace{ + +// A floor's spinner tiles, by the way each slides the player. +struct SpinnerFloor{ + std::string_view map; + std::vector north; + std::vector south; + std::vector west; + std::vector east; + std::vector stop; +}; + +// Read off pokefirered: each floor's layout (data/layouts/RocketHideout_ +// B2F, _B3F map.bin, primary tileset gTileset_Building, secondary +// gTileset_SilphCo) with each metatile's behaviour from the tilesets' +// metatile_attributes.bin: MB_SPIN_UP (0x56), MB_SPIN_DOWN (0x57), +// MB_SPIN_LEFT (0x55), MB_SPIN_RIGHT (0x54), MB_STOP_SPINNING (0x58). +const std::vector& spinner_floors(){ + static const std::vector FLOORS{ + { + "RocketHideout_B2F", + {{9, 5}, {11, 6}, {7, 7}, {11, 8}, {15, 9}, {7, 10}, {9, 10}, {3, 11}, {15, 11}, {13, 12}, {15, 13}, {9, 14}, {5, 17}, {7, 18}, {5, 19}}, + {{12, 5}, {8, 9}, {10, 9}, {14, 11}, {10, 13}, {8, 17}}, + {{3, 4}, {7, 4}, {9, 4}, {11, 4}, {16, 5}, {16, 6}, {12, 13}, {3, 14}, {7, 14}, {12, 14}, {12, 17}, {12, 18}}, + {{3, 6}, {12, 7}, {4, 9}, {3, 10}, {10, 11}, {12, 11}, {9, 12}, {11, 12}, {9, 20}}, + {{1, 4}, {7, 6}, {13, 7}, {15, 8}, {13, 10}, {8, 11}, {14, 13}, {1, 14}, {5, 15}, {10, 15}, {8, 19}, {13, 20}}, + }, + { + "RocketHideout_B3F", + {{8, 11}, {10, 14}, {6, 15}, {6, 17}, {4, 18}}, + {{9, 10}, {7, 16}}, + {{4, 9}}, + {{6, 9}, {2, 11}, {6, 13}, {5, 14}, {7, 14}, {4, 15}, {3, 16}, {2, 17}}, + {{2, 9}, {8, 9}, {6, 11}, {10, 13}, {9, 14}, {7, 20}}, + }, + }; + return FLOORS; +} + +const SpinnerFloor* spinner_floor(std::string_view map){ + for (const SpinnerFloor& floor : spinner_floors()){ + if (floor.map == map){ + return &floor; + } + } + return nullptr; +} + +bool contains(const std::vector& tiles, const TilePos& point){ + return std::any_of(tiles.begin(), tiles.end(), [&](const TilePos& tile){ + return tile.x == point.x && tile.y == point.y; + }); +} + +bool has_object(const MapData& map, std::string_view name){ + return std::any_of(map.objects.begin(), map.objects.end(), [&](const MapObject& object){ + return object.name == name; + }); +} + +MapObject object(std::string name, Pokemon::ObjectKind kind, const TilePos& tile){ + MapObject out; + out.name = std::move(name); + out.kind = kind; + out.x = tile.x; + out.y = tile.y; + return out; +} + +// LAYOUT_POKEMON_CENTER_1F's collision and elevation, as the map lock's +// seven Centers (PokemonSimulation 6c2f5c8, data/games/frlg/maps/runtime/ +// *_PokemonCenter_1F.json) all have them. The mat's warps: (6..8, 8), +// the middle one MB_SOUTH_ARROW_WARP-like ("walk_south"); the stairs to +// 2F at (1, 6), which isn't loaded. +const char CENTER_ROOM_JSON[] = R"({ + "name": "PokemonCenter_1F", + "source": {"decomp_file": "data/layouts/PokemonCenter_1F/map.bin", "revision": "ce6406d8c2eaf46d543c8a2606de0c3cb1951982", "date": "2026-11-09"}, + "allow_running": false, + "tiles": ["#.#############", "###############", "....###..##....", "....#######....", "...............", "...............", "#..........##..", "...........##..", "...............", "###############"], + "elevation": ["030000000000000", "000000000000000", "333300033003333", "333300000003333", "333333333333333", "330333333333333", "044033333330033", "330333333330033", "333333333333333", "000000000000000"], + "points": {"warp_0": [6, 8], "warp_1": [7, 8], "warp_2": [8, 8], "nurse_front": [7, 4]}, + "warps": [ + {"x": 6, "y": 8, "enter": "walk_into"}, + {"x": 7, "y": 8, "enter": "walk_south"}, + {"x": 8, "y": 8, "enter": "walk_into"}, + {"x": 1, "y": 6, "enter": "step_on"} + ], + "objects": [{"name": "nurse", "kind": "npc", "x": 7, "y": 2}] +})"; + +// LAYOUT_ROCKET_HIDEOUT_ELEVATOR's collision (map.bin: rows 0 to 2 and 6 +// walls, 3 to 5 floor), the panel's bg event at (0, 2), and warp 1 at +// (2, 5), the one MB_SOUTH_ARROW_WARP tile (warp 0 at (1, 5) has no +// behaviour, so never fires). +const char LIFT_ROOM_JSON[] = R"({ + "name": "RocketHideout_Elevator", + "source": {"decomp_file": "data/layouts/RocketHideout_Elevator/map.bin", "revision": "ce6406d8c2eaf46d543c8a2606de0c3cb1951982", "date": "2026-11-09"}, + "tiles": ["#####", "#####", "S####", ".....", ".....", ".....", "#####"], + "points": {"warp_0": [1, 5], "warp_1": [2, 5]}, + "warps": [{"x": 2, "y": 5, "enter": "walk_south"}] +})"; + +} // namespace + + +std::optional coded_spin_direction(std::string_view map, const TilePos& point){ + const SpinnerFloor* floor = spinner_floor(map); + if (floor == nullptr){ + return std::nullopt; + } + if (contains(floor->north, point)){ + return Direction::NORTH; + } + if (contains(floor->south, point)){ + return Direction::SOUTH; + } + if (contains(floor->west, point)){ + return Direction::WEST; + } + if (contains(floor->east, point)){ + return Direction::EAST; + } + return std::nullopt; +} + +bool coded_spin_stop(std::string_view map, const TilePos& point){ + const SpinnerFloor* floor = spinner_floor(map); + return floor != nullptr && contains(floor->stop, point); +} + + +void add_coded_objects(MapData& map){ + if (map.name != GAME_CORNER_MAP){ + return; + } + if (!has_object(map, "poster")){ + map.objects.push_back(object("poster", Pokemon::ObjectKind::SIGN, GAME_CORNER_POSTER)); + } + if (!has_object(map, "poster_stairs")){ + for (const TilePos& tile : {TilePos{15, 2}, TilePos{16, 2}, TilePos{17, 2}, TilePos{16, 3}, TilePos{17, 3}}){ + map.objects.push_back(object("poster_stairs", Pokemon::ObjectKind::NPC, tile)); + } + } +} + + +bool is_pokemon_center(std::string_view map){ + return map.ends_with("_PokemonCenter_1F"); +} + +MapData pokemon_center_room(const std::string& name, const Pokemon::WarpDestination& outside){ + MapData room = parse_map(CENTER_ROOM_JSON, name); + room.name = name; + for (MapWarp& warp : room.warps){ + if (warp.y == CENTER_MAT.y){ + warp.to = outside; + } + } + return room; +} + +std::optional add_pokemon_center_room(std::vector& maps, size_t town){ + for (const MapWarp& warp : maps[town].warps){ + if (!warp.to || !is_pokemon_center(warp.to->map)){ + continue; + } + const std::string center = warp.to->map; + const std::string door = center + "_door"; + maps[town].points[door] = TilePos{warp.x, warp.y}; + Pokemon::WarpDestination outside{maps[town].name, door}; + maps.push_back(pokemon_center_room(center, outside)); + return center; + } + return std::nullopt; +} + + +MapData rocket_hideout_lift_room(){ + return parse_map(LIFT_ROOM_JSON, std::string(LIFT_MAP)); +} + +const std::vector& rocket_hideout_lift_doors(){ + static const std::vector DOORS{ + {"RocketHideout_B1F", {24, 25}}, + {"RocketHideout_B2F", {28, 16}}, + {"RocketHideout_B4F", {20, 23}}, + }; + return DOORS; +} + + + +} // namespace PokemonFRLG +} // namespace NintendoSwitch +} // namespace PokemonAutomation diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_CodedRooms.h b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_CodedRooms.h new file mode 100644 index 0000000000..348aba0492 --- /dev/null +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_CodedRooms.h @@ -0,0 +1,96 @@ +/* Coded Rooms and Tiles + * + * From: https://github.com/PokemonAutomation/ + * + * Places the story scripts rather than maps (the user's call, 2026-11-09): + * every Pokemon Center's ground floor, which all share one layout, the + * Rocket Hideout's lift, a room of 5 by 7 tiles, and the tiles that maps + * can't say in glyphs: the Rocket Hideout's spinners and the Game + * Corner's poster. All of it is read off pret/pokefirered, cited where it + * is defined, so no map file has to carry it. + * + */ + +#ifndef PokemonAutomation_PokemonFRLG_CodedRooms_H +#define PokemonAutomation_PokemonFRLG_CodedRooms_H + +#include +#include +#include +#include +#include "PokemonFRLG_OverworldMap.h" +#include "PokemonFRLG_OverworldRoute.h" + +namespace PokemonAutomation{ +namespace NintendoSwitch{ +namespace PokemonFRLG{ + + +// The spinner arrow on `point` of the map named `map`, from the +// decompilation's metatile behaviours, if the map is one of the hideout's +// spinner floors (RocketHideout_B2F, RocketHideout_B3F). +std::optional coded_spin_direction(std::string_view map, const TilePos& point); +// Whether `point` of the map named `map` is a coded MB_STOP_SPINNING tile. +bool coded_spin_stop(std::string_view map, const TilePos& point); + + +// The Game Corner, whose poster hides the hideout's switch. +inline constexpr std::string_view GAME_CORNER_MAP = "CeladonCity_GameCorner"; +// The poster (pokefirered CeladonCity_GameCorner map.json, the bg event +// CeladonCity_GameCorner_EventScript_Poster at (11, 1)). +inline constexpr TilePos GAME_CORNER_POSTER{11, 1}; +// Adds what the Game Corner's map can't say to `map`, if it is the Game +// Corner and hasn't them: the poster, an object "poster", and the tiles +// the switch turns into stairs (CeladonCity_GameCorner_EventScript_ +// OpenRocketHideout's setmetatile: (15, 2), (16..17, 2..3)), objects +// "poster_stairs" that block them until it is pushed. +void add_coded_objects(MapData& map); + + +// A Pokemon Center's ground floor. pokefirered gives all of Kanto's and +// the Sevii Islands' but the Indigo Plateau's and One Island's the one +// layout, LAYOUT_POKEMON_CENTER_1F; the seven in the map lock have the +// same tiles and differ only in who stands where, none of them on the +// nurse's column. +// The mat inside the door: the player arrives on it and leaves from it, +// walking south. +inline constexpr TilePos CENTER_MAT{7, 8}; +// Below the nurse's counter, facing her (the nurse at (7, 2)). +inline constexpr TilePos CENTER_NURSE_FRONT{7, 4}; +// Whether `map` names a Pokemon Center's ground floor. +bool is_pokemon_center(std::string_view map); +// The ground floor of the Center named `name`, whose mat lets out on +// `outside` (the door tile of the town's map): its tiles, the nurse, and +// the mat's warps. No person but the nurse: who stands where differs, and +// the script keeps to the nurse's column. +MapData pokemon_center_room(const std::string& name, const Pokemon::WarpDestination& outside); +// For a sim: adds the coded room of the Center whose door is on +// `maps[town]` to `maps`, and returns its name; nothing if the town has +// no Center door. The town gets a point "
_door" on its door tile +// for the room's mat to let out on. +std::optional add_pokemon_center_room(std::vector& maps, size_t town); + + +// The Rocket Hideout's lift (pokefirered LAYOUT_ROCKET_HIDEOUT_ELEVATOR, +// 5 by 7 tiles, rows 3 to 5 walkable). +inline constexpr std::string_view LIFT_MAP = "RocketHideout_Elevator"; +// Where the floors' lift doors put the player (warp 1, an +// MB_SOUTH_ARROW_WARP tile): south from it leaves the lift. +inline constexpr TilePos LIFT_ARRIVAL{2, 5}; +// Below the panel (a bg event at (0, 2), RocketHideout_Elevator_ +// EventScript_FloorSelect), facing north. +inline constexpr TilePos LIFT_PANEL_FRONT{0, 3}; +// The lift's room. Its door is a dynamic warp: the sim takes it to the +// floor picked (SimScript::lift_floors with rocket_hideout_lift_doors()). +MapData rocket_hideout_lift_room(); +// Where the lift lets out for each floor on its panel, top first +// (setdynamicwarp in RocketHideout_Elevator's scripts): B1F (24, 25), +// B2F (28, 16), B4F (20, 23), each its floor's lift door. +const std::vector& rocket_hideout_lift_doors(); + + + +} // namespace PokemonFRLG +} // namespace NintendoSwitch +} // namespace PokemonAutomation +#endif diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_MovementMechanics.h b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_MovementMechanics.h index d2f761596c..de3c682440 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_MovementMechanics.h +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_MovementMechanics.h @@ -48,10 +48,12 @@ inline constexpr Milliseconds TILE_TIME(267); inline constexpr Milliseconds RUN_TILE_TIME(133); // Surfing: a tile per 8 frames. inline constexpr Milliseconds SURF_TILE_TIME(133); -// Riding the Bicycle: a tile per 4 frames (pokefirered bike.c, -// PlayerRideWaterCurrent(): MOVE_SPEED_FAST_2). An estimate from the -// decompilation, not measured on the console. -inline constexpr Milliseconds BIKE_TILE_TIME(67); +// Riding the Bicycle, measured on console B (2026-11-09, Lavender Town +// row 13, wall to wall, from rest): 16 tiles (1, 13) to (17, 13) in +// 1800 ms of motion, east and back west alike, 112 ms a tile; 5 tiles +// from rest in 600 ms (120 ms a tile, the start up included). Not the +// decompilation's 4 frames a tile (67 ms): the bike speeds up from rest. +inline constexpr Milliseconds BIKE_TILE_TIME(112); // The longest tap measured to only turn a player facing another way, and // to take exactly one step for one facing its way. inline constexpr Milliseconds LONGEST_TAP(133); diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldMap.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldMap.cpp index fb2317c92a..41a578fdde 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldMap.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldMap.cpp @@ -6,6 +6,7 @@ #include #include "Common/Cpp/Exceptions.h" +#include "PokemonFRLG_CodedRooms.h" #include "PokemonFRLG_OverworldMap.h" namespace PokemonAutomation{ @@ -246,6 +247,9 @@ bool in_region(const MapData& map, const char* region, const TilePos& point){ } // namespace std::optional spin_direction(const MapData& map, const TilePos& point){ + if (const std::optional coded = coded_spin_direction(map.name, point)){ + return coded; + } static const std::pair ARROWS[] = { {SPIN_NORTH_REGION, Direction::NORTH}, {SPIN_SOUTH_REGION, Direction::SOUTH}, @@ -260,7 +264,7 @@ std::optional spin_direction(const MapData& map, const TilePos& point return std::nullopt; } bool stops_spinning(const MapData& map, const TilePos& point){ - return in_region(map, SPIN_STOP_REGION, point); + return coded_spin_stop(map.name, point) || in_region(map, SPIN_STOP_REGION, point); } std::optional spin_slide(const MapData& map, const PlayerState& state){ diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldMap.h b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldMap.h index 84bf33ea49..aecc3af3c0 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldMap.h +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldMap.h @@ -162,8 +162,9 @@ PlayerState after_step_onto( // Spinner tiles (Rocket Hideout B2F and B3F, Viridian Gym): pokefirered's // MB_SPIN_UP, MB_SPIN_DOWN, MB_SPIN_LEFT, MB_SPIN_RIGHT and -// MB_STOP_SPINNING. The tile glyphs can't say so, so a map lists them in -// these regions, as it does WILD_REGION. +// MB_STOP_SPINNING. The tile glyphs can't say so: the hideout's floors +// have them coded (coded_spin_direction(), PokemonFRLG_CodedRooms.h); +// another map may list them in these regions, as it does WILD_REGION. // "spin_north": MB_SPIN_UP. extern const char SPIN_NORTH_REGION[]; // "spin_south": MB_SPIN_DOWN. diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSim.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSim.cpp index b0cd746e07..2e9b85afac 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSim.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSim.cpp @@ -145,6 +145,7 @@ OverworldSim::OverworldSim(std::vector maps, MapPosition start, Directi if (m_map < 0){ throw InternalProgramError(nullptr, PA_CURRENT_FUNCTION, "Sim: start on a map that isn't loaded: " + start.map); } + add_coded_field(); m_player = PlayerState{start.point, elevation_at(map(), start.point), false}; m_state.facing = facing; show(m_script.start_menu_open ? SimScreen::START_MENU : SimScreen::OVERWORLD, m_now); diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSim.h b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSim.h index f2dc04326b..94fdd1d063 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSim.h +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSim.h @@ -140,7 +140,8 @@ struct SimScript{ // A lift's map, and where its door lets the player out for each floor // on its panel's menu, top first (pokefirered setdynamicwarp in // RocketHideout_Elevator's scripts): the door's own warp is the - // game's placeholder. + // game's placeholder. The hideout's: rocket_hideout_lift_room() under + // LIFT_MAP, with rocket_hideout_lift_doors(). std::map> lift_floors = {}; SimTiming timing; }; @@ -222,7 +223,8 @@ enum class SimField{ // The poster the player faces (an object named "poster"): the switch // behind it opens the stairs, which takes away the objects named // "poster_stairs" for good (pokefirered - // CeladonCity_GameCorner_EventScript_Poster's setmetatile). + // CeladonCity_GameCorner_EventScript_Poster's setmetatile). The sim + // adds both to the Game Corner from code (add_coded_objects()). POSTER_SWITCH, // The panel of the lift the player stands in (SimScript::lift_floors): // the floor picked, the lift's door now lets out there. @@ -325,6 +327,8 @@ class OverworldSim{ bool slide_on(Step& step) const; // The slide's time after `step`, and its facing; 0 for no slide. Milliseconds after_slide(const Step& step); + // What the maps can't say, from code (add_coded_objects()). + void add_coded_field(); bool cut_tree(); bool choose_lift_floor(size_t floor); bool push_poster_switch(); diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSimField.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSimField.cpp index 2f657677a6..ac198790ac 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSimField.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSimField.cpp @@ -9,6 +9,7 @@ #include #include +#include "PokemonFRLG_CodedRooms.h" #include "PokemonFRLG_OverworldSim.h" namespace PokemonAutomation{ @@ -36,6 +37,12 @@ bool OverworldSim::use_field(SimField field, size_t floor){ return false; } +void OverworldSim::add_coded_field(){ + for (MapData& loaded : m_maps){ + add_coded_objects(loaded); + } +} + bool OverworldSim::slide_on(Step& step) const{ if (!spin_direction(m_maps[step.map], step.player.position)){ return true; diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryHideout.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryHideout.cpp index 3726c116a4..8c11c1fa7d 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryHideout.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryHideout.cpp @@ -9,6 +9,7 @@ #include "PokemonFRLG_AutoStoryActions.h" #include "PokemonFRLG_AutoStoryHideout.h" #include "PokemonFRLG_AutoStoryItemUse.h" +#include "PokemonFRLG_AutoStoryRooms.h" namespace PokemonAutomation{ namespace NintendoSwitch{ @@ -88,7 +89,7 @@ constexpr Milliseconds HIDEOUT_SCENE_TIMEOUT = 30000ms; } // namespace -void ride_lift(ConsoleHandle& console, ProControllerContext& context, const LiftRide& ride){ +void pick_lift_floor(ConsoleHandle& console, ProControllerContext& context, const LiftRide& ride){ const MenuPresses presses = lift_menu_presses(ride, rocket_hideout_lift_menu().size()); console.log( "Story: lift from " + rocket_hideout_lift_menu()[ride.from] + " to " + rocket_hideout_lift_menu()[ride.to] @@ -104,6 +105,12 @@ void ride_lift(ConsoleHandle& console, ProControllerContext& context, const Lift mash_until_overworld(console, context, HIDEOUT_SCENE_TIMEOUT); } +void ride_lift(ConsoleHandle& console, ProControllerContext& context, const LiftRide& ride){ + walk_room_legs(console, context, lift_in_legs(), Pokemon::Direction::NORTH); + pick_lift_floor(console, context, ride); + walk_room_legs(console, context, lift_out_legs(), Pokemon::Direction::NORTH); +} + void push_poster_switch(ConsoleHandle& console, ProControllerContext& context){ console.log("Story: the switch behind the poster."); pbf_press_button(context, BUTTON_A, 160ms, 800ms); @@ -113,9 +120,17 @@ void push_poster_switch(ConsoleHandle& console, ProControllerContext& context){ std::optional run_field_game_step( ConsoleHandle& console, ProControllerContext& context, Language language, const Pokemon::StoryStep& step ){ + const auto done = [&step]{ + return step.pose_after ? Pokemon::outcome_ok(*step.pose_after) : Pokemon::outcome_ok(); + }; if (const std::optional ride = parse_lift_floor_variant(step.variant)){ ride_lift(console, context, *ride); - return Pokemon::outcome_ok(); + return done(); + } + if (is_center_variant(step.variant)){ + // Both start facing north: at the door, or at the nurse. + walk_room_legs(console, context, center_legs(step.variant), Pokemon::Direction::NORTH); + return done(); } if (step.variant == POSTER_SWITCH_VARIANT){ push_poster_switch(console, context); @@ -130,7 +145,7 @@ std::optional run_field_game_step( if (end != ItemUseEnd::USED){ return Pokemon::outcome_failed(std::string("use_item_") + item_use_end_name(end), step.variant); } - return step.pose_after ? Pokemon::outcome_ok(*step.pose_after) : Pokemon::outcome_ok(); + return done(); } diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryHideout.h b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryHideout.h index 1282c2d880..bf8ed55c83 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryHideout.h +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryHideout.h @@ -37,10 +37,12 @@ namespace PokemonFRLG{ // beaten first. inline const std::string POSTER_SWITCH_VARIANT = "poster_switch"; -// The GAME step that rides the Rocket Hideout's lift, the player facing -// its panel with the LIFT KEY: "lift_floor ", floors as the -// panel names them (B1F, B2F, B4F). `from` is the floor the lift stands -// at, where the panel's cursor starts. +// The GAME step that rides the Rocket Hideout's lift with the LIFT KEY: +// "lift_floor ", floors as the panel names them (B1F, B2F, +// B4F). `from` is the floor the lift stands at, where the panel's cursor +// starts. The player starts below `from`'s lift door, facing north, and +// ends on `to`'s lift door (rocket_hideout_lift_doors()): the lift is +// walked by a script (lift_in_legs(), lift_out_legs()), not a map. inline constexpr std::string_view LIFT_FLOOR_PREFIX = "lift_floor "; // The lift panel's menu, top first (pokefirered @@ -73,15 +75,18 @@ bool is_hideout_variant(std::string_view variant); // On the console: A on the panel, the floor picked, the ride waited out // back to the overworld, the player still in the lift. +void pick_lift_floor(ConsoleHandle& console, ProControllerContext& context, const LiftRide& ride); +// On the console, the whole ride: into the lift from below the door, +// the floor picked, out onto the floor's lift door. void ride_lift(ConsoleHandle& console, ProControllerContext& context, const LiftRide& ride); // On the console: A on the poster, its message closed back to the // overworld. void push_poster_switch(ConsoleHandle& console, ProControllerContext& context); -// On the console, a GAME step of this file's or an item from the bag -// (is_item_use_variant()); nothing for another GAME step. The hideout's -// steps leave the player where they stand; an item used ends on the -// step's pose_after (an Escape Rope's), if it has one. +// On the console, a GAME step of this file's, a Pokemon Center's +// (is_center_variant()) or an item from the bag (is_item_use_variant()); +// nothing for another GAME step. The step ends on its pose_after, if it +// has one (an Escape Rope's, a lift ride's, a Center's). std::optional run_field_game_step( ConsoleHandle& console, ProControllerContext& context, Language language, const Pokemon::StoryStep& step ); diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryHideout_Tests.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryHideout_Tests.cpp index 12db0549e2..ae6b342f3e 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryHideout_Tests.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryHideout_Tests.cpp @@ -8,6 +8,7 @@ #include #include #include "Common/Cpp/TestRunners/UnitTest.h" +#include "VideoGames/PokemonFRLG/Overworld/PokemonFRLG_CodedRooms.h" #include "VideoGames/PokemonFRLG/Overworld/PokemonFRLG_MovementMechanics.h" #include "VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldMaps.h" #include "VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSim.h" @@ -100,57 +101,99 @@ UnitTestResult test_steps_on_sim(){ return true; } +// The Game Corner with no poster or stairs in its map: the sim adds them +// from code (add_coded_objects()). The room ends at x 16, so the walk +// east ends on (15, 2), the stairs' top, only once the switch opens it. std::string poster_on_sim(){ - const MapData room = parse_map(R"({ - "name": "Corner", "source": {"decomp_file": "", "revision": "test", "date": "2026-11-09"}, - "tiles": ["#####", "#...#", "#...#", "#####"], - "objects": [ - {"name": "poster", "kind": "sign", "x": 2, "y": 1}, - {"name": "poster_stairs", "kind": "npc", "x": 3, "y": 1} - ] - })", "Corner"); - OverworldSim sim({room}, MapPosition{"Corner", {2, 2}}, Direction::NORTH); - StoryPose at{"Corner", {2, 2}, Direction::NORTH}; + std::string rows; + for (int y = 0; y < 5; y++){ + rows += std::string(y == 0 ? "" : ", ") + (y == 0 || y == 4 ? "\"#################\"" : "\"#...............#\""); + } + const MapData room = parse_map( + "{\"name\": \"CeladonCity_GameCorner\", \"source\": {\"decomp_file\": \"\", \"revision\": \"test\", \"date\": \"2026-11-09\"}," + " \"tiles\": [" + rows + "]}", + "CeladonCity_GameCorner" + ); + const MapPosition below_poster{"CeladonCity_GameCorner", {GAME_CORNER_POSTER.x, GAME_CORNER_POSTER.y + 1}}; + OverworldSim sim({room}, below_poster, Direction::NORTH); + StoryPose at{below_poster.map, below_poster.point, Direction::NORTH}; const std::string failure = row_step_on_sim(sim, at, StoryTable::poster_switch("poster_switch", "test"), "00.31"); if (!failure.empty()){ return failure; } const Milliseconds tile = MovementMechanics::TILE_TIME; - sim.hold(Direction::EAST, tile * 2, MovementMechanics::STEP_RELEASE, tile * 2, {}); - sim.hold(Direction::NORTH, tile * 2, MovementMechanics::STEP_RELEASE, tile * 2, {}); - if (!(sim.state().position == MapPosition{"Corner", {3, 1}})){ - return "After the poster step, walked onto " + to_string(sim.state().position) + ", not the stairs."; + sim.hold(Direction::EAST, tile * 6, MovementMechanics::STEP_RELEASE, tile * 6, {}); + if (!(sim.state().position == MapPosition{"CeladonCity_GameCorner", {15, 2}})){ + return "After the poster step, walked onto " + to_string(sim.state().position) + ", not the stairs' (15, 2)."; } return ""; } +// A hideout floor of 32 by 26 open tiles with its lift door, which lets +// into the lift as pokefirered's floors' warps do (warp 1 of the lift). +MapData hideout_floor(const std::string& name, const TilePos& door){ + std::string rows; + for (int y = 0; y < 26; y++){ + std::string row(32, '.'); + if (y == door.y){ + row[door.x] = 'D'; + } + rows += (y == 0 ? "\"" : ", \"") + row + "\""; + } + return parse_map(std::format( + "{{\"name\": \"{}\", \"source\": {{\"decomp_file\": \"\", \"revision\": \"test\", \"date\": \"2026-11-09\"}}," + " \"tiles\": [{}], \"warps\": [{{\"x\": {}, \"y\": {}, \"enter\": \"walk_into\", \"to_map\": \"{}\", \"to_point\": \"warp_1\"}}]}}", + name, rows, door.x, door.y, LIFT_MAP + ), name); +} + +// The ride from B2F to B4F with the lift's room coded, not mapped: from +// below B2F's lift door, in, the panel, out onto B4F's lift door. std::string lift_on_sim(){ - std::vector maps; - maps.push_back(parse_map(R"({ - "name": "Lift", "source": {"decomp_file": "", "revision": "test", "date": "2026-11-09"}, - "tiles": ["###", "#.#", "#.#", "###"], - "warps": [{"x": 1, "y": 2, "enter": "walk_south"}] - })", "Lift")); - maps.push_back(parse_map(R"({ - "name": "B4F", "source": {"decomp_file": "", "revision": "test", "date": "2026-11-09"}, - "tiles": ["###", "#.#", "###"] - })", "B4F")); + const std::vector& doors = rocket_hideout_lift_doors(); + std::vector maps{ + hideout_floor("RocketHideout_B2F", doors[1].point), + hideout_floor("RocketHideout_B4F", doors[2].point), + rocket_hideout_lift_room(), + }; SimScript script; - const MapPosition b4f{"B4F", {1, 1}}; - script.lift_floors["Lift"] = {MapPosition{"Lift", {1, 1}}, MapPosition{"Lift", {1, 1}}, b4f}; - OverworldSim sim(maps, MapPosition{"Lift", {1, 2}}, Direction::SOUTH, script); - StoryPose at{"Lift", {1, 2}, Direction::SOUTH}; + script.lift_floors[std::string(LIFT_MAP)] = doors; + const MapPosition below_door{"RocketHideout_B2F", doors[1].point.next(Direction::SOUTH)}; + OverworldSim sim(maps, below_door, Direction::NORTH, script); + StoryPose at{below_door.map, below_door.point, Direction::NORTH}; const std::string failure = row_step_on_sim(sim, at, StoryTable::lift_floor("lift_to_b4f", "B2F", "B4F", "test"), "00.32"); if (!failure.empty()){ return failure; } - sim.hold(Direction::SOUTH, MovementMechanics::TILE_TIME, MovementMechanics::STEP_RELEASE, std::chrono::milliseconds(3000), {}); - if (!(sim.state().position == b4f)){ + if (!(sim.state().position == doors[2])){ return "After the lift step, the door let out on " + to_string(sim.state().position) + "."; } + if (!sim.state().violations.empty()){ + return "The lift step broke the game's rules: " + sim.state().violations.front(); + } return ""; } +// The hideout's spinners are coded: a map named as B2F or B3F slides the +// player with no spin_* regions of its own. +UnitTestResult test_coded_spinners(){ + MapData b3f = parse_map(R"({ + "name": "RocketHideout_B3F", "source": {"decomp_file": "", "revision": "test", "date": "2026-11-09"}, + "tiles": ["##########", "#........#", "#........#", "##########"] + })", "RocketHideout_B3F"); + if (spin_direction(b3f, TilePos{4, 9}) != Direction::WEST || !stops_spinning(b3f, TilePos{2, 9})){ + return "Expected B3F (4, 9) to slide west and (2, 9) to stop a slide."; + } + if (coded_spin_direction("RocketHideout_B2F", TilePos{3, 4}) != Direction::WEST + || coded_spin_direction("RocketHideout_B2F", TilePos{9, 5}) != Direction::NORTH + || !coded_spin_stop("RocketHideout_B2F", TilePos{1, 4}) + || coded_spin_direction("RocketHideout_B1F", TilePos{3, 4}).has_value() + ){ + return "Expected B2F's arrows and stops from pokefirered, and none on B1F."; + } + return true; +} + struct AutoStoryHideoutBodyInput{ std::string name; UnitTestResult (*body)(); @@ -186,6 +229,10 @@ const AutoStoryHideoutBodyCase HIDEOUT_BODY_CASES[] = { .input = {.name = "table steps on the sim", .body = test_steps_on_sim}, .expectation = {.description = "the poster opens the stairs; the lift lets out on the floor picked"}, }, + { + .input = {.name = "coded spinners", .body = test_coded_spinners}, + .expectation = {.description = "B2F's and B3F's arrows come from code, not the map"}, + }, }; const LiftCase LIFT_CASES[] = { diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryItemUse.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryItemUse.cpp index 1f0c4bdeb9..3bce9b0ae6 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryItemUse.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryItemUse.cpp @@ -111,9 +111,17 @@ ItemUseEnd renew_repel(Logger& logger, ItemUseActions& actions, std::string_view namespace{ -// The bag slides in, and ignores presses until it is done (as -// use_max_repel_from_bag()). -constexpr Milliseconds BAG_SLIDE_IN = 1000ms; +// The waits that worked on console B (2026-11-09, the Bicycle from Key +// Items: TEACHY TV, TM CASE, HELIX FOSSIL, FAME CHECKER, S.S. TICKET, +// BICYCLE; USE the first option, on the bike about 1.5 s after its A). +// The bag slides in, and ignores presses until it is done. +constexpr Milliseconds BAG_SLIDE_IN = 1500ms; +// A pocket switch (left or right), press and wait. +constexpr Milliseconds POCKET_TAP = 100ms; +constexpr Milliseconds POCKET_SWITCH_WAIT = 600ms; +// A cursor step in a pocket, press and wait: 250 ms in all. +constexpr Milliseconds CURSOR_TAP = 100ms; +constexpr Milliseconds CURSOR_WAIT = 150ms; // Out of the bag and its messages, or the Escape Rope's warp. constexpr Milliseconds BAG_CLOSE_TIMEOUT = 30000ms; @@ -130,10 +138,10 @@ bool ConsoleItemUseActions::open_pocket(BagPocket pocket){ pbf_wait(m_context, BAG_SLIDE_IN); // Left to the Items pocket, which doesn't wrap, then right to `pocket`. for (int c = 0; c < 3; c++){ - pbf_press_dpad(m_context, DPAD_LEFT, 100ms, 600ms); + pbf_press_dpad(m_context, DPAD_LEFT, POCKET_TAP, POCKET_SWITCH_WAIT); } for (int c = 0; c < (int)pocket; c++){ - pbf_press_dpad(m_context, DPAD_RIGHT, 100ms, 600ms); + pbf_press_dpad(m_context, DPAD_RIGHT, POCKET_TAP, POCKET_SWITCH_WAIT); } for (int c = 0; c < 20; c++){ pbf_press_dpad(m_context, DPAD_UP, 100ms, 100ms); @@ -152,7 +160,7 @@ std::vector ConsoleItemUseActions::read_pocket(){ void ConsoleItemUseActions::use_row(size_t row){ for (size_t c = 0; c < row; c++){ - pbf_press_dpad(m_context, DPAD_DOWN, 100ms, 300ms); + pbf_press_dpad(m_context, DPAD_DOWN, CURSOR_TAP, CURSOR_WAIT); } // The item's menu, USE on top. pbf_press_button(m_context, BUTTON_A, 160ms, 800ms); diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRooms.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRooms.cpp new file mode 100644 index 0000000000..52de05543b --- /dev/null +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRooms.cpp @@ -0,0 +1,91 @@ +/* AutoStory Scripted Rooms + * + * From: https://github.com/PokemonAutomation/ + * + */ + +#include "VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldWalk.h" +#include "PokemonFRLG_AutoStoryActions.h" +#include "PokemonFRLG_AutoStoryRooms.h" + +namespace PokemonAutomation{ +namespace NintendoSwitch{ +namespace PokemonFRLG{ + + +bool is_center_variant(std::string_view variant){ + return variant == CENTER_ENTER_VARIANT || variant == CENTER_EXIT_VARIANT; +} + +const std::vector& center_enter_legs(){ + static const std::vector LEGS{ + {Pokemon::Direction::NORTH, 1, true}, + {Pokemon::Direction::NORTH, 4, false}, + }; + return LEGS; +} +const std::vector& center_exit_legs(){ + static const std::vector LEGS{ + {Pokemon::Direction::SOUTH, 4, false}, + {Pokemon::Direction::SOUTH, 1, true}, + }; + return LEGS; +} +const std::vector& lift_in_legs(){ + static const std::vector LEGS{ + {Pokemon::Direction::NORTH, 1, true}, + {Pokemon::Direction::NORTH, 2, false}, + {Pokemon::Direction::WEST, 2, false}, + {Pokemon::Direction::NORTH, 0, false}, + }; + return LEGS; +} +const std::vector& lift_out_legs(){ + static const std::vector LEGS{ + {Pokemon::Direction::EAST, 2, false}, + {Pokemon::Direction::SOUTH, 2, false}, + {Pokemon::Direction::SOUTH, 1, true}, + }; + return LEGS; +} +const std::vector& center_legs(std::string_view variant){ + static const std::vector NONE; + if (variant == CENTER_ENTER_VARIANT){ + return center_enter_legs(); + } + if (variant == CENTER_EXIT_VARIANT){ + return center_exit_legs(); + } + return NONE; +} + + +void walk_room_legs( + ConsoleHandle& console, ProControllerContext& context, + const std::vector& legs, std::optional facing +){ + for (const RoomLeg& leg : legs){ + if (leg.tiles == 0){ + OverworldWalkSteps::turn_to(console, context, leg.direction); + facing = leg.direction; + continue; + } + for (int tile = 0; tile < leg.tiles; tile++){ + step_once(console, context, leg.direction, facing); + facing = leg.direction; + } + if (leg.warps){ + RouteStep step; + step.direction = leg.direction; + step.tiles = 1; + step.warps = true; + OverworldWalkSteps::wait_out_warp(console, context, step); + } + } +} + + + +} // namespace PokemonFRLG +} // namespace NintendoSwitch +} // namespace PokemonAutomation diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRooms.h b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRooms.h new file mode 100644 index 0000000000..ee5b3d9f91 --- /dev/null +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRooms.h @@ -0,0 +1,81 @@ +/* AutoStory Scripted Rooms + * + * From: https://github.com/PokemonAutomation/ + * + * Rooms the story walks by a fixed script of taps, not a planned route: + * every Pokemon Center's ground floor (one layout, so one script) and the + * Rocket Hideout's lift. Their tiles are coded (PokemonFRLG_CodedRooms.h), + * not mapped: the user's call, 2026-11-09 ("mostly the same"; "small area, + * high overhead, just script it"). + * + */ + +#ifndef PokemonAutomation_PokemonFRLG_AutoStoryRooms_H +#define PokemonAutomation_PokemonFRLG_AutoStoryRooms_H + +#include +#include +#include +#include +#include "Common/Cpp/TestRunners/UnitTestDatabase.h" +#include "NintendoSwitch/Controllers/Procon/NintendoSwitch_ProController.h" +#include "NintendoSwitch/NintendoSwitch_ConsoleHandle.h" +#include "Pokemon/Navigation/Pokemon_Grid.h" + +namespace PokemonAutomation{ +namespace NintendoSwitch{ +namespace PokemonFRLG{ + + +// The GAME step into a Pokemon Center: from the tile below its door, +// facing north, through the door onto the mat (CENTER_MAT) and up the +// nurse's column to below her counter (CENTER_NURSE_FRONT), facing her. +// The HEAL step after it talks to her. +inline const std::string CENTER_ENTER_VARIANT = "center_enter"; +// The GAME step out of a Pokemon Center: from below the nurse's counter +// down to the mat and out; the game walks the player a tile out of the +// door, onto the tile below it, facing south. +inline const std::string CENTER_EXIT_VARIANT = "center_exit"; +// Whether `variant` is one of the Center's steps. +bool is_center_variant(std::string_view variant); + +// A straight piece of a room's script: `tiles` steps `direction`, one +// tap a tile; none: a turn to face `direction`. `warps`: the last step +// takes a warp, whose fade is waited out. +struct RoomLeg{ + Pokemon::Direction direction = Pokemon::Direction::NORTH; + int tiles = 0; + bool warps = false; +}; +// Into a Center: north through the door, north 4 to the nurse. +const std::vector& center_enter_legs(); +// Out of a Center: south 4 to the mat, south through the door. +const std::vector& center_exit_legs(); +// Into the hideout's lift, from below a floor's lift door facing north: +// north through the door onto LIFT_ARRIVAL, north 2, west 2 to below the +// panel (LIFT_PANEL_FRONT), facing it. +const std::vector& lift_in_legs(); +// Out of the lift, from below the panel: east 2, south 2 onto the arrow +// warp, south through it, onto the floor picked's lift door. +const std::vector& lift_out_legs(); +// The legs of the Center's step `variant`; empty if it isn't one. +const std::vector& center_legs(std::string_view variant); + +// On the console: the legs, a step tap a tile (step_once()), each warp's +// fade waited out. `facing` is the way the player faces at the start, if +// known. +void walk_room_legs( + ConsoleHandle& console, ProControllerContext& context, + const std::vector& legs, std::optional facing +); + + +// Registers the scripted rooms' tests. +void add_tests_AutoStoryRooms(UnitTestDatabase& database); + + + +} // namespace PokemonFRLG +} // namespace NintendoSwitch +} // namespace PokemonAutomation +#endif diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRooms_Tests.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRooms_Tests.cpp new file mode 100644 index 0000000000..00884dc0b3 --- /dev/null +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRooms_Tests.cpp @@ -0,0 +1,125 @@ +/* AutoStory Scripted Rooms Tests + * + * From: https://github.com/PokemonAutomation/ + * + */ + +#include +#include +#include "Common/Cpp/TestRunners/UnitTest.h" +#include "VideoGames/PokemonFRLG/Overworld/PokemonFRLG_CodedRooms.h" +#include "VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldMaps.h" +#include "VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSim.h" +#include "PokemonFRLG_AutoStoryRooms.h" +#include "PokemonFRLG_AutoStoryRowSim.h" +#include "PokemonFRLG_AutoStoryTableSteps.h" + +namespace PokemonAutomation{ +namespace NintendoSwitch{ +namespace PokemonFRLG{ + + +namespace{ + +struct CenterInput{ + // The town or route whose Center it is. + std::string town; +}; +struct CenterExpectation{ + std::string center; +}; +struct CenterCase{ + CenterInput input; + CenterExpectation expectation; +}; + +// The Center's coded room has the tiles of its map in the lock. +std::string same_tiles(const std::string& center){ + const MapData mapped = load_map(center); + const MapData coded = pokemon_center_room(center, {}); + if (mapped.tiles.width != coded.tiles.width || mapped.tiles.height != coded.tiles.height){ + return center + ": the coded room is not the map's size."; + } + for (int y = 0; y < coded.tiles.height; y++){ + for (int x = 0; x < coded.tiles.width; x++){ + if (tile_at(mapped, TilePos{x, y}) != tile_at(coded, TilePos{x, y})){ + return center + ": the coded room differs at (" + std::to_string(x) + ", " + std::to_string(y) + ")."; + } + } + } + return ""; +} + +// On the sim, with the town's map and the Center's coded room: in from +// below the door to the nurse, out again to below the door. +std::string in_and_out(const std::string& town, const std::string& center){ + std::vector maps{load_map(town)}; + const std::optional added = add_pokemon_center_room(maps, 0); + if (added != center){ + return town + ": no door to " + center + "."; + } + const TilePos door = maps[0].points.at(center + "_door"); + const MapPosition below_door{town, door.next(Direction::SOUTH)}; + OverworldSim sim(maps, below_door, Direction::NORTH); + StoryPose at{town, below_door.point, Direction::NORTH}; + std::string failure = row_step_on_sim(sim, at, StoryTable::center_enter("to_nurse", center.c_str(), "test"), "test"); + if (!failure.empty()){ + return failure; + } + const Pokemon::Pose outside = StoryTable::at(town.c_str(), below_door.point.x, below_door.point.y, Direction::SOUTH); + failure = row_step_on_sim(sim, at, StoryTable::center_exit("out", outside, "test"), "test"); + if (!failure.empty()){ + return failure; + } + if (!sim.state().violations.empty()){ + return town + ": " + sim.state().violations.front(); + } + return ""; +} + +class Test_AutoStoryCenter : public UnitTest{ +public: + explicit Test_AutoStoryCenter(CenterCase test_case) + : UnitTest("PokemonFRLG::AutoStoryRooms - Center: " + test_case.expectation.center) + , m_case(std::move(test_case)) + {} + virtual UnitTestResult run(Logger&, CancellableScope&) const override{ + const std::string& center = m_case.expectation.center; + if (std::string failure = same_tiles(center); !failure.empty()){ + return failure; + } + if (std::string failure = in_and_out(m_case.input.town, center); !failure.empty()){ + return failure; + } + return true; + } + +private: + CenterCase m_case; +}; + +// The seven Centers in the map lock. +const CenterCase CENTER_CASES[] = { + {.input = {.town = "ViridianCity"}, .expectation = {.center = "ViridianCity_PokemonCenter_1F"}}, + {.input = {.town = "PewterCity"}, .expectation = {.center = "PewterCity_PokemonCenter_1F"}}, + {.input = {.town = "Route4"}, .expectation = {.center = "Route4_PokemonCenter_1F"}}, + {.input = {.town = "CeruleanCity"}, .expectation = {.center = "CeruleanCity_PokemonCenter_1F"}}, + {.input = {.town = "VermilionCity"}, .expectation = {.center = "VermilionCity_PokemonCenter_1F"}}, + {.input = {.town = "Route10"}, .expectation = {.center = "Route10_PokemonCenter_1F"}}, + {.input = {.town = "LavenderTown"}, .expectation = {.center = "LavenderTown_PokemonCenter_1F"}}, +}; + +} // namespace + + +void add_tests_AutoStoryRooms(UnitTestDatabase& database){ + for (const CenterCase& item : CENTER_CASES){ + database.add(item); + } +} + + + +} // namespace PokemonFRLG +} // namespace NintendoSwitch +} // namespace PokemonAutomation diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRowSim.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRowSim.cpp index 936d342526..089904ef6a 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRowSim.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRowSim.cpp @@ -15,7 +15,9 @@ #include "Pokemon/AutoStory/Pokemon_TilePose.h" #include "PokemonFRLG_AutoStoryActions.h" #include "PokemonFRLG_AutoStoryBattleDecisions.h" +#include "VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldWalk.h" #include "PokemonFRLG_AutoStoryHideout.h" +#include "PokemonFRLG_AutoStoryRooms.h" #include "PokemonFRLG_AutoStoryRowSim.h" namespace PokemonAutomation{ @@ -522,9 +524,30 @@ std::string OverworldStepSim::cut(const StoryStep& step){ return ""; } -// A Rocket Hideout GAME step on the sim: the poster's switch, or the -// lift's floor (SimScript::lift_floors, rows as on the panel); any other -// GAME step is stubbed. +namespace{ + +// walk_room_legs() on the sim: a step tap a tile, each warp's fade and +// the walk out of a door waited out. +void sim_walk_room_legs(OverworldSim& sim, const std::vector& legs){ + for (const RoomLeg& leg : legs){ + if (leg.tiles == 0){ + sim_turn_to(sim, leg.direction); + continue; + } + for (int tile = 0; tile < leg.tiles; tile++){ + sim_step_once(sim, leg.direction); + } + if (leg.warps){ + sim.watch({}, OverworldWalkSteps::AFTER_WARP); + } + } +} + +} // namespace + +// A scripted GAME step on the sim: the poster's switch, the lift's ride +// (its room coded, SimScript::lift_floors, rows as on the panel), or a +// Pokemon Center's way in or out; any other GAME step is stubbed. Pokemon::StoryAction OverworldStepSim::hideout_or_stub(){ Pokemon::StoryAction stub = m_stubs.stub(); Pokemon::StoryAction sim = played([this](RunState&, const StoryStep& step){ @@ -532,7 +555,9 @@ Pokemon::StoryAction OverworldStepSim::hideout_or_stub(){ return failure.empty() ? Pokemon::outcome_ok() : Pokemon::outcome_failed("sim_failure", failure); }); sim.act = [stub, played_act = sim.act](RunState& state, const StoryStep& step){ - return is_hideout_variant(step.variant) ? played_act(state, step) : stub.act(state, step); + return is_hideout_variant(step.variant) || is_center_variant(step.variant) + ? played_act(state, step) + : stub.act(state, step); }; sim.needs_console = stub.needs_console; return sim; @@ -542,10 +567,34 @@ std::string OverworldStepSim::hideout(const StoryStep& step){ if (step.variant == POSTER_SWITCH_VARIANT){ return m_sim.use_field(SimField::POSTER_SWITCH) ? "" : "no poster ahead."; } + if (is_center_variant(step.variant)){ + sim_walk_room_legs(m_sim, center_legs(step.variant)); + return ended_on(step); + } const std::optional ride = parse_lift_floor_variant(step.variant); - if (!ride || !m_sim.use_field(SimField::LIFT_FLOOR, ride->to)){ + if (!ride){ + return "no lift ride \"" + step.variant + "\"."; + } + sim_walk_room_legs(m_sim, lift_in_legs()); + if (!m_sim.use_field(SimField::LIFT_FLOOR, ride->to)){ return "no lift panel for \"" + step.variant + "\"."; } + sim_walk_room_legs(m_sim, lift_out_legs()); + return ended_on(step); +} + +// After a scripted step: the player's pose, and whether it is the step's +// pose_after, if it has one. +std::string OverworldStepSim::ended_on(const StoryStep& step){ + const SimState& state = m_sim.state(); + m_at = StoryPose{state.position.map, state.position.point, state.facing}; + if (!step.pose_after){ + return ""; + } + const std::optional expected = story_pose(*step.pose_after); + if (!expected || !(MapPosition{expected->map, expected->tile} == state.position)){ + return "expected to end on " + (expected ? to_string(MapPosition{expected->map, expected->tile}) : std::string("a pose")) + "."; + } return ""; } diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRowSim.h b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRowSim.h index aa36f4f023..401b5b9b34 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRowSim.h +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRowSim.h @@ -185,6 +185,7 @@ class OverworldStepSim : public Pokemon::TableExecutor{ std::string battle(const StoryStep& step); Pokemon::StoryAction hideout_or_stub(); std::string hideout(const StoryStep& step); + std::string ended_on(const StoryStep& step); OverworldSim& m_sim; StoryPose m_at; diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryStepTable_Tests.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryStepTable_Tests.cpp index 8eeb70211c..c61f6c10ce 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryStepTable_Tests.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryStepTable_Tests.cpp @@ -20,6 +20,7 @@ #include "PokemonFRLG_AutoStoryStepTable.h" #include "PokemonFRLG_AutoStoryEvents.h" #include "PokemonFRLG_AutoStoryHideout.h" +#include "PokemonFRLG_AutoStoryRooms.h" #include "PokemonFRLG_AutoStoryItemUse.h" #include "PokemonFRLG_AutoStoryTable.h" #include "PokemonFRLG_AutoStoryTrashCans.h" @@ -253,6 +254,7 @@ void add_tests_AutoStoryStepTable(UnitTestDatabase& database){ add_tests_AutoStoryStepInterrupts(database); // The GAME variants with logic of their own. add_tests_AutoStoryHideout(database); + add_tests_AutoStoryRooms(database); add_tests_AutoStoryItemUse(database); } diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryTableSteps.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryTableSteps.cpp index 81140d3520..70d3a2b8f0 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryTableSteps.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryTableSteps.cpp @@ -4,8 +4,10 @@ * */ +#include "VideoGames/PokemonFRLG/Overworld/PokemonFRLG_CodedRooms.h" #include "PokemonFRLG_AutoStoryHideout.h" #include "PokemonFRLG_AutoStoryItemUse.h" +#include "PokemonFRLG_AutoStoryRooms.h" #include "PokemonFRLG_AutoStoryTableSteps.h" namespace PokemonAutomation{ @@ -165,6 +167,24 @@ StoryStep poster_switch(std::string name, std::string why){ StoryStep lift_floor(std::string name, std::string_view from, std::string_view to, std::string why){ StoryStep step = make(StoryStepKind::GAME, std::move(name), std::move(why)); step.variant = lift_floor_variant(from, to); + if (const std::optional ride = parse_lift_floor_variant(step.variant)){ + const MapPosition& door = rocket_hideout_lift_doors()[ride->to]; + step.pose_after = to_pose(StoryPose{door.map, door.point, Direction::SOUTH}); + } + return step; +} + +StoryStep center_enter(std::string name, const char* center, std::string why){ + StoryStep step = make(StoryStepKind::GAME, std::move(name), std::move(why)); + step.variant = CENTER_ENTER_VARIANT; + step.pose_after = at(center, CENTER_NURSE_FRONT.x, CENTER_NURSE_FRONT.y, Direction::NORTH); + return step; +} + +StoryStep center_exit(std::string name, Pokemon::Pose below_door, std::string why){ + StoryStep step = make(StoryStepKind::GAME, std::move(name), std::move(why)); + step.variant = CENTER_EXIT_VARIANT; + step.pose_after = std::move(below_door); return step; } diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryTableSteps.h b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryTableSteps.h index 0e28ad3048..8729198d44 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryTableSteps.h +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryTableSteps.h @@ -186,9 +186,17 @@ StoryStep cut_tree(std::string name, Pokemon::Pose tree, std::string why); // Pushes the switch behind the Game Corner's poster the player faces // (POSTER_SWITCH_VARIANT). StoryStep poster_switch(std::string name, std::string why); -// Rides the Rocket Hideout's lift, the player facing its panel, from the -// floor it stands at to `to` (lift_floor_variant()): "B1F", "B2F", "B4F". +// Rides the Rocket Hideout's lift from the floor it stands at to `to` +// (lift_floor_variant()): "B1F", "B2F", "B4F". The player starts below +// `from`'s lift door, facing north, and ends on `to`'s, facing south. StoryStep lift_floor(std::string name, std::string_view from, std::string_view to, std::string why); +// Into the Pokemon Center `center` (a map name) from below its door, +// facing north, to below the nurse's counter (CENTER_ENTER_VARIANT): the +// same script in every Center, with no map of its rooms. +StoryStep center_enter(std::string name, const char* center, std::string why); +// Out of the Center from below the nurse's counter (CENTER_EXIT_VARIANT) +// to `below_door`, the tile below its door outside, facing south. +StoryStep center_exit(std::string name, Pokemon::Pose below_door, std::string why); // Uses `item` from the bag on the overworld (use_item_variant()): a // Repel, or an Escape Rope, which leaves the player on `pose_after`. StoryStep use_item(std::string name, std::string_view item, std::string why, std::optional pose_after = std::nullopt); diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/Draft/README.md b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/Draft/README.md index 532ef68bfa..0d23b8ff91 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/Draft/README.md +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/Draft/README.md @@ -37,8 +37,8 @@ of the hideout after Giovanni (00.32), which puts the player at the Game Corner's door, CeladonCity (34, 22) (pokefirered `UpdateEscapeWarp()`: the last outdoor door, a tile south). The Rocket Hideout has no wild Pokemon (`wild_encounters.json` lists none of its floors), so no Repel is used there. -The BICYCLE (00.26) is ridden on Route 8's open legs (`bike`); it is -`BIKE_TILE_TIME`, an estimate from the decompilation, until measured. +The BICYCLE (00.26) is ridden on Route 8's open legs (`bike`) at +`BIKE_TILE_TIME`, 112 ms a tile, measured on console B (2026-11-09). ## The maps each draft needs @@ -57,27 +57,45 @@ or neither: | UndergroundPath_WestEntrance | 00.30 | candidate | | Route7 | 00.30 | candidate | | CeladonCity | 00.30 to 00.32 | candidate | -| CeladonCity_PokemonCenter_1F | 00.30, 00.31 | missing | | CeladonCity_GameCorner | 00.31, 00.32 | candidate | | RocketHideout_B1F | 00.31, 00.32 | candidate | | RocketHideout_B2F | 00.31, 00.32 | candidate | | RocketHideout_B3F | 00.31 | candidate | | RocketHideout_B4F | 00.31, 00.32 | candidate | -| RocketHideout_Elevator | 00.32 | missing | - -Beyond publishing (a PokemonSimulation publish and a lock bump, which need the -user's approval), the code added for these drafts reads three things the -candidate maps don't carry yet: - -- B2F's and B3F's spinner tiles as regions `spin_north`, `spin_south`, - `spin_west`, `spin_east` and `spin_stop` (pokefirered `MB_SPIN_*`, - `MB_STOP_SPINNING`; `spin_slide()` in PokemonFRLG_OverworldMap.h); -- the Game Corner's poster as an object `poster` at (11, 1), and its stairs - (16..17, 2..3) as objects `poster_stairs`, which the switch removes - (`SimField::POSTER_SWITCH`); -- the lift's floors: its door is a dynamic warp (`setdynamicwarp`), so the sim - is told where each floor lets out (`SimScript::lift_floors`: B1F (24, 25), - B2F (28, 16), B4F (20, 23)) and the planner can't route through it yet. + +### Scripted, not mapped + +Pokemon Centers and the hideout's lift have no maps (the user's call, +2026-11-09): every Center's ground floor shares pokefirered's +`LAYOUT_POKEMON_CENTER_1F`, and the lift is 5 by 7 tiles. The seven Centers in +the map lock have the same tiles; they differ only in the people standing in +them, none on the nurse's column (x 7). So the story walks both by a fixed +script (`PokemonFRLG_AutoStoryRooms.h`), and the sim builds their rooms from +code (`PokemonFRLG_CodedRooms.h`): + +- `center_enter`: from below the Center's door, facing north, through the door + onto the mat (7, 8) and north 4 to below the nurse (7, 4); `heal` follows. + `center_exit`: south 4 and out; the game walks the player back onto the tile + below the door. 00.30 and 00.31 use them for Lavender's and Celadon's + Centers; no `CeladonCity_PokemonCenter_1F` map is needed. +- `lift_floor `: from below `from`'s lift door, facing north: in + onto (2, 5), north 2, west 2 to below the panel (0, 2), the floor picked, + east 2, south 2 and south through the arrow warp onto `to`'s lift door + (`setdynamicwarp`: B1F (24, 25), B2F (28, 16), B4F (20, 23)). No + `RocketHideout_Elevator` map is needed. + +The two other things the candidate maps can't say in glyphs are coded too, +from pokefirered, so the maps need no extra regions or objects: + +- B2F's and B3F's spinner tiles (`MB_SPIN_*`, `MB_STOP_SPINNING` from the + floors' `map.bin` and the tilesets' metatile attributes; + `coded_spin_direction()`); +- the Game Corner's poster at (11, 1) and the tiles its switch turns into + stairs, (15, 2) and (16..17, 2..3) (`OpenRocketHideout`'s `setmetatile`), + added to the sim's Game Corner by `add_coded_objects()`. + +Beyond those, the drafts need a PokemonSimulation publish and a lock bump for +the candidate maps above, which need the user's approval. `STORY_TRAINERS` names the battles these drafts fight: CeladonCity_GameCorner `rocket_grunt` (GRUNT_7), and on RocketHideout_B4F `lift_key_grunt` (GRUNT_18), @@ -103,6 +121,7 @@ drafts become table rows, their battle steps take those names. format can't yet say `handoff`/`live_start` as 00.12/00.12b do in C++. - `game_action` variants the C++ executor now has (no console run yet): `poster_switch`, `lift_floor ` (PokemonFRLG_AutoStoryHideout.h), + `center_enter`, `center_exit` (PokemonFRLG_AutoStoryRooms.h), `use_item ` and `ride_bike` (PokemonFRLG_AutoStoryItemUse.h), and the `bike` route variant. Variants that no executor has yet: `party_room`, `gift_rng`, `use_item rare-candy @@ -140,10 +159,13 @@ the Elite Four rooms' arrival points (e.g. Lorelei's `warp_0` (6, 12)) are wall tiles, and Indigo Plateau's door glyph is at (11, 5) with its warp at (11, 6). +The `*_nurse` legs below (drafts on #303) need no Center maps once they become +`center_enter` steps, as 00.30's has. + | Skipped leg | Why | |---|---| | 00.32/b2f_lift | B2F's lift corner is reached over arrow tiles: the planner solves them now, but the candidate map has no `spin_*` regions | -| 00.32/b4f_below_guards | RocketHideout_Elevator map not in source-candidate | +| 00.32/b4f_below_guards | planned before the lift was scripted; it now starts on B4F's lift door (20, 23) | | 00.32/x_item_clerk | CeladonCity_DepartmentStore_Elevator map not in source-candidate | | 00.32/route16_below_tree | CeladonCity_DepartmentStore_Elevator map not in source-candidate | | 00.32/celadon_nurse | map not in source-candidate | diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/Draft/frlg-00.30.plan.json b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/Draft/frlg-00.30.plan.json index 4e01206a12..6ccbd8d610 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/Draft/frlg-00.30.plan.json +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/Draft/frlg-00.30.plan.json @@ -6,12 +6,19 @@ "title": "Lavender Mart, then west over Route 8: Gamer Rich, a Pidgey for Fly, the Underground Path to Celadon", "start": {"certainty": "tile", "map": "LavenderTown_PokemonCenter_1F", "where": {"facing": "north", "kind": "tiles", "tiles": [[7, 4]]}}, "events": [ + { + "id": "out_of_lavender_center", + "kind": "game_action", + "declared_after": {"certainty": "tile", "map": "LavenderTown", "where": {"facing": "south", "kind": "tiles", "tiles": [[6, 6]]}}, + "variant": "center_exit", + "why": "the Center script out: south to the mat and out of the door (6, 5)" + }, { "id": "lavender_mart_clerk", "kind": "route", "target": {"certainty": "tile", "map": "LavenderTown_Mart", "where": {"facing": "west", "kind": "tiles", "tiles": [[4, 3]]}}, "variant": "run", - "why": "out of the Center, east along row 6 and down to the Mart (20, 15), to its clerk" + "why": "east along row 6 and down to the Mart (20, 15), to its clerk" }, { "id": "buy_ropes_and_super_repels", @@ -87,10 +94,10 @@ }, { "id": "celadon_nurse", - "kind": "route", - "target": {"certainty": "tile", "map": "CeladonCity_PokemonCenter_1F", "where": {"facing": "north", "kind": "tiles", "tiles": [[7, 4]]}}, - "variant": "run", - "why": "into the Center, to the nurse" + "kind": "game_action", + "declared_after": {"certainty": "tile", "map": "CeladonCity_PokemonCenter_1F", "where": {"facing": "north", "kind": "tiles", "tiles": [[7, 4]]}}, + "variant": "center_enter", + "why": "the Center script in: through the door and up to the nurse; no map of the Center" }, { "id": "heal_celadon", diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/Draft/frlg-00.31.plan.json b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/Draft/frlg-00.31.plan.json index bef003ddb2..39dd599fd8 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/Draft/frlg-00.31.plan.json +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/Draft/frlg-00.31.plan.json @@ -6,12 +6,19 @@ "title": "Celadon Game Corner and the Rocket Hideout down to B4F: the poster guard, the Lift Key Grunt, the LIFT KEY and B3F's Rare Candy", "start": {"certainty": "tile", "map": "CeladonCity_PokemonCenter_1F", "where": {"facing": "north", "kind": "tiles", "tiles": [[7, 4]]}}, "events": [ + { + "id": "out_of_celadon_center", + "kind": "game_action", + "declared_after": {"certainty": "tile", "map": "CeladonCity", "where": {"facing": "south", "kind": "tiles", "tiles": [[48, 12]]}}, + "variant": "center_exit", + "why": "the Center script out: south to the mat and out of the door (48, 11)" + }, { "id": "celadon_below_game_corner", "kind": "route", "target": {"certainty": "tile", "map": "CeladonCity", "where": {"facing": "north", "kind": "tiles", "tiles": [[34, 22]]}}, "variant": "run", - "why": "out of the Center, west along row 12, down column 41..43 to row 22, west to below the Game Corner (34, 21)" + "why": "west along row 12, down column 41..43 to row 22, west to below the Game Corner (34, 21)" }, { "id": "below_poster_guard", diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/Draft/frlg-00.32.plan.json b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/Draft/frlg-00.32.plan.json index 4351f396c4..d5170089d4 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/Draft/frlg-00.32.plan.json +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/Draft/frlg-00.32.plan.json @@ -16,15 +16,16 @@ { "id": "lift_to_b4f", "kind": "game_action", + "declared_after": {"certainty": "tile", "map": "RocketHideout_B4F", "where": {"facing": "south", "kind": "tiles", "tiles": [[20, 23]]}}, "variant": "lift_floor B2F B4F", - "why": "the LIFT KEY works the lift: B4F" + "why": "the lift script: in through the door (28, 16), to the panel, B4F with the LIFT KEY, out onto B4F's lift door; no map of the lift" }, { "id": "b4f_below_guards", "kind": "route", "target": {"certainty": "tile", "map": "RocketHideout_B4F", "where": {"facing": "north", "kind": "tiles", "tiles": [[17, 16]]}}, "variant": "run", - "why": "out of the lift to below the two Grunts (16, 14) and (19, 14)" + "why": "from the lift door to below the two Grunts (16, 14) and (19, 14)" }, { "id": "talk_left_guard", diff --git a/SerialPrograms/cmake/SourceFiles.cmake b/SerialPrograms/cmake/SourceFiles.cmake index 3b38e8424d..35375a29ec 100644 --- a/SerialPrograms/cmake/SourceFiles.cmake +++ b/SerialPrograms/cmake/SourceFiles.cmake @@ -1846,6 +1846,8 @@ file(GLOB LIBRARY_SOURCES Source/VideoGames/PokemonFRLG/Inference/Sounds/PokemonFRLG_CatchFanfareDetector.h Source/VideoGames/PokemonFRLG/Inference/Sounds/PokemonFRLG_ShinySoundDetector.cpp Source/VideoGames/PokemonFRLG/Inference/Sounds/PokemonFRLG_ShinySoundDetector.h + Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_CodedRooms.cpp + Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_CodedRooms.h Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_MovementMechanics.h Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldLateBattle.cpp Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldLateBattle.h @@ -1951,6 +1953,9 @@ file(GLOB LIBRARY_SOURCES Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRngLoop_Tests.cpp Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRngOptions.cpp Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRngOptions.h + Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRooms.cpp + Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRooms.h + Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRooms_Tests.cpp Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRowSim.cpp Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRowSim.h Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRunPlan_Tests.cpp From 69272083fd773778d053bc4f29b9c4f88f87cdd3 Mon Sep 17 00:00:00 2001 From: dayfine Date: Mon, 9 Nov 2026 18:26:40 -0800 Subject: [PATCH 11/79] FRLG AutoStory: every story checkpoint as an authored JSON plan The authored checkpoint format gains what the FRLG table uses: sections (each event logged with its section), notes on checkpoints, sections and events, once_per_save, and FRLG execution fields for supplies, live start and handoff. Variants are checked against what FRLG's executor does. StoryData/frlg-.plan.json is each C++ row exported once (the export test), split into sections, with the table's design comments as notes. Tests compare every JSON row with its C++ row and the whole story's sim trace with the C++ table's and a golden copy of it. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss --- .../Pokemon/AutoStory/Pokemon_StoryEvents.cpp | 12 +- .../Pokemon/AutoStory/Pokemon_StoryEvents.h | 9 +- .../AutoStory/Pokemon_StoryStepJson.cpp | 107 +- .../Pokemon/AutoStory/Pokemon_StorySteps.cpp | 34 +- .../Pokemon/AutoStory/Pokemon_StorySteps.h | 21 + .../AutoStory/Data/AuthoredStory_Tests.cpp | 222 +++ .../AutoStory/Data/AuthoredStory_Tests.h | 30 + .../Programs/AutoStory/Data/JsonParser.cpp | 190 ++- .../Programs/AutoStory/Data/JsonParser.h | 9 + .../Programs/AutoStory/Data/Json_Tests.cpp | 2 + .../AutoStory/PokemonFRLG_AutoStoryEvents.cpp | 4 + .../ReplayData/frlg-story-sim-trace.json | 1208 +++++++++++++++++ .../AutoStory/StoryData/frlg-00.01.plan.json | 31 + .../AutoStory/StoryData/frlg-00.01b.plan.json | 33 + .../AutoStory/StoryData/frlg-00.02.plan.json | 24 + .../AutoStory/StoryData/frlg-00.03.plan.json | 39 + .../AutoStory/StoryData/frlg-00.04.plan.json | 27 + .../AutoStory/StoryData/frlg-00.04b.plan.json | 68 + .../AutoStory/StoryData/frlg-00.06.plan.json | 35 + .../AutoStory/StoryData/frlg-00.07.plan.json | 101 ++ .../AutoStory/StoryData/frlg-00.08.plan.json | 78 ++ .../AutoStory/StoryData/frlg-00.09.plan.json | 74 + .../AutoStory/StoryData/frlg-00.10.plan.json | 51 + .../AutoStory/StoryData/frlg-00.11.plan.json | 128 ++ .../AutoStory/StoryData/frlg-00.12.plan.json | 43 + .../AutoStory/StoryData/frlg-00.12b.plan.json | 28 + .../AutoStory/StoryData/frlg-00.12c.plan.json | 34 + .../AutoStory/StoryData/frlg-00.13.plan.json | 189 +++ .../AutoStory/StoryData/frlg-00.14.plan.json | 96 ++ .../AutoStory/StoryData/frlg-00.14b.plan.json | 96 ++ .../AutoStory/StoryData/frlg-00.14c.plan.json | 71 + .../AutoStory/StoryData/frlg-00.15.plan.json | 93 ++ .../AutoStory/StoryData/frlg-00.15b.plan.json | 40 + .../AutoStory/StoryData/frlg-00.16.plan.json | 173 +++ .../AutoStory/StoryData/frlg-00.17.plan.json | 146 ++ .../AutoStory/StoryData/frlg-00.18.plan.json | 112 ++ .../AutoStory/StoryData/frlg-00.19.plan.json | 47 + .../AutoStory/StoryData/frlg-00.20.plan.json | 75 + .../AutoStory/StoryData/frlg-00.21.plan.json | 94 ++ .../AutoStory/StoryData/frlg-00.22.plan.json | 160 +++ .../AutoStory/StoryData/frlg-00.23.plan.json | 178 +++ .../AutoStory/StoryData/frlg-00.24.plan.json | 115 ++ .../AutoStory/StoryData/frlg-00.25.plan.json | 72 + .../AutoStory/StoryData/frlg-00.26.plan.json | 156 +++ .../AutoStory/StoryData/frlg-00.27.plan.json | 202 +++ .../AutoStory/StoryData/frlg-00.28.plan.json | 355 +++++ .../AutoStory/StoryData/frlg-00.29.plan.json | 70 + SerialPrograms/cmake/SourceFiles.cmake | 2 + 48 files changed, 5158 insertions(+), 26 deletions(-) create mode 100644 SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/Data/AuthoredStory_Tests.cpp create mode 100644 SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/Data/AuthoredStory_Tests.h create mode 100644 SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/ReplayData/frlg-story-sim-trace.json create mode 100644 SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.01.plan.json create mode 100644 SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.01b.plan.json create mode 100644 SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.02.plan.json create mode 100644 SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.03.plan.json create mode 100644 SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.04.plan.json create mode 100644 SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.04b.plan.json create mode 100644 SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.06.plan.json create mode 100644 SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.07.plan.json create mode 100644 SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.08.plan.json create mode 100644 SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.09.plan.json create mode 100644 SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.10.plan.json create mode 100644 SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.11.plan.json create mode 100644 SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.12.plan.json create mode 100644 SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.12b.plan.json create mode 100644 SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.12c.plan.json create mode 100644 SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.13.plan.json create mode 100644 SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.14.plan.json create mode 100644 SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.14b.plan.json create mode 100644 SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.14c.plan.json create mode 100644 SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.15.plan.json create mode 100644 SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.15b.plan.json create mode 100644 SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.16.plan.json create mode 100644 SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.17.plan.json create mode 100644 SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.18.plan.json create mode 100644 SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.19.plan.json create mode 100644 SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.20.plan.json create mode 100644 SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.21.plan.json create mode 100644 SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.22.plan.json create mode 100644 SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.23.plan.json create mode 100644 SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.24.plan.json create mode 100644 SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.25.plan.json create mode 100644 SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.26.plan.json create mode 100644 SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.27.plan.json create mode 100644 SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.28.plan.json create mode 100644 SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.29.plan.json diff --git a/SerialPrograms/Source/Pokemon/AutoStory/Pokemon_StoryEvents.cpp b/SerialPrograms/Source/Pokemon/AutoStory/Pokemon_StoryEvents.cpp index ad22d7a6a7..75914a491b 100644 --- a/SerialPrograms/Source/Pokemon/AutoStory/Pokemon_StoryEvents.cpp +++ b/SerialPrograms/Source/Pokemon/AutoStory/Pokemon_StoryEvents.cpp @@ -111,8 +111,14 @@ const char* recovery_name(RecoveryKind kind){ } -std::string event_log_line(const std::string& checkpoint, size_t number, const std::string& event, const std::string& status){ - return std::format("[Event] {}/{} {}: {}", checkpoint, number, event, status); +std::string event_log_line( + const std::string& checkpoint, size_t number, const std::string& event, const std::string& status, + const std::string& section +){ + if (section.empty()){ + return std::format("[Event] {}/{} {}: {}", checkpoint, number, event, status); + } + return std::format("[Event] {}/{} [{}] {}: {}", checkpoint, number, section, event, status); } @@ -198,7 +204,7 @@ struct EventRun{ }; void log_status(EventRun& run, const std::string& status){ - run.log(event_log_line(run.checkpoint.id, run.number, run.event.name, status)); + run.log(event_log_line(run.checkpoint.id, run.number, run.event.name, status, run.event.section)); } diff --git a/SerialPrograms/Source/Pokemon/AutoStory/Pokemon_StoryEvents.h b/SerialPrograms/Source/Pokemon/AutoStory/Pokemon_StoryEvents.h index 388ce48b03..739b817f6f 100644 --- a/SerialPrograms/Source/Pokemon/AutoStory/Pokemon_StoryEvents.h +++ b/SerialPrograms/Source/Pokemon/AutoStory/Pokemon_StoryEvents.h @@ -165,6 +165,8 @@ struct Recovery{ struct Event{ std::string name; std::string why; + // The checkpoint's section the event is in, for the log; may be empty. + std::string section; // Skipped when all of these hold (and there is at least one). std::vector skip_if; // Must hold before `act`; a failure is "require_failed". @@ -240,7 +242,12 @@ using EventLogger = MoveOnlyFunction; // One log line, in a format the lab watcher parses: // [Event] 00.04/3 talk_mom: start // [Event] 00.04/3 talk_mom: failed: expect_failed: has_parcel -std::string event_log_line(const std::string& checkpoint, size_t number, const std::string& event, const std::string& status); +// An event in a section names it before the event: +// [Event] 00.28/12 [b1f_east] winston_line: start +std::string event_log_line( + const std::string& checkpoint, size_t number, const std::string& event, const std::string& status, + const std::string& section = "" +); // Problems an author should fix before running: unnamed or empty events, // missing actions, recoveries out of escalation order. diff --git a/SerialPrograms/Source/Pokemon/AutoStory/Pokemon_StoryStepJson.cpp b/SerialPrograms/Source/Pokemon/AutoStory/Pokemon_StoryStepJson.cpp index 3ee2f51f6d..f433f9ec90 100644 --- a/SerialPrograms/Source/Pokemon/AutoStory/Pokemon_StoryStepJson.cpp +++ b/SerialPrograms/Source/Pokemon/AutoStory/Pokemon_StoryStepJson.cpp @@ -275,12 +275,18 @@ JsonValue story_step_json(const StoryStep& step){ if (step.pose_after){ result["declared_after"] = story_pose_json(*step.pose_after); } + if (step.once_per_save){ + result["once_per_save"] = true; + } + if (!step.notes.empty()){ + result["notes"] = strings_json(step.notes); + } return result; } StoryStep read_story_step(const JsonValue& value, std::string_view source){ const JsonObject& root = fields(value, {"id", "kind", "why", "target", "direction", "legs", "fight_wild", "yes", - "may_lose", "battles", "items", "variant", "skip_if", "declared_after"}, source); + "may_lose", "battles", "items", "variant", "skip_if", "declared_after", "once_per_save", "notes"}, source); StoryStep result; result.name = root.get_string_throw("id"); if (result.name.empty()){ @@ -312,26 +318,80 @@ StoryStep read_story_step(const JsonValue& value, std::string_view source){ if (const JsonValue* field = root.get_value("declared_after")){ result.pose_after = read_story_pose(*field, source); } + if (const JsonValue* field = root.get_value("once_per_save")){ + result.once_per_save = field->to_boolean_throw(); + } + if (const JsonValue* field = root.get_value("notes")){ + result.notes = read_strings(*field, source); + } + return result; +} + +namespace{ + +JsonArray events_json(const std::vector& steps, const std::string& section){ + JsonArray result; + for (const StoryStep& step : steps){ + if (step.section == section){ + result.push_back(story_step_json(step)); + } + } + return result; +} + +JsonArray sections_json(const StoryCheckpoint& checkpoint){ + JsonArray result; + for (const StorySection& section : checkpoint.sections){ + JsonObject item; + item["id"] = section.id; + item["title"] = section.title; + if (!section.notes.empty()){ + item["notes"] = strings_json(section.notes); + } + item["events"] = events_json(checkpoint.steps, section.id); + result.push_back(std::move(item)); + } return result; } +// `events` read into `checkpoint`'s steps, in `section`, each id unique +// across the checkpoint (`names`). +void read_events( + StoryCheckpoint& checkpoint, std::set& names, + const JsonValue& events, const std::string& section, std::string_view source +){ + for (const JsonValue& event : events.to_array_throw(std::string(source))){ + StoryStep step = read_story_step(event, source); + if (step.name.empty() || !names.insert(step.name).second){ + throw ParseException("Empty or duplicate story event id."); + } + step.section = section; + checkpoint.steps.push_back(std::move(step)); + } +} + +} // namespace + JsonValue story_checkpoint_json(const StoryCheckpoint& checkpoint){ JsonObject result; result["id"] = checkpoint.id; result["title"] = checkpoint.title; + if (!checkpoint.notes.empty()){ + result["notes"] = strings_json(checkpoint.notes); + } if (checkpoint.start){ result["start"] = story_pose_json(*checkpoint.start); } - JsonArray events; - for (const StoryStep& step : checkpoint.steps){ - events.push_back(story_step_json(step)); + if (checkpoint.sections.empty()){ + result["events"] = events_json(checkpoint.steps, ""); + }else{ + result["sections"] = sections_json(checkpoint); } - result["events"] = std::move(events); return result; } StoryCheckpoint read_story_checkpoint(const JsonValue& value, std::string_view source){ - const JsonObject& root = fields(value, {"id", "title", "start", "events"}, source); + const JsonObject& root = fields(value, {"id", "title", "notes", "start", "events", "sections"}, source); StoryCheckpoint result; result.id = root.get_string_throw("id"); if (result.id.empty()){ @@ -341,13 +401,38 @@ StoryCheckpoint read_story_checkpoint(const JsonValue& value, std::string_view s if (const JsonValue* start = root.get_value("start")){ result.start = read_story_pose(*start, source); } + if (const JsonValue* notes = root.get_value("notes")){ + result.notes = read_strings(*notes, source); + } + const JsonValue* events = root.get_value("events"); + const JsonValue* sections = root.get_value("sections"); + if ((events == nullptr) == (sections == nullptr)){ + throw ParseException(std::format("{}: a checkpoint has events or sections, not both or neither.", source)); + } std::set names; - for (const JsonValue& event : root.get_array_throw("events")){ - StoryStep step = read_story_step(event, source); - if (step.name.empty() || !names.insert(step.name).second){ - throw ParseException("Empty or duplicate story event id."); + if (events){ + read_events(result, names, *events, "", source); + return result; + } + std::set section_ids; + for (const JsonValue& item : sections->to_array_throw(std::string(source))){ + const JsonObject& section = fields(item, {"id", "title", "notes", "events"}, source); + StorySection header{.id = section.get_string_throw("id"), .title = section.get_string_throw("title"), .notes = {}}; + if (header.id.empty() || !section_ids.insert(header.id).second){ + throw ParseException(std::format("{}: empty or duplicate section id.", source)); + } + if (const JsonValue* notes = section.get_value("notes")){ + header.notes = read_strings(*notes, source); } - result.steps.push_back(std::move(step)); + const size_t before = result.steps.size(); + read_events(result, names, section.get_value_throw("events"), header.id, source); + if (result.steps.size() == before){ + throw ParseException(std::format("{}: section {} has no events.", source, header.id)); + } + result.sections.push_back(std::move(header)); + } + if (result.sections.empty()){ + throw ParseException(std::format("{}: no sections.", source)); } return result; } diff --git a/SerialPrograms/Source/Pokemon/AutoStory/Pokemon_StorySteps.cpp b/SerialPrograms/Source/Pokemon/AutoStory/Pokemon_StorySteps.cpp index 3004ba6013..2e3d19b5d9 100644 --- a/SerialPrograms/Source/Pokemon/AutoStory/Pokemon_StorySteps.cpp +++ b/SerialPrograms/Source/Pokemon/AutoStory/Pokemon_StorySteps.cpp @@ -163,6 +163,7 @@ Event story_event(const StoryStep& step, StoryStepExecutor& executor){ Event event; event.name = step.name; event.why = step.why; + event.section = step.section; for (const std::string& name : step.skip_if){ event.skip_if.push_back(condition(name, [&executor, name](RunState& state){ return executor.holds(name, state); @@ -267,8 +268,39 @@ std::string missing_field(const StoryStep& step){ } // namespace -std::vector lint_story_checkpoint(const StoryCheckpoint& data){ +namespace{ + +// With sections, each step's names one, in the sections' order, and every +// section has a step. +std::vector section_problems(const StoryCheckpoint& data){ std::vector problems; + if (data.sections.empty()){ + return problems; + } + size_t at = 0; + std::vector used(data.sections.size(), false); + for (const StoryStep& step : data.steps){ + while (at < data.sections.size() && data.sections[at].id != step.section){ + at++; + } + if (at == data.sections.size()){ + problems.push_back(std::format("{} {}: section {} is not one of the checkpoint's, in order", data.id, step.name, step.section)); + return problems; + } + used[at] = true; + } + for (size_t c = 0; c < used.size(); c++){ + if (!used[c]){ + problems.push_back(std::format("{}: section {} has no step", data.id, data.sections[c].id)); + } + } + return problems; +} + +} // namespace + +std::vector lint_story_checkpoint(const StoryCheckpoint& data){ + std::vector problems = section_problems(data); if (data.id.empty()){ problems.emplace_back("a checkpoint has no id"); } diff --git a/SerialPrograms/Source/Pokemon/AutoStory/Pokemon_StorySteps.h b/SerialPrograms/Source/Pokemon/AutoStory/Pokemon_StorySteps.h index 27aaabad8a..bdfd089636 100644 --- a/SerialPrograms/Source/Pokemon/AutoStory/Pokemon_StorySteps.h +++ b/SerialPrograms/Source/Pokemon/AutoStory/Pokemon_StorySteps.h @@ -134,6 +134,21 @@ struct StoryStep{ // Where the step leaves the player, when its action does not say: the // end of a scene that moves the player. std::optional pose_after; + // The id of the checkpoint's section the step is in (StorySection); + // empty for a checkpoint without sections. Logged with the event. + std::string section; + // The author's notes on the step: why it is done this way, what was + // seen on the console. Not read by any executor. + std::vector notes; +}; + +// A part of a checkpoint, e.g. one floor of a cave: a run of steps that +// name it in their `section`. Steps are numbered across the checkpoint, +// not per section. +struct StorySection{ + std::string id; + std::string title; + std::vector notes; }; // Milestone row in the story table grouping related steps and starting pose. @@ -143,6 +158,12 @@ struct StoryCheckpoint{ // Where its starting save leaves the player; none for a new game. std::optional start; std::vector steps; + // The author's notes on the whole checkpoint: the maps, trainers and + // numbers its steps were planned from. + std::vector notes; + // In order; each step's `section` names one of them. Empty when the + // checkpoint is not split. + std::vector sections; }; diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/Data/AuthoredStory_Tests.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/Data/AuthoredStory_Tests.cpp new file mode 100644 index 0000000000..8392d8d7da --- /dev/null +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/Data/AuthoredStory_Tests.cpp @@ -0,0 +1,222 @@ +/* FRLG Authored Story Tests + * From: https://github.com/PokemonAutomation/ + * + * The story table as loaded from the StoryData plans against the C++ + * rows it was exported from: the same events, and the same trace of the + * whole story on the story maps (StoryMapsSim). + * + */ + +#include +#include +#include +#include "Common/Cpp/Exceptions.h" +#include "Common/Cpp/Filesystem/Filesystem.h" +#include "Common/Cpp/Filesystem/FileIO.h" +#include "Common/Cpp/Json/JsonArray.h" +#include "Common/Cpp/Json/JsonObject.h" +#include "Common/Cpp/TestRunners/UnitTest.h" +#include "Pokemon/AutoStory/Pokemon_StorySegments.h" +#include "VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRowSim.h" +#include "VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryTable.h" +#include "VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_StoryReplay.h" +#include "JsonParser.h" +#include "JsonWriter.h" +#include "AuthoredStory_Tests.h" + +namespace PokemonAutomation{ +namespace NintendoSwitch{ +namespace PokemonFRLG{ + + +namespace{ + +// "[Event] 00.28/12 [b1f_east] winston_line: start" without its section, +// as the table logged it before it had sections. +std::string without_section(const std::string& line){ + const size_t open = line.find(" [", 1); + const size_t close = open == std::string::npos ? open : line.find("] ", open); + if (!line.starts_with("[Event] ") || close == std::string::npos){ + return line; + } + return line.substr(0, open) + line.substr(close + 1); +} + +// The story on the story maps, each step's end pose traced. +class TraceGame : public StoryMapsSim{ +public: + std::vector trace; + + virtual void begin_attempt(const Pokemon::StoryCheckpoint& data) override{ + StoryMapsSim::begin_attempt(data); + m_row = data.id; + trace.push_back("begin " + data.id); + } + virtual Pokemon::Outcome run(Pokemon::RunState& state, const StoryStep& step) override{ + Pokemon::Outcome outcome = StoryMapsSim::run(state, step); + trace.push_back(std::format("{}/{}: {} at {}", m_row, step.name, outcome.succeeded() ? "ok" : "failed", + outcome.pose ? Pokemon::to_string(*outcome.pose) : "-")); + return outcome; + } + +private: + std::string m_row; +}; + +} // namespace + +std::vector story_sim_trace(const std::vector& table){ + const std::vector rows = plan_story_run(table, 0, table.size() - 1, StoryHandoffs{}).rows; + TraceGame game; + game.set_language(Language::Japanese); + Pokemon::Segment segment; + segment.id = "00"; + for (const StoryCheckpoint& data : rows){ + segment.checkpoints.push_back(Pokemon::CheckpointSpec{ + .id = data.id, .title = data.title, .saves = true, + .build = [&game, &data]{ + return Pokemon::build_story_checkpoint(data, game); + }, + }); + } + Pokemon::SegmentHooks hooks; + hooks.save = [&game](Pokemon::RunState& state){ + game.trace.push_back("save at " + Pokemon::to_string(state.pose)); + return Pokemon::outcome_ok(); + }; + hooks.reload = [&game](Pokemon::RunState&){ + game.trace.push_back("reload"); + return Pokemon::outcome_ok(); + }; + hooks.log = [&game](const std::string& line){ + game.trace.push_back(without_section(line)); + }; + Pokemon::RunState state; + const Pokemon::SegmentReport report = Pokemon::run_segment(state, segment, {}, Pokemon::SegmentPolicy{}, hooks); + game.trace.push_back(report.completed ? "completed" : "not completed"); + game.trace.push_back(stub_report(game.stubs().rows())); + return game.trace; +} + + +namespace{ + +// The row as the C++ table built it: no notes or sections. +JsonValue plain_export(StoryCheckpoint row){ + row.notes.clear(); + row.sections.clear(); + for (StoryStep& step : row.steps){ + step.notes.clear(); + step.section.clear(); + } + return story_checkpoint_export(row); +} + +std::string compare_rows(const StoryCheckpoint& authored, const StoryCheckpoint& table){ + const JsonValue a = plain_export(authored); + const JsonValue b = plain_export(table); + if (!(a == b)){ + return std::format("{}: authored {}\nC++ {}", table.id, a.dump(-1), b.dump(-1)); + } + if (authored.live_start != table.live_start || authored.handoff != table.handoff){ + return table.id + ": live start or handoff differ."; + } + return ""; +} + +UnitTestResult test_rows_match(){ + const std::vector authored = load_authored_story(); + const std::vector& table = story_checkpoints(); + if (authored.size() != table.size()){ + return std::format("Expected {} authored rows, read {}.", table.size(), authored.size()); + } + for (size_t c = 0; c < table.size(); c++){ + const std::string error = compare_rows(authored[c], table[c]); + if (!error.empty()){ + return error; + } + } + return true; +} + +UnitTestResult test_traces_match(){ + const std::vector authored = story_sim_trace(load_authored_story()); + const std::vector table = story_sim_trace(story_checkpoints()); + for (size_t c = 0; c < std::min(authored.size(), table.size()); c++){ + if (authored[c] != table[c]){ + return std::format("Trace line {}: authored \"{}\", C++ \"{}\".", c, authored[c], table[c]); + } + } + if (authored.size() != table.size()){ + return std::format("Expected {} trace lines, read {}.", table.size(), authored.size()); + } + return true; +} + +// The story table's trace against the golden one, taken from the C++ +// rows before they moved to StoryData (ReplayData/frlg-story-sim-trace.json). +UnitTestResult test_trace_golden(){ + const JsonValue fixture = parse_json(story_replay_fixture("frlg-story-sim-trace")); + const JsonArray& golden = fixture.to_object_throw().get_array_throw("trace"); + const std::vector trace = story_sim_trace(story_checkpoints()); + for (size_t c = 0; c < std::min(golden.size(), trace.size()); c++){ + if (golden[c].to_string_throw() != trace[c]){ + return std::format("Trace line {}: golden \"{}\", read \"{}\".", c, golden[c].to_string_throw(), trace[c]); + } + } + if (golden.size() != trace.size()){ + return std::format("Expected {} trace lines, read {}.", golden.size(), trace.size()); + } + return true; +} + +// Migration only: writes each C++ row as its authored plan, and the C++ +// table's trace, to frlg-story-export/ under the working directory. +UnitTestResult test_export(){ + const std::string folder = "frlg-story-export/"; + Filesystem::create_directories(Filesystem::Path(folder)); + for (const StoryCheckpoint& row : story_checkpoints()){ + string_to_file(folder + "frlg-" + row.id + ".plan.json", authored_checkpoint_json(row).dump(2)); + } + JsonArray lines; + for (const std::string& line : story_sim_trace(story_checkpoints())){ + lines.push_back(line); + } + string_to_file(folder + "frlg-story-sim-trace.json", JsonValue(std::move(lines)).dump(1)); + return true; +} + +struct AuthoredCase{ + std::string name; + UnitTestResult (*body)(); +}; + +class AuthoredTest : public UnitTest{ +public: + explicit AuthoredTest(AuthoredCase test) + : UnitTest("PokemonFRLG::AutoStory - Authored: " + test.name), m_test(std::move(test)){} + virtual UnitTestResult run(Logger&, CancellableScope&) const override{ + try{ + return m_test.body(); + }catch (Exception& e){ + return std::string(e.name()) + ": " + e.message(); + } + } +private: + AuthoredCase m_test; +}; + +} // namespace + + +void add_tests_AuthoredStory(UnitTestDatabase& database){ + database.add(AuthoredCase{"every row as authored is the C++ row", test_rows_match}); + database.add(AuthoredCase{"the story sim's trace is the C++ table's", test_traces_match}); + database.add(AuthoredCase{"export the C++ rows", test_export}); + database.add(AuthoredCase{"the story sim's trace is the golden one", test_trace_golden}); +} + + +} // namespace PokemonFRLG +} // namespace NintendoSwitch +} // namespace PokemonAutomation diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/Data/AuthoredStory_Tests.h b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/Data/AuthoredStory_Tests.h new file mode 100644 index 0000000000..be7c0c092c --- /dev/null +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/Data/AuthoredStory_Tests.h @@ -0,0 +1,30 @@ +/* FRLG Authored Story Tests + * From: https://github.com/PokemonAutomation/ + */ + +#ifndef PokemonAutomation_PokemonFRLG_AuthoredStory_Tests_H +#define PokemonAutomation_PokemonFRLG_AuthoredStory_Tests_H + +#include +#include +#include "Common/Cpp/TestRunners/UnitTestDatabase.h" +#include "VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryEvents.h" + +namespace PokemonAutomation{ +namespace NintendoSwitch{ +namespace PokemonFRLG{ + + +// The whole story of `table` on the story maps (StoryMapsSim), every +// handoff off: each step's end, each event's log line without its +// section, each save's pose, and the steps the sim stubbed. +std::vector story_sim_trace(const std::vector& table); + +// The authored story table against its golden trace. +void add_tests_AuthoredStory(UnitTestDatabase& database); + + +} // namespace PokemonFRLG +} // namespace NintendoSwitch +} // namespace PokemonAutomation +#endif diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/Data/JsonParser.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/Data/JsonParser.cpp index 780b3a9a88..e84e3eaa07 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/Data/JsonParser.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/Data/JsonParser.cpp @@ -2,6 +2,7 @@ * From: https://github.com/PokemonAutomation/ */ +#include #include #include #include @@ -11,6 +12,15 @@ #include "Common/Cpp/Json/JsonObject.h" #include "Pokemon/AutoStory/Pokemon_StoryStepJson.h" #include "Pokemon/AutoStory/Pokemon_AuthoredCheckpointJson.h" +#include "VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryCapture.h" +#include "VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryChoice.h" +#include "VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryGrind.h" +#include "VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryMart.h" +#include "VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryMember.h" +#include "VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryParty.h" +#include "VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryPcStorage.h" +#include "VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryTeach.h" +#include "VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryTrashCans.h" #include "LegacyJsonFormat.h" #include "JsonParser.h" @@ -175,20 +185,142 @@ void check_envelope(const JsonObject& root, std::string_view source){ } } +constexpr std::pair HANDOFFS[]{ + {StoryHandoff::NONE, "none"}, + {StoryHandoff::SID_HELPER, "sid_helper"}, + {StoryHandoff::STARTER_RNG, "starter_rng"}, + {StoryHandoff::GIFT_RNG, "gift_rng"}, +}; + +// The healing items a checkpoint starts with, and its lead: a new game's +// unless "lead" names the one after Brock (story_lead_after_brock()). +Supplies read_authored_supplies(const JsonValue& value, std::string_view source){ + const JsonObject& root = fields(value, {"potions", "antidotes", "parlyz_heals", "lead"}, source); + Supplies result; + if (const JsonValue* field = root.get_value("potions")){ + result.potions = read_int(*field, source); + } + if (const JsonValue* field = root.get_value("antidotes")){ + result.antidotes = read_int(*field, source); + } + if (const JsonValue* field = root.get_value("parlyz_heals")){ + result.parlyz_heals = read_int(*field, source); + } + if (const JsonValue* field = root.get_value("lead")){ + if (field->to_string_throw(std::string(source)) != "after_brock"){ + throw ParseException(std::format("{}: unsupported lead {}", source, field->to_string_throw())); + } + result.lead = story_lead_after_brock(); + } + return result; +} + +// Whether `variant` names a GAME step FRLG's executor does. +bool known_game_variant(const std::string& variant){ + for (const std::string& name : {CLOSE_TRAINER_CARD, LEAVE_GIFT_SUMMARY, CUT_TREE_VARIANT, TRASH_CANS_VARIANT}){ + if (variant == name){ + return true; + } + } + return parse_capture_variant(variant) || parse_pc_variant(variant) || parse_mart_variant(variant) + || parse_teach_variant(variant) || parse_grind_variant(variant) || parse_grind_check_variant(variant) + || parse_fossil_variant(variant) || parse_level_variant(variant); +} + +// Whether FRLG does `step`'s kind the way its variant names. +bool known_variant(const StoryStep& step){ + switch (step.kind){ + case StoryStepKind::ROUTE: + case StoryStepKind::LEGS: + return step.variant.empty() || step.variant == RUN_VARIANT; + case StoryStepKind::STEP: + return step.variant.empty() || step.variant == TRAINER_LINE_VARIANT || step.variant == TRAINER_WAIT_VARIANT; + case StoryStepKind::GAME: + return known_game_variant(step.variant); + default: + return step.variant.empty(); + } +} + +// The checkpoint's steps against what FRLG can do: each variant known, +// and nothing lint_story_checkpoint() finds. +void check_steps(const StoryCheckpoint& checkpoint, std::string_view source){ + for (const StoryStep& step : checkpoint.steps){ + if (!known_variant(step)){ + throw ParseException(std::format("{}: {} has an unsupported variant \"{}\"", source, step.name, step.variant)); + } + } + const std::vector problems = Pokemon::lint_story_checkpoint(checkpoint); + if (!problems.empty()){ + throw ParseException(std::format("{}: {}", source, problems.front())); + } +} + StoryCheckpoint apply_execution(Pokemon::AuthoredCheckpoint parsed, std::string_view source){ const JsonObject& execution = parsed.execution; - Pokemon::require_story_json_fields(execution, {"menu"}, source); + for (const auto& [key, unused] : execution){ + if (key != "menu" && key != "supplies" && key != "live_start" && key != "handoff"){ + throw ParseException(std::format("{}: unsupported execution field {}", source, key)); + } + } StoryCheckpoint result; static_cast(result) = std::move(parsed.checkpoint); - const std::string& menu = execution.get_string_throw("menu"); - if (menu == "before_pokemon"){ - result.menu = StartMenu::BEFORE_POKEMON; - }else if (menu == "before_pokedex"){ - result.menu = StartMenu::BEFORE_POKEDEX; - }else if (menu == "full"){ - result.menu = StartMenu::FULL; - }else{ - throw ParseException("Unsupported authored checkpoint menu."); + result.menu = read_named({StartMenu::BEFORE_POKEMON, StartMenu::BEFORE_POKEDEX, StartMenu::FULL}, + StoryJsonInternal::menu_name, execution.get_string_throw("menu", std::string(source)), source); + if (const JsonValue* field = execution.get_value("supplies")){ + result.supplies = read_authored_supplies(*field, source); + } + if (const JsonValue* field = execution.get_value("live_start")){ + result.live_start = field->to_boolean_throw(std::string(source)); + } + if (const JsonValue* field = execution.get_value("handoff")){ + const std::string& name = field->to_string_throw(std::string(source)); + bool found = false; + for (const auto& [handoff, label] : HANDOFFS){ + if (name == label){ + result.handoff = handoff; + found = true; + } + } + if (!found){ + throw ParseException(std::format("{}: unsupported handoff {}", source, name)); + } + } + check_steps(result, source); + return result; +} + +// Whether two leads are the same as far as a checkpoint's row sets them. +bool same_lead(const PartyMember& a, const PartyMember& b){ + if (a.species != b.species || a.level != b.level || a.moves_through_level != b.moves_through_level + || a.moves_read != b.moves_read || a.moves.size() != b.moves.size() + ){ + return false; + } + for (size_t c = 0; c < a.moves.size(); c++){ + if (a.moves[c].move != b.moves[c].move || a.moves[c].pp != b.moves[c].pp){ + return false; + } + } + return true; +} + +// The supplies as authored: what differs from a new game's. +JsonObject authored_supplies_json(const Supplies& supplies){ + JsonObject result; + if (supplies.potions){ + result["potions"] = supplies.potions; + } + if (supplies.antidotes){ + result["antidotes"] = supplies.antidotes; + } + if (supplies.parlyz_heals){ + result["parlyz_heals"] = supplies.parlyz_heals; + } + if (same_lead(supplies.lead, story_lead_after_brock())){ + result["lead"] = "after_brock"; + }else if (!same_lead(supplies.lead, Supplies{}.lead)){ + throw ParseException("Only a new game's lead or the lead after Brock can be authored."); } return result; } @@ -204,6 +336,44 @@ StoryCheckpoint load_authored_checkpoint(std::string_view file){ return apply_execution(Pokemon::load_authored_checkpoint(autostory_checkpoint_json(), file, "frlg"), file); } +std::vector load_authored_story(){ + std::vector result; + for (const auto& [name, text] : autostory_checkpoint_json()){ + if (name.ends_with(".plan")){ + result.push_back(read_authored_checkpoint(parse_json(text), name)); + } + } + std::sort(result.begin(), result.end(), [](const StoryCheckpoint& a, const StoryCheckpoint& b){ + return a.id < b.id; + }); + for (size_t c = 1; c < result.size(); c++){ + if (result[c].id == result[c - 1].id){ + throw ParseException("Two authored checkpoints are " + result[c].id + "."); + } + } + return result; +} + +JsonValue authored_checkpoint_json(const StoryCheckpoint& checkpoint){ + JsonObject execution; + execution["menu"] = StoryJsonInternal::menu_name(checkpoint.menu); + JsonObject supplies = authored_supplies_json(checkpoint.supplies); + if (supplies.size() != 0){ + execution["supplies"] = std::move(supplies); + } + if (checkpoint.live_start){ + execution["live_start"] = true; + } + if (checkpoint.handoff != StoryHandoff::NONE){ + for (const auto& [handoff, label] : HANDOFFS){ + if (handoff == checkpoint.handoff){ + execution["handoff"] = std::string(label); + } + } + } + return Pokemon::authored_checkpoint_json(checkpoint, "frlg", std::move(execution)); +} + StoryCheckpoint read_story_checkpoint_export(const JsonValue& value, std::string_view source){ const JsonObject& root = fields(value, {"format", "game", "status", "checkpoint", "native_fields", "state_basis", "unbound", "source_revision"}, source); diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/Data/JsonParser.h b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/Data/JsonParser.h index 9b20466141..b931b7d677 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/Data/JsonParser.h +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/Data/JsonParser.h @@ -24,6 +24,15 @@ StoryCheckpoint read_authored_checkpoint(const JsonValue& value, std::string_vie // Load an embedded authored plan by filename without .json; no controller IO. StoryCheckpoint load_authored_checkpoint(std::string_view file); +// Every embedded authored plan (StoryData/*.plan.json), in order of id: +// the story table. A malformed plan or two with one id throw ParseException. +std::vector load_authored_story(); + +// `checkpoint` as an authored plan: the shared checkpoint, and its START +// menu, supplies, live start and handoff as `execution`. Supplies beyond +// the counted items and the lead after Brock aren't authored. +JsonValue authored_checkpoint_json(const StoryCheckpoint& checkpoint); + // Embedded StoryData/*.json records: (filename without .json, text), sorted by name. const std::vector>& autostory_checkpoint_json(); diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/Data/Json_Tests.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/Data/Json_Tests.cpp index 0e712607a2..47c937a9cd 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/Data/Json_Tests.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/Data/Json_Tests.cpp @@ -10,6 +10,7 @@ #include "JsonWriter.h" #include "VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryTable.h" #include "VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_StoryReplay.h" +#include "AuthoredStory_Tests.h" #include "Json_Tests.h" namespace PokemonAutomation{ @@ -271,6 +272,7 @@ class LoadTest : public UnitTest{ void add_tests_AutoStoryJson(UnitTestDatabase& database){ add_tests_StoryReplay(database); + add_tests_AuthoredStory(database); for (const ExportCase& test : CASES){ database.add(test); } diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryEvents.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryEvents.cpp index 13a39e6cae..97e0addd98 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryEvents.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryEvents.cpp @@ -826,6 +826,10 @@ StoryCheckpoint joined_rows(const StoryCheckpoint& first, const StoryCheckpoint& row.live_start = first.live_start; row.steps = first.steps; row.steps.insert(row.steps.end(), second.steps.begin(), second.steps.end()); + row.notes = first.notes; + row.notes.insert(row.notes.end(), second.notes.begin(), second.notes.end()); + row.sections = first.sections; + row.sections.insert(row.sections.end(), second.sections.begin(), second.sections.end()); return row; } diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/ReplayData/frlg-story-sim-trace.json b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/ReplayData/frlg-story-sim-trace.json new file mode 100644 index 0000000000..282d79e0f5 --- /dev/null +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/ReplayData/frlg-story-sim-trace.json @@ -0,0 +1,1208 @@ +{ + "about": "story_sim_trace() of the FRLG story table (Data/AuthoredStory_Tests.h), taken from the C++ rows before they moved to StoryData.", + "trace": [ + "[Segment] 00: start, 33 checkpoints", + "begin 00.01", + "[Checkpoint] 00.01: start, 2 events", + "[Event] 00.01/1 intro: start", + "00.01/intro: ok at -", + "[Event] 00.01/1 intro: done", + "[Event] 00.01/2 options: start", + "00.01/options: ok at -", + "[Event] 00.01/2 options: done", + "save at PalletTown_PlayersHouse_2F (6, 6) facing north (tile)", + "[Checkpoint] 00.01: done, 2 run, 0 skipped", + "[Checkpoint] 00.01: passed on attempt 1 (one-shot)", + "begin 00.02", + "[Checkpoint] 00.02: start, 2 events", + "[Event] 00.02/1 from_save: start", + "[Event] 00.02/1 from_save: done", + "[Event] 00.02/2 front_door: start", + "00.02/front_door: ok at PalletTown (6, 8) facing south (tile)", + "[Event] 00.02/2 front_door: done", + "save at PalletTown (6, 8) facing south (tile)", + "[Checkpoint] 00.02: done, 2 run, 0 skipped", + "[Checkpoint] 00.02: passed on attempt 1 (one-shot)", + "begin 00.03", + "[Checkpoint] 00.03: start, 4 events", + "[Event] 00.03/1 from_save: start", + "[Event] 00.03/1 from_save: done", + "[Event] 00.03/2 below_oaks_trigger: start", + "00.03/below_oaks_trigger: ok at PalletTown (12, 2) facing north (tile)", + "[Event] 00.03/2 below_oaks_trigger: done", + "[Event] 00.03/3 oaks_trigger: start", + "00.03/oaks_trigger: ok at PalletTown (12, 1) facing north (tile)", + "[Event] 00.03/3 oaks_trigger: done", + "[Event] 00.03/4 to_the_lab: start", + "00.03/to_the_lab: ok at -", + "[Event] 00.03/4 to_the_lab: done", + "save at PalletTown_ProfessorOaksLab (6, 4) facing north (tile)", + "[Checkpoint] 00.03: done, 4 run, 0 skipped", + "[Checkpoint] 00.03: passed on attempt 1 (one-shot)", + "begin 00.04", + "[Checkpoint] 00.04: start, 9 events", + "[Event] 00.04/1 from_save: start", + "[Event] 00.04/1 from_save: done", + "[Event] 00.04/2 below_squirtle: start", + "00.04/below_squirtle: ok at PalletTown_ProfessorOaksLab (9, 5) facing north (tile)", + "[Event] 00.04/2 below_squirtle: done", + "[Event] 00.04/3 squirtle_ball: start", + "00.04/squirtle_ball: ok at -", + "[Event] 00.04/3 squirtle_ball: done", + "[Event] 00.04/4 choose_squirtle: start", + "00.04/choose_squirtle: ok at -", + "[Event] 00.04/4 choose_squirtle: done", + "[Event] 00.04/5 no_nickname: start", + "00.04/no_nickname: ok at -", + "[Event] 00.04/5 no_nickname: done", + "[Event] 00.04/6 rival_takes_bulbasaur: start", + "00.04/rival_takes_bulbasaur: ok at -", + "[Event] 00.04/6 rival_takes_bulbasaur: done", + "[Event] 00.04/7 above_rival_trigger: start", + "00.04/above_rival_trigger: ok at PalletTown_ProfessorOaksLab (7, 7) facing south (tile)", + "[Event] 00.04/7 above_rival_trigger: done", + "[Event] 00.04/8 rival_trigger: start", + "00.04/rival_trigger: ok at PalletTown_ProfessorOaksLab (7, 8) facing south (tile)", + "[Event] 00.04/8 rival_trigger: done", + "[Event] 00.04/9 rival_battle: start", + "00.04/rival_battle: ok at -", + "[Event] 00.04/9 rival_battle: done", + "save at PalletTown_ProfessorOaksLab (7, 8) facing south (tile)", + "[Checkpoint] 00.04: done, 9 run, 0 skipped", + "[Checkpoint] 00.04: passed on attempt 1 (one-shot)", + "begin 00.05", + "[Checkpoint] 00.05: start, 4 events", + "[Event] 00.05/1 from_save: start", + "[Event] 00.05/1 from_save: done", + "[Event] 00.05/2 below_mart_door: start", + "00.05/below_mart_door: ok at ViridianCity (36, 20) facing north (tile)", + "[Event] 00.05/2 below_mart_door: done", + "[Event] 00.05/3 mart_door: start", + "00.05/mart_door: ok at ViridianCity (36, 19) facing north (tile)", + "[Event] 00.05/3 mart_door: done", + "[Event] 00.05/4 parcel_from_clerk: start", + "00.05/parcel_from_clerk: ok at -", + "[Event] 00.05/4 parcel_from_clerk: done", + "save at ViridianCity_Mart (4, 3) facing west (tile)", + "[Checkpoint] 00.05: done, 4 run, 0 skipped", + "[Checkpoint] 00.05: passed on attempt 1 (one-shot)", + "begin 00.06", + "[Checkpoint] 00.06: start, 4 events", + "[Event] 00.06/1 from_save: start", + "[Event] 00.06/1 from_save: done", + "[Event] 00.06/2 below_oak: start", + "00.06/below_oak: ok at PalletTown_ProfessorOaksLab (6, 4) facing north (tile)", + "[Event] 00.06/2 below_oak: done", + "[Event] 00.06/3 give_parcel: start", + "00.06/give_parcel: ok at -", + "[Event] 00.06/3 give_parcel: done", + "[Event] 00.06/4 pokedex_scene: start", + "00.06/pokedex_scene: ok at -", + "[Event] 00.06/4 pokedex_scene: done", + "save at PalletTown_ProfessorOaksLab (6, 4) facing south (tile)", + "[Checkpoint] 00.06: done, 4 run, 0 skipped", + "[Checkpoint] 00.06: passed on attempt 1 (one-shot)", + "begin 00.07", + "[Checkpoint] 00.07: start, 10 events", + "[Event] 00.07/1 from_save: start", + "[Event] 00.07/1 from_save: done", + "[Event] 00.07/2 mart_clerk: start", + "00.07/mart_clerk: ok at ViridianCity_Mart (4, 3) facing west (tile)", + "[Event] 00.07/2 mart_clerk: done", + "[Event] 00.07/3 potions_and_antidotes: start", + "00.07/potions_and_antidotes: ok at -", + "[Event] 00.07/3 potions_and_antidotes: done", + "[Event] 00.07/4 viridian_nurse: start", + "00.07/viridian_nurse: ok at ViridianCity_PokemonCenter_1F (7, 4) facing north (tile)", + "[Event] 00.07/4 viridian_nurse: done", + "[Event] 00.07/5 heal_viridian: start", + "00.07/heal_viridian: ok at -", + "[Event] 00.07/5 heal_viridian: done", + "[Event] 00.07/6 below_old_man_trigger: start", + "00.07/below_old_man_trigger: ok at ViridianCity (20, 9) facing north (tile)", + "[Event] 00.07/6 below_old_man_trigger: done", + "[Event] 00.07/7 old_man_trigger: start", + "00.07/old_man_trigger: ok at ViridianCity (20, 8) facing north (tile)", + "[Event] 00.07/7 old_man_trigger: done", + "[Event] 00.07/8 old_man_tutorial: start", + "00.07/old_man_tutorial: ok at -", + "[Event] 00.07/8 old_man_tutorial: done", + "[Event] 00.07/9 past_old_man: start", + "00.07/past_old_man: ok at ViridianCity (20, 5) facing north (tile)", + "[Event] 00.07/9 past_old_man: done", + "[Event] 00.07/10 forest_entrance: start", + "00.07/forest_entrance: ok at ViridianForest (29, 62) facing north (tile)", + "[Event] 00.07/10 forest_entrance: done", + "save at ViridianForest (29, 62) facing north (tile)", + "[Checkpoint] 00.07: done, 10 run, 0 skipped", + "[Checkpoint] 00.07: passed on attempt 1 (one-shot)", + "begin 00.08", + "[Checkpoint] 00.08: start, 7 events", + "[Event] 00.08/1 from_save: start", + "[Event] 00.08/1 from_save: done", + "[Event] 00.08/2 forest_east: start", + "00.08/forest_east: ok at ViridianForest (44, 43) facing north (tile)", + "[Event] 00.08/2 forest_east: done", + "[Event] 00.08/3 forest_north: start", + "00.08/forest_north: ok at ViridianForest (39, 25) facing west (tile)", + "[Event] 00.08/3 forest_north: done", + "[Event] 00.08/4 forest_exit: start", + "00.08/forest_exit: ok at ViridianForest (4, 13) facing east (tile)", + "[Event] 00.08/4 forest_exit: done", + "[Event] 00.08/5 forest_gate: start", + "00.08/forest_gate: ok at Route2_ViridianForest_NorthEntrance (7, 10) facing north (tile)", + "[Event] 00.08/5 forest_gate: done", + "[Event] 00.08/6 pewter_nurse: start", + "00.08/pewter_nurse: ok at PewterCity_PokemonCenter_1F (7, 4) facing north (tile)", + "[Event] 00.08/6 pewter_nurse: done", + "[Event] 00.08/7 heal_pewter: start", + "00.08/heal_pewter: ok at -", + "[Event] 00.08/7 heal_pewter: done", + "save at PewterCity_PokemonCenter_1F (7, 4) facing north (tile)", + "[Checkpoint] 00.08: done, 7 run, 0 skipped", + "[Checkpoint] 00.08: passed on attempt 1 (one-shot)", + "begin 00.09", + "[Checkpoint] 00.09: start, 8 events", + "[Event] 00.09/1 from_save: start", + "[Event] 00.09/1 from_save: done", + "[Event] 00.09/2 below_liam_line: start", + "00.09/below_liam_line: ok at PewterCity_Gym (6, 9) facing north (tile)", + "[Event] 00.09/2 below_liam_line: done", + "[Event] 00.09/3 liam_line: start", + "00.09/liam_line: ok at PewterCity_Gym (6, 8) facing north (tile)", + "[Event] 00.09/3 liam_line: done", + "[Event] 00.09/4 camper_liam: start", + "00.09/camper_liam: ok at -", + "[Event] 00.09/4 camper_liam: done", + "[Event] 00.09/5 ready_for_brock: start", + "00.09/ready_for_brock: ok at -", + "[Event] 00.09/5 ready_for_brock: done", + "[Event] 00.09/6 before_brock: start", + "00.09/before_brock: ok at PewterCity_Gym (6, 6) facing north (tile)", + "[Event] 00.09/6 before_brock: done", + "[Event] 00.09/7 challenge_brock: start", + "00.09/challenge_brock: ok at -", + "[Event] 00.09/7 challenge_brock: done", + "[Event] 00.09/8 brock: start", + "00.09/brock: ok at -", + "[Event] 00.09/8 brock: done", + "save at PewterCity_Gym (6, 6) facing north (tile)", + "[Checkpoint] 00.09: done, 8 run, 0 skipped", + "[Checkpoint] 00.09: passed on attempt 1 (one-shot)", + "begin 00.10", + "[Checkpoint] 00.10: start, 5 events", + "[Event] 00.10/1 from_save: start", + "[Event] 00.10/1 from_save: done", + "[Event] 00.10/2 before_aide_trigger: start", + "00.10/before_aide_trigger: ok at PewterCity (45, 21) facing east (tile)", + "[Event] 00.10/2 before_aide_trigger: done", + "[Event] 00.10/3 aide_trigger: start", + "00.10/aide_trigger: ok at PewterCity (46, 21) facing east (tile)", + "[Event] 00.10/3 aide_trigger: done", + "[Event] 00.10/4 shoes_from_aide: start", + "00.10/shoes_from_aide: ok at -", + "[Event] 00.10/4 shoes_from_aide: done", + "[Event] 00.10/5 below_pewter_center: start", + "00.10/below_pewter_center: ok at PewterCity (17, 26) facing south (tile)", + "[Event] 00.10/5 below_pewter_center: done", + "save at PewterCity (17, 26) facing south (tile)", + "[Checkpoint] 00.10: done, 5 run, 0 skipped", + "[Checkpoint] 00.10: passed on attempt 1 (one-shot)", + "begin 00.11", + "[Checkpoint] 00.11: start, 14 events", + "[Event] 00.11/1 from_save: start", + "[Event] 00.11/1 from_save: done", + "[Event] 00.11/2 pewter_nurse: start", + "00.11/pewter_nurse: ok at PewterCity_PokemonCenter_1F (7, 4) facing north (tile)", + "[Event] 00.11/2 pewter_nurse: done", + "[Event] 00.11/3 heal_pewter: start", + "00.11/heal_pewter: ok at -", + "[Event] 00.11/3 heal_pewter: done", + "[Event] 00.11/4 west_of_janice_line: start", + "00.11/west_of_janice_line: ok at Route3 (13, 8) facing east (tile)", + "[Event] 00.11/4 west_of_janice_line: done", + "[Event] 00.11/5 below_colton_line: start", + "00.11/below_colton_line: ok at Route3 (14, 7) facing north (tile)", + "[Event] 00.11/5 below_colton_line: done", + "[Event] 00.11/6 colton_line: start", + "00.11/colton_line: ok at Route3 (14, 6) facing north (tile)", + "[Event] 00.11/6 colton_line: done", + "[Event] 00.11/7 bug_catcher_colton: start", + "00.11/bug_catcher_colton: ok at -", + "[Event] 00.11/7 bug_catcher_colton: done", + "[Event] 00.11/8 past_ben: start", + "00.11/past_ben: ok at Route3 (24, 5) facing east (tile)", + "[Event] 00.11/8 past_ben: done", + "[Event] 00.11/9 greg_line: start", + "00.11/greg_line: ok at Route3 (25, 5) facing east (tile)", + "[Event] 00.11/9 greg_line: done", + "[Event] 00.11/10 bug_catcher_greg: start", + "00.11/bug_catcher_greg: ok at -", + "[Event] 00.11/10 bug_catcher_greg: done", + "[Event] 00.11/11 above_james_line: start", + "00.11/above_james_line: ok at Route3 (36, 5) facing east (tile)", + "[Event] 00.11/11 above_james_line: done", + "[Event] 00.11/12 james_line: start", + "00.11/james_line: ok at Route3 (36, 6) facing south (tile)", + "[Event] 00.11/12 james_line: done", + "[Event] 00.11/13 bug_catcher_james: start", + "00.11/bug_catcher_james: ok at -", + "[Event] 00.11/13 bug_catcher_james: done", + "[Event] 00.11/14 save_spot: start", + "00.11/save_spot: ok at Route3 (36, 8) facing south (tile)", + "[Event] 00.11/14 save_spot: done", + "save at Route3 (36, 8) facing south (tile)", + "[Checkpoint] 00.11: done, 14 run, 0 skipped", + "[Checkpoint] 00.11: passed on attempt 1 (one-shot)", + "begin 00.12", + "[Checkpoint] 00.12: start, 4 events", + "[Event] 00.12/1 from_save: start", + "[Event] 00.12/1 from_save: done", + "[Event] 00.12/2 route4_nurse: start", + "00.12/route4_nurse: ok at Route4_PokemonCenter_1F (7, 4) facing north (tile)", + "[Event] 00.12/2 route4_nurse: done", + "[Event] 00.12/3 heal_route4: start", + "00.12/heal_route4: ok at -", + "[Event] 00.12/3 heal_route4: done", + "[Event] 00.12/4 before_salesman: start", + "00.12/before_salesman: ok at Route4_PokemonCenter_1F (2, 3) facing west (tile)", + "[Event] 00.12/4 before_salesman: done", + "save at Route4_PokemonCenter_1F (2, 3) facing west (tile)", + "[Checkpoint] 00.12: done, 4 run, 0 skipped", + "[Checkpoint] 00.12: passed on attempt 1 (one-shot)", + "begin 00.12c", + "[Checkpoint] 00.12c: start, 3 events", + "[Event] 00.12c/1 from_save: start", + "[Event] 00.12c/1 from_save: done", + "[Event] 00.12c/2 pc_front: start", + "00.12c/pc_front: ok at Route4_PokemonCenter_1F (11, 2) facing north (tile)", + "[Event] 00.12c/2 pc_front: done", + "[Event] 00.12c/3 magikarp_to_box: start", + "00.12c/magikarp_to_box: ok at Route4_PokemonCenter_1F (11, 2) facing north (tile)", + "[Event] 00.12c/3 magikarp_to_box: done", + "save at Route4_PokemonCenter_1F (11, 2) facing north (tile)", + "[Checkpoint] 00.12c: done, 3 run, 0 skipped", + "[Checkpoint] 00.12c: passed on attempt 1 (one-shot)", + "begin 00.13", + "[Checkpoint] 00.13: start, 20 events", + "[Event] 00.13/1 from_save: start", + "[Event] 00.13/1 from_save: done", + "[Event] 00.13/2 route4_nurse: start", + "00.13/route4_nurse: ok at Route4_PokemonCenter_1F (7, 4) facing north (tile)", + "[Event] 00.13/2 route4_nurse: done", + "[Event] 00.13/3 heal_route4: start", + "00.13/heal_route4: ok at -", + "[Event] 00.13/3 heal_route4: done", + "[Event] 00.13/4 mt_moon_entrance: start", + "00.13/mt_moon_entrance: ok at MtMoon_1F (18, 37) facing north (tile)", + "[Event] 00.13/4 mt_moon_entrance: done", + "[Event] 00.13/5 mt_moon_1f: start", + "00.13/mt_moon_1f: ok at MtMoon_1F (3, 3) facing east (tile)", + "[Event] 00.13/5 mt_moon_1f: done", + "[Event] 00.13/6 below_moon_stone: start", + "00.13/below_moon_stone: ok at MtMoon_1F (3, 3) facing north (tile)", + "[Event] 00.13/6 below_moon_stone: done", + "[Event] 00.13/7 moon_stone_ball: start", + "00.13/moon_stone_ball: ok at -", + "[Event] 00.13/7 moon_stone_ball: done", + "[Event] 00.13/8 found_moon_stone: start", + "00.13/found_moon_stone: ok at -", + "[Event] 00.13/8 found_moon_stone: done", + "[Event] 00.13/9 b2f_ladder_foot: start", + "00.13/b2f_ladder_foot: ok at MtMoon_B2F (26, 21) facing east (tile)", + "[Event] 00.13/9 b2f_ladder_foot: done", + "[Event] 00.13/10 b2f_south: start", + "00.13/b2f_south: ok at MtMoon_B2F (11, 21) facing north (tile)", + "[Event] 00.13/10 b2f_south: done", + "[Event] 00.13/11 grunt_line: start", + "00.13/grunt_line: ok at MtMoon_B2F (12, 21) facing east (tile)", + "[Event] 00.13/11 grunt_line: done", + "[Event] 00.13/12 rocket_grunt: start", + "00.13/rocket_grunt: ok at -", + "[Event] 00.13/12 rocket_grunt: done", + "[Event] 00.13/13 ready_for_miguel: start", + "00.13/ready_for_miguel: ok at -", + "[Event] 00.13/13 ready_for_miguel: done", + "[Event] 00.13/14 below_miguel_trigger: start", + "00.13/below_miguel_trigger: ok at MtMoon_B2F (14, 12) facing east (tile)", + "[Event] 00.13/14 below_miguel_trigger: done", + "[Event] 00.13/15 miguel_trigger: start", + "00.13/miguel_trigger: ok at MtMoon_B2F (14, 11) facing north (tile)", + "[Event] 00.13/15 miguel_trigger: done", + "[Event] 00.13/16 super_nerd_miguel: start", + "00.13/super_nerd_miguel: ok at -", + "[Event] 00.13/16 super_nerd_miguel: done", + "[Event] 00.13/17 below_helix_fossil: start", + "00.13/below_helix_fossil: ok at MtMoon_B2F (14, 8) facing north (tile)", + "[Event] 00.13/17 below_helix_fossil: done", + "[Event] 00.13/18 helix_fossil: start", + "00.13/helix_fossil: ok at MtMoon_B2F (14, 8) facing north (tile)", + "[Event] 00.13/18 helix_fossil: done", + "[Event] 00.13/19 helix_gap: start", + "00.13/helix_gap: ok at MtMoon_B2F (14, 7) facing north (tile)", + "[Event] 00.13/19 helix_gap: done", + "[Event] 00.13/20 route4_east: start", + "00.13/route4_east: ok at Route4 (32, 6) facing south (tile)", + "[Event] 00.13/20 route4_east: done", + "save at Route4 (32, 6) facing south (tile)", + "[Checkpoint] 00.13: done, 20 run, 0 skipped", + "[Checkpoint] 00.13: passed on attempt 1 (one-shot)", + "begin 00.14", + "[Checkpoint] 00.14: start, 10 events", + "[Event] 00.14/1 from_save: start", + "[Event] 00.14/1 from_save: done", + "[Event] 00.14/2 mega_kick_tutor: start", + "00.14/mega_kick_tutor: ok at Route4 (50, 4) facing north (tile)", + "[Event] 00.14/2 mega_kick_tutor: done", + "[Event] 00.14/3 teach_mega_kick: start", + "00.14/teach_mega_kick: ok at Route4 (50, 4) facing north (tile)", + "[Event] 00.14/3 teach_mega_kick: done", + "[Event] 00.14/4 above_ledge: start", + "00.14/above_ledge: ok at Route4 (93, 8) facing south (tile)", + "[Event] 00.14/4 above_ledge: done", + "[Event] 00.14/5 ledge_hop: start", + "00.14/ledge_hop: ok at Route4 (93, 9) facing south (tile)", + "[Event] 00.14/5 ledge_hop: done", + "[Event] 00.14/6 cerulean_entry: start", + "00.14/cerulean_entry: ok at CeruleanCity (9, 20) facing east (tile)", + "[Event] 00.14/6 cerulean_entry: done", + "[Event] 00.14/7 above_city_ledge: start", + "00.14/above_city_ledge: ok at CeruleanCity (25, 17) facing west (tile)", + "[Event] 00.14/7 above_city_ledge: done", + "[Event] 00.14/8 city_ledge_hop: start", + "00.14/city_ledge_hop: ok at CeruleanCity (25, 18) facing south (tile)", + "[Event] 00.14/8 city_ledge_hop: done", + "[Event] 00.14/9 cerulean_nurse: start", + "00.14/cerulean_nurse: ok at CeruleanCity_PokemonCenter_1F (7, 4) facing north (tile)", + "[Event] 00.14/9 cerulean_nurse: done", + "[Event] 00.14/10 heal_cerulean: start", + "00.14/heal_cerulean: ok at -", + "[Event] 00.14/10 heal_cerulean: done", + "save at CeruleanCity_PokemonCenter_1F (7, 4) facing north (tile)", + "[Checkpoint] 00.14: done, 10 run, 0 skipped", + "[Checkpoint] 00.14: passed on attempt 1 (one-shot)", + "begin 00.14b", + "[Checkpoint] 00.14b: start, 10 events", + "[Event] 00.14b/1 from_save: start", + "[Event] 00.14b/1 from_save: done", + "[Event] 00.14b/2 mart_clerk: start", + "00.14b/mart_clerk: ok at CeruleanCity_Mart (4, 3) facing west (tile)", + "[Event] 00.14b/2 mart_clerk: done", + "[Event] 00.14b/3 buy_potions: start", + "00.14b/buy_potions: ok at CeruleanCity_Mart (4, 3) facing west (tile)", + "[Event] 00.14b/3 buy_potions: done", + "[Event] 00.14b/4 grind_patch: start", + "00.14b/grind_patch: ok at Route4 (86, 16) facing west (tile)", + "[Event] 00.14b/4 grind_patch: done", + "[Event] 00.14b/5 grind_to_lv23: start", + "00.14b/grind_to_lv23: ok at Route4 (86, 16) (85, 16) (set)", + "[Event] 00.14b/5 grind_to_lv23: done", + "[Event] 00.14b/6 cerulean_nurse: start", + "00.14b/cerulean_nurse: ok at CeruleanCity_PokemonCenter_1F (7, 4) facing north (tile)", + "[Event] 00.14b/6 cerulean_nurse: done", + "[Event] 00.14b/7 heal_cerulean: start", + "00.14b/heal_cerulean: ok at -", + "[Event] 00.14b/7 heal_cerulean: done", + "[Event] 00.14b/8 gym_below_luis: start", + "00.14b/gym_below_luis: ok at CeruleanCity_Gym (9, 13) facing north (tile)", + "[Event] 00.14b/8 gym_below_luis: done", + "[Event] 00.14b/9 gym_west_walkway: start", + "00.14b/gym_west_walkway: ok at CeruleanCity_Gym (4, 13) facing west (tile)", + "[Event] 00.14b/9 gym_west_walkway: done", + "[Event] 00.14b/10 below_misty_platform: start", + "00.14b/below_misty_platform: ok at CeruleanCity_Gym (9, 7) facing west (tile)", + "[Event] 00.14b/10 below_misty_platform: done", + "save at CeruleanCity_Gym (9, 7) facing west (tile)", + "[Checkpoint] 00.14b: done, 10 run, 0 skipped", + "[Checkpoint] 00.14b: passed on attempt 1 (one-shot)", + "begin 00.14c", + "[Checkpoint] 00.14c: start, 8 events", + "[Event] 00.14c/1 from_save: start", + "[Event] 00.14c/1 from_save: done", + "[Event] 00.14c/2 beside_misty: start", + "00.14c/beside_misty: ok at CeruleanCity_Gym (9, 6) facing west (tile)", + "[Event] 00.14c/2 beside_misty: done", + "[Event] 00.14c/3 challenge_misty: start", + "00.14c/challenge_misty: ok at -", + "[Event] 00.14c/3 challenge_misty: done", + "[Event] 00.14c/4 misty: start", + "00.14c/misty: ok at -", + "[Event] 00.14c/4 misty: done", + "[Event] 00.14c/5 gym_way_out: start", + "00.14c/gym_way_out: ok at CeruleanCity_Gym (9, 13) facing east (tile)", + "[Event] 00.14c/5 gym_way_out: done", + "[Event] 00.14c/6 cerulean_nurse: start", + "00.14c/cerulean_nurse: ok at CeruleanCity_PokemonCenter_1F (7, 4) facing north (tile)", + "[Event] 00.14c/6 cerulean_nurse: done", + "[Event] 00.14c/7 heal_cerulean: start", + "00.14c/heal_cerulean: ok at -", + "[Event] 00.14c/7 heal_cerulean: done", + "[Event] 00.14c/8 teach_water_pulse: start", + "00.14c/teach_water_pulse: ok at CeruleanCity_PokemonCenter_1F (7, 4) facing north (tile)", + "[Event] 00.14c/8 teach_water_pulse: done", + "save at CeruleanCity_PokemonCenter_1F (7, 4) facing north (tile)", + "[Checkpoint] 00.14c: done, 8 run, 0 skipped", + "[Checkpoint] 00.14c: passed on attempt 1 (one-shot)", + "begin 00.15", + "[Checkpoint] 00.15: start, 9 events", + "[Event] 00.15/1 from_save: start", + "[Event] 00.15/1 from_save: done", + "[Event] 00.15/2 teach_water_pulse: start", + "00.15/teach_water_pulse: ok at CeruleanCity_PokemonCenter_1F (7, 4) facing north (tile)", + "[Event] 00.15/2 teach_water_pulse: done", + "[Event] 00.15/3 mart_clerk: start", + "00.15/mart_clerk: ok at CeruleanCity_Mart (4, 3) facing west (tile)", + "[Event] 00.15/3 mart_clerk: done", + "[Event] 00.15/4 buy_potions: start", + "00.15/buy_potions: ok at CeruleanCity_Mart (4, 3) facing west (tile)", + "[Event] 00.15/4 buy_potions: done", + "[Event] 00.15/5 grind_patch: start", + "00.15/grind_patch: ok at Route4 (86, 16) facing west (tile)", + "[Event] 00.15/5 grind_patch: done", + "[Event] 00.15/6 grind_for_rival: start", + "00.15/grind_for_rival: ok at Route4 (86, 16) (85, 16) (set)", + "[Event] 00.15/6 grind_for_rival: done", + "[Event] 00.15/7 cerulean_nurse: start", + "00.15/cerulean_nurse: ok at CeruleanCity_PokemonCenter_1F (7, 4) facing north (tile)", + "[Event] 00.15/7 cerulean_nurse: done", + "[Event] 00.15/8 heal_cerulean: start", + "00.15/heal_cerulean: ok at -", + "[Event] 00.15/8 heal_cerulean: done", + "[Event] 00.15/9 below_rival_trigger: start", + "00.15/below_rival_trigger: ok at CeruleanCity (23, 7) facing north (tile)", + "[Event] 00.15/9 below_rival_trigger: done", + "save at CeruleanCity (23, 7) facing north (tile)", + "[Checkpoint] 00.15: done, 9 run, 0 skipped", + "[Checkpoint] 00.15: passed on attempt 1 (one-shot)", + "begin 00.15b", + "[Checkpoint] 00.15b: start, 4 events", + "[Event] 00.15b/1 from_save: start", + "[Event] 00.15b/1 from_save: done", + "[Event] 00.15b/2 teach_water_pulse: start", + "00.15b/teach_water_pulse: ok at CeruleanCity (23, 7) facing north (tile)", + "[Event] 00.15b/2 teach_water_pulse: done", + "[Event] 00.15b/3 rival_trigger: start", + "00.15b/rival_trigger: ok at CeruleanCity (23, 6) facing north (tile)", + "[Event] 00.15b/3 rival_trigger: done", + "[Event] 00.15b/4 rival_cerulean: start", + "00.15b/rival_cerulean: ok at -", + "[Event] 00.15b/4 rival_cerulean: done", + "save at CeruleanCity (23, 6) facing south (tile)", + "[Checkpoint] 00.15b: done, 4 run, 0 skipped", + "[Checkpoint] 00.15b: passed on attempt 1 (one-shot)", + "begin 00.16", + "[Checkpoint] 00.16: start, 22 events", + "[Event] 00.16/1 from_save: start", + "[Event] 00.16/1 from_save: done", + "[Event] 00.16/2 cerulean_nurse: start", + "00.16/cerulean_nurse: ok at CeruleanCity_PokemonCenter_1F (7, 4) facing north (tile)", + "[Event] 00.16/2 cerulean_nurse: done", + "[Event] 00.16/3 heal_cerulean: start", + "00.16/heal_cerulean: ok at -", + "[Event] 00.16/3 heal_cerulean: done", + "[Event] 00.16/4 below_cale_line: start", + "00.16/below_cale_line: ok at Route24 (11, 32) facing north (tile)", + "[Event] 00.16/4 below_cale_line: done", + "[Event] 00.16/5 cale_line: start", + "00.16/cale_line: ok at Route24 (11, 31) facing north (tile)", + "[Event] 00.16/5 cale_line: done", + "[Event] 00.16/6 bug_catcher_cale: start", + "00.16/bug_catcher_cale: ok at -", + "[Event] 00.16/6 bug_catcher_cale: done", + "[Event] 00.16/7 below_ali_line: start", + "00.16/below_ali_line: ok at Route24 (11, 29) facing north (tile)", + "[Event] 00.16/7 below_ali_line: done", + "[Event] 00.16/8 ali_line: start", + "00.16/ali_line: ok at Route24 (11, 28) facing north (tile)", + "[Event] 00.16/8 ali_line: done", + "[Event] 00.16/9 lass_ali: start", + "00.16/lass_ali: ok at -", + "[Event] 00.16/9 lass_ali: done", + "[Event] 00.16/10 below_timmy_line: start", + "00.16/below_timmy_line: ok at Route24 (11, 26) facing north (tile)", + "[Event] 00.16/10 below_timmy_line: done", + "[Event] 00.16/11 timmy_line: start", + "00.16/timmy_line: ok at Route24 (11, 25) facing north (tile)", + "[Event] 00.16/11 timmy_line: done", + "[Event] 00.16/12 youngster_timmy: start", + "00.16/youngster_timmy: ok at -", + "[Event] 00.16/12 youngster_timmy: done", + "[Event] 00.16/13 below_reli_line: start", + "00.16/below_reli_line: ok at Route24 (11, 23) facing north (tile)", + "[Event] 00.16/13 below_reli_line: done", + "[Event] 00.16/14 reli_line: start", + "00.16/reli_line: ok at Route24 (11, 22) facing north (tile)", + "[Event] 00.16/14 reli_line: done", + "[Event] 00.16/15 lass_reli: start", + "00.16/lass_reli: ok at -", + "[Event] 00.16/15 lass_reli: done", + "[Event] 00.16/16 below_ethan_line: start", + "00.16/below_ethan_line: ok at Route24 (11, 20) facing north (tile)", + "[Event] 00.16/16 below_ethan_line: done", + "[Event] 00.16/17 ethan_line: start", + "00.16/ethan_line: ok at Route24 (11, 19) facing north (tile)", + "[Event] 00.16/17 ethan_line: done", + "[Event] 00.16/18 camper_ethan: start", + "00.16/camper_ethan: ok at -", + "[Event] 00.16/18 camper_ethan: done", + "[Event] 00.16/19 ready_for_rocket: start", + "00.16/ready_for_rocket: ok at -", + "[Event] 00.16/19 ready_for_rocket: done", + "[Event] 00.16/20 below_rocket_trigger: start", + "00.16/below_rocket_trigger: ok at Route24 (11, 16) facing north (tile)", + "[Event] 00.16/20 below_rocket_trigger: done", + "[Event] 00.16/21 rocket_trigger: start", + "00.16/rocket_trigger: ok at Route24 (11, 15) facing north (tile)", + "[Event] 00.16/21 rocket_trigger: done", + "[Event] 00.16/22 rocket_grunt: start", + "00.16/rocket_grunt: ok at -", + "[Event] 00.16/22 rocket_grunt: done", + "save at Route24 (11, 15) facing east (tile)", + "[Checkpoint] 00.16: done, 22 run, 0 skipped", + "[Checkpoint] 00.16: passed on attempt 1 (one-shot)", + "begin 00.17", + "[Checkpoint] 00.17: start, 15 events", + "[Event] 00.17/1 from_save: start", + "[Event] 00.17/1 from_save: done", + "[Event] 00.17/2 below_franklin_line: start", + "00.17/below_franklin_line: ok at Route25 (15, 5) facing north (tile)", + "[Event] 00.17/2 below_franklin_line: done", + "[Event] 00.17/3 franklin_line: start", + "00.17/franklin_line: ok at Route25 (15, 4) facing north (tile)", + "[Event] 00.17/3 franklin_line: done", + "[Event] 00.17/4 hiker_franklin: start", + "00.17/hiker_franklin: ok at -", + "[Event] 00.17/4 hiker_franklin: done", + "[Event] 00.17/5 west_of_dan: start", + "00.17/west_of_dan: ok at Route25 (19, 4) facing north (tile)", + "[Event] 00.17/5 west_of_dan: done", + "[Event] 00.17/6 round_dan: start", + "00.17/round_dan: ok at Route25 (24, 7) facing south (tile)", + "[Event] 00.17/6 round_dan: done", + "[Event] 00.17/7 kelsey_line: start", + "00.17/kelsey_line: ok at Route25 (24, 8) facing south (tile)", + "[Event] 00.17/7 kelsey_line: done", + "[Event] 00.17/8 picnicker_kelsey: start", + "00.17/picnicker_kelsey: ok at -", + "[Event] 00.17/8 picnicker_kelsey: done", + "[Event] 00.17/9 west_of_nob_line: start", + "00.17/west_of_nob_line: ok at Route25 (26, 8) facing east (tile)", + "[Event] 00.17/9 west_of_nob_line: done", + "[Event] 00.17/10 nob_line: start", + "00.17/nob_line: ok at Route25 (27, 8) facing east (tile)", + "[Event] 00.17/10 nob_line: done", + "[Event] 00.17/11 hiker_nob: start", + "00.17/hiker_nob: ok at -", + "[Event] 00.17/11 hiker_nob: done", + "[Event] 00.17/12 below_haley_line: start", + "00.17/below_haley_line: ok at Route25 (42, 9) facing east (tile)", + "[Event] 00.17/12 below_haley_line: done", + "[Event] 00.17/13 haley_line: start", + "00.17/haley_line: ok at Route25 (42, 8) facing north (tile)", + "[Event] 00.17/13 haley_line: done", + "[Event] 00.17/14 lass_haley: start", + "00.17/lass_haley: ok at -", + "[Event] 00.17/14 lass_haley: done", + "[Event] 00.17/15 sea_cottage: start", + "00.17/sea_cottage: ok at Route25_SeaCottage (7, 8) facing north (tile)", + "[Event] 00.17/15 sea_cottage: done", + "save at Route25_SeaCottage (7, 8) facing north (tile)", + "[Checkpoint] 00.17: done, 15 run, 0 skipped", + "[Checkpoint] 00.17: passed on attempt 1 (one-shot)", + "begin 00.18", + "[Checkpoint] 00.18: start, 13 events", + "[Event] 00.18/1 from_save: start", + "[Event] 00.18/1 from_save: done", + "[Event] 00.18/2 below_bill_clefairy: start", + "00.18/below_bill_clefairy: ok at Route25_SeaCottage (10, 7) facing north (tile)", + "[Event] 00.18/2 below_bill_clefairy: done", + "[Event] 00.18/3 bill_clefairy: start", + "00.18/bill_clefairy: ok at -", + "[Event] 00.18/3 bill_clefairy: done", + "[Event] 00.18/4 help_bill: start", + "00.18/help_bill: ok at -", + "[Event] 00.18/4 help_bill: done", + "[Event] 00.18/5 bill_into_teleporter: start", + "00.18/bill_into_teleporter: ok at -", + "[Event] 00.18/5 bill_into_teleporter: done", + "[Event] 00.18/6 pc_front: start", + "00.18/pc_front: ok at Route25_SeaCottage (4, 6) facing north (tile)", + "[Event] 00.18/6 pc_front: done", + "[Event] 00.18/7 cell_separator: start", + "00.18/cell_separator: ok at -", + "[Event] 00.18/7 cell_separator: done", + "[Event] 00.18/8 bill_comes_out: start", + "00.18/bill_comes_out: ok at -", + "[Event] 00.18/8 bill_comes_out: done", + "[Event] 00.18/9 beside_bill: start", + "00.18/beside_bill: ok at Route25_SeaCottage (6, 6) facing east (tile)", + "[Event] 00.18/9 beside_bill: done", + "[Event] 00.18/10 thank_bill: start", + "00.18/thank_bill: ok at -", + "[Event] 00.18/10 thank_bill: done", + "[Event] 00.18/11 ss_ticket: start", + "00.18/ss_ticket: ok at -", + "[Event] 00.18/11 ss_ticket: done", + "[Event] 00.18/12 around_bill: start", + "00.18/around_bill: ok at Route25_SeaCottage (7, 8) facing east (tile)", + "[Event] 00.18/12 around_bill: done", + "[Event] 00.18/13 out_of_cottage: start", + "00.18/out_of_cottage: ok at Route25 (51, 5) facing south (tile)", + "[Event] 00.18/13 out_of_cottage: done", + "save at Route25 (51, 5) facing south (tile)", + "[Checkpoint] 00.18: done, 13 run, 0 skipped", + "[Checkpoint] 00.18: passed on attempt 1 (one-shot)", + "begin 00.19", + "[Checkpoint] 00.19: start, 5 events", + "[Event] 00.19/1 from_save: start", + "[Event] 00.19/1 from_save: done", + "[Event] 00.19/2 above_cerulean_ledge: start", + "00.19/above_cerulean_ledge: ok at CeruleanCity (27, 0) facing south (tile)", + "[Event] 00.19/2 above_cerulean_ledge: done", + "[Event] 00.19/3 cerulean_ledge_hop: start", + "00.19/cerulean_ledge_hop: ok at CeruleanCity (27, 1) facing south (tile)", + "[Event] 00.19/3 cerulean_ledge_hop: done", + "[Event] 00.19/4 cerulean_nurse: start", + "00.19/cerulean_nurse: ok at CeruleanCity_PokemonCenter_1F (7, 4) facing north (tile)", + "[Event] 00.19/4 cerulean_nurse: done", + "[Event] 00.19/5 heal_cerulean: start", + "00.19/heal_cerulean: ok at -", + "[Event] 00.19/5 heal_cerulean: done", + "save at CeruleanCity_PokemonCenter_1F (7, 4) facing north (tile)", + "[Checkpoint] 00.19: done, 5 run, 0 skipped", + "[Checkpoint] 00.19: passed on attempt 1 (one-shot)", + "begin 00.20", + "[Checkpoint] 00.20: start, 7 events", + "[Event] 00.20/1 from_save: start", + "[Event] 00.20/1 from_save: done", + "[Event] 00.20/2 mart_clerk: start", + "00.20/mart_clerk: ok at CeruleanCity_Mart (4, 3) facing west (tile)", + "[Event] 00.20/2 mart_clerk: done", + "[Event] 00.20/3 buy_poke_balls: start", + "00.20/buy_poke_balls: ok at CeruleanCity_Mart (4, 3) facing west (tile)", + "[Event] 00.20/3 buy_poke_balls: done", + "[Event] 00.20/4 oddish_patch: start", + "00.20/oddish_patch: ok at Route24 (3, 19) facing south (tile)", + "[Event] 00.20/4 oddish_patch: done", + "[Event] 00.20/5 catch_oddish: start", + "00.20/catch_oddish: ok at Route24 (3, 19) (4, 19) (set)", + "[Event] 00.20/5 catch_oddish: done", + "[Event] 00.20/6 cerulean_nurse: start", + "00.20/cerulean_nurse: ok at CeruleanCity_PokemonCenter_1F (7, 4) facing north (tile)", + "[Event] 00.20/6 cerulean_nurse: done", + "[Event] 00.20/7 heal_cerulean: start", + "00.20/heal_cerulean: ok at -", + "[Event] 00.20/7 heal_cerulean: done", + "save at CeruleanCity_PokemonCenter_1F (7, 4) facing north (tile)", + "[Checkpoint] 00.20: done, 7 run, 0 skipped", + "[Checkpoint] 00.20: passed on attempt 1 (one-shot)", + "begin 00.21", + "[Checkpoint] 00.21: start, 10 events", + "[Event] 00.21/1 from_save: start", + "[Event] 00.21/1 from_save: done", + "[Event] 00.21/2 west_of_rocket: start", + "00.21/west_of_rocket: ok at CeruleanCity (32, 7) facing east (tile)", + "[Event] 00.21/2 west_of_rocket: done", + "[Event] 00.21/3 rocket_trigger: start", + "00.21/rocket_trigger: ok at CeruleanCity (33, 7) facing east (tile)", + "[Event] 00.21/3 rocket_trigger: done", + "[Event] 00.21/4 rocket_grunt: start", + "00.21/rocket_grunt: ok at -", + "[Event] 00.21/4 rocket_grunt: done", + "[Event] 00.21/5 route6_column15: start", + "00.21/route6_column15: ok at Route6 (15, 14) facing west (tile)", + "[Event] 00.21/5 route6_column15: done", + "[Event] 00.21/6 round_keigo_and_elijah: start", + "00.21/round_keigo_and_elijah: ok at Route6 (9, 33) facing east (tile)", + "[Event] 00.21/6 round_keigo_and_elijah: done", + "[Event] 00.21/7 jeff_line: start", + "00.21/jeff_line: ok at Route6 (10, 33) facing east (tile)", + "[Event] 00.21/7 jeff_line: done", + "[Event] 00.21/8 camper_jeff: start", + "00.21/camper_jeff: ok at -", + "[Event] 00.21/8 camper_jeff: done", + "[Event] 00.21/9 vermilion_nurse: start", + "00.21/vermilion_nurse: ok at VermilionCity_PokemonCenter_1F (7, 4) facing north (tile)", + "[Event] 00.21/9 vermilion_nurse: done", + "[Event] 00.21/10 heal_vermilion: start", + "00.21/heal_vermilion: ok at -", + "[Event] 00.21/10 heal_vermilion: done", + "save at VermilionCity_PokemonCenter_1F (7, 4) facing north (tile)", + "[Checkpoint] 00.21: done, 10 run, 0 skipped", + "[Checkpoint] 00.21: passed on attempt 1 (one-shot)", + "begin 00.22", + "[Checkpoint] 00.22: start, 19 events", + "[Event] 00.22/1 from_save: start", + "[Event] 00.22/1 from_save: done", + "[Event] 00.22/2 above_ticket_check: start", + "00.22/above_ticket_check: ok at VermilionCity (23, 32) facing south (tile)", + "[Event] 00.22/2 above_ticket_check: done", + "[Event] 00.22/3 ticket_check: start", + "00.22/ticket_check: ok at VermilionCity (23, 33) facing south (tile)", + "[Event] 00.22/3 ticket_check: done", + "[Event] 00.22/4 show_ss_ticket: start", + "00.22/show_ss_ticket: ok at -", + "[Event] 00.22/4 show_ss_ticket: done", + "[Event] 00.22/5 aboard: start", + "00.22/aboard: ok at SSAnne_1F_Corridor (19, 2) facing south (tile)", + "[Event] 00.22/5 aboard: done", + "[Event] 00.22/6 past_the_cabins: start", + "00.22/past_the_cabins: ok at SSAnne_1F_Corridor (13, 8) facing north (tile)", + "[Event] 00.22/6 past_the_cabins: done", + "[Event] 00.22/7 below_rival_trigger: start", + "00.22/below_rival_trigger: ok at SSAnne_2F_Corridor (30, 7) facing north (tile)", + "[Event] 00.22/7 below_rival_trigger: done", + "[Event] 00.22/8 rival_trigger: start", + "00.22/rival_trigger: ok at SSAnne_2F_Corridor (30, 6) facing north (tile)", + "[Event] 00.22/8 rival_trigger: done", + "[Event] 00.22/9 rival_ss_anne: start", + "00.22/rival_ss_anne: ok at -", + "[Event] 00.22/9 rival_ss_anne: done", + "[Event] 00.22/10 behind_captain: start", + "00.22/behind_captain: ok at SSAnne_CaptainsOffice (5, 5) facing north (tile)", + "[Event] 00.22/10 behind_captain: done", + "[Event] 00.22/11 captain: start", + "00.22/captain: ok at -", + "[Event] 00.22/11 captain: done", + "[Event] 00.22/12 hm01_cut: start", + "00.22/hm01_cut: ok at -", + "[Event] 00.22/12 hm01_cut: done", + "[Event] 00.22/13 off_2f: start", + "00.22/off_2f: ok at SSAnne_1F_Corridor (13, 8) facing east (tile)", + "[Event] 00.22/13 off_2f: done", + "[Event] 00.22/14 round_the_sailor: start", + "00.22/round_the_sailor: ok at SSAnne_1F_Corridor (19, 9) facing east (tile)", + "[Event] 00.22/14 round_the_sailor: done", + "[Event] 00.22/15 below_ship_door: start", + "00.22/below_ship_door: ok at SSAnne_1F_Corridor (19, 2) facing north (tile)", + "[Event] 00.22/15 below_ship_door: done", + "[Event] 00.22/16 off_the_ship: start", + "00.22/off_the_ship: ok at SSAnne_1F_Corridor (19, 1) facing north (tile)", + "[Event] 00.22/16 off_the_ship: done", + "[Event] 00.22/17 ss_anne_sails: start", + "00.22/ss_anne_sails: ok at -", + "[Event] 00.22/17 ss_anne_sails: done", + "[Event] 00.22/18 vermilion_nurse: start", + "00.22/vermilion_nurse: ok at VermilionCity_PokemonCenter_1F (7, 4) facing north (tile)", + "[Event] 00.22/18 vermilion_nurse: done", + "[Event] 00.22/19 heal_vermilion: start", + "00.22/heal_vermilion: ok at -", + "[Event] 00.22/19 heal_vermilion: done", + "save at VermilionCity_PokemonCenter_1F (7, 4) facing north (tile)", + "[Checkpoint] 00.22: done, 19 run, 0 skipped", + "[Checkpoint] 00.22: passed on attempt 1 (one-shot)", + "begin 00.23", + "[Checkpoint] 00.23: start, 20 events", + "[Event] 00.23/1 from_save: start", + "[Event] 00.23/1 from_save: done", + "[Event] 00.23/2 teach_cut: start", + "00.23/teach_cut: ok at VermilionCity_PokemonCenter_1F (7, 4) facing north (tile)", + "[Event] 00.23/2 teach_cut: done", + "[Event] 00.23/3 teach_dig: start", + "00.23/teach_dig: ok at VermilionCity_PokemonCenter_1F (7, 4) facing north (tile)", + "[Event] 00.23/3 teach_dig: done", + "[Event] 00.23/4 above_gym_tree: start", + "00.23/above_gym_tree: ok at VermilionCity (19, 23) facing south (tile)", + "[Event] 00.23/4 above_gym_tree: done", + "[Event] 00.23/5 cut_gym_tree: start", + "00.23/cut_gym_tree: ok at VermilionCity (19, 23) facing south (tile)", + "[Event] 00.23/5 cut_gym_tree: done", + "[Event] 00.23/6 gym_door: start", + "00.23/gym_door: ok at VermilionCity_Gym (5, 19) facing north (tile)", + "[Event] 00.23/6 gym_door: done", + "[Event] 00.23/7 west_of_dwayne_line: start", + "00.23/west_of_dwayne_line: ok at VermilionCity_Gym (7, 15) facing east (tile)", + "[Event] 00.23/7 west_of_dwayne_line: done", + "[Event] 00.23/8 dwayne_sight: start", + "00.23/dwayne_sight: ok at VermilionCity_Gym (8, 15) facing east (tile)", + "[Event] 00.23/8 dwayne_sight: done", + "[Event] 00.23/9 sailor_dwayne: start", + "00.23/sailor_dwayne: ok at -", + "[Event] 00.23/9 sailor_dwayne: done", + "[Event] 00.23/10 east_of_baily_line: start", + "00.23/east_of_baily_line: ok at VermilionCity_Gym (3, 13) facing west (tile)", + "[Event] 00.23/10 east_of_baily_line: done", + "[Event] 00.23/11 baily_sight: start", + "00.23/baily_sight: ok at VermilionCity_Gym (2, 13) facing west (tile)", + "[Event] 00.23/11 baily_sight: done", + "[Event] 00.23/12 engineer_baily: start", + "00.23/engineer_baily: ok at -", + "[Event] 00.23/12 engineer_baily: done", + "[Event] 00.23/13 below_tucker_line: start", + "00.23/below_tucker_line: ok at VermilionCity_Gym (5, 9) facing east (tile)", + "[Event] 00.23/13 below_tucker_line: done", + "[Event] 00.23/14 tucker_line: start", + "00.23/tucker_line: ok at VermilionCity_Gym (5, 8) facing north (tile)", + "[Event] 00.23/14 tucker_line: done", + "[Event] 00.23/15 gentleman_tucker: start", + "00.23/gentleman_tucker: ok at -", + "[Event] 00.23/15 gentleman_tucker: done", + "[Event] 00.23/16 trash_cans: start", + "00.23/trash_cans: ok at VermilionCity_Gym (5, 8) facing east (tile)", + "[Event] 00.23/16 trash_cans: done", + "[Event] 00.23/17 below_gym_tree: start", + "00.23/below_gym_tree: ok at VermilionCity (19, 25) facing north (tile)", + "[Event] 00.23/17 below_gym_tree: done", + "[Event] 00.23/18 cut_tree_out: start", + "00.23/cut_tree_out: ok at VermilionCity (19, 25) facing north (tile)", + "[Event] 00.23/18 cut_tree_out: done", + "[Event] 00.23/19 vermilion_nurse: start", + "00.23/vermilion_nurse: ok at VermilionCity_PokemonCenter_1F (7, 4) facing north (tile)", + "[Event] 00.23/19 vermilion_nurse: done", + "[Event] 00.23/20 heal_vermilion: start", + "00.23/heal_vermilion: ok at -", + "[Event] 00.23/20 heal_vermilion: done", + "save at VermilionCity_PokemonCenter_1F (7, 4) facing north (tile)", + "[Checkpoint] 00.23: done, 20 run, 0 skipped", + "[Checkpoint] 00.23: passed on attempt 1 (one-shot)", + "begin 00.24", + "[Checkpoint] 00.24: start, 12 events", + "[Event] 00.24/1 from_save: start", + "[Event] 00.24/1 from_save: done", + "[Event] 00.24/2 surge_winnable: start", + "00.24/surge_winnable: ok at VermilionCity_PokemonCenter_1F (7, 4) facing north (tile)", + "[Event] 00.24/2 surge_winnable: done", + "[Event] 00.24/3 route6_south_path: start", + "00.24/route6_south_path: ok at Route6 (11, 34) facing north (tile)", + "[Event] 00.24/3 route6_south_path: done", + "[Event] 00.24/4 round_isabelle_line: start", + "00.24/round_isabelle_line: ok at Route6 (13, 31) facing east (tile)", + "[Event] 00.24/4 round_isabelle_line: done", + "[Event] 00.24/5 grind_for_surge: start", + "00.24/grind_for_surge: ok at Route6 (13, 31) (14, 31) (set)", + "[Event] 00.24/5 grind_for_surge: done", + "[Event] 00.24/6 west_on_row_31: start", + "00.24/west_on_row_31: ok at Route6 (7, 31) facing west (tile)", + "[Event] 00.24/6 west_on_row_31: done", + "[Event] 00.24/7 down_to_jeff_row: start", + "00.24/down_to_jeff_row: ok at Route6 (11, 33) facing east (tile)", + "[Event] 00.24/7 down_to_jeff_row: done", + "[Event] 00.24/8 vermilion_nurse: start", + "00.24/vermilion_nurse: ok at VermilionCity_PokemonCenter_1F (7, 4) facing north (tile)", + "[Event] 00.24/8 vermilion_nurse: done", + "[Event] 00.24/9 heal_vermilion: start", + "00.24/heal_vermilion: ok at -", + "[Event] 00.24/9 heal_vermilion: done", + "[Event] 00.24/10 above_gym_tree: start", + "00.24/above_gym_tree: ok at VermilionCity (19, 23) facing south (tile)", + "[Event] 00.24/10 above_gym_tree: done", + "[Event] 00.24/11 cut_gym_tree: start", + "00.24/cut_gym_tree: ok at VermilionCity (19, 23) facing south (tile)", + "[Event] 00.24/11 cut_gym_tree: done", + "[Event] 00.24/12 below_lt_surge: start", + "00.24/below_lt_surge: ok at VermilionCity_Gym (5, 3) facing north (tile)", + "[Event] 00.24/12 below_lt_surge: done", + "save at VermilionCity_Gym (5, 3) facing north (tile)", + "[Checkpoint] 00.24: done, 12 run, 0 skipped", + "[Checkpoint] 00.24: passed on attempt 1 (one-shot)", + "begin 00.25", + "[Checkpoint] 00.25: start, 8 events", + "[Event] 00.25/1 from_save: start", + "[Event] 00.25/1 from_save: done", + "[Event] 00.25/2 challenge_lt_surge: start", + "00.25/challenge_lt_surge: ok at -", + "[Event] 00.25/2 challenge_lt_surge: done", + "[Event] 00.25/3 lt_surge: start", + "00.25/lt_surge: ok at -", + "[Event] 00.25/3 lt_surge: done", + "[Event] 00.25/4 below_gym_tree: start", + "00.25/below_gym_tree: ok at VermilionCity (19, 25) facing north (tile)", + "[Event] 00.25/4 below_gym_tree: done", + "[Event] 00.25/5 cut_tree_out: start", + "00.25/cut_tree_out: ok at VermilionCity (19, 25) facing north (tile)", + "[Event] 00.25/5 cut_tree_out: done", + "[Event] 00.25/6 below_oaks_aide: start", + "00.25/below_oaks_aide: ok at VermilionCity (14, 10) facing west (tile)", + "[Event] 00.25/6 below_oaks_aide: done", + "[Event] 00.25/7 vermilion_nurse: start", + "00.25/vermilion_nurse: ok at VermilionCity_PokemonCenter_1F (7, 4) facing north (tile)", + "[Event] 00.25/7 vermilion_nurse: done", + "[Event] 00.25/8 heal_vermilion: start", + "00.25/heal_vermilion: ok at -", + "[Event] 00.25/8 heal_vermilion: done", + "save at VermilionCity_PokemonCenter_1F (7, 4) facing north (tile)", + "[Checkpoint] 00.25: done, 8 run, 0 skipped", + "[Checkpoint] 00.25: passed on attempt 1 (one-shot)", + "begin 00.26", + "[Checkpoint] 00.26: start, 18 events", + "[Event] 00.26/1 from_save: start", + "[Event] 00.26/1 from_save: done", + "[Event] 00.26/2 below_center: start", + "00.26/below_center: ok at VermilionCity (14, 10) facing west (tile)", + "[Event] 00.26/2 below_center: done", + "[Event] 00.26/3 beside_chairman: start", + "00.26/beside_chairman: ok at VermilionCity_PokemonFanClub (4, 4) facing east (tile)", + "[Event] 00.26/3 beside_chairman: done", + "[Event] 00.26/4 chairman: start", + "00.26/chairman: ok at -", + "[Event] 00.26/4 chairman: done", + "[Event] 00.26/5 hear_story: start", + "00.26/hear_story: ok at -", + "[Event] 00.26/5 hear_story: done", + "[Event] 00.26/6 bike_voucher: start", + "00.26/bike_voucher: ok at -", + "[Event] 00.26/6 bike_voucher: done", + "[Event] 00.26/7 west_of_oaks_aide: start", + "00.26/west_of_oaks_aide: ok at VermilionCity (22, 10) facing west (tile)", + "[Event] 00.26/7 west_of_oaks_aide: done", + "[Event] 00.26/8 route6_south_path: start", + "00.26/route6_south_path: ok at Route6 (11, 34) facing north (tile)", + "[Event] 00.26/8 route6_south_path: done", + "[Event] 00.26/9 round_isabelle_and_elijah: start", + "00.26/round_isabelle_and_elijah: ok at Route6 (16, 12) facing north (tile)", + "[Event] 00.26/9 round_isabelle_and_elijah: done", + "[Event] 00.26/10 below_cerulean_tree: start", + "00.26/below_cerulean_tree: ok at CeruleanCity (26, 33) facing north (tile)", + "[Event] 00.26/10 below_cerulean_tree: done", + "[Event] 00.26/11 cut_cerulean_tree: start", + "00.26/cut_cerulean_tree: ok at CeruleanCity (26, 33) facing north (tile)", + "[Event] 00.26/11 cut_cerulean_tree: done", + "[Event] 00.26/12 bike_clerk: start", + "00.26/bike_clerk: ok at CeruleanCity_BikeShop (7, 3) facing east (tile)", + "[Event] 00.26/12 bike_clerk: done", + "[Event] 00.26/13 talk_bike_clerk: start", + "00.26/talk_bike_clerk: ok at -", + "[Event] 00.26/13 talk_bike_clerk: done", + "[Event] 00.26/14 bicycle: start", + "00.26/bicycle: ok at -", + "[Event] 00.26/14 bicycle: done", + "[Event] 00.26/15 mart_clerk: start", + "00.26/mart_clerk: ok at CeruleanCity_Mart (4, 3) facing west (tile)", + "[Event] 00.26/15 mart_clerk: done", + "[Event] 00.26/16 buy_repels: start", + "00.26/buy_repels: ok at CeruleanCity_Mart (4, 3) facing west (tile)", + "[Event] 00.26/16 buy_repels: done", + "[Event] 00.26/17 cerulean_nurse: start", + "00.26/cerulean_nurse: ok at CeruleanCity_PokemonCenter_1F (7, 4) facing north (tile)", + "[Event] 00.26/17 cerulean_nurse: done", + "[Event] 00.26/18 heal_cerulean: start", + "00.26/heal_cerulean: ok at -", + "[Event] 00.26/18 heal_cerulean: done", + "save at CeruleanCity_PokemonCenter_1F (7, 4) facing north (tile)", + "[Checkpoint] 00.26: done, 18 run, 0 skipped", + "[Checkpoint] 00.26: passed on attempt 1 (one-shot)", + "begin 00.27", + "[Checkpoint] 00.27: start, 23 events", + "[Event] 00.27/1 from_save: start", + "[Event] 00.27/1 from_save: done", + "[Event] 00.27/2 above_cerulean_tree: start", + "00.27/above_cerulean_tree: ok at CeruleanCity (26, 31) facing south (tile)", + "[Event] 00.27/2 above_cerulean_tree: done", + "[Event] 00.27/3 cut_cerulean_tree: start", + "00.27/cut_cerulean_tree: ok at CeruleanCity (26, 31) facing south (tile)", + "[Event] 00.27/3 cut_cerulean_tree: done", + "[Event] 00.27/4 west_of_route9_tree: start", + "00.27/west_of_route9_tree: ok at Route9 (1, 8) facing east (tile)", + "[Event] 00.27/4 west_of_route9_tree: done", + "[Event] 00.27/5 cut_route9_tree: start", + "00.27/cut_route9_tree: ok at Route9 (1, 8) facing east (tile)", + "[Event] 00.27/5 cut_route9_tree: done", + "[Event] 00.27/6 above_alicia_line: start", + "00.27/above_alicia_line: ok at Route9 (11, 9) facing south (tile)", + "[Event] 00.27/6 above_alicia_line: done", + "[Event] 00.27/7 alicia_line: start", + "00.27/alicia_line: ok at Route9 (11, 10) facing south (tile)", + "[Event] 00.27/7 alicia_line: done", + "[Event] 00.27/8 picnicker_alicia: start", + "00.27/picnicker_alicia: ok at -", + "[Event] 00.27/8 picnicker_alicia: done", + "[Event] 00.27/9 alicia_ledge_hop: start", + "00.27/alicia_ledge_hop: ok at Route9 (11, 11) facing south (tile)", + "[Event] 00.27/9 alicia_ledge_hop: done", + "[Event] 00.27/10 west_of_jeremy_sight: start", + "00.27/west_of_jeremy_sight: ok at Route9 (19, 13) facing east (tile)", + "[Event] 00.27/10 west_of_jeremy_sight: done", + "[Event] 00.27/11 jeremy_sight: start", + "00.27/jeremy_sight: ok at Route9 (20, 13) facing east (tile)", + "[Event] 00.27/11 jeremy_sight: done", + "[Event] 00.27/12 hiker_jeremy: start", + "00.27/hiker_jeremy: ok at -", + "[Event] 00.27/12 hiker_jeremy: done", + "[Event] 00.27/13 below_conner_line: start", + "00.27/below_conner_line: ok at Route9 (52, 8) facing north (tile)", + "[Event] 00.27/13 below_conner_line: done", + "[Event] 00.27/14 conner_line: start", + "00.27/conner_line: ok at Route9 (52, 7) facing north (tile)", + "[Event] 00.27/14 conner_line: done", + "[Event] 00.27/15 bug_catcher_conner: start", + "00.27/bug_catcher_conner: ok at -", + "[Event] 00.27/15 bug_catcher_conner: done", + "[Event] 00.27/16 round_brice: start", + "00.27/round_brice: ok at Route9 (64, 2) facing south (tile)", + "[Event] 00.27/16 round_brice: done", + "[Event] 00.27/17 above_east_ledge: start", + "00.27/above_east_ledge: ok at Route9 (64, 3) facing south (tile)", + "[Event] 00.27/17 above_east_ledge: done", + "[Event] 00.27/18 east_ledge_hop: start", + "00.27/east_ledge_hop: ok at Route9 (64, 4) facing south (tile)", + "[Event] 00.27/18 east_ledge_hop: done", + "[Event] 00.27/19 above_caitlin_line: start", + "00.27/above_caitlin_line: ok at Route9 (70, 8) facing east (tile)", + "[Event] 00.27/19 above_caitlin_line: done", + "[Event] 00.27/20 route10_ledge_end: start", + "00.27/route10_ledge_end: ok at Route10 (17, 11) facing east (tile)", + "[Event] 00.27/20 route10_ledge_end: done", + "[Event] 00.27/21 below_center_door: start", + "00.27/below_center_door: ok at Route10 (13, 21) facing east (tile)", + "[Event] 00.27/21 below_center_door: done", + "[Event] 00.27/22 route10_nurse: start", + "00.27/route10_nurse: ok at Route10_PokemonCenter_1F (7, 4) facing north (tile)", + "[Event] 00.27/22 route10_nurse: done", + "[Event] 00.27/23 heal_route10: start", + "00.27/heal_route10: ok at -", + "[Event] 00.27/23 heal_route10: done", + "save at Route10_PokemonCenter_1F (7, 4) facing north (tile)", + "[Checkpoint] 00.27: done, 23 run, 0 skipped", + "[Checkpoint] 00.27: passed on attempt 1 (one-shot)", + "begin 00.28", + "[Checkpoint] 00.28: start, 39 events", + "[Event] 00.28/1 from_save: start", + "[Event] 00.28/1 from_save: done", + "[Event] 00.28/2 below_route10_tree: start", + "00.28/below_route10_tree: ok at Route10 (10, 21) facing north (tile)", + "[Event] 00.28/2 below_route10_tree: done", + "[Event] 00.28/3 cut_route10_tree: start", + "00.28/cut_route10_tree: ok at Route10 (10, 21) facing north (tile)", + "[Event] 00.28/3 cut_route10_tree: done", + "[Event] 00.28/4 west_of_tree: start", + "00.28/west_of_tree: ok at Route10 (9, 20) facing west (tile)", + "[Event] 00.28/4 west_of_tree: done", + "[Event] 00.28/5 below_rock_tunnel: start", + "00.28/below_rock_tunnel: ok at Route10 (8, 20) facing west (tile)", + "[Event] 00.28/5 below_rock_tunnel: done", + "[Event] 00.28/6 rock_tunnel_1f: start", + "00.28/rock_tunnel_1f: ok at RockTunnel_1F (17, 2) facing north (tile)", + "[Event] 00.28/6 rock_tunnel_1f: done", + "[Event] 00.28/7 above_ashton_line: start", + "00.28/above_ashton_line: ok at RockTunnel_1F (24, 9) facing west (tile)", + "[Event] 00.28/7 above_ashton_line: done", + "[Event] 00.28/8 ashton_line: start", + "00.28/ashton_line: ok at RockTunnel_1F (24, 10) facing south (tile)", + "[Event] 00.28/8 ashton_line: done", + "[Event] 00.28/9 pokemaniac_ashton: start", + "00.28/pokemaniac_ashton: ok at -", + "[Event] 00.28/9 pokemaniac_ashton: done", + "[Event] 00.28/10 b1f_south_ladder: start", + "00.28/b1f_south_ladder: ok at RockTunnel_B1F (38, 28) facing north (tile)", + "[Event] 00.28/10 b1f_south_ladder: done", + "[Event] 00.28/11 winston_line_end: start", + "00.28/winston_line_end: ok at RockTunnel_B1F (32, 37) facing west (tile)", + "[Event] 00.28/11 winston_line_end: done", + "[Event] 00.28/12 winston_line: start", + "00.28/winston_line: ok at RockTunnel_B1F (29, 37) facing west (tile)", + "[Event] 00.28/12 winston_line: done", + "[Event] 00.28/13 pokemaniac_winston: start", + "00.28/pokemaniac_winston: ok at -", + "[Event] 00.28/13 pokemaniac_winston: done", + "[Event] 00.28/14 below_martha_line: start", + "00.28/below_martha_line: ok at RockTunnel_B1F (16, 35) facing east (tile)", + "[Event] 00.28/14 below_martha_line: done", + "[Event] 00.28/15 martha_line: start", + "00.28/martha_line: ok at RockTunnel_B1F (16, 33) facing north (tile)", + "[Event] 00.28/15 martha_line: done", + "[Event] 00.28/16 picnicker_martha: start", + "00.28/picnicker_martha: ok at -", + "[Event] 00.28/16 picnicker_martha: done", + "[Event] 00.28/17 below_allen_line: start", + "00.28/below_allen_line: ok at RockTunnel_B1F (38, 12) facing north (tile)", + "[Event] 00.28/17 below_allen_line: done", + "[Event] 00.28/18 allen_line: start", + "00.28/allen_line: ok at RockTunnel_B1F (36, 12) facing west (tile)", + "[Event] 00.28/18 allen_line: done", + "[Event] 00.28/19 hiker_allen: start", + "00.28/hiker_allen: ok at -", + "[Event] 00.28/19 hiker_allen: done", + "[Event] 00.28/20 west_of_b1f_ladder: start", + "00.28/west_of_b1f_ladder: ok at RockTunnel_B1F (32, 2) facing north (tile)", + "[Event] 00.28/20 west_of_b1f_ladder: done", + "[Event] 00.28/21 1f_west_ladder: start", + "00.28/1f_west_ladder: ok at RockTunnel_1F (4, 2) facing north (tile)", + "[Event] 00.28/21 1f_west_ladder: done", + "[Event] 00.28/22 above_lenny_line: start", + "00.28/above_lenny_line: ok at RockTunnel_1F (6, 9) facing south (tile)", + "[Event] 00.28/22 above_lenny_line: done", + "[Event] 00.28/23 lenny_line: start", + "00.28/lenny_line: ok at RockTunnel_1F (7, 9) facing east (tile)", + "[Event] 00.28/23 lenny_line: done", + "[Event] 00.28/24 hiker_lenny: start", + "00.28/hiker_lenny: ok at -", + "[Event] 00.28/24 hiker_lenny: done", + "[Event] 00.28/25 west_of_lucas_line: start", + "00.28/west_of_lucas_line: ok at RockTunnel_1F (20, 16) facing east (tile)", + "[Event] 00.28/25 west_of_lucas_line: done", + "[Event] 00.28/26 b1f_middle_ladder: start", + "00.28/b1f_middle_ladder: ok at RockTunnel_B1F (27, 12) facing north (tile)", + "[Event] 00.28/26 b1f_middle_ladder: done", + "[Event] 00.28/27 east_of_sofia_line: start", + "00.28/east_of_sofia_line: ok at RockTunnel_B1F (13, 16) facing west (tile)", + "[Event] 00.28/27 east_of_sofia_line: done", + "[Event] 00.28/28 sofia_line: start", + "00.28/sofia_line: ok at RockTunnel_B1F (11, 16) facing west (tile)", + "[Event] 00.28/28 sofia_line: done", + "[Event] 00.28/29 picnicker_sofia: start", + "00.28/picnicker_sofia: ok at -", + "[Event] 00.28/29 picnicker_sofia: done", + "[Event] 00.28/30 east_of_dudley_line: start", + "00.28/east_of_dudley_line: ok at RockTunnel_B1F (8, 15) facing north (tile)", + "[Event] 00.28/30 east_of_dudley_line: done", + "[Event] 00.28/31 dudley_line: start", + "00.28/dudley_line: ok at RockTunnel_B1F (5, 15) facing west (tile)", + "[Event] 00.28/31 dudley_line: done", + "[Event] 00.28/32 hiker_dudley: start", + "00.28/hiker_dudley: ok at -", + "[Event] 00.28/32 hiker_dudley: done", + "[Event] 00.28/33 past_cooper: start", + "00.28/past_cooper: ok at RockTunnel_B1F (1, 3) facing south (tile)", + "[Event] 00.28/33 past_cooper: done", + "[Event] 00.28/34 1f_east_ladder: start", + "00.28/1f_east_ladder: ok at RockTunnel_1F (45, 21) facing north (tile)", + "[Event] 00.28/34 1f_east_ladder: done", + "[Event] 00.28/35 above_dana_line: start", + "00.28/above_dana_line: ok at RockTunnel_1F (28, 31) facing south (tile)", + "[Event] 00.28/35 above_dana_line: done", + "[Event] 00.28/36 dana_line: start", + "00.28/dana_line: ok at RockTunnel_1F (26, 31) facing west (tile)", + "[Event] 00.28/36 dana_line: done", + "[Event] 00.28/37 picnicker_dana: start", + "00.28/picnicker_dana: ok at -", + "[Event] 00.28/37 picnicker_dana: done", + "[Event] 00.28/38 above_south_mouth: start", + "00.28/above_south_mouth: ok at RockTunnel_1F (18, 36) facing west (tile)", + "[Event] 00.28/38 above_south_mouth: done", + "[Event] 00.28/39 route10_south: start", + "00.28/route10_south: ok at Route10 (8, 58) facing south (tile)", + "[Event] 00.28/39 route10_south: done", + "save at Route10 (8, 58) facing south (tile)", + "[Checkpoint] 00.28: done, 39 run, 0 skipped", + "[Checkpoint] 00.28: passed on attempt 1 (one-shot)", + "begin 00.29", + "[Checkpoint] 00.29: start, 7 events", + "[Event] 00.29/1 from_save: start", + "[Event] 00.29/1 from_save: done", + "[Event] 00.29/2 route10_east_side: start", + "00.29/route10_east_side: ok at Route10 (11, 73) facing west (tile)", + "[Event] 00.29/2 route10_east_side: done", + "[Event] 00.29/3 route10_ledge_hop: start", + "00.29/route10_ledge_hop: ok at Route10 (11, 74) facing south (tile)", + "[Event] 00.29/3 route10_ledge_hop: done", + "[Event] 00.29/4 lavender_north_wall: start", + "00.29/lavender_north_wall: ok at LavenderTown (11, 8) facing south (tile)", + "[Event] 00.29/4 lavender_north_wall: done", + "[Event] 00.29/5 below_center_door: start", + "00.29/below_center_door: ok at LavenderTown (6, 9) facing west (tile)", + "[Event] 00.29/5 below_center_door: done", + "[Event] 00.29/6 lavender_nurse: start", + "00.29/lavender_nurse: ok at LavenderTown_PokemonCenter_1F (7, 4) facing north (tile)", + "[Event] 00.29/6 lavender_nurse: done", + "[Event] 00.29/7 heal_lavender: start", + "00.29/heal_lavender: ok at -", + "[Event] 00.29/7 heal_lavender: done", + "save at LavenderTown_PokemonCenter_1F (7, 4) facing north (tile)", + "[Checkpoint] 00.29: done, 7 run, 0 skipped", + "[Checkpoint] 00.29: passed on attempt 1 (one-shot)", + "[Segment] 00: 33 of 33 checkpoints one-shot", + "[Segment] 00: done, 33 checkpoints", + "completed", + "00.01: 2 stubbed: intro, options\n00.02: 0 stubbed\n00.03: 1 stubbed: to_the_lab\n00.04: 5 stubbed: squirtle_ball, choose_squirtle, no_nickname, rival_takes_bulbasaur, rival_battle\n00.05: 1 stubbed: parcel_from_clerk\n00.06: 2 stubbed: give_parcel, pokedex_scene\n00.07: 2 stubbed: heal_viridian, old_man_tutorial\n00.08: 1 stubbed: heal_pewter\n00.09: 3 stubbed: camper_liam, challenge_brock, brock\n00.10: 1 stubbed: shoes_from_aide\n00.11: 4 stubbed: heal_pewter, bug_catcher_colton, bug_catcher_greg, bug_catcher_james\n00.12: 1 stubbed: heal_route4\n00.12c: 1 stubbed: magikarp_to_box\n00.13: 6 stubbed: heal_route4, moon_stone_ball, found_moon_stone, rocket_grunt, super_nerd_miguel, helix_fossil\n00.14: 2 stubbed: teach_mega_kick, heal_cerulean\n00.14b: 3 stubbed: buy_potions, grind_to_lv23, heal_cerulean\n00.14c: 4 stubbed: challenge_misty, misty, heal_cerulean, teach_water_pulse\n00.15: 4 stubbed: teach_water_pulse, buy_potions, grind_for_rival, heal_cerulean\n00.15b: 2 stubbed: teach_water_pulse, rival_cerulean\n00.16: 7 stubbed: heal_cerulean, bug_catcher_cale, lass_ali, youngster_timmy, lass_reli, camper_ethan, rocket_grunt\n00.17: 4 stubbed: hiker_franklin, picnicker_kelsey, hiker_nob, lass_haley\n00.18: 7 stubbed: bill_clefairy, help_bill, bill_into_teleporter, cell_separator, bill_comes_out, thank_bill, ss_ticket\n00.19: 1 stubbed: heal_cerulean\n00.20: 3 stubbed: buy_poke_balls, catch_oddish, heal_cerulean\n00.21: 3 stubbed: rocket_grunt, camper_jeff, heal_vermilion\n00.22: 6 stubbed: show_ss_ticket, rival_ss_anne, captain, hm01_cut, ss_anne_sails, heal_vermilion\n00.23: 9 stubbed: teach_cut, teach_dig, cut_gym_tree, sailor_dwayne, engineer_baily, gentleman_tucker, trash_cans, cut_tree_out, heal_vermilion\n00.24: 4 stubbed: surge_winnable, grind_for_surge, heal_vermilion, cut_gym_tree\n00.25: 4 stubbed: challenge_lt_surge, lt_surge, cut_tree_out, heal_vermilion\n00.26: 8 stubbed: chairman, hear_story, bike_voucher, cut_cerulean_tree, talk_bike_clerk, bicycle, buy_repels, heal_cerulean\n00.27: 6 stubbed: cut_cerulean_tree, cut_route9_tree, picnicker_alicia, hiker_jeremy, bug_catcher_conner, heal_route10\n00.28: 9 stubbed: cut_route10_tree, pokemaniac_ashton, pokemaniac_winston, picnicker_martha, hiker_allen, hiker_lenny, picnicker_sofia, hiker_dudley, picnicker_dana\n00.29: 1 stubbed: heal_lavender\n" + ] +} diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.01.plan.json b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.01.plan.json new file mode 100644 index 0000000000..f265a765ba --- /dev/null +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.01.plan.json @@ -0,0 +1,31 @@ +{ + "format": "pokesim-authored-checkpoint/1", + "game": "frlg", + "checkpoint": { + "id": "00.01", + "title": "new game to the bedroom", + "sections": [ + { + "id": "new_game", + "title": "Title screen to the bedroom", + "events": [ + { + "id": "intro", + "kind": "new_game", + "declared_after": {"certainty": "tile", "map": "PalletTown_PlayersHouse_2F", "where": {"facing": "north", "kind": "tiles", "tiles": [[6, 6]]}}, + "why": "Oak's speech, BOY, the player's name (default if none is set), rival GREEN", + "notes": [ + "new_game.c: the bedroom at (6, 6), facing the TV." + ] + }, + { + "id": "options", + "kind": "options", + "why": "fast text; no switch prompt between a trainer's Pokemon" + } + ] + } + ] + }, + "execution": {"handoff": "sid_helper", "menu": "before_pokemon"} +} diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.01b.plan.json b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.01b.plan.json new file mode 100644 index 0000000000..bbf99b42a9 --- /dev/null +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.01b.plan.json @@ -0,0 +1,33 @@ +{ + "format": "pokesim-authored-checkpoint/1", + "game": "frlg", + "checkpoint": { + "id": "00.01b", + "title": "after SID Helper: close the Trainer Card, save in the bedroom", + "notes": [ + "SID Helper confirms the name, finishes the intro and reads the Trainer Card from the START menu, without moving the player or saving." + ], + "start": {"certainty": "tile", "map": "PalletTown_PlayersHouse_2F", "where": {"facing": "north", "kind": "tiles", "tiles": [[6, 6]]}}, + "sections": [ + { + "id": "bedroom", + "title": "Back from SID Helper in the bedroom", + "events": [ + { + "id": "close_trainer_card", + "kind": "game_action", + "variant": "close_trainer_card", + "declared_after": {"certainty": "tile", "map": "PalletTown_PlayersHouse_2F", "where": {"facing": "north", "kind": "tiles", "tiles": [[6, 6]]}}, + "why": "the Trainer Card SID Helper left open, or HOME" + }, + { + "id": "options", + "kind": "options", + "why": "fast text; no switch prompt between a trainer's Pokemon" + } + ] + } + ] + }, + "execution": {"live_start": true, "menu": "before_pokemon"} +} diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.02.plan.json b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.02.plan.json new file mode 100644 index 0000000000..24d0869164 --- /dev/null +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.02.plan.json @@ -0,0 +1,24 @@ +{ + "format": "pokesim-authored-checkpoint/1", + "game": "frlg", + "checkpoint": { + "id": "00.02", + "title": "bedroom to Pallet Town", + "start": {"certainty": "tile", "map": "PalletTown_PlayersHouse_2F", "where": {"facing": "north", "kind": "tiles", "tiles": [[6, 6]]}}, + "sections": [ + { + "id": "players_house", + "title": "Down the stairs and out", + "events": [ + { + "id": "front_door", + "kind": "route", + "target": {"certainty": "tile", "map": "PalletTown", "where": {"kind": "tiles", "tiles": [[6, 8]]}}, + "why": "down the stairs and out of the house" + } + ] + } + ] + }, + "execution": {"menu": "before_pokemon"} +} diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.03.plan.json b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.03.plan.json new file mode 100644 index 0000000000..a357eec763 --- /dev/null +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.03.plan.json @@ -0,0 +1,39 @@ +{ + "format": "pokesim-authored-checkpoint/1", + "game": "frlg", + "checkpoint": { + "id": "00.03", + "title": "Oak stops the player and walks them to the lab", + "start": {"certainty": "tile", "map": "PalletTown", "where": {"facing": "south", "kind": "tiles", "tiles": [[6, 8]]}}, + "sections": [ + { + "id": "pallet_north", + "title": "Pallet Town's north exit to Oak's lab", + "events": [ + { + "id": "below_oaks_trigger", + "kind": "route", + "target": {"certainty": "tile", "map": "PalletTown", "where": {"facing": "north", "kind": "tiles", "tiles": [[12, 2]]}}, + "why": "below the north exit, short of Oak's trigger at (12, 1)" + }, + { + "id": "oaks_trigger", + "kind": "step", + "direction": "north", + "why": "the trigger: \"Don't go out!\"" + }, + { + "id": "to_the_lab", + "kind": "scene", + "declared_after": {"certainty": "tile", "map": "PalletTown_ProfessorOaksLab", "where": {"facing": "north", "kind": "tiles", "tiles": [[6, 4]]}}, + "why": "Oak walks the player into the lab; the scene ends at the table", + "notes": [ + "PlayerEnter walks the player up 8 tiles from the lab's door." + ] + } + ] + } + ] + }, + "execution": {"menu": "before_pokemon"} +} diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.04.plan.json b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.04.plan.json new file mode 100644 index 0000000000..59ff4431fa --- /dev/null +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.04.plan.json @@ -0,0 +1,27 @@ +{ + "format": "pokesim-authored-checkpoint/1", + "game": "frlg", + "checkpoint": { + "id": "00.04", + "title": "to Squirtle's ball, south of the table", + "notes": [ + "Starter RNG starts from a save south of the table, facing the ball." + ], + "start": {"certainty": "tile", "map": "PalletTown_ProfessorOaksLab", "where": {"facing": "north", "kind": "tiles", "tiles": [[6, 4]]}}, + "sections": [ + { + "id": "lab_table", + "title": "Oak's lab, below Squirtle's ball", + "events": [ + { + "id": "below_squirtle", + "kind": "route", + "target": {"certainty": "tile", "map": "PalletTown_ProfessorOaksLab", "where": {"facing": "north", "kind": "tiles", "tiles": [[9, 5]]}}, + "why": "under Squirtle's ball (9, 4)" + } + ] + } + ] + }, + "execution": {"handoff": "starter_rng", "menu": "before_pokemon"} +} diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.04b.plan.json b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.04b.plan.json new file mode 100644 index 0000000000..84f39b5060 --- /dev/null +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.04b.plan.json @@ -0,0 +1,68 @@ +{ + "format": "pokesim-authored-checkpoint/1", + "game": "frlg", + "checkpoint": { + "id": "00.04b", + "title": "Squirtle, then the rival's battle", + "start": {"certainty": "tile", "map": "PalletTown_ProfessorOaksLab", "where": {"facing": "north", "kind": "tiles", "tiles": [[9, 5]]}}, + "sections": [ + { + "id": "starter", + "title": "Squirtle from the table", + "events": [ + { + "id": "squirtle_ball", + "kind": "talk", + "why": "\"So, you want the WATER POKEMON SQUIRTLE?\"" + }, + { + "id": "choose_squirtle", + "kind": "answer", + "why": "take Squirtle" + }, + { + "id": "no_nickname", + "kind": "answer", + "yes": false, + "why": "\"give a nickname?\" NO" + }, + { + "id": "rival_takes_bulbasaur", + "kind": "scene", + "declared_after": {"certainty": "tile", "map": "PalletTown_ProfessorOaksLab", "where": {"facing": "north", "kind": "tiles", "tiles": [[9, 5]]}}, + "why": "the rival picks his ball; the player still faces the table (console B, 2026-11-01)" + } + ] + }, + { + "id": "rival_lab", + "title": "The rival's first battle", + "events": [ + { + "id": "above_rival_trigger", + "kind": "route", + "target": {"certainty": "tile", "map": "PalletTown_ProfessorOaksLab", "where": {"facing": "south", "kind": "tiles", "tiles": [[7, 7]]}}, + "why": "short of the rival's trigger row 8" + }, + { + "id": "rival_trigger", + "kind": "step", + "direction": "south", + "why": "\"Wait, let's check out our POKEMON!\"" + }, + { + "id": "rival_battle", + "kind": "battle", + "may_lose": true, + "declared_after": {"certainty": "tile", "map": "PalletTown_ProfessorOaksLab", "where": {"facing": "south", "kind": "tiles", "tiles": [[7, 8]]}}, + "why": "the tutorial battle; losing goes on too", + "notes": [ + "The rival leaves; PlayerWatchRivalExitAfterBattleRight ends facing down." + ] + } + ] + } + ] + }, + "execution": {"menu": "before_pokedex"} +} diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.06.plan.json b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.06.plan.json new file mode 100644 index 0000000000..7eac3e37a5 --- /dev/null +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.06.plan.json @@ -0,0 +1,35 @@ +{ + "format": "pokesim-authored-checkpoint/1", + "game": "frlg", + "checkpoint": { + "id": "00.06", + "title": "Oak's Parcel to the Pokedex", + "start": {"certainty": "tile", "map": "ViridianCity_Mart", "where": {"facing": "west", "kind": "tiles", "tiles": [[4, 3]]}}, + "sections": [ + { + "id": "route1_to_oak", + "title": "Route 1 back to Oak", + "events": [ + { + "id": "below_oak", + "kind": "route", + "target": {"certainty": "tile", "map": "PalletTown_ProfessorOaksLab", "where": {"facing": "north", "kind": "tiles", "tiles": [[6, 4]]}}, + "why": "back down Route 1 to Oak" + }, + { + "id": "give_parcel", + "kind": "talk", + "why": "Oak takes the parcel" + }, + { + "id": "pokedex_scene", + "kind": "scene", + "declared_after": {"certainty": "tile", "map": "PalletTown_ProfessorOaksLab", "where": {"facing": "south", "kind": "tiles", "tiles": [[6, 4]]}}, + "why": "the rival comes in, Pokedexes from the desk; the player ends facing south (console B, 2026-11-01)" + } + ] + } + ] + }, + "execution": {"menu": "full"} +} diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.07.plan.json b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.07.plan.json new file mode 100644 index 0000000000..dd1d5f4047 --- /dev/null +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.07.plan.json @@ -0,0 +1,101 @@ +{ + "format": "pokesim-authored-checkpoint/1", + "game": "frlg", + "checkpoint": { + "id": "00.07", + "title": "Viridian shopping, then into Viridian Forest", + "start": {"certainty": "tile", "map": "PalletTown_ProfessorOaksLab", "where": {"facing": "south", "kind": "tiles", "tiles": [[6, 4]]}}, + "sections": [ + { + "id": "viridian_mart", + "title": "Viridian Mart", + "events": [ + { + "id": "mart_clerk", + "kind": "route", + "target": {"certainty": "tile", "map": "ViridianCity_Mart", "where": {"facing": "west", "kind": "tiles", "tiles": [[4, 3]]}}, + "why": "Route 1 again" + }, + { + "id": "potions_and_antidotes", + "kind": "shop", + "items": [{"item": "potion", "quantity": 5}, {"item": "antidote", "quantity": 3}, {"item": "parlyz_heal", "quantity": 1}], + "why": "5 Potions, 3 Antidotes, 1 Parlyz Heal", + "notes": [ + "2000 of the 3000 a new game starts with, plus the rival's prize." + ] + } + ] + }, + { + "id": "viridian_center", + "title": "Viridian's Pokemon Center", + "events": [ + { + "id": "viridian_nurse", + "kind": "route", + "target": {"certainty": "tile", "map": "ViridianCity_PokemonCenter_1F", "where": {"facing": "north", "kind": "tiles", "tiles": [[7, 4]]}}, + "why": "heal before the forest" + }, + { + "id": "heal_viridian", + "kind": "heal", + "why": "full HP" + } + ] + }, + { + "id": "old_man", + "title": "The old man's catching tutorial", + "events": [ + { + "id": "below_old_man_trigger", + "kind": "route", + "target": {"certainty": "tile", "map": "ViridianCity", "where": {"facing": "north", "kind": "tiles", "tiles": [[20, 9]]}}, + "why": "short of the tutorial trigger (20, 8)" + }, + { + "id": "old_man_trigger", + "kind": "step", + "direction": "north", + "why": "the old man's catching tutorial can't be walked around" + }, + { + "id": "old_man_tutorial", + "kind": "scene", + "declared_after": {"certainty": "tile", "map": "ViridianCity", "where": {"facing": "east", "kind": "tiles", "tiles": [[20, 8]]}}, + "why": "about 60 lines and his demo battle; TEACHY TV", + "notes": [ + "TutorialTriggerLeft turns the player right, to the old man." + ] + }, + { + "id": "past_old_man", + "kind": "route", + "target": {"certainty": "tile", "map": "ViridianCity", "where": {"facing": "north", "kind": "tiles", "tiles": [[20, 5]]}}, + "why": "north along column 20, clear of the old man", + "notes": [ + "After his demo the old man stands east of the player, beside (20, 8), where the map doesn't have him: \"east 2\" from there didn't move, and the walk north ended under Route 2's ledge in column 8 (console B, 2026-11-01). Go north first." + ] + } + ] + }, + { + "id": "route2", + "title": "Route 2 to Viridian Forest", + "events": [ + { + "id": "forest_entrance", + "kind": "route", + "target": {"certainty": "tile", "map": "ViridianForest", "where": {"facing": "north", "kind": "tiles", "tiles": [[29, 62]]}}, + "why": "Route 2 and the south gate, running from wild battles", + "notes": [ + "The gate's north warp lands on the forest's exit mat (29, 62), facing north. The save there keeps a forest failure from going back to Pallet." + ] + } + ] + } + ] + }, + "execution": {"menu": "full"} +} diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.08.plan.json b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.08.plan.json new file mode 100644 index 0000000000..3f348baaf4 --- /dev/null +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.08.plan.json @@ -0,0 +1,78 @@ +{ + "format": "pokesim-authored-checkpoint/1", + "game": "frlg", + "checkpoint": { + "id": "00.08", + "title": "Viridian Forest to Pewter Center", + "notes": [ + "The supplies bought in 00.07." + ], + "start": {"certainty": "tile", "map": "ViridianForest", "where": {"facing": "north", "kind": "tiles", "tiles": [[29, 62]]}}, + "sections": [ + { + "id": "viridian_forest", + "title": "Viridian Forest, fighting wild battles", + "events": [ + { + "id": "forest_east", + "kind": "legs", + "legs": [{"direction": "east", "tiles": 1}, {"direction": "north", "tiles": 4}, {"direction": "east", "tiles": 14}, {"direction": "north", "tiles": 15}], + "fight_wild": true, + "why": "up the east side to (44, 43)", + "notes": [ + "Wild battles are fought for EXP. Straight up the east side from the entrance, each leg ending on a wall (the Boy at (45, 58) stops the east one). Rick (47, 45) sees (42..46, 45), so the last leg meets his battle and is held on to its wall after it. The by-hand run's detour west to (13, 46) and back is dropped." + ] + }, + { + "id": "forest_north", + "kind": "route", + "target": {"certainty": "tile", "map": "ViridianForest", "where": {"kind": "tiles", "tiles": [[39, 25]]}}, + "fight_wild": true, + "why": "north part" + }, + { + "id": "forest_exit", + "kind": "legs", + "legs": [ + {"direction": "north", "tiles": 10}, {"direction": "west", "tiles": 12}, {"direction": "south", "tiles": 10}, {"direction": "west", "tiles": 6}, {"direction": "north", "tiles": 20}, {"direction": "south", "tiles": 1}, + {"direction": "west", "tiles": 10}, {"direction": "south", "tiles": 27}, {"direction": "west", "tiles": 8}, {"direction": "north", "tiles": 20}, {"direction": "east", "tiles": 1} + ], + "fight_wild": true, + "why": "walls all the way to the gate's column", + "notes": [ + "To the gate by legs that end on walls, which the walker holds again after a battle instead of estimating where it stopped: planned routes with open legs lost the player in the north of the forest (console B, 2026-11-01). The two 1-tile legs are single steps." + ] + }, + { + "id": "forest_gate", + "kind": "route", + "target": {"certainty": "tile", "map": "Route2_ViridianForest_NorthEntrance", "where": {"facing": "north", "kind": "tiles", "tiles": [[7, 10]]}}, + "fight_wild": true, + "why": "north onto the exit, arriving on the gate's mat" + } + ] + }, + { + "id": "pewter_center", + "title": "Route 2 north to Pewter's Pokemon Center", + "events": [ + { + "id": "pewter_nurse", + "kind": "route", + "target": {"certainty": "tile", "map": "PewterCity_PokemonCenter_1F", "where": {"facing": "north", "kind": "tiles", "tiles": [[7, 4]]}}, + "why": "Route 2 north to Pewter's Center", + "notes": [ + "Out of the forest, wild battles are run from; trainers are still fought." + ] + }, + { + "id": "heal_pewter", + "kind": "heal", + "why": "full HP" + } + ] + } + ] + }, + "execution": {"menu": "full", "supplies": {"antidotes": 3, "parlyz_heals": 1, "potions": 5}} +} diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.09.plan.json b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.09.plan.json new file mode 100644 index 0000000000..bbd97680fe --- /dev/null +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.09.plan.json @@ -0,0 +1,74 @@ +{ + "format": "pokesim-authored-checkpoint/1", + "game": "frlg", + "checkpoint": { + "id": "00.09", + "title": "Pewter Gym: Camper Liam, then Brock", + "notes": [ + "The by-hand save: 2 Potions and 1 Antidote left after the forest." + ], + "start": {"certainty": "tile", "map": "PewterCity_PokemonCenter_1F", "where": {"facing": "north", "kind": "tiles", "tiles": [[7, 4]]}}, + "sections": [ + { + "id": "camper_liam", + "title": "Pewter Gym: Camper Liam", + "events": [ + { + "id": "below_liam_line", + "kind": "route", + "target": {"certainty": "tile", "map": "PewterCity_Gym", "where": {"facing": "north", "kind": "tiles", "tiles": [[6, 9]]}}, + "why": "in by the door, up column 6 to below Liam's row", + "notes": [ + "Camper Liam (3, 8) always faces east (MOVEMENT_TYPE_FACE_RIGHT, sight 4) and sees (4..7, 8): walking north up column 6 from the door, the step onto (6, 8) starts his battle. He walks up to the player, who stays put and keeps facing north (FRLG doesn't turn the player to a trainer). That step is taken on its own, so no leg is cut." + ] + }, + { + "id": "liam_line", + "kind": "step", + "direction": "north", + "why": "onto (6, 8), in Liam's line" + }, + { + "id": "camper_liam", + "kind": "battle", + "declared_after": {"certainty": "tile", "map": "PewterCity_Gym", "where": {"facing": "north", "kind": "tiles", "tiles": [[6, 8]]}}, + "why": "Geodude and Sandshrew; EXP before Brock" + } + ] + }, + { + "id": "brock", + "title": "Pewter Gym: Brock", + "events": [ + { + "id": "ready_for_brock", + "kind": "ready", + "target": {"certainty": "tile", "map": "PewterCity_PokemonCenter_1F", "where": {"facing": "north", "kind": "tiles", "tiles": [[7, 4]]}}, + "why": "items for a status or low HP; the nurse only if they can't", + "notes": [ + "On to Brock unless red HP or a status is left that no item cures." + ] + }, + { + "id": "before_brock", + "kind": "route", + "target": {"certainty": "tile", "map": "PewterCity_Gym", "where": {"facing": "north", "kind": "tiles", "tiles": [[6, 6]]}}, + "why": "below Brock (6, 5); Liam, beaten, stands at (5, 8)" + }, + { + "id": "challenge_brock", + "kind": "talk", + "why": "Brock's speech" + }, + { + "id": "brock", + "kind": "battle", + "declared_after": {"certainty": "tile", "map": "PewterCity_Gym", "where": {"facing": "north", "kind": "tiles", "tiles": [[6, 6]]}}, + "why": "Geodude and Onix, with Bubble; Boulder Badge and TM39" + } + ] + } + ] + }, + "execution": {"menu": "full", "supplies": {"antidotes": 1, "potions": 2}} +} diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.10.plan.json b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.10.plan.json new file mode 100644 index 0000000000..05fd3c2de9 --- /dev/null +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.10.plan.json @@ -0,0 +1,51 @@ +{ + "format": "pokesim-authored-checkpoint/1", + "game": "frlg", + "checkpoint": { + "id": "00.10", + "title": "Pewter: the Running Shoes from Oak's aide", + "start": {"certainty": "tile", "map": "PewterCity_Gym", "where": {"facing": "north", "kind": "tiles", "tiles": [[6, 6]]}}, + "sections": [ + { + "id": "pewter_aide", + "title": "Pewter City: Oak's aide and the Running Shoes", + "events": [ + { + "id": "before_aide_trigger", + "kind": "route", + "target": {"certainty": "tile", "map": "PewterCity", "where": {"facing": "east", "kind": "tiles", "tiles": [[45, 21]]}}, + "why": "out of the Gym, east along row 21, short of the top trigger", + "notes": [ + "Brock's win sets VAR_MAP_SCENE_PEWTER_CITY to 1 and shows the aide at (46, 20); his triggers are (46, 21..23) (PewterCity map.json). The Gym guide's triggers at (42..43, 21..23) need the scene at 0." + ] + }, + { + "id": "aide_trigger", + "kind": "step", + "direction": "east", + "why": "onto (46, 21), below the aide" + }, + { + "id": "shoes_from_aide", + "kind": "scene", + "declared_after": {"certainty": "tile", "map": "PewterCity", "where": {"facing": "north", "kind": "tiles", "tiles": [[46, 21]]}}, + "why": "\"Oh, PLAYER!\" ... the Running Shoes; ends facing north", + "notes": [ + "RunningShoesAideTriggerTop: the aide talks from (46, 20), no YES/NO; the player only turns up. He walks off and is removed; FLAG_SYS_B_DASH is set (console B, 2026-11-02: about 20 B presses to the overworld)." + ] + }, + { + "id": "below_pewter_center", + "kind": "route", + "target": {"certainty": "tile", "map": "PewterCity", "where": {"facing": "south", "kind": "tiles", "tiles": [[17, 26]]}}, + "why": "west along row 21 and down to below the Pokemon Center's door (17, 25)", + "notes": [ + "Where the by-hand walk stopped to start 00.11 (console B, 2026-11-02)." + ] + } + ] + } + ] + }, + "execution": {"menu": "full", "supplies": {"lead": "after_brock"}} +} diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.11.plan.json b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.11.plan.json new file mode 100644 index 0000000000..e1a2022efd --- /dev/null +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.11.plan.json @@ -0,0 +1,128 @@ +{ + "format": "pokesim-authored-checkpoint/1", + "game": "frlg", + "checkpoint": { + "id": "00.11", + "title": "Pewter Center, then Route 3's trainers", + "notes": [ + "Route 3's trainers (Route3 map.json): the way east meets three of them. Bug Catcher Colton (12, 6) faces east, sight 3: the only way north past the row 7 ledges is the gap at x 14..15, below his line. Youngster Ben (17, 4) faces south, sight 2, so the way east keeps to row 3 past him. Bug Catcher Greg (25, 4) faces south, sight 2, over the way east along row 5. Bug Catcher James (32, 6) faces east, sight 4, over the way down at x 35..36. The others are kept out of: Lass Janice (19, 9) sees west along row 9 to x 14, Lass Sally (30, 3) west along row 3 to x 25, and Youngster Calvin (29, 10) west along row 10. Each line is stepped into on its own, so no leg is cut; the trainer walks up to the player, who stays put facing the way they stepped." + ], + "start": {"certainty": "tile", "map": "PewterCity", "where": {"facing": "south", "kind": "tiles", "tiles": [[17, 26]]}}, + "sections": [ + { + "id": "pewter_center", + "title": "Pewter's Pokemon Center", + "events": [ + { + "id": "pewter_nurse", + "kind": "route", + "variant": "run", + "target": {"certainty": "tile", "map": "PewterCity_PokemonCenter_1F", "where": {"facing": "north", "kind": "tiles", "tiles": [[7, 4]]}}, + "why": "in by the door below the player" + }, + { + "id": "heal_pewter", + "kind": "heal", + "why": "full HP" + } + ] + }, + { + "id": "route3_colton", + "title": "Route 3 west: Bug Catcher Colton", + "events": [ + { + "id": "west_of_janice_line", + "kind": "route", + "variant": "run", + "target": {"certainty": "tile", "map": "Route3", "where": {"kind": "tiles", "tiles": [[13, 8]]}}, + "why": "out of Pewter by row 21, east into Route 3, short of Janice's line", + "notes": [ + "Up from row 9 west of Janice's line, which ends at x 14." + ] + }, + { + "id": "below_colton_line", + "kind": "legs", + "variant": "run", + "legs": [{"direction": "east", "tiles": 1}, {"direction": "north", "tiles": 1}], + "why": "to (14, 7), in the ledges' gap" + }, + { + "id": "colton_line", + "kind": "step", + "direction": "north", + "why": "onto (14, 6), in Colton's line" + }, + { + "id": "bug_catcher_colton", + "kind": "battle", + "declared_after": {"certainty": "tile", "map": "Route3", "where": {"facing": "north", "kind": "tiles", "tiles": [[14, 6]]}}, + "why": "his Bug Pokemon; Colton stops at (13, 6)" + } + ] + }, + { + "id": "route3_greg", + "title": "Route 3 middle: past Ben to Bug Catcher Greg", + "events": [ + { + "id": "past_ben", + "kind": "legs", + "variant": "run", + "legs": [{"direction": "north", "tiles": 3}, {"direction": "east", "tiles": 4}, {"direction": "south", "tiles": 2}, {"direction": "east", "tiles": 6}], + "why": "up to row 3 above Ben, down at x 18 east of his line, to (24, 5)" + }, + { + "id": "greg_line", + "kind": "step", + "direction": "east", + "why": "onto (25, 5), below Greg" + }, + { + "id": "bug_catcher_greg", + "kind": "battle", + "declared_after": {"certainty": "tile", "map": "Route3", "where": {"facing": "east", "kind": "tiles", "tiles": [[25, 5]]}}, + "why": "his Bug Pokemon; Greg is already next to the player" + } + ] + }, + { + "id": "route3_james", + "title": "Route 3 east: Bug Catcher James and the save spot", + "events": [ + { + "id": "above_james_line", + "kind": "legs", + "variant": "run", + "legs": [{"direction": "east", "tiles": 11}], + "why": "along row 5 to the wall at (36, 5)" + }, + { + "id": "james_line", + "kind": "step", + "direction": "south", + "why": "onto (36, 6), at the end of James's line" + }, + { + "id": "bug_catcher_james", + "kind": "battle", + "declared_after": {"certainty": "tile", "map": "Route3", "where": {"facing": "south", "kind": "tiles", "tiles": [[36, 6]]}}, + "why": "his Bug Pokemon; James stops at (35, 6)" + }, + { + "id": "save_spot", + "kind": "legs", + "variant": "run", + "legs": [{"direction": "south", "tiles": 2}], + "why": "down to (36, 8), beside the wall east of it", + "notes": [ + "Saved here, the trainers behind, so a failure on the way to Route 4 doesn't fight them again." + ] + } + ] + } + ] + }, + "execution": {"menu": "full", "supplies": {"lead": "after_brock"}} +} diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.12.plan.json b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.12.plan.json new file mode 100644 index 0000000000..48e1acbaaf --- /dev/null +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.12.plan.json @@ -0,0 +1,43 @@ +{ + "format": "pokesim-authored-checkpoint/1", + "game": "frlg", + "checkpoint": { + "id": "00.12", + "title": "Route 3 and 4 to the Magikarp salesman", + "notes": [ + "Route 3's north exit (x 68..75) joins Route 4 (offset 60) at x 8..15, up which column 12 leads to the Pokemon Center's door (12, 5). Lass Robin (40, 11) wanders up and down at x 40, looking north and south, sight 3. Rock above (y <= 8) and grass below (y >= 12) leave every way east across her column at y 9..11, so whether she sees the player depends on her facing. The walk watches for her after the leg along row 9, which crosses her sight on (40, 9) only; if she saw the player, her message goes to story_interrupts(), which fight her, and the route goes on from (40, 9) (run_route(); console B, 2026-11-02, she stopped the player there and spoke after the leg's short watch)." + ], + "start": {"certainty": "tile", "map": "Route3", "where": {"facing": "south", "kind": "tiles", "tiles": [[36, 8]]}}, + "sections": [ + { + "id": "route4_center", + "title": "Route 3 and 4 to the Magikarp salesman", + "events": [ + { + "id": "route4_nurse", + "kind": "route", + "variant": "run", + "target": {"certainty": "tile", "map": "Route4_PokemonCenter_1F", "where": {"facing": "north", "kind": "tiles", "tiles": [[7, 4]]}}, + "why": "east over Route 3, off the grass, north into Route 4 and its Pokemon Center" + }, + { + "id": "heal_route4", + "kind": "heal", + "why": "full HP" + }, + { + "id": "before_salesman", + "kind": "route", + "variant": "run", + "target": {"certainty": "tile", "map": "Route4_PokemonCenter_1F", "where": {"facing": "west", "kind": "tiles", "tiles": [[2, 3]]}}, + "why": "beside the Magikarp salesman, facing him", + "notes": [ + "Gift RNG starts from a save facing the salesman (1, 3)." + ] + } + ] + } + ] + }, + "execution": {"handoff": "gift_rng", "menu": "full", "supplies": {"lead": "after_brock"}} +} diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.12b.plan.json b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.12b.plan.json new file mode 100644 index 0000000000..005365f269 --- /dev/null +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.12b.plan.json @@ -0,0 +1,28 @@ +{ + "format": "pokesim-authored-checkpoint/1", + "game": "frlg", + "checkpoint": { + "id": "00.12b", + "title": "after Gift RNG: save with the Magikarp", + "notes": [ + "Gift RNG buys the Magikarp (500 of the money 00.12 brings) without moving the player and leaves its summary open, or HOME. This saves the shiny where 00.12 ended. A run started here with Gift RNG's handoff on loads the save beside the salesman and runs Gift RNG first." + ], + "start": {"certainty": "tile", "map": "Route4_PokemonCenter_1F", "where": {"facing": "west", "kind": "tiles", "tiles": [[2, 3]]}}, + "sections": [ + { + "id": "route4_center", + "title": "Back from Gift RNG beside the salesman", + "events": [ + { + "id": "leave_gift_summary", + "kind": "game_action", + "variant": "leave_gift_summary", + "declared_after": {"certainty": "tile", "map": "Route4_PokemonCenter_1F", "where": {"facing": "west", "kind": "tiles", "tiles": [[2, 3]]}}, + "why": "the Magikarp's summary Gift RNG left open, or HOME" + } + ] + } + ] + }, + "execution": {"live_start": true, "menu": "full", "supplies": {"lead": "after_brock"}} +} diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.12c.plan.json b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.12c.plan.json new file mode 100644 index 0000000000..0c547fa4f5 --- /dev/null +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.12c.plan.json @@ -0,0 +1,34 @@ +{ + "format": "pokesim-authored-checkpoint/1", + "game": "frlg", + "checkpoint": { + "id": "00.12c", + "title": "Route 4 Center: the Magikarp into BOX 1", + "notes": [ + "The Magikarp goes to BOX 1 at the Center's PC (11, 1), so Mt. Moon is fought with the starter alone (console B, 2026-11-02: done by hand and saved at (11, 2), facing the PC, where this row ends). The wandering boy (4..6, 3..5) is walked around. The Magikarp comes from Gift RNG: with Gift RNG off the party is the starter alone, and the deposit is skipped." + ], + "start": {"certainty": "tile", "map": "Route4_PokemonCenter_1F", "where": {"facing": "west", "kind": "tiles", "tiles": [[2, 3]]}}, + "sections": [ + { + "id": "route4_center_pc", + "title": "Route 4's Pokemon Center PC", + "events": [ + { + "id": "pc_front", + "kind": "route", + "variant": "run", + "target": {"certainty": "tile", "map": "Route4_PokemonCenter_1F", "where": {"facing": "north", "kind": "tiles", "tiles": [[11, 2]]}}, + "why": "below the PC (11, 1), facing it" + }, + { + "id": "magikarp_to_box", + "kind": "game_action", + "variant": "pc deposit slot=2 box=1 if_present", + "why": "DEPOSIT the party's second slot into BOX 1, if it has one" + } + ] + } + ] + }, + "execution": {"menu": "full", "supplies": {"lead": "after_brock"}} +} diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.13.plan.json b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.13.plan.json new file mode 100644 index 0000000000..4f9d2e6bab --- /dev/null +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.13.plan.json @@ -0,0 +1,189 @@ +{ + "format": "pokesim-authored-checkpoint/1", + "game": "frlg", + "checkpoint": { + "id": "00.13", + "title": "Mt. Moon: a Moon Stone, a Rocket, Miguel and the Helix Fossil", + "notes": [ + "Mt. Moon (pokefirered data/maps/MtMoon_1F, _B1F, _B2F). Every floor tile of the cave has wild encounters, which are run from, so its legs end on walls, ladders or someone standing still, which the walker holds again after a battle; the few open ones are short. The way through: up 1F's middle and west side, its north-west ladder, B1F's west ladder down to B2F's south-east, round B2F's south edge to its west, north past Miguel and the fossils, and the ladder up to B1F's east end, which leads out to Route 4 east of the mountain.", + "- 1F's trainers are walked around: Youngster Josh (13, 17) sees east along row 17 to x 17, so the way west into the west room is down column 18 and up column 11; Lass Miriam walks round (32..33, 4..5), sight 2, so the way east keeps to row 9 and columns 38 and 40; Hiker Marcos wanders (5..9, 8..12) and sees one tile, so the way north is column 11 and row 3.", + "- The Moon Stone ball (3, 2) on 1F (FLAG_HIDE_MT_MOON_1F_MOON_STONE) is a few tiles off the way to the ladder (5, 6).", + "- The Grunt at (37, 21) on B2F looks around (sight 3) over the only way east round B2F. His room is crossed on legs to walls, at one tile of his sight each, (37, 22) and (40, 21); if he looks the player's way, he walks up beside the leg, story_interrupts() fights him, and the leg is held on to its wall.", + "- The Grunt at (12, 20) faces south (sight 2) over (12, 21..22), across rows 21..22, the only way north to Miguel: stepped into from the west, he is next to the player and doesn't walk.", + "- Super Nerd Miguel (13, 11) battles on the step onto (14, 11) (MtMoon_B2F_EventScript_MiguelTrigger, VAR_MAP_SCENE_MT_MOON_B2F 0), then \"We'll each take one!\"", + "- The fossils: DOME (13, 7), HELIX (14, 7). After the HELIX, Miguel walks up to (13, 8) and takes the DOME, which opens the gap north. The save is on Route 4: the save card's places don't include Mt. Moon." + ], + "start": {"certainty": "tile", "map": "Route4_PokemonCenter_1F", "where": {"facing": "north", "kind": "tiles", "tiles": [[11, 2]]}}, + "sections": [ + { + "id": "route4_center", + "title": "Route 4's Pokemon Center", + "events": [ + { + "id": "route4_nurse", + "kind": "route", + "variant": "run", + "target": {"certainty": "tile", "map": "Route4_PokemonCenter_1F", "where": {"facing": "north", "kind": "tiles", "tiles": [[7, 4]]}}, + "why": "the nurse, below the counter" + }, + { + "id": "heal_route4", + "kind": "heal", + "why": "full HP" + } + ] + }, + { + "id": "mt_moon_1f", + "title": "Mt. Moon 1F and the Moon Stone", + "events": [ + { + "id": "mt_moon_entrance", + "kind": "route", + "variant": "run", + "target": {"certainty": "tile", "map": "MtMoon_1F", "where": {"facing": "north", "kind": "tiles", "tiles": [[18, 37]]}}, + "why": "out of the Center, west into Mt. Moon" + }, + { + "id": "mt_moon_1f", + "kind": "legs", + "variant": "run", + "legs": [ + {"direction": "north", "tiles": 12}, {"direction": "east", "tiles": 8}, {"direction": "north", "tiles": 12}, {"direction": "east", "tiles": 3}, {"direction": "south", "tiles": 1}, {"direction": "east", "tiles": 9}, + {"direction": "north", "tiles": 1}, {"direction": "east", "tiles": 2}, {"direction": "north", "tiles": 4}, {"direction": "west", "tiles": 24}, {"direction": "east", "tiles": 2}, {"direction": "south", "tiles": 12}, + {"direction": "west", "tiles": 7}, {"direction": "north", "tiles": 18}, {"direction": "west", "tiles": 9}, {"direction": "east", "tiles": 1} + ], + "why": "up the middle, east of Miriam, west along row 9, down column 18 past Josh, up column 11 past Marcos, to (3, 3)" + }, + { + "id": "below_moon_stone", + "kind": "route", + "variant": "run", + "target": {"certainty": "tile", "map": "MtMoon_1F", "where": {"facing": "north", "kind": "tiles", "tiles": [[3, 3]]}}, + "why": "facing the Moon Stone (3, 2)" + }, + { + "id": "moon_stone_ball", + "kind": "talk", + "why": "A on the item ball" + }, + { + "id": "found_moon_stone", + "kind": "scene", + "declared_after": {"certainty": "tile", "map": "MtMoon_1F", "where": {"facing": "north", "kind": "tiles", "tiles": [[3, 3]]}}, + "why": "\" found a MOON STONE!\", then the pocket line; the ball is gone", + "notes": [ + "No reader for the text yet: the scene's end is the overworld." + ] + } + ] + }, + { + "id": "mt_moon_b2f_grunt", + "title": "Mt. Moon B2F: round the south edge to the Grunt", + "events": [ + { + "id": "b2f_ladder_foot", + "kind": "route", + "variant": "run", + "target": {"certainty": "tile", "map": "MtMoon_B2F", "where": {"facing": "east", "kind": "tiles", "tiles": [[26, 21]]}}, + "why": "1F's ladder (5, 6), down B1F's west side to its ladder (22, 18), onto B2F" + }, + { + "id": "b2f_south", + "kind": "legs", + "variant": "run", + "legs": [ + {"direction": "north", "tiles": 4}, {"direction": "east", "tiles": 8}, {"direction": "west", "tiles": 2}, {"direction": "south", "tiles": 5}, {"direction": "east", "tiles": 8}, {"direction": "north", "tiles": 3}, + {"direction": "west", "tiles": 1}, {"direction": "north", "tiles": 5}, {"direction": "east", "tiles": 7}, {"direction": "south", "tiles": 14}, {"direction": "west", "tiles": 9}, {"direction": "south", "tiles": 10}, + {"direction": "west", "tiles": 29}, {"direction": "east", "tiles": 3}, {"direction": "north", "tiles": 17} + ], + "why": "through the Grunt's room at (37, 21), round the south edge, up column 11 to (11, 21)" + }, + { + "id": "grunt_line", + "kind": "step", + "direction": "east", + "why": "onto (12, 21), below the Grunt at (12, 20)" + }, + { + "id": "rocket_grunt", + "kind": "battle", + "declared_after": {"certainty": "tile", "map": "MtMoon_B2F", "where": {"facing": "east", "kind": "tiles", "tiles": [[12, 21]]}}, + "why": "Rattata and Zubat, Lv13" + } + ] + }, + { + "id": "mt_moon_b2f_miguel", + "title": "Mt. Moon B2F: Miguel and the Helix Fossil", + "events": [ + { + "id": "ready_for_miguel", + "kind": "ready", + "target": {"certainty": "tile", "map": "Route4_PokemonCenter_1F", "where": {"facing": "north", "kind": "tiles", "tiles": [[7, 4]]}}, + "why": "items for a status or low HP; the nurse, back through the cave, only if they can't" + }, + { + "id": "below_miguel_trigger", + "kind": "legs", + "variant": "run", + "legs": [{"direction": "east", "tiles": 1}, {"direction": "north", "tiles": 9}, {"direction": "east", "tiles": 1}], + "why": "to (14, 12), below Miguel's trigger (14, 11)", + "notes": [ + "Up column 13 to Miguel, who stops the leg on (13, 12), then east to the wall: the tile below his trigger." + ] + }, + { + "id": "miguel_trigger", + "kind": "step", + "direction": "north", + "why": "onto (14, 11), beside Miguel" + }, + { + "id": "super_nerd_miguel", + "kind": "battle", + "declared_after": {"certainty": "tile", "map": "MtMoon_B2F", "where": {"facing": "north", "kind": "tiles", "tiles": [[14, 11]]}}, + "why": "Grimer, Voltorb and Koffing, Lv12; \"We'll each take one!\"" + }, + { + "id": "below_helix_fossil", + "kind": "legs", + "variant": "run", + "legs": [{"direction": "north", "tiles": 3}], + "why": "up column 14 to the HELIX FOSSIL (14, 7)" + }, + { + "id": "helix_fossil", + "kind": "game_action", + "variant": "fossil helix", + "why": "the HELIX FOSSIL; Miguel takes the DOME FOSSIL" + }, + { + "id": "helix_gap", + "kind": "step", + "direction": "north", + "why": "onto (14, 7), where the HELIX FOSSIL lay", + "notes": [ + "The maps keep the fossils, which the game removes after the choice: the step onto the HELIX's tile is taken on its own." + ] + } + ] + }, + { + "id": "mt_moon_exit", + "title": "B1F's east exit onto Route 4", + "events": [ + { + "id": "route4_east", + "kind": "route", + "variant": "run", + "target": {"certainty": "tile", "map": "Route4", "where": {"facing": "south", "kind": "tiles", "tiles": [[32, 6]]}}, + "why": "west to B2F's ladder (5, 10), up to B1F, east to its exit onto Route 4" + } + ] + } + ] + }, + "execution": {"menu": "full", "supplies": {"lead": "after_brock"}} +} diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.14.plan.json b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.14.plan.json new file mode 100644 index 0000000000..a2d58040b7 --- /dev/null +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.14.plan.json @@ -0,0 +1,96 @@ +{ + "format": "pokesim-authored-checkpoint/1", + "game": "frlg", + "checkpoint": { + "id": "00.14", + "title": "Route 4: Mega Kick from its tutor, then east to Cerulean's Pokemon Center", + "notes": [ + "Route 4 east of Mt. Moon (Route4 map.json) joins Cerulean City at its east end (x 107; Route 4's row 3 is the city's row 13). Its upper road (rows 2..8) reaches the city only by water: the way on by land is down the ledge row 9 at x 90..96 to the lower road (rows 10..12), which joins the city's rows 20..22. Lass Crissy (75, 3) faces east, sight 4, over row 3 from x 76 to 79; the way east keeps out of her line and off the grass south of the road (75..87, 11..17).", + "On the way, the Mega Kick tutor (Black Belt (50, 3), facing west, Route4_EventScript_MegaKickTutor) stands in a pen (46..51, 2..4) north of the road, beside the Mega Punch tutor (47, 3); the pen opens south only on (48, 5) and (49, 5), the rest of row 5 ledges out of it. From Mt. Moon's exit the walk goes east and up into the pen to (50, 4), below the tutor, and Mega Kick takes Withdraw's slot. Cerulean can't be walked back to Route 4's upper road without Surf, so it is now or much later.", + "The open leg east across the city's edge ended a tile short on the console (2026-11-03: on (6, 20), not (7, 20)), and no hold to a wall in the city's west end finds the player from there: the next hold south met the fence on (6, 23) and the walk went on a column off. So the entry ends on (9, 20), and only legs to walls follow: north up column 9 (or 8, a tile short) to row 12, west to (8, 12), east to (30, 12) beside the policeman (31, 12), south to (30, 17), west to (25, 17), and down the ledge row 18 to (25, 19), a few tiles from the door (22, 19). The way keeps out of the boy's (16, 18..24) and the balding man's (8..10, 22..24) wander boxes." + ], + "start": {"certainty": "tile", "map": "Route4", "where": {"facing": "south", "kind": "tiles", "tiles": [[32, 6]]}}, + "sections": [ + { + "id": "mega_kick_tutor", + "title": "Route 4: the Mega Kick tutor", + "events": [ + { + "id": "mega_kick_tutor", + "kind": "route", + "variant": "run", + "target": {"certainty": "tile", "map": "Route4", "where": {"facing": "north", "kind": "tiles", "tiles": [[50, 4]]}}, + "why": "east and up through (48, 5) into the tutors' pen, below the Mega Kick tutor (50, 3)" + }, + { + "id": "teach_mega_kick", + "kind": "game_action", + "variant": "teach tutor mega-kick slot=1 forget=withdraw", + "once_per_save": true, + "why": "the tutor's Mega Kick in place of Withdraw, unless the lead knows it" + } + ] + }, + { + "id": "route4_east", + "title": "Route 4's upper road and its ledge", + "events": [ + { + "id": "above_ledge", + "kind": "route", + "variant": "run", + "target": {"certainty": "tile", "map": "Route4", "where": {"facing": "south", "kind": "tiles", "tiles": [[93, 8]]}}, + "why": "east along Route 4's upper road to above the ledge row 9" + }, + { + "id": "ledge_hop", + "kind": "step", + "direction": "south", + "declared_after": {"certainty": "tile", "map": "Route4", "where": {"facing": "south", "kind": "tiles", "tiles": [[93, 10]]}}, + "why": "down the ledge (93, 9) to the lower road" + } + ] + }, + { + "id": "cerulean", + "title": "Cerulean City to its Pokemon Center", + "events": [ + { + "id": "cerulean_entry", + "kind": "route", + "variant": "run", + "target": {"certainty": "tile", "map": "CeruleanCity", "where": {"facing": "east", "kind": "tiles", "tiles": [[9, 20]]}}, + "why": "east into Cerulean City, to (9, 20) below column 9" + }, + { + "id": "above_city_ledge", + "kind": "legs", + "variant": "run", + "legs": [{"direction": "north", "tiles": 8}, {"direction": "west", "tiles": 1}, {"direction": "east", "tiles": 22}, {"direction": "south", "tiles": 5}, {"direction": "west", "tiles": 5}], + "why": "to walls: (9, 12), (8, 12), (30, 12), (30, 17), (25, 17)" + }, + { + "id": "city_ledge_hop", + "kind": "step", + "direction": "south", + "declared_after": {"certainty": "tile", "map": "CeruleanCity", "where": {"facing": "south", "kind": "tiles", "tiles": [[25, 19]]}}, + "why": "down the ledge (25, 18)" + }, + { + "id": "cerulean_nurse", + "kind": "route", + "variant": "run", + "target": {"certainty": "tile", "map": "CeruleanCity_PokemonCenter_1F", "where": {"facing": "north", "kind": "tiles", "tiles": [[7, 4]]}}, + "why": "west along row 20 to the Pokemon Center's door (22, 19)" + }, + { + "id": "heal_cerulean", + "kind": "heal", + "why": "full HP" + } + ] + } + ] + }, + "execution": {"menu": "full", "supplies": {"lead": "after_brock"}} +} diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.14b.plan.json b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.14b.plan.json new file mode 100644 index 0000000000..fa88ff60fa --- /dev/null +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.14b.plan.json @@ -0,0 +1,96 @@ +{ + "format": "pokesim-authored-checkpoint/1", + "game": "frlg", + "checkpoint": { + "id": "00.14b", + "title": "Cerulean: Potions, a GRIND to Lv23, then into the Gym, saved below Misty's platform", + "notes": [ + "Cerulean Gym (pokefirered CeruleanCity_Gym map.json and scripts.inc): a pool with walkways. Misty (8, 6) stands on a platform (7..9, 6) above row 7. Picnicker Diana (4, 7) faces east, sight 4, over (5..8, 7), so misty_front (8, 7) is in her line; Swimmer Luis (10, 12) in the water faces west, sight 1, over (9, 12), on column 9 north of the door. No gym trainer has to be fought for Misty, so neither is: from the door up column 9 to row 13 (a route there, so the planner's walk to a wall doesn't run on past it through (9, 12)), west to (4, 13), and to walls round the pool's west and north sides, (4, 10), (12, 10), (12, 7), then west to (9, 7), the tile below the platform's east end, out of Diana's line. 00.14c steps up onto (9, 6) and talks to Misty from beside her.", + "Misty beat a Lv20 Wartortle (console B, run m51), so first a GRIND to Lv23 on 00.15's patch. Gen 3 numbers (pokefirered: her mons have IV 0; Wartortle taken at IV 15, no EVs): Starmie Lv21 has 56 HP, Atk 36, SpA 47, SpD 40. Bite is Dark, special in Gen 3, no STAB, x2 on Psychic: at Lv23 (SpA 39) it does 23..28, three hits (two on top rolls); at Lv20, 20..24. Her Swift (physical, 60) does 9..11 to a Lv23 Wartortle (about 67 HP, Def 45) and Water Pulse (STAB, resisted) 8..10: 6 or more hits, though m51 saw about 20 a turn. Her Recover (28) and Super Potion undo a Bite, so the margin is in Bite's damage.", + "The Mart comes before the GRIND: its wild battles are fought only with 2 or more Potions, and 00.14's save has none (m51 met Misty with only the 5 this row bought). 5 Potions (row 3, 300 each), then up to 3 Super Potions (row 2, 700), last so they take the Items pocket's last row; the battle doesn't use them yet. The money box can't be read, so the floor stands for it, and a floor above the money fails the step (the quantity box wraps). Prizes (pokefirered: 4 x last level x the class's factor) from a new game's 3000, less Viridian's 2000 and the Magikarp's 500: Liam 220, Brock 1400, Route 3's bug catchers 360, the Mt. Moon grunt 416 and Miguel 288 (the first rival's 80 only if won), at least 3184 here. Floor and budget 3000: 5 Potions and 2 Super Potions, 2900. Misty's 2100 (4 x 21 x 25) then leaves 00.15 its floor of 1500. Then the nurse, and the save before Misty, so her battle is its own checkpoint, 00.14c, verified and retried from it. 00.15's GRIND then fights until the sim beats the Cerulean rival often enough." + ], + "start": {"certainty": "tile", "map": "CeruleanCity_PokemonCenter_1F", "where": {"facing": "north", "kind": "tiles", "tiles": [[7, 4]]}}, + "sections": [ + { + "id": "cerulean_mart", + "title": "Cerulean Mart", + "events": [ + { + "id": "mart_clerk", + "kind": "route", + "variant": "run", + "target": {"certainty": "tile", "map": "CeruleanCity_Mart", "where": {"facing": "west", "kind": "tiles", "tiles": [[4, 3]]}}, + "why": "out of the Center to the Mart's clerk" + }, + { + "id": "buy_potions", + "kind": "game_action", + "variant": "mart CeruleanCity_Mart budget=3000 floor=3000 potion=5 super-potion=3", + "once_per_save": true, + "why": "5 Potions for the GRIND's wild battles, then Super Potions as the money allows" + } + ] + }, + { + "id": "grind", + "title": "Route 4's grass: a GRIND to Lv23", + "events": [ + { + "id": "grind_patch", + "kind": "route", + "variant": "run", + "target": {"certainty": "tile", "map": "Route4", "where": {"facing": "west", "kind": "tiles", "tiles": [[86, 16]]}}, + "why": "west out of the city along Route 4's lower road onto its grass's east edge" + }, + { + "id": "grind_to_lv23", + "kind": "game_action", + "variant": "grind slot=1 level=23 encounters=100 pace=west heal_every=0", + "target": {"certainty": "tile", "map": "CeruleanCity_PokemonCenter_1F", "where": {"facing": "north", "kind": "tiles", "tiles": [[7, 4]]}}, + "why": "wild battles until the lead is Lv23, where Bite takes Starmie in three" + }, + { + "id": "cerulean_nurse", + "kind": "route", + "variant": "run", + "target": {"certainty": "tile", "map": "CeruleanCity_PokemonCenter_1F", "where": {"facing": "north", "kind": "tiles", "tiles": [[7, 4]]}}, + "why": "back to the Center: Misty's battle starts at full HP and PP" + }, + { + "id": "heal_cerulean", + "kind": "heal", + "why": "full HP" + } + ] + }, + { + "id": "cerulean_gym", + "title": "Cerulean Gym to below Misty's platform", + "events": [ + { + "id": "gym_below_luis", + "kind": "route", + "variant": "run", + "target": {"certainty": "tile", "map": "CeruleanCity_Gym", "where": {"kind": "tiles", "tiles": [[9, 13]]}}, + "why": "into the Gym, up column 9 to row 13, short of Luis's (9, 12)" + }, + { + "id": "gym_west_walkway", + "kind": "legs", + "variant": "run", + "legs": [{"direction": "west", "tiles": 5}], + "why": "west to the wall (4, 13)" + }, + { + "id": "below_misty_platform", + "kind": "legs", + "variant": "run", + "legs": [{"direction": "north", "tiles": 3}, {"direction": "east", "tiles": 8}, {"direction": "north", "tiles": 3}, {"direction": "west", "tiles": 3}], + "why": "walls (4, 10), (12, 10), (12, 7), then to (9, 7), out of Diana's line" + } + ] + } + ] + }, + "execution": {"menu": "full", "supplies": {"lead": "after_brock"}} +} diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.14c.plan.json b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.14c.plan.json new file mode 100644 index 0000000000..989e062d93 --- /dev/null +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.14c.plan.json @@ -0,0 +1,71 @@ +{ + "format": "pokesim-authored-checkpoint/1", + "game": "frlg", + "checkpoint": { + "id": "00.14c", + "title": "Cerulean Gym: Misty, then Water Pulse", + "notes": [ + "Misty (TRAINER_LEADER_MISTY: Staryu Lv18, Starmie Lv21), talked to from (9, 6), beside her on the platform. Her win text runs on to the CASCADE BADGE, TM03 (Water Pulse) and its explanation, all read with the battle's. Bite is chosen against her party (Starmie is Water/Psychic). Back to the nurse round the pool's west side, out of Luis's line; then Water Pulse in place of Tail Whip, last, at the Center, from the bag's TM CASE. Ends where 00.15 starts." + ], + "start": {"certainty": "tile", "map": "CeruleanCity_Gym", "where": {"facing": "west", "kind": "tiles", "tiles": [[9, 7]]}}, + "sections": [ + { + "id": "misty", + "title": "Misty", + "events": [ + { + "id": "beside_misty", + "kind": "route", + "variant": "run", + "target": {"certainty": "tile", "map": "CeruleanCity_Gym", "where": {"facing": "west", "kind": "tiles", "tiles": [[9, 6]]}}, + "why": "up onto (9, 6), facing Misty (8, 6)" + }, + { + "id": "challenge_misty", + "kind": "talk", + "why": "Misty's speech" + }, + { + "id": "misty", + "kind": "battle", + "declared_after": {"certainty": "tile", "map": "CeruleanCity_Gym", "where": {"facing": "west", "kind": "tiles", "tiles": [[9, 6]]}}, + "why": "Staryu and Starmie, with Bite; CASCADE BADGE and TM03" + } + ] + }, + { + "id": "cerulean_center", + "title": "Out of the Gym to the Center, then Water Pulse", + "events": [ + { + "id": "gym_way_out", + "kind": "legs", + "variant": "run", + "legs": [{"direction": "south", "tiles": 1}, {"direction": "east", "tiles": 3}, {"direction": "south", "tiles": 3}, {"direction": "west", "tiles": 8}, {"direction": "south", "tiles": 3}, {"direction": "east", "tiles": 5}], + "why": "walls (12, 7), (12, 10), (4, 10), (4, 13), (9, 13), round Luis's (9, 12)" + }, + { + "id": "cerulean_nurse", + "kind": "route", + "variant": "run", + "target": {"certainty": "tile", "map": "CeruleanCity_PokemonCenter_1F", "where": {"facing": "north", "kind": "tiles", "tiles": [[7, 4]]}}, + "why": "down column 9 out of the Gym, to the Center" + }, + { + "id": "heal_cerulean", + "kind": "heal", + "why": "full HP" + }, + { + "id": "teach_water_pulse", + "kind": "game_action", + "variant": "teach tm03 water-pulse slot=1 forget=tail-whip", + "once_per_save": true, + "why": "TM03 Water Pulse in place of Tail Whip" + } + ] + } + ] + }, + "execution": {"menu": "full", "supplies": {"lead": "after_brock"}} +} diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.15.plan.json b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.15.plan.json new file mode 100644 index 0000000000..e5d41285fe --- /dev/null +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.15.plan.json @@ -0,0 +1,93 @@ +{ + "format": "pokesim-authored-checkpoint/1", + "game": "frlg", + "checkpoint": { + "id": "00.15", + "title": "Cerulean: Water Pulse, Potions, a GRIND until the rival is winnable, then saved below his trigger", + "notes": [ + "Before the rival north of Cerulean (cerulean_rival()), from the Center: first TM03 Water Pulse over Tail Whip, if the lead doesn't know it yet, so the GRIND's sim plays it (a run without TM03 from Misty skips the step). Then 3 Potions at the Mart (CeruleanCity_Mart_Items: POTION is row 3, 300 each; Mt. Moon's trainers leave well over the floor) and 2 Awakenings (row 6, 250 each; pokefirered items.json) for the rival's Bulbasaur's Sleep Powder (console B, m56: asleep at 34/65 HP, it fainted two turns later with 15 Potions), 1400 of the floor's 1500. Then a GRIND on Route 4's grass east of Mt. Moon (75..86, 11..17; Spearow, Rattata, Ekans and Mankey around Lv10, about 80 EXP each), healing at the Center, until the battle sim beats the rival 00.15b fights 50% or more: the win chance his battle refuses below. Console B's Wartortle (Lv22, 65 HP, Water Pulse) is about 42% there and 62% at Lv23; Lv28 (about 88%, some 120 battles from Lv22) is the cap. Then the nurse, and the save on (23, 7), the tile below his trigger: his battle is its own checkpoint, 00.15b, verified and retried from this save." + ], + "start": {"certainty": "tile", "map": "CeruleanCity_PokemonCenter_1F", "where": {"facing": "north", "kind": "tiles", "tiles": [[7, 4]]}}, + "sections": [ + { + "id": "water_pulse", + "title": "Water Pulse in the Center", + "events": [ + { + "id": "teach_water_pulse", + "kind": "game_action", + "variant": "teach tm03 water-pulse slot=1 forget=tail-whip", + "once_per_save": true, + "why": "TM03 Water Pulse in place of Tail Whip, unless the lead knows it or there is no TM03" + } + ] + }, + { + "id": "cerulean_mart", + "title": "Cerulean Mart", + "events": [ + { + "id": "mart_clerk", + "kind": "route", + "variant": "run", + "target": {"certainty": "tile", "map": "CeruleanCity_Mart", "where": {"facing": "west", "kind": "tiles", "tiles": [[4, 3]]}}, + "why": "out of the Center to the Mart's clerk" + }, + { + "id": "buy_potions", + "kind": "game_action", + "variant": "mart CeruleanCity_Mart budget=1500 floor=1500 potion=3 awakening=2", + "once_per_save": true, + "why": "3 Potions: the GRIND fights wild battles only with 2 or more; 2 Awakenings for the rival's Sleep Powder" + } + ] + }, + { + "id": "grind", + "title": "Route 4's grass: a GRIND until the rival is winnable", + "events": [ + { + "id": "grind_patch", + "kind": "route", + "variant": "run", + "target": {"certainty": "tile", "map": "Route4", "where": {"facing": "west", "kind": "tiles", "tiles": [[86, 16]]}}, + "why": "west out of the city along Route 4's lower road onto its grass's east edge" + }, + { + "id": "grind_for_rival", + "kind": "game_action", + "variant": "grind slot=1 level=28 encounters=150 pace=west heal_every=0 beat=TRAINER_RIVAL_CERULEAN_BULBASAUR chance=50", + "target": {"certainty": "tile", "map": "CeruleanCity_PokemonCenter_1F", "where": {"facing": "north", "kind": "tiles", "tiles": [[7, 4]]}}, + "why": "wild battles until the sim beats the rival 50% or more, Lv28 at most; the nurse when hurt or low on PP" + }, + { + "id": "cerulean_nurse", + "kind": "route", + "variant": "run", + "target": {"certainty": "tile", "map": "CeruleanCity_PokemonCenter_1F", "where": {"facing": "north", "kind": "tiles", "tiles": [[7, 4]]}}, + "why": "back to the Center: the rival's battle starts at full HP and PP" + }, + { + "id": "heal_cerulean", + "kind": "heal", + "why": "full HP" + } + ] + }, + { + "id": "rival_trigger", + "title": "North to below the rival's trigger", + "events": [ + { + "id": "below_rival_trigger", + "kind": "route", + "variant": "run", + "target": {"certainty": "tile", "map": "CeruleanCity", "where": {"facing": "north", "kind": "tiles", "tiles": [[23, 7]]}}, + "why": "out of the Center, north up to (23, 7), short of the trigger row 6" + } + ] + } + ] + }, + "execution": {"menu": "full", "supplies": {"lead": "after_brock"}} +} diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.15b.plan.json b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.15b.plan.json new file mode 100644 index 0000000000..e2fe43c68b --- /dev/null +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.15b.plan.json @@ -0,0 +1,40 @@ +{ + "format": "pokesim-authored-checkpoint/1", + "game": "frlg", + "checkpoint": { + "id": "00.15b", + "title": "Cerulean: Water Pulse if not known, then the rival north of the city", + "notes": [ + "The rival north of Cerulean (CeruleanCity scripts.inc): the only way north to Nugget Bridge is columns 22..24, and a step onto row 6 there (CeruleanCity_EventScript_RivalTrigger*, VAR_MAP_SCENE_CERULEAN_CITY_RIVAL 0) brings him down to the player. From the middle, (23, 6), he stops at (23, 5); after the battle he walks round the player and off south, and the player, turning to watch him, ends facing south. His FAME CHECKER's text is read to the overworld with the battle's. For a player who took Squirtle he has Pidgeotto Lv17, Abra Lv16, Rattata Lv15 and Bulbasaur Lv18 (sParty_RivalCeruleanBulbasaur), whose Vine Whip and Sleep Powder are the danger. The row starts from 00.15's save below the trigger, and saves after him. First TM03 Water Pulse over Tail Whip (from the bag, where the player stands), if the lead doesn't know it yet: console B's save (2026-11-03) is past Misty's TEACH, which failed there. Where she taught it, the step reads the moves and does nothing." + ], + "start": {"certainty": "tile", "map": "CeruleanCity", "where": {"facing": "north", "kind": "tiles", "tiles": [[23, 7]]}}, + "sections": [ + { + "id": "rival_cerulean", + "title": "The rival north of Cerulean", + "events": [ + { + "id": "teach_water_pulse", + "kind": "game_action", + "variant": "teach tm03 water-pulse slot=1 forget=tail-whip", + "once_per_save": true, + "why": "TM03 Water Pulse in place of Tail Whip, unless the lead knows it" + }, + { + "id": "rival_trigger", + "kind": "step", + "direction": "north", + "why": "onto (23, 6), the middle trigger: \"Yo! !\"" + }, + { + "id": "rival_cerulean", + "kind": "battle", + "declared_after": {"certainty": "tile", "map": "CeruleanCity", "where": {"facing": "south", "kind": "tiles", "tiles": [[23, 6]]}}, + "why": "Pidgeotto, Abra, Rattata and Bulbasaur; then the FAME CHECKER" + } + ] + } + ] + }, + "execution": {"menu": "full", "supplies": {"lead": "after_brock"}} +} diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.16.plan.json b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.16.plan.json new file mode 100644 index 0000000000..aa4749e3d6 --- /dev/null +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.16.plan.json @@ -0,0 +1,173 @@ +{ + "format": "pokesim-authored-checkpoint/1", + "game": "frlg", + "checkpoint": { + "id": "00.16", + "title": "Nugget Bridge: the nurse, five trainers and the Rocket", + "notes": [ + "Nugget Bridge (Route24 map.json) is x 10..12 from row 32 north to row 16, the city's columns 22..24 (offset 12). Its five trainers stand on it facing across, sight 2, so each line crosses the middle column 11 on the trainer's row: Bug Catcher Cale (12, 31), Lass Ali (10, 28), Youngster Timmy (12, 25), Lass Reli (10, 22) and Camper Ethan (12, 19). Each is fought on the step onto their row, beside them: they don't walk, and the player keeps facing north. Two tiles separate the rows, walked as one short leg; the step onto a row goes on a tile at a time until the trainer sees the player (into_line()), as the open leg onto the bridge ended a tile short twice on console B (2026-11-03), on (11, 33), and one step left the player out of Cale's sight. Then the Rocket (12, 15): the step onto (11, 15) (Route24_EventScript_RocketTriggerRight, VAR_MAP_SCENE_ROUTE24 0) gives the NUGGET, \"join Team Rocket\", and his battle; he only turns, and the player turns east to him. Camper Shane (5, 21) looks north from the west bank, off the way." + ], + "start": {"certainty": "tile", "map": "CeruleanCity", "where": {"facing": "south", "kind": "tiles", "tiles": [[23, 6]]}}, + "sections": [ + { + "id": "cerulean_center", + "title": "Cerulean's Pokemon Center", + "events": [ + { + "id": "cerulean_nurse", + "kind": "route", + "variant": "run", + "target": {"certainty": "tile", "map": "CeruleanCity_PokemonCenter_1F", "where": {"facing": "north", "kind": "tiles", "tiles": [[7, 4]]}}, + "why": "back to the Center after the rival, before Nugget Bridge" + }, + { + "id": "heal_cerulean", + "kind": "heal", + "why": "full HP" + } + ] + }, + { + "id": "nugget_bridge", + "title": "Nugget Bridge's five trainers", + "events": [ + { + "id": "below_cale_line", + "kind": "route", + "variant": "run", + "target": {"certainty": "tile", "map": "Route24", "where": {"facing": "north", "kind": "tiles", "tiles": [[11, 32]]}}, + "why": "out of the Center, north past the rival's row onto the bridge, below Cale's row" + }, + { + "id": "cale_line", + "kind": "step", + "variant": "trainer_line", + "direction": "north", + "why": "onto (11, 31), beside Cale" + }, + { + "id": "bug_catcher_cale", + "kind": "battle", + "declared_after": {"certainty": "tile", "map": "Route24", "where": {"facing": "north", "kind": "tiles", "tiles": [[11, 31]]}}, + "why": "his Bug Pokemon" + }, + { + "id": "below_ali_line", + "kind": "legs", + "variant": "run", + "legs": [{"direction": "north", "tiles": 2}], + "why": "up to (11, 29)" + }, + { + "id": "ali_line", + "kind": "step", + "variant": "trainer_line", + "direction": "north", + "why": "onto (11, 28), beside Ali" + }, + { + "id": "lass_ali", + "kind": "battle", + "declared_after": {"certainty": "tile", "map": "Route24", "where": {"facing": "north", "kind": "tiles", "tiles": [[11, 28]]}}, + "why": "her Pokemon" + }, + { + "id": "below_timmy_line", + "kind": "legs", + "variant": "run", + "legs": [{"direction": "north", "tiles": 2}], + "why": "up to (11, 26)" + }, + { + "id": "timmy_line", + "kind": "step", + "variant": "trainer_line", + "direction": "north", + "why": "onto (11, 25), beside Timmy" + }, + { + "id": "youngster_timmy", + "kind": "battle", + "declared_after": {"certainty": "tile", "map": "Route24", "where": {"facing": "north", "kind": "tiles", "tiles": [[11, 25]]}}, + "why": "his Pokemon" + }, + { + "id": "below_reli_line", + "kind": "legs", + "variant": "run", + "legs": [{"direction": "north", "tiles": 2}], + "why": "up to (11, 23)" + }, + { + "id": "reli_line", + "kind": "step", + "variant": "trainer_line", + "direction": "north", + "why": "onto (11, 22), beside Reli" + }, + { + "id": "lass_reli", + "kind": "battle", + "declared_after": {"certainty": "tile", "map": "Route24", "where": {"facing": "north", "kind": "tiles", "tiles": [[11, 22]]}}, + "why": "her Pokemon" + }, + { + "id": "below_ethan_line", + "kind": "legs", + "variant": "run", + "legs": [{"direction": "north", "tiles": 2}], + "why": "up to (11, 20)" + }, + { + "id": "ethan_line", + "kind": "step", + "variant": "trainer_line", + "direction": "north", + "why": "onto (11, 19), beside Ethan" + }, + { + "id": "camper_ethan", + "kind": "battle", + "declared_after": {"certainty": "tile", "map": "Route24", "where": {"facing": "north", "kind": "tiles", "tiles": [[11, 19]]}}, + "why": "his Pokemon" + } + ] + }, + { + "id": "rocket", + "title": "The Rocket at the bridge's north end", + "events": [ + { + "id": "ready_for_rocket", + "kind": "ready", + "target": {"certainty": "tile", "map": "CeruleanCity_PokemonCenter_1F", "where": {"facing": "north", "kind": "tiles", "tiles": [[7, 4]]}}, + "why": "items for a status or low HP; the nurse only if they can't", + "notes": [ + "A route, not legs: the nurse may have been needed." + ] + }, + { + "id": "below_rocket_trigger", + "kind": "route", + "variant": "run", + "target": {"certainty": "tile", "map": "Route24", "where": {"facing": "north", "kind": "tiles", "tiles": [[11, 16]]}}, + "why": "up the bridge to below the Rocket's trigger (11, 15)" + }, + { + "id": "rocket_trigger", + "kind": "step", + "direction": "north", + "why": "onto (11, 15), beside the Rocket" + }, + { + "id": "rocket_grunt", + "kind": "battle", + "declared_after": {"certainty": "tile", "map": "Route24", "where": {"facing": "east", "kind": "tiles", "tiles": [[11, 15]]}}, + "why": "the NUGGET, then Ekans and Zubat, Lv15" + } + ] + } + ] + }, + "execution": {"menu": "full", "supplies": {"lead": "after_brock"}} +} diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.17.plan.json b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.17.plan.json new file mode 100644 index 0000000000..d3e074547a --- /dev/null +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.17.plan.json @@ -0,0 +1,146 @@ +{ + "format": "pokesim-authored-checkpoint/1", + "game": "frlg", + "checkpoint": { + "id": "00.17", + "title": "Route 24 and 25 to Bill's Sea Cottage: Franklin, Kelsey, Nob and Haley", + "notes": [ + "Route 24 north of Nugget Bridge (Route24 map.json) joins Route 25 by its rows 7..9; the ledges on Route 25's row 6 (x 0..9) leave the way north at x 12..13. Route 25 (Route25 map.json, scripts.inc) to Bill's Sea Cottage door (51, 4): of its nine trainers, four can't be walked around.", + "- Hiker Franklin (11, 4) faces east, sight 4, over (12..15, 4), and Hiker Wayne (17, 7) east over (18..19, 7): the only ways east past x 15. Franklin is fought, from (15, 5) on the step onto (15, 4), the end of his line: he walks up to (14, 4).", + "- Youngster Joey (18, 2) faces south over (18, 3..4): the way keeps off column 18, south round Wayne to (19, 6) and up to (19, 4).", + "- Youngster Dan (22, 4) looks around, sight 2, over the only way east, (20..21, 4). On (20, 4), a one-tile leg, he may see the player and walk up to (21, 4); so the way goes north from there to row 2, east, and down column 23 past him to (23, 5), off every tile he may walk up to. Where his sight is crossed, the leg ends on a wall or is one tile; if he looks the player's way, story_interrupts() fight him.", + "- Picnicker Kelsey (22, 8) faces east over (23..24, 8), across the only way on: fought on the step onto (24, 8); she walks up to (23, 8).", + "- Hiker Nob (27, 9) faces north over (27, 6..8), Camper Flint (28, 4) south over (28, 5..7): every way east crosses one. Nob is fought on the step onto (27, 8), beside him; the way on keeps off Flint's column, by one-tile legs and legs to walls.", + "- Youngster Chad (36, 4) walks up and down column 36 (rows 2..7), so he may see any tile of it down to row 9. The way crosses his column on row 9, a leg to the water at (42, 9), where he can only walk up beside it.", + "- Lass Haley (42, 5) faces south over (42, 6..8), the only way east of x 42: fought on the step onto (42, 8); she walks up to (42, 7). The row saves inside the Sea Cottage, which the save card names ROUTE 25." + ], + "start": {"certainty": "tile", "map": "Route24", "where": {"facing": "east", "kind": "tiles", "tiles": [[11, 15]]}}, + "sections": [ + { + "id": "route24_franklin", + "title": "Off the bridge to Hiker Franklin", + "events": [ + { + "id": "below_franklin_line", + "kind": "route", + "variant": "run", + "target": {"certainty": "tile", "map": "Route25", "where": {"facing": "north", "kind": "tiles", "tiles": [[15, 5]]}}, + "why": "north off Nugget Bridge, east into Route 25, round its ledges to (15, 5), below the end of Franklin's line" + }, + { + "id": "franklin_line", + "kind": "step", + "variant": "trainer_line", + "direction": "north", + "why": "onto (15, 4), at the end of Franklin's line" + }, + { + "id": "hiker_franklin", + "kind": "battle", + "declared_after": {"certainty": "tile", "map": "Route25", "where": {"facing": "north", "kind": "tiles", "tiles": [[15, 4]]}}, + "why": "Machop and Geodude, Lv15; Franklin stops at (14, 4)" + } + ] + }, + { + "id": "route25_kelsey", + "title": "Round Dan to Picnicker Kelsey", + "events": [ + { + "id": "west_of_dan", + "kind": "legs", + "variant": "run", + "legs": [{"direction": "east", "tiles": 2}, {"direction": "south", "tiles": 2}, {"direction": "east", "tiles": 2}, {"direction": "north", "tiles": 2}], + "why": "to (17, 4), short of Joey's (18, 4); round Wayne (17, 7) to (19, 6); up to (19, 4)" + }, + { + "id": "round_dan", + "kind": "legs", + "variant": "run", + "legs": [ + {"direction": "east", "tiles": 1}, {"direction": "north", "tiles": 2}, {"direction": "east", "tiles": 4}, {"direction": "west", "tiles": 1}, {"direction": "south", "tiles": 3}, {"direction": "east", "tiles": 1}, + {"direction": "south", "tiles": 2} + ], + "why": "onto (20, 4); up to (20, 2), east to (24, 2), down column 23 past Dan to (23, 5), to (24, 7) above Kelsey's line" + }, + { + "id": "kelsey_line", + "kind": "step", + "variant": "trainer_line", + "direction": "south", + "why": "onto (24, 8), at the end of Kelsey's line" + }, + { + "id": "picnicker_kelsey", + "kind": "battle", + "declared_after": {"certainty": "tile", "map": "Route25", "where": {"facing": "south", "kind": "tiles", "tiles": [[24, 8]]}}, + "why": "Nidoran M and Nidoran F, Lv15; Kelsey stops at (23, 8)" + } + ] + }, + { + "id": "route25_nob", + "title": "Hiker Nob", + "events": [ + { + "id": "west_of_nob_line", + "kind": "legs", + "variant": "run", + "legs": [{"direction": "east", "tiles": 2}], + "why": "along row 8 to (26, 8)" + }, + { + "id": "nob_line", + "kind": "step", + "variant": "trainer_line", + "direction": "east", + "why": "onto (27, 8), above Nob" + }, + { + "id": "hiker_nob", + "kind": "battle", + "declared_after": {"certainty": "tile", "map": "Route25", "where": {"facing": "east", "kind": "tiles", "tiles": [[27, 8]]}}, + "why": "three Geodude and a Machop, Lv13" + } + ] + }, + { + "id": "route25_haley", + "title": "Past Chad to Lass Haley and the Sea Cottage", + "events": [ + { + "id": "below_haley_line", + "kind": "legs", + "variant": "run", + "legs": [ + {"direction": "east", "tiles": 1}, {"direction": "south", "tiles": 1}, {"direction": "east", "tiles": 1}, {"direction": "north", "tiles": 3}, {"direction": "east", "tiles": 5}, {"direction": "south", "tiles": 3}, + {"direction": "east", "tiles": 8} + ], + "why": "below Flint's column to (29, 9), up to (29, 6), east to (34, 6), down to (34, 9), east along row 9 past Chad's column to the water, (42, 9)" + }, + { + "id": "haley_line", + "kind": "step", + "variant": "trainer_line", + "direction": "north", + "why": "onto (42, 8), at the end of Haley's line" + }, + { + "id": "lass_haley", + "kind": "battle", + "declared_after": {"certainty": "tile", "map": "Route25", "where": {"facing": "north", "kind": "tiles", "tiles": [[42, 8]]}}, + "why": "Oddish, Pidgey and Oddish, Lv13; Haley stops at (42, 7)" + }, + { + "id": "sea_cottage", + "kind": "route", + "variant": "run", + "target": {"certainty": "tile", "map": "Route25_SeaCottage", "where": {"facing": "north", "kind": "tiles", "tiles": [[7, 8]]}}, + "why": "east along row 8, up column 51 into the Sea Cottage (51, 4), a step in from its mat" + } + ] + } + ] + }, + "execution": {"menu": "full", "supplies": {"lead": "after_brock"}} +} diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.18.plan.json b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.18.plan.json new file mode 100644 index 0000000000..6f0cc4d022 --- /dev/null +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.18.plan.json @@ -0,0 +1,112 @@ +{ + "format": "pokesim-authored-checkpoint/1", + "game": "frlg", + "checkpoint": { + "id": "00.18", + "title": "Bill's Sea Cottage: the Cell Separator and the S.S. Ticket", + "notes": [ + "Bill's Sea Cottage (Route25_SeaCottage scripts.inc). Bill is the Clefairy at (10, 6) (FLAG_HELPED_BILL_IN_SEA_COTTAGE unset): talked to from (10, 7), below him, he asks \"Help me out!\" (YES/NO; NO goes on the same), says to run the Cell Separation on the PC, and walks up into the right teleporter (10, 3); with the player facing north he walks straight up. The PC (4, 5) answers only from the south, (4, 6). Its scene: the teleporters run, Bill comes out of the left one (3, 3) and walks to (7, 6) (BillWalkToMiddleOfRoom); the player isn't moved. Talked to from (6, 6), Bill gives the S.S. TICKET, no YES/NO, and goes on about the S.S. ANNE (FLAG_GOT_SS_TICKET, which also hides Nugget Bridge's Rocket). Out by the mat (7, 9); the door puts the player on (51, 5), facing south. The maps keep Bill at (7, 5), but after his scene he stands on (7, 6), in the way from (6, 6) to the mat (console B, 2026-11-03), so the walk out goes around him to (7, 8) first." + ], + "start": {"certainty": "tile", "map": "Route25_SeaCottage", "where": {"facing": "north", "kind": "tiles", "tiles": [[7, 8]]}}, + "sections": [ + { + "id": "clefairy", + "title": "Bill as a Clefairy", + "events": [ + { + "id": "below_bill_clefairy", + "kind": "route", + "variant": "run", + "target": {"certainty": "tile", "map": "Route25_SeaCottage", "where": {"facing": "north", "kind": "tiles", "tiles": [[10, 7]]}}, + "why": "below the Clefairy (10, 6), facing it" + }, + { + "id": "bill_clefairy", + "kind": "talk", + "why": "\"Hiya! I'm a POKEMON... ...No I'm not!\" ... \"Help me out!\"" + }, + { + "id": "help_bill", + "kind": "answer", + "why": "YES: \"run the Cell Separation on the PC\"" + }, + { + "id": "bill_into_teleporter", + "kind": "scene", + "declared_after": {"certainty": "tile", "map": "Route25_SeaCottage", "where": {"facing": "north", "kind": "tiles", "tiles": [[10, 7]]}}, + "why": "the Clefairy walks up into the right teleporter" + } + ] + }, + { + "id": "cell_separator", + "title": "The PC's Cell Separator", + "events": [ + { + "id": "pc_front", + "kind": "route", + "variant": "run", + "target": {"certainty": "tile", "map": "Route25_SeaCottage", "where": {"facing": "north", "kind": "tiles", "tiles": [[4, 6]]}}, + "why": "below the PC (4, 5), facing it" + }, + { + "id": "cell_separator", + "kind": "talk", + "why": "the PC: \" initiated the TELEPORTER's CELL SEPARATOR!\"" + }, + { + "id": "bill_comes_out", + "kind": "scene", + "declared_after": {"certainty": "tile", "map": "Route25_SeaCottage", "where": {"facing": "north", "kind": "tiles", "tiles": [[4, 6]]}}, + "why": "the teleporters run; Bill comes out of the left one and walks to (7, 6)" + } + ] + }, + { + "id": "ss_ticket", + "title": "Bill and the S.S. Ticket", + "events": [ + { + "id": "beside_bill", + "kind": "legs", + "variant": "run", + "legs": [{"direction": "east", "tiles": 2}], + "why": "to (6, 6), west of Bill, facing him" + }, + { + "id": "thank_bill", + "kind": "talk", + "why": "\"Thanks, bud! ... take this\"" + }, + { + "id": "ss_ticket", + "kind": "scene", + "declared_after": {"certainty": "tile", "map": "Route25_SeaCottage", "where": {"facing": "east", "kind": "tiles", "tiles": [[6, 6]]}}, + "why": "the S.S. TICKET; \"... the S.S. ANNE ... go instead\"" + } + ] + }, + { + "id": "out", + "title": "Round Bill and out of the cottage", + "events": [ + { + "id": "around_bill", + "kind": "legs", + "variant": "run", + "legs": [{"direction": "south", "tiles": 2}, {"direction": "east", "tiles": 1}], + "why": "to (7, 8), above the mat; Bill stands on (7, 6) after his scene" + }, + { + "id": "out_of_cottage", + "kind": "route", + "variant": "run", + "target": {"certainty": "tile", "map": "Route25", "where": {"facing": "south", "kind": "tiles", "tiles": [[51, 5]]}}, + "why": "down to the mat and out; the door puts the player below it" + } + ] + } + ] + }, + "execution": {"menu": "full", "supplies": {"lead": "after_brock"}} +} diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.19.plan.json b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.19.plan.json new file mode 100644 index 0000000000..0e74ab339c --- /dev/null +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.19.plan.json @@ -0,0 +1,47 @@ +{ + "format": "pokesim-authored-checkpoint/1", + "game": "frlg", + "checkpoint": { + "id": "00.19", + "title": "Route 25's south path back to Cerulean's Pokemon Center", + "notes": [ + "Back to Cerulean by Route 25's south path (Route25 map.json): from below the cottage down column 51 to row 12, west along row 12 and row 11 into Route 24 (x 14..23, row 11), and down its column 14..16 east of Nugget Bridge to Cerulean's north edge (x 26..28, offset 12). No trainer stands on it. Cerulean's row 1 there is a ledge (26..28, 1), hopped south from (27, 0); then on into the city to the Pokemon Center." + ], + "start": {"certainty": "tile", "map": "Route25", "where": {"facing": "south", "kind": "tiles", "tiles": [[51, 5]]}}, + "sections": [ + { + "id": "route25_south_path", + "title": "Route 25's south path to Cerulean's Pokemon Center", + "events": [ + { + "id": "above_cerulean_ledge", + "kind": "route", + "variant": "run", + "target": {"certainty": "tile", "map": "CeruleanCity", "where": {"facing": "south", "kind": "tiles", "tiles": [[27, 0]]}}, + "why": "Route 25's south path west, Route 24 east of the bridge south, to above Cerulean's ledge (27, 1)" + }, + { + "id": "cerulean_ledge_hop", + "kind": "step", + "direction": "south", + "declared_after": {"certainty": "tile", "map": "CeruleanCity", "where": {"facing": "south", "kind": "tiles", "tiles": [[27, 2]]}}, + "why": "down the ledge (27, 1)" + }, + { + "id": "cerulean_nurse", + "kind": "route", + "variant": "run", + "target": {"certainty": "tile", "map": "CeruleanCity_PokemonCenter_1F", "where": {"facing": "north", "kind": "tiles", "tiles": [[7, 4]]}}, + "why": "into the city to the Pokemon Center" + }, + { + "id": "heal_cerulean", + "kind": "heal", + "why": "full HP" + } + ] + } + ] + }, + "execution": {"menu": "full", "supplies": {"lead": "after_brock"}} +} diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.20.plan.json b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.20.plan.json new file mode 100644 index 0000000000..d8a251d0aa --- /dev/null +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.20.plan.json @@ -0,0 +1,75 @@ +{ + "format": "pokesim-authored-checkpoint/1", + "game": "frlg", + "checkpoint": { + "id": "00.20", + "title": "Route 24's grass: an Oddish for Cut, then the Center", + "notes": [ + "Stopgap for console B's save, which caught nothing on Route 1. A new playthrough should instead catch a Rattata on Route 1 or 22 early, as its Cut user and spare member, and drop this row (and its walk over Nugget Bridge and back).", + "An Oddish for HM01 Cut, and a second member behind the lead (docs/design/AutoStory-FRLG-FutureEvents.md, \"Console B run choices\"). Route 24's grass (Route24 map.json: x 3..5, rows 19..31, west of Nugget Bridge) is the nearest to the Center with Oddish: FireRed's sRoute24_FireRed (pokefirered wild_encounters.json) has it in 25% of battles, Lv12..14, as Route 25's grass; Routes 5 and 6 aren't on the story's maps yet. Up the bridge, whose trainers 00.16 beat, west along rows 10..15 to the cliff (3, 15) and down column 3 to the grass's first row, (3, 19); the step paces east to (4, 19) and back. Camper Shane (5, 21) faces north, sight 5, over (5, 16..20): column 5 is kept off. The leg west ends on the cliff, not open: on console B (m63) an open leg west to (4, 15) ended a tile short, and the walk down column 5 came into Shane's sight.", + "First 7 Poke Balls at the Mart (row 1, 200 each; the bag isn't read, so the step buys them whatever the bag holds). The floor, from 00.15's 1500 less its 1400: the rival's 288 (4 x 18 x 4), the Rocket's 480 (4 x 15 x 8), Franklin's 540 and Nob's 468 (hikers, 9) alone make 1876 (pokefirered gTrainerMoneyTable). An Oddish at full HP (catch rate 255) stays in a Poke Ball about 1 time in 3 (Gen 3: a = 85, four shakes of 0.76), so 7 balls catch it about 94% of the time; the step throws 7 at most, in 30 battles (none an Oddish: 0.02%). Nothing weakens it: the HP bar isn't read on the console yet.", + "The Oddish joins the party second. Battles keep the lead in (PokemonFRLG_AutoStoryBattleDecisions.h): the Oddish is sent only when the lead faints in a trainer's battle, which counts as lost. Back to the nurse, and the save in the Center." + ], + "start": {"certainty": "tile", "map": "CeruleanCity_PokemonCenter_1F", "where": {"facing": "north", "kind": "tiles", "tiles": [[7, 4]]}}, + "sections": [ + { + "id": "cerulean_mart", + "title": "Cerulean Mart: Poke Balls", + "events": [ + { + "id": "mart_clerk", + "kind": "route", + "variant": "run", + "target": {"certainty": "tile", "map": "CeruleanCity_Mart", "where": {"facing": "west", "kind": "tiles", "tiles": [[4, 3]]}}, + "why": "out of the Center to the Mart's clerk" + }, + { + "id": "buy_poke_balls", + "kind": "game_action", + "variant": "mart CeruleanCity_Mart budget=1400 floor=1500 poke-ball=7", + "once_per_save": true, + "why": "7 Poke Balls for the Oddish" + } + ] + }, + { + "id": "route24_grass", + "title": "Route 24's grass: an Oddish", + "events": [ + { + "id": "oddish_patch", + "kind": "route", + "variant": "run", + "target": {"certainty": "tile", "map": "Route24", "where": {"kind": "tiles", "tiles": [[3, 19]]}}, + "why": "north over Nugget Bridge, west to the cliff and down column 3 onto the grass's first row, out of Shane's column 5" + }, + { + "id": "catch_oddish", + "kind": "game_action", + "variant": "capture oddish catches=1 encounters=30 balls=7 pace=east", + "why": "wild battles until an Oddish, then Poke Balls; any other species is run from" + } + ] + }, + { + "id": "cerulean_center", + "title": "Back to Cerulean's Pokemon Center", + "events": [ + { + "id": "cerulean_nurse", + "kind": "route", + "variant": "run", + "target": {"certainty": "tile", "map": "CeruleanCity_PokemonCenter_1F", "where": {"facing": "north", "kind": "tiles", "tiles": [[7, 4]]}}, + "why": "back over the bridge to the Center" + }, + { + "id": "heal_cerulean", + "kind": "heal", + "why": "full HP" + } + ] + } + ] + }, + "execution": {"menu": "full", "supplies": {"lead": "after_brock"}} +} diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.21.plan.json b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.21.plan.json new file mode 100644 index 0000000000..464619c714 --- /dev/null +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.21.plan.json @@ -0,0 +1,94 @@ +{ + "format": "pokesim-authored-checkpoint/1", + "game": "frlg", + "checkpoint": { + "id": "00.21", + "title": "The Cerulean Rocket, Route 5, the Underground Path and Route 6 to Vermilion's Pokemon Center: Jeff", + "notes": [ + "Cerulean's only way south without Cut (CeruleanCity map.json, scripts.inc) is through the burgled house (30, 11), whose door the policeman leaves once the S.S. TICKET is had, out of the hole in its back wall into the yard (31, 8). The Rocket there (33, 6) stops the player on (33, 5) or (33, 7) (CeruleanCity_EventScript_GruntTrigger*): from (32, 7), the step east onto (33, 7) turns the player to him; Machop and Drowzee, Lv17, then TM28 Dig, and he is gone. Then east round the yard, down to the city's south edge by the path along its east side (39..40, 20..31), down Route 5's east side to the Underground Path's north house (31, 31), through its tunnel and out of the south house onto Route 6, below its door (19, 14). Route 6:", + "- Bug Catcher Keigo (3, 16) faces east, sight 5, over the middle path (4..8, 16); Bug Catcher Elijah (20, 25) faces west, sight 3, over the east path (17..19, 25). The way goes down column 15, through the grass to the wall (15, 33), out of both lines; the open leg west to it, a tile short, leaves the player on column 16, out of them too.", + "- Camper Ricky and Picnicker Nancy (12..13, 21) battle only when talked to.", + "- Picnicker Isabelle (13, 32) and Camper Jeff (13, 33) face west, sight 3, over (10..12, 32) and (10..12, 33); the only way south, (10..12, 34), is from Jeff's row. Up to (15, 31), west to the wall (7, 31), down to the wall (7, 33), east: Jeff is fought on the step onto (10, 33) and walks up to (11, 33). Isabelle's row is kept off. Then down into Vermilion City (offset 12) to its Pokemon Center." + ], + "start": {"certainty": "tile", "map": "CeruleanCity_PokemonCenter_1F", "where": {"facing": "north", "kind": "tiles", "tiles": [[7, 4]]}}, + "sections": [ + { + "id": "cerulean_rocket", + "title": "The Rocket behind the burgled house", + "events": [ + { + "id": "west_of_rocket", + "kind": "route", + "variant": "run", + "target": {"certainty": "tile", "map": "CeruleanCity", "where": {"facing": "east", "kind": "tiles", "tiles": [[32, 7]]}}, + "why": "through the burgled house and out of the hole in its back wall, west of the Rocket (33, 6)" + }, + { + "id": "rocket_trigger", + "kind": "step", + "direction": "east", + "why": "onto (33, 7), below the Rocket" + }, + { + "id": "rocket_grunt", + "kind": "battle", + "declared_after": {"certainty": "tile", "map": "CeruleanCity", "where": {"facing": "north", "kind": "tiles", "tiles": [[33, 7]]}}, + "why": "Machop and Drowzee, Lv17; TM28 Dig" + } + ] + }, + { + "id": "route6", + "title": "Route 5, the Underground Path and Route 6: Camper Jeff", + "events": [ + { + "id": "route6_column15", + "kind": "route", + "variant": "run", + "target": {"certainty": "tile", "map": "Route6", "where": {"kind": "tiles", "tiles": [[15, 14]]}}, + "why": "round the yard and down Cerulean's east side, Route 5 into the Underground Path, through it onto Route 6, west to column 15" + }, + { + "id": "round_keigo_and_elijah", + "kind": "legs", + "variant": "run", + "legs": [{"direction": "south", "tiles": 19}, {"direction": "north", "tiles": 1}, {"direction": "north", "tiles": 1}, {"direction": "west", "tiles": 8}, {"direction": "south", "tiles": 2}, {"direction": "east", "tiles": 2}], + "why": "down column 15 to the wall (15, 33); up to (15, 31), west to the wall (7, 31), down to the wall (7, 33), east to (9, 33)" + }, + { + "id": "jeff_line", + "kind": "step", + "variant": "trainer_line", + "direction": "east", + "why": "onto (10, 33), in Jeff's line" + }, + { + "id": "camper_jeff", + "kind": "battle", + "declared_after": {"certainty": "tile", "map": "Route6", "where": {"facing": "east", "kind": "tiles", "tiles": [[10, 33]]}}, + "why": "Spearow and Raticate, Lv16; Jeff stops at (11, 33)" + } + ] + }, + { + "id": "vermilion_center", + "title": "Vermilion's Pokemon Center", + "events": [ + { + "id": "vermilion_nurse", + "kind": "route", + "variant": "run", + "target": {"certainty": "tile", "map": "VermilionCity_PokemonCenter_1F", "where": {"facing": "north", "kind": "tiles", "tiles": [[7, 4]]}}, + "why": "down Route 6's south path into Vermilion City, to the Pokemon Center" + }, + { + "id": "heal_vermilion", + "kind": "heal", + "why": "full HP" + } + ] + } + ] + }, + "execution": {"menu": "full", "supplies": {"lead": "after_brock"}} +} diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.22.plan.json b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.22.plan.json new file mode 100644 index 0000000000..b932951dda --- /dev/null +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.22.plan.json @@ -0,0 +1,160 @@ +{ + "format": "pokesim-authored-checkpoint/1", + "game": "frlg", + "checkpoint": { + "id": "00.22", + "title": "The S.S. Anne: the rival, HM01 Cut from the Captain, back to Vermilion's Pokemon Center", + "notes": [ + "The S.S. Anne (VermilionCity, SSAnne_* scripts.inc). The step onto (23, 33) (VermilionCity_EventScript_CheckTicket) has the sailor (24, 33) ask for a ticket; the S.S. TICKET (00.18) is shown and the player turns east to him. Then onto the pier (23, 34), along the gangway, through 1F, by legs off its cabins' doormats on row 10, which planned routes cross, and up its stairs (3, 8) to 2F. The step onto (30, 6), below the Captain's door (30, 2) (SSAnne_2F_Corridor_EventScript_RivalTriggerLeft), brings the rival out and down to (30, 5); the player keeps facing north, and after the battle he walks round the player and off. For a player who took Squirtle: Pidgeotto Lv19, Raticate Lv16, Kadabra Lv18, Ivysaur Lv20. The ship's trainers are in its cabins and on its deck, off the way. The Captain (5, 4) faces up; talked to from (5, 5) he is rubbed on the back and gives HM01 (VAR_MAP_SCENE_VERMILION_CITY 1). Back out through 1F's door (19, 1): on the gangway the ship sails (SSAnne_Exterior_ExitSSAnne), the player is put on (23, 34) and walked up to (23, 32) (VermilionCity_EventScript_ExitSSAnne). Cut is taught later, to the Oddish." + ], + "start": {"certainty": "tile", "map": "VermilionCity_PokemonCenter_1F", "where": {"facing": "north", "kind": "tiles", "tiles": [[7, 4]]}}, + "sections": [ + { + "id": "boarding", + "title": "The ticket check and S.S. Anne 1F", + "events": [ + { + "id": "above_ticket_check", + "kind": "route", + "variant": "run", + "target": {"certainty": "tile", "map": "VermilionCity", "where": {"facing": "south", "kind": "tiles", "tiles": [[23, 32]]}}, + "why": "out of the Center down to the harbor, above the ticket check (23, 33)" + }, + { + "id": "ticket_check", + "kind": "step", + "direction": "south", + "why": "onto (23, 33): \"Do you have a ticket?\"" + }, + { + "id": "show_ss_ticket", + "kind": "scene", + "declared_after": {"certainty": "tile", "map": "VermilionCity", "where": {"facing": "east", "kind": "tiles", "tiles": [[23, 33]]}}, + "why": "the S.S. TICKET; the player turns to the sailor" + }, + { + "id": "aboard", + "kind": "route", + "variant": "run", + "target": {"certainty": "tile", "map": "SSAnne_1F_Corridor", "where": {"facing": "south", "kind": "tiles", "tiles": [[19, 2]]}}, + "why": "onto the pier, along the gangway and in by 1F's door, a step below it" + }, + { + "id": "past_the_cabins", + "kind": "legs", + "variant": "run", + "legs": [{"direction": "south", "tiles": 8}, {"direction": "north", "tiles": 1}, {"direction": "west", "tiles": 6}, {"direction": "north", "tiles": 1}], + "why": "to the wall (19, 10), up a step, west to the worker (12, 9), up a step to (13, 8): off the cabins' mats on row 10" + } + ] + }, + { + "id": "rival_ss_anne", + "title": "2F: the rival", + "events": [ + { + "id": "below_rival_trigger", + "kind": "route", + "variant": "run", + "target": {"certainty": "tile", "map": "SSAnne_2F_Corridor", "where": {"facing": "north", "kind": "tiles", "tiles": [[30, 7]]}}, + "why": "west along 1F, up the stairs (3, 8) and along 2F below the Captain's door" + }, + { + "id": "rival_trigger", + "kind": "step", + "direction": "north", + "why": "onto (30, 6): the rival comes out of the Captain's door" + }, + { + "id": "rival_ss_anne", + "kind": "battle", + "declared_after": {"certainty": "tile", "map": "SSAnne_2F_Corridor", "where": {"facing": "north", "kind": "tiles", "tiles": [[30, 6]]}}, + "why": "Pidgeotto, Raticate, Kadabra and Ivysaur" + } + ] + }, + { + "id": "captain", + "title": "The Captain and HM01", + "events": [ + { + "id": "behind_captain", + "kind": "route", + "variant": "run", + "target": {"certainty": "tile", "map": "SSAnne_CaptainsOffice", "where": {"facing": "north", "kind": "tiles", "tiles": [[5, 5]]}}, + "why": "into the Captain's office, behind the Captain (5, 4)" + }, + { + "id": "captain", + "kind": "talk", + "why": "\"Ooargh... I feel hideous... Urrp! Seasick...\"" + }, + { + "id": "hm01_cut", + "kind": "scene", + "declared_after": {"certainty": "tile", "map": "SSAnne_CaptainsOffice", "where": {"facing": "north", "kind": "tiles", "tiles": [[5, 5]]}}, + "why": "the player rubs his back; HM01, and what Cut does" + } + ] + }, + { + "id": "off_the_ship", + "title": "Back out and off the ship", + "events": [ + { + "id": "off_2f", + "kind": "route", + "variant": "run", + "target": {"certainty": "tile", "map": "SSAnne_1F_Corridor", "where": {"kind": "tiles", "tiles": [[13, 8]]}}, + "why": "back along 2F, down the stairs and east along 1F's row 8" + }, + { + "id": "round_the_sailor", + "kind": "legs", + "variant": "run", + "legs": [{"direction": "east", "tiles": 4}, {"direction": "south", "tiles": 1}, {"direction": "east", "tiles": 2}], + "why": "to the sailor (18, 8), down a step, east to (19, 9): off the cabins' mats on row 10" + }, + { + "id": "below_ship_door", + "kind": "route", + "variant": "run", + "target": {"certainty": "tile", "map": "SSAnne_1F_Corridor", "where": {"facing": "north", "kind": "tiles", "tiles": [[19, 2]]}}, + "why": "up below the door to the gangway" + }, + { + "id": "off_the_ship", + "kind": "step", + "direction": "north", + "why": "out onto the gangway" + }, + { + "id": "ss_anne_sails", + "kind": "scene", + "declared_after": {"certainty": "tile", "map": "VermilionCity", "where": {"facing": "north", "kind": "tiles", "tiles": [[23, 32]]}}, + "why": "the ship sails; the player is walked off the pier to (23, 32)" + } + ] + }, + { + "id": "vermilion_center", + "title": "Vermilion's Pokemon Center", + "events": [ + { + "id": "vermilion_nurse", + "kind": "route", + "variant": "run", + "target": {"certainty": "tile", "map": "VermilionCity_PokemonCenter_1F", "where": {"facing": "north", "kind": "tiles", "tiles": [[7, 4]]}}, + "why": "back to the Pokemon Center" + }, + { + "id": "heal_vermilion", + "kind": "heal", + "why": "full HP" + } + ] + } + ] + }, + "execution": {"menu": "full", "supplies": {"lead": "after_brock"}} +} diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.23.plan.json b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.23.plan.json new file mode 100644 index 0000000000..7ddd9c356c --- /dev/null +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.23.plan.json @@ -0,0 +1,178 @@ +{ + "format": "pokesim-authored-checkpoint/1", + "game": "frlg", + "checkpoint": { + "id": "00.23", + "title": "Vermilion Gym: Cut and Dig, the tree, Dwayne, Baily and Tucker, the trash cans", + "notes": [ + "Rows 00.23 to 00.25: HM01 Cut to the Oddish, the tree before Vermilion Gym, its three trainers and its trash cans, then Lt. Surge from a save in front of him.", + "The gym (VermilionCity_Gym map.json, scripts.inc), 11 x 20, entered on (5, 19): the cans on rows 10, 12 and 14 at x 1, 3, 5, 7, 9 (PokemonFRLG_AutoStoryTrashCans.h), the beams across rows 6 and 7 that the two switches turn off, Lt. Surge (5, 2) facing down above them. Its trainers, sight 3:", + "- Sailor Dwayne (8, 13) and Engineer Baily (2, 11) look around (MOVEMENT_TYPE_LOOK_AROUND): between them they see across rows 11 and 13 and down columns 2 and 8, so no way from the door to the cans keeps out of their sight. Each is fought from the second tile of his line, stepped onto from beside it, out of sight, and waited on there until he turns to the player (TRAINER_WAIT_VARIANT): Dwayne from (8, 15), stepped onto from (7, 15), Baily from (2, 13), from (3, 13). Each walks up a tile, Dwayne to (8, 14), Baily to (2, 12), and stays there while the player is in the gym.", + "- Gentleman Tucker (7, 8) faces west over (4..6, 8): fought on the step up from (5, 9) onto (5, 8); he walks up to (6, 8). The cans' stands, on rows 9, 11 and 13 above each, are clear of where the three stand after their battles. Leaving the gym puts them back where the map has them, beaten, and grows the tree back.", + "HM01 Cut, from the S.S. Anne (00.22), to the Oddish (00.20), second in the party: a wild Oddish of Lv12 to 14 knows 2 or 3 moves (Absorb, Sweet Scent, Poison Powder at 14), so it has room. TM28 Dig, from the Cerulean Rocket (00.21), to the lead in place of Withdraw: Ground, twice as strong on Lt. Surge's three, it takes the sim's chance against him for a Lv28 Wartortle with 14 Potions from 6% to 47%. Vermilion's tree (19, 24) (EventScript_CutTree) is the only way into the gym's yard, row 24 being walls but for it; the gym's door is (14, 25). In the gym, the trainers as above, then the trash cans until the door opens; out, the tree cut again from below, and back to the nurse." + ], + "start": {"certainty": "tile", "map": "VermilionCity_PokemonCenter_1F", "where": {"facing": "north", "kind": "tiles", "tiles": [[7, 4]]}}, + "sections": [ + { + "id": "teach", + "title": "Cut and Dig in the Center", + "events": [ + { + "id": "teach_cut", + "kind": "game_action", + "variant": "teach hm01 cut slot=2", + "once_per_save": true, + "why": "HM01 Cut to the Oddish, second in the party, unless it knows it" + }, + { + "id": "teach_dig", + "kind": "game_action", + "variant": "teach tm28 dig slot=1 forget=withdraw", + "once_per_save": true, + "why": "TM28 Dig in place of Withdraw, for Lt. Surge, unless the lead knows it or there is no TM28" + } + ] + }, + { + "id": "gym_tree", + "title": "The tree and the gym's door", + "events": [ + { + "id": "above_gym_tree", + "kind": "route", + "variant": "run", + "target": {"certainty": "tile", "map": "VermilionCity", "where": {"facing": "south", "kind": "tiles", "tiles": [[19, 23]]}}, + "why": "out of the Center, south through the city to above the tree (19, 24)" + }, + { + "id": "cut_gym_tree", + "kind": "game_action", + "variant": "cut_tree", + "direction": "south", + "declared_after": {"certainty": "tile", "map": "VermilionCity", "where": {"facing": "south", "kind": "tiles", "tiles": [[19, 24]]}}, + "why": "the Oddish cuts the tree; a step onto its tile" + }, + { + "id": "gym_door", + "kind": "route", + "variant": "run", + "target": {"certainty": "tile", "map": "VermilionCity_Gym", "where": {"facing": "north", "kind": "tiles", "tiles": [[5, 19]]}}, + "why": "down into the yard and in by the gym's door (14, 25)" + } + ] + }, + { + "id": "gym_trainers", + "title": "Dwayne, Baily and Tucker", + "events": [ + { + "id": "west_of_dwayne_line", + "kind": "legs", + "variant": "run", + "legs": [{"direction": "north", "tiles": 4}, {"direction": "east", "tiles": 2}], + "why": "up column 5 to the can (5, 14), east to (7, 15): out of Dwayne's and Baily's sight" + }, + { + "id": "dwayne_sight", + "kind": "step", + "variant": "trainer_wait", + "direction": "east", + "why": "onto (8, 15), two below Dwayne (8, 13): he turns to the player and walks up to (8, 14)" + }, + { + "id": "sailor_dwayne", + "kind": "battle", + "declared_after": {"certainty": "tile", "map": "VermilionCity_Gym", "where": {"facing": "north", "kind": "tiles", "tiles": [[8, 15]]}}, + "why": "two Pikachu, Lv21" + }, + { + "id": "east_of_baily_line", + "kind": "legs", + "variant": "run", + "legs": [{"direction": "west", "tiles": 4}, {"direction": "north", "tiles": 2}, {"direction": "west", "tiles": 1}], + "why": "west along row 15 to (4, 15), up to (4, 13), west to (3, 13): out of Baily's sight" + }, + { + "id": "baily_sight", + "kind": "step", + "variant": "trainer_wait", + "direction": "west", + "why": "onto (2, 13), two below Baily (2, 11): he turns to the player and walks up to (2, 12)" + }, + { + "id": "engineer_baily", + "kind": "battle", + "declared_after": {"certainty": "tile", "map": "VermilionCity_Gym", "where": {"facing": "north", "kind": "tiles", "tiles": [[2, 13]]}}, + "why": "Voltorb and Magnemite, Lv21" + }, + { + "id": "below_tucker_line", + "kind": "legs", + "variant": "run", + "legs": [{"direction": "east", "tiles": 2}, {"direction": "north", "tiles": 4}, {"direction": "east", "tiles": 1}], + "why": "east to (4, 13), up column 4 past Baily's row to (4, 9), east to (5, 9): below Tucker's line, not on it" + }, + { + "id": "tucker_line", + "kind": "step", + "variant": "trainer_line", + "direction": "north", + "why": "onto (5, 8), in Tucker's line: he walks up to (6, 8)" + }, + { + "id": "gentleman_tucker", + "kind": "battle", + "declared_after": {"certainty": "tile", "map": "VermilionCity_Gym", "where": {"facing": "east", "kind": "tiles", "tiles": [[5, 8]]}}, + "why": "Pikachu, Lv23" + } + ] + }, + { + "id": "trash_cans", + "title": "The trash cans", + "events": [ + { + "id": "trash_cans", + "kind": "game_action", + "variant": "trash_cans", + "why": "the cans until both locks open; a wrong second can resets them" + } + ] + }, + { + "id": "vermilion_center", + "title": "Out, the tree, back to the Center", + "events": [ + { + "id": "below_gym_tree", + "kind": "route", + "variant": "run", + "target": {"certainty": "tile", "map": "VermilionCity", "where": {"facing": "north", "kind": "tiles", "tiles": [[19, 25]]}}, + "why": "out of the gym, east to below the tree, grown back" + }, + { + "id": "cut_tree_out", + "kind": "game_action", + "variant": "cut_tree", + "direction": "north", + "declared_after": {"certainty": "tile", "map": "VermilionCity", "where": {"facing": "north", "kind": "tiles", "tiles": [[19, 24]]}}, + "why": "the tree again; a step onto its tile" + }, + { + "id": "vermilion_nurse", + "kind": "route", + "variant": "run", + "target": {"certainty": "tile", "map": "VermilionCity_PokemonCenter_1F", "where": {"facing": "north", "kind": "tiles", "tiles": [[7, 4]]}}, + "why": "north through the city to the Pokemon Center" + }, + { + "id": "heal_vermilion", + "kind": "heal", + "why": "full HP" + } + ] + } + ] + }, + "execution": {"menu": "full", "supplies": {"lead": "after_brock"}} +} diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.24.plan.json b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.24.plan.json new file mode 100644 index 0000000000..e7c920ab07 --- /dev/null +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.24.plan.json @@ -0,0 +1,115 @@ +{ + "format": "pokesim-authored-checkpoint/1", + "game": "frlg", + "checkpoint": { + "id": "00.24", + "title": "Route 6's grass until Lt. Surge is winnable, then through the open beams to him", + "notes": [ + "Wild battles on Route 6 until the sim beats Lt. Surge half the time: with Dig, 47% at Lv28 and 51% at Lv29, so a lead the gym's trainers have brought to Lv29 passes at once, and a Lv28 one after a level. The grass nearest the city is Route 6's south patch (13..16, 30..33); Picnicker Isabelle (13, 32) faces west over (10..12, 32), on the way north from the city, so the walk goes along Jeff's row 33 (he is beaten) to the wall (7, 33), up to row 31 and east along it onto the patch's west edge, (13, 31), above Isabelle, out of her line. Back to the nurse the same way. All that is skipped when the lead, read in the Center, passes already. Then the tree, the gym, whose trainers stand where the map has them, beaten, and whose beams stay off (FLAG_FOUND_BOTH_VERMILION_GYM_SWITCHES): up column 5 to below Lt. Surge, and saved there." + ], + "start": {"certainty": "tile", "map": "VermilionCity_PokemonCenter_1F", "where": {"facing": "north", "kind": "tiles", "tiles": [[7, 4]]}}, + "sections": [ + { + "id": "surge_check", + "title": "Whether Lt. Surge is winnable already", + "events": [ + { + "id": "surge_winnable", + "kind": "game_action", + "variant": "grind_check slot=1 level=32 encounters=150 pace=east heal_every=0 beat=TRAINER_LEADER_LT_SURGE chance=50", + "why": "the lead as it is: if the sim beats Lt. Surge 50% or more already, no trip to Route 6" + } + ] + }, + { + "id": "route6_grind", + "title": "Route 6's grass: a GRIND until he is", + "events": [ + { + "id": "route6_south_path", + "kind": "route", + "variant": "run", + "target": {"certainty": "tile", "map": "Route6", "where": {"facing": "north", "kind": "tiles", "tiles": [[11, 34]]}}, + "skip_if": ["surge_winnable"], + "why": "out of the Center, north out of the city onto Route 6's path, below Jeff's row" + }, + { + "id": "round_isabelle_line", + "kind": "legs", + "variant": "run", + "legs": [{"direction": "north", "tiles": 1}, {"direction": "west", "tiles": 4}, {"direction": "north", "tiles": 2}, {"direction": "east", "tiles": 5}, {"direction": "east", "tiles": 1}], + "skip_if": ["surge_winnable"], + "why": "onto Jeff's row (11, 33), west to the wall (7, 33), up to (7, 31), east along row 31 to (12, 31) and a step onto the grass, (13, 31): out of Isabelle's line" + }, + { + "id": "grind_for_surge", + "kind": "game_action", + "variant": "grind slot=1 level=32 encounters=150 pace=east heal_every=0 beat=TRAINER_LEADER_LT_SURGE chance=50", + "target": {"certainty": "tile", "map": "VermilionCity_PokemonCenter_1F", "where": {"facing": "north", "kind": "tiles", "tiles": [[7, 4]]}}, + "skip_if": ["surge_winnable"], + "why": "wild battles until the sim beats Lt. Surge 50% or more, Lv32 at most; the nurse when hurt or low on PP" + }, + { + "id": "west_on_row_31", + "kind": "route", + "variant": "run", + "target": {"certainty": "tile", "map": "Route6", "where": {"kind": "tiles", "tiles": [[7, 31]]}}, + "skip_if": ["surge_winnable"], + "why": "west along row 31, out of the grass, to the wall (7, 31)" + }, + { + "id": "down_to_jeff_row", + "kind": "legs", + "variant": "run", + "legs": [{"direction": "south", "tiles": 2}, {"direction": "east", "tiles": 4}], + "skip_if": ["surge_winnable"], + "why": "down to the wall (7, 33), east along Jeff's row to (11, 33): out of Isabelle's line" + }, + { + "id": "vermilion_nurse", + "kind": "route", + "variant": "run", + "target": {"certainty": "tile", "map": "VermilionCity_PokemonCenter_1F", "where": {"facing": "north", "kind": "tiles", "tiles": [[7, 4]]}}, + "skip_if": ["surge_winnable"], + "why": "south into the city to the Pokemon Center" + }, + { + "id": "heal_vermilion", + "kind": "heal", + "skip_if": ["surge_winnable"], + "why": "full HP" + } + ] + }, + { + "id": "to_lt_surge", + "title": "The tree and the open beams to below Lt. Surge", + "events": [ + { + "id": "above_gym_tree", + "kind": "route", + "variant": "run", + "target": {"certainty": "tile", "map": "VermilionCity", "where": {"facing": "south", "kind": "tiles", "tiles": [[19, 23]]}}, + "why": "out of the Center, south through the city to above the tree (19, 24)" + }, + { + "id": "cut_gym_tree", + "kind": "game_action", + "variant": "cut_tree", + "direction": "south", + "declared_after": {"certainty": "tile", "map": "VermilionCity", "where": {"facing": "south", "kind": "tiles", "tiles": [[19, 24]]}}, + "why": "the tree; a step onto its tile" + }, + { + "id": "below_lt_surge", + "kind": "route", + "variant": "run", + "target": {"certainty": "tile", "map": "VermilionCity_Gym", "where": {"facing": "north", "kind": "tiles", "tiles": [[5, 3]]}}, + "why": "into the gym, up round the cans and through the beams, off, to below Surge (5, 2)" + } + ] + } + ] + }, + "execution": {"menu": "full", "supplies": {"lead": "after_brock"}} +} diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.25.plan.json b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.25.plan.json new file mode 100644 index 0000000000..179b116978 --- /dev/null +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.25.plan.json @@ -0,0 +1,72 @@ +{ + "format": "pokesim-authored-checkpoint/1", + "game": "frlg", + "checkpoint": { + "id": "00.25", + "title": "Vermilion Gym: Lt. Surge, the THUNDERBADGE, then the Center", + "notes": [ + "Lt. Surge (5, 2), talked to from below, from the save in front of him: Voltorb Lv21, Pikachu Lv18 and Raichu Lv24, Shock Wave and Thunder Wave, a Super Potion and a Full Heal (sParty_LeaderLtSurge); then the THUNDERBADGE and TM34, read to the overworld with the battle's text. Out, the tree, and the nurse. Surge's win also puts Oak's aide on Vermilion City's (25, 7) (VermilionCity_Gym_EventScript_ShowOaksAide), where he stays until talked to; the story's maps don't have him. The way to the nurse along row 7 runs into him (console B, 2026-11-03: the leg west stopped beside him and the step into the Center's door went into a house), so it goes along row 10 to the water instead, clear of him, and up column 14 from there." + ], + "start": {"certainty": "tile", "map": "VermilionCity_Gym", "where": {"facing": "north", "kind": "tiles", "tiles": [[5, 3]]}}, + "sections": [ + { + "id": "lt_surge", + "title": "Lt. Surge", + "events": [ + { + "id": "challenge_lt_surge", + "kind": "talk", + "why": "\"Hey, kid! What do you think you're doing here?\"" + }, + { + "id": "lt_surge", + "kind": "battle", + "declared_after": {"certainty": "tile", "map": "VermilionCity_Gym", "where": {"facing": "north", "kind": "tiles", "tiles": [[5, 3]]}}, + "why": "Voltorb, Pikachu and Raichu; THUNDERBADGE and TM34" + } + ] + }, + { + "id": "vermilion_center", + "title": "Out, the tree, round Oak's aide to the Center", + "events": [ + { + "id": "below_gym_tree", + "kind": "route", + "variant": "run", + "target": {"certainty": "tile", "map": "VermilionCity", "where": {"facing": "north", "kind": "tiles", "tiles": [[19, 25]]}}, + "why": "down through the beams, out of the gym, east to below the tree, grown back" + }, + { + "id": "cut_tree_out", + "kind": "game_action", + "variant": "cut_tree", + "direction": "north", + "declared_after": {"certainty": "tile", "map": "VermilionCity", "where": {"facing": "north", "kind": "tiles", "tiles": [[19, 24]]}}, + "why": "the tree; a step onto its tile" + }, + { + "id": "below_oaks_aide", + "kind": "route", + "variant": "run", + "target": {"certainty": "tile", "map": "VermilionCity", "where": {"kind": "tiles", "tiles": [[14, 10]]}}, + "why": "north through the city and west along row 10 to the water, (14, 10): off Oak's aide's row 7" + }, + { + "id": "vermilion_nurse", + "kind": "route", + "variant": "run", + "target": {"certainty": "tile", "map": "VermilionCity_PokemonCenter_1F", "where": {"facing": "north", "kind": "tiles", "tiles": [[7, 4]]}}, + "why": "up to the Pokemon Center" + }, + { + "id": "heal_vermilion", + "kind": "heal", + "why": "full HP" + } + ] + } + ] + }, + "execution": {"menu": "full", "supplies": {"lead": "after_brock"}} +} diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.26.plan.json b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.26.plan.json new file mode 100644 index 0000000000..34d8de5dd6 --- /dev/null +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.26.plan.json @@ -0,0 +1,156 @@ +{ + "format": "pokesim-authored-checkpoint/1", + "game": "frlg", + "checkpoint": { + "id": "00.26", + "title": "The BIKE VOUCHER from the Fan Club, back north to Cerulean, the BICYCLE, Repels and Escape Ropes", + "notes": [ + "Rows from 00.26 on, after the THUNDERBADGE: the BICYCLE, and the way east and south to Celadon City.", + "The BIKE VOUCHER and the BICYCLE, from Vermilion's Center to Cerulean's (pokeguy 43:50 to 45:00).", + "- The Pokemon Fan Club (VermilionCity_PokemonFanClub map.json, scripts.inc), in by Vermilion's (12, 17): the chairman (5, 4) sits above a table (5..6, 5..6) with the worker (6, 4) east of him, so he is talked to from (4, 4), west of him. \"Did you come to hear about my POKEMON?\" YES: his story, then the BIKE VOUCHER (FLAG_GOT_BIKE_VOUCHER). Oak's aide stands on Vermilion's (25, 7) since Lt. Surge, where the story's maps don't have him: the way planned from the Center's door goes east along his row 7, so the walk goes down to the water (14, 10) first, as 00.25 came up from it. From the Fan Club, up to (22, 10) first, so that the way on to Route 6 goes up column 22, west of him, not round by column 27.", + "- Route 6 north, the trainers as 00.21 left them: Jeff (13, 33) beaten, Isabelle (13, 32) and Elijah (20, 25) not. As in 00.24, onto Jeff's row, west to the wall (7, 33) and up to row 31, above Isabelle's line; then east along row 31 to the wall (17, 31) and up column 16, west of Elijah's line (17..19, 25) and east of Keigo's (4..8, 16), to the ledge (16, 11). The first three legs are 00.24's, walked on console B; the two after end on walls, which the walker holds again after a wild battle in the grass.", + "- The Underground Path north, Route 5's sides, which have no trainer, and Cerulean's south edge, whose way into the city without the burgled house is the tree (26, 32) (pokeguy 44:42).", + "- The Bike Shop (CeruleanCity_BikeShop), in by (13, 28): the clerk (9, 3) is across the counter (8, 3), talked to from (7, 3). With the voucher he gives the BICYCLE (FLAG_GOT_BICYCLE) with no YES/NO; it isn't registered or ridden yet.", + "- The Mart: 5 Repels (row 9, 350 each) and 2 Escape Ropes (row 8, 550 each; pokefirered items.json), 2850 in all. Console B had about 9000 after Lt. Surge (2026-11-03); the floor of 6000 leaves 3000 or more after them.", + "- The nurse, and the save in Cerulean's Center." + ], + "start": {"certainty": "tile", "map": "VermilionCity_PokemonCenter_1F", "where": {"facing": "north", "kind": "tiles", "tiles": [[7, 4]]}}, + "sections": [ + { + "id": "fan_club", + "title": "The Fan Club's BIKE VOUCHER", + "events": [ + { + "id": "below_center", + "kind": "route", + "variant": "run", + "target": {"certainty": "tile", "map": "VermilionCity", "where": {"kind": "tiles", "tiles": [[14, 10]]}}, + "why": "out of the Center, down to the water (14, 10): off Oak's aide's row 7" + }, + { + "id": "beside_chairman", + "kind": "route", + "variant": "run", + "target": {"certainty": "tile", "map": "VermilionCity_PokemonFanClub", "where": {"facing": "east", "kind": "tiles", "tiles": [[4, 4]]}}, + "why": "east along row 10, down to the Fan Club's door (12, 17), in, and up its west side beside the chairman (5, 4)" + }, + { + "id": "chairman", + "kind": "talk", + "why": "\"I chair the POKEMON Fan Club!\" ... \"Did you come to hear about my POKEMON?\"" + }, + { + "id": "hear_story", + "kind": "answer", + "why": "YES: his story" + }, + { + "id": "bike_voucher", + "kind": "scene", + "declared_after": {"certainty": "tile", "map": "VermilionCity_PokemonFanClub", "where": {"facing": "east", "kind": "tiles", "tiles": [[4, 4]]}}, + "why": "the story of his Rapidash; the BIKE VOUCHER" + } + ] + }, + { + "id": "route6_north", + "title": "North over Route 6", + "events": [ + { + "id": "west_of_oaks_aide", + "kind": "route", + "variant": "run", + "target": {"certainty": "tile", "map": "VermilionCity", "where": {"kind": "tiles", "tiles": [[22, 10]]}}, + "why": "out of the Fan Club, east along row 18 and up column 22 to (22, 10)" + }, + { + "id": "route6_south_path", + "kind": "route", + "variant": "run", + "target": {"certainty": "tile", "map": "Route6", "where": {"facing": "north", "kind": "tiles", "tiles": [[11, 34]]}}, + "why": "up column 22 west of Oak's aide (25, 7), out of the city onto Route 6's path, below Jeff's row" + }, + { + "id": "round_isabelle_and_elijah", + "kind": "legs", + "variant": "run", + "legs": [{"direction": "north", "tiles": 1}, {"direction": "west", "tiles": 4}, {"direction": "north", "tiles": 2}, {"direction": "east", "tiles": 9}, {"direction": "north", "tiles": 19}], + "why": "onto Jeff's row (11, 33), west to the wall (7, 33), up to (7, 31), east along row 31 to the wall (16, 31), up column 16 to the ledge (16, 12): out of Isabelle's and Elijah's lines" + } + ] + }, + { + "id": "bike_shop", + "title": "Cerulean's tree and the Bike Shop", + "events": [ + { + "id": "below_cerulean_tree", + "kind": "route", + "variant": "run", + "target": {"certainty": "tile", "map": "CeruleanCity", "where": {"facing": "north", "kind": "tiles", "tiles": [[26, 33]]}}, + "why": "the Underground Path north, up Route 5's side into Cerulean, below the tree (26, 32)" + }, + { + "id": "cut_cerulean_tree", + "kind": "game_action", + "variant": "cut_tree", + "direction": "north", + "declared_after": {"certainty": "tile", "map": "CeruleanCity", "where": {"facing": "north", "kind": "tiles", "tiles": [[26, 32]]}}, + "why": "the tree; a step onto its tile" + }, + { + "id": "bike_clerk", + "kind": "route", + "variant": "run", + "target": {"certainty": "tile", "map": "CeruleanCity_BikeShop", "where": {"facing": "east", "kind": "tiles", "tiles": [[7, 3]]}}, + "why": "west into the Bike Shop (13, 28), across the counter from the clerk (9, 3)" + }, + { + "id": "talk_bike_clerk", + "kind": "talk", + "why": "\"Oh, that's... A BIKE VOUCHER!\"" + }, + { + "id": "bicycle", + "kind": "scene", + "declared_after": {"certainty": "tile", "map": "CeruleanCity_BikeShop", "where": {"facing": "east", "kind": "tiles", "tiles": [[7, 3]]}}, + "why": "the voucher exchanged for a BICYCLE" + } + ] + }, + { + "id": "cerulean_mart", + "title": "Repels and Escape Ropes, then the Center", + "events": [ + { + "id": "mart_clerk", + "kind": "route", + "variant": "run", + "target": {"certainty": "tile", "map": "CeruleanCity_Mart", "where": {"facing": "west", "kind": "tiles", "tiles": [[4, 3]]}}, + "why": "out of the Bike Shop to the Mart's clerk" + }, + { + "id": "buy_repels", + "kind": "game_action", + "variant": "mart CeruleanCity_Mart budget=2850 floor=6000 repel=5 escape-rope=2", + "once_per_save": true, + "why": "5 Repels and 2 Escape Ropes, 2850 at most" + }, + { + "id": "cerulean_nurse", + "kind": "route", + "variant": "run", + "target": {"certainty": "tile", "map": "CeruleanCity_PokemonCenter_1F", "where": {"facing": "north", "kind": "tiles", "tiles": [[7, 4]]}}, + "why": "out of the Mart to the Center" + }, + { + "id": "heal_cerulean", + "kind": "heal", + "why": "full HP" + } + ] + } + ] + }, + "execution": {"menu": "full", "supplies": {"lead": "after_brock"}} +} diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.27.plan.json b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.27.plan.json new file mode 100644 index 0000000000..e95427ff8e --- /dev/null +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.27.plan.json @@ -0,0 +1,202 @@ +{ + "format": "pokesim-authored-checkpoint/1", + "game": "frlg", + "checkpoint": { + "id": "00.27", + "title": "East over Route 9 to Route 10's Pokemon Center: the two trees, Alicia, Jeremy and Conner", + "notes": [ + "East out of Cerulean over Route 9 to Route 10's Pokemon Center (pokeguy 45:12 to 47:27), on foot: the Bicycle isn't registered yet.", + "- Cerulean (CeruleanCity map.json): the way east, column 39..40 up from row 33 to rows 18..19 and out of the city's east edge, is reached from the city only through the tree (26, 32), grown back since 00.26 (its flag is a FLAG_TEMP), or the burgled house. Cut from above. Route 9 joins the city's rows 18..19 by its rows 8..9 (offset -10); its tree (2, 8) (FLAG_TEMP_12) closes them, (2, 9) being rock: cut from (1, 8), west of it.", + "- Route 9 (Route9 map.json, scripts.inc), its ledges all facing south. Of its nine trainers, three can't be walked around, as in pokeguy's run, where Jeremy happened to look away:", + " - Picnicker Alicia (14, 10) faces west, sight 3, over (11..13, 10), the only tiles above the ledge row 11 the way west goes down by: fought on the step onto (11, 10); she walks up to (12, 10). Then down the ledge (11, 11).", + " - Hiker Jeremy (20, 17) looks north and west (FACE_UP_AND_LEFT), sight 4: north over (20, 13..16), every way east of column 19 below the rocks of row 12. Fought on (20, 13), waiting for him to look north (TRAINER_WAIT_VARIANT); he walks up to (20, 14).", + " - Bug Catcher Conner (49, 7) faces east, sight 3, over (50..52, 7): the way north from row 13 is column 52 alone (the ledges of row 11 face south), and row 7 is the way onto the ridge. Fought on the step onto (52, 7); he walks up to (51, 7).", + " - Hiker Brice wanders row 2 (50..56), looking west and east, sight 1, over (49..57, 2), and the way up from the ledges of row 4 is (50..51, 4) below him. The leg up column 51 ends on row 3 if he stands at (51, 2), else it goes on to (51, 1) past him, and he may see the player there; either way the legs to walls after it meet on (48, 1): west to the rock (48, 3) or (48, 1), up to (48, 1). Row 1 is clear of his sight; east along it to the rock (64, 1) and down column 64 past the hidden Rare Candy (63, 2), not picked up. A held leg down to (64, 3) would hop the ledge (64, 4) and go on, so the last tile is one step, then the hop.", + " - Picnicker Caitlin (60, 9) faces east over (61..64, 9): the way to Route 10 goes along row 8, above her line, by legs to (70, 8), a tile short of the edge. Camper Chris (26, 7), Bug Catcher Brent (26, 1), Camper Drew (36, 6) and Hiker Alan (61, 16) are off the way; TM40 (12, 17) is left.", + "- Route 10 (Route10 map.json) joins Route 9's rows 8..10 by its own; its north part, down to the Center's door (13, 20), has no trainer on the way and its grass is walked round. The trees west of the door (10, 20..26) stay. The walk there ends its open legs where a tile of error can't reach a blocker, and finds its place again on walls (console B, 2026-11-09, two runs \"no fade\" at the door): the step onto Route 10 is not always held up, so the player may stand a tile further east, and the leg along row 11 holds to the wall (17, 11) instead of ending on (16, 11) by count. The 12 tiles down column 16 may end a tile short or long: from rows 22..29 a tile west and up to the Center's wall (15, 20) all end on (15, 21). West along row 21 to the wall (9, 21) ends on (10, 21), three west of the door's column: the only count no wall after it checks.", + "- The nurse, and the save in Route 10's Center: the save card names ROUTE 10." + ], + "start": {"certainty": "tile", "map": "CeruleanCity_PokemonCenter_1F", "where": {"facing": "north", "kind": "tiles", "tiles": [[7, 4]]}}, + "sections": [ + { + "id": "cerulean_trees", + "title": "Cerulean's tree and Route 9's", + "events": [ + { + "id": "above_cerulean_tree", + "kind": "route", + "variant": "run", + "target": {"certainty": "tile", "map": "CeruleanCity", "where": {"facing": "south", "kind": "tiles", "tiles": [[26, 31]]}}, + "why": "out of the Center, south through the city to above the tree (26, 32), grown back" + }, + { + "id": "cut_cerulean_tree", + "kind": "game_action", + "variant": "cut_tree", + "direction": "south", + "declared_after": {"certainty": "tile", "map": "CeruleanCity", "where": {"facing": "south", "kind": "tiles", "tiles": [[26, 32]]}}, + "why": "the tree; a step onto its tile" + }, + { + "id": "west_of_route9_tree", + "kind": "route", + "variant": "run", + "target": {"certainty": "tile", "map": "Route9", "where": {"facing": "east", "kind": "tiles", "tiles": [[1, 8]]}}, + "why": "down to row 33, east and up column 39 or 40 to row 18, east out of the city onto Route 9, west of its tree (2, 8)" + }, + { + "id": "cut_route9_tree", + "kind": "game_action", + "variant": "cut_tree", + "direction": "east", + "declared_after": {"certainty": "tile", "map": "Route9", "where": {"facing": "east", "kind": "tiles", "tiles": [[2, 8]]}}, + "why": "Route 9's tree; a step onto its tile" + } + ] + }, + { + "id": "route9_west", + "title": "Route 9 west: Alicia and Jeremy", + "events": [ + { + "id": "above_alicia_line", + "kind": "route", + "variant": "run", + "target": {"certainty": "tile", "map": "Route9", "where": {"facing": "south", "kind": "tiles", "tiles": [[11, 9]]}}, + "why": "east to (11, 9), above the west end of Alicia's line" + }, + { + "id": "alicia_line", + "kind": "step", + "variant": "trainer_line", + "direction": "south", + "why": "onto (11, 10), in Alicia's line: she walks up to (12, 10)" + }, + { + "id": "picnicker_alicia", + "kind": "battle", + "declared_after": {"certainty": "tile", "map": "Route9", "where": {"facing": "east", "kind": "tiles", "tiles": [[11, 10]]}}, + "why": "Oddish, Bellsprout, Oddish and Bellsprout, Lv18" + }, + { + "id": "alicia_ledge_hop", + "kind": "step", + "direction": "south", + "declared_after": {"certainty": "tile", "map": "Route9", "where": {"facing": "south", "kind": "tiles", "tiles": [[11, 12]]}}, + "why": "down the ledge (11, 11)" + }, + { + "id": "west_of_jeremy_sight", + "kind": "route", + "variant": "run", + "target": {"certainty": "tile", "map": "Route9", "where": {"facing": "east", "kind": "tiles", "tiles": [[19, 13]]}}, + "why": "down to row 13 and east along it to (19, 13), west of Jeremy's north line" + }, + { + "id": "jeremy_sight", + "kind": "step", + "variant": "trainer_wait", + "direction": "east", + "why": "onto (20, 13), four above Jeremy (20, 17): when he looks north he walks up to (20, 14)" + }, + { + "id": "hiker_jeremy", + "kind": "battle", + "declared_after": {"certainty": "tile", "map": "Route9", "where": {"facing": "south", "kind": "tiles", "tiles": [[20, 13]]}}, + "why": "Machop and Onix, Lv20" + } + ] + }, + { + "id": "route9_east", + "title": "Route 9 east: Conner, round Brice, above Caitlin", + "events": [ + { + "id": "below_conner_line", + "kind": "route", + "variant": "run", + "target": {"certainty": "tile", "map": "Route9", "where": {"facing": "north", "kind": "tiles", "tiles": [[52, 8]]}}, + "why": "east along row 13 and up column 52 to (52, 8), below the east end of Conner's line" + }, + { + "id": "conner_line", + "kind": "step", + "variant": "trainer_line", + "direction": "north", + "why": "onto (52, 7), the end of Conner's line: he walks up to (51, 7)" + }, + { + "id": "bug_catcher_conner", + "kind": "battle", + "declared_after": {"certainty": "tile", "map": "Route9", "where": {"facing": "west", "kind": "tiles", "tiles": [[52, 7]]}}, + "why": "Caterpie, Weedle and Venonat, Lv20" + }, + { + "id": "round_brice", + "kind": "legs", + "variant": "run", + "legs": [ + {"direction": "north", "tiles": 2}, {"direction": "west", "tiles": 1}, {"direction": "north", "tiles": 2}, {"direction": "west", "tiles": 3}, {"direction": "north", "tiles": 2}, {"direction": "east", "tiles": 16}, + {"direction": "south", "tiles": 1} + ], + "why": "up to the ledge (52, 4), up column 51 to Brice's row, west to the rock (48, 3) (or (48, 1)), up to (48, 1), east along row 1 to the rock (64, 1), down to (64, 2)" + }, + { + "id": "above_east_ledge", + "kind": "step", + "direction": "south", + "declared_after": {"certainty": "tile", "map": "Route9", "where": {"facing": "south", "kind": "tiles", "tiles": [[64, 3]]}}, + "why": "onto (64, 3), above the ledge (64, 4)" + }, + { + "id": "east_ledge_hop", + "kind": "step", + "direction": "south", + "declared_after": {"certainty": "tile", "map": "Route9", "where": {"facing": "south", "kind": "tiles", "tiles": [[64, 5]]}}, + "why": "down the ledge (64, 4)" + }, + { + "id": "above_caitlin_line", + "kind": "legs", + "variant": "run", + "legs": [{"direction": "south", "tiles": 3}, {"direction": "east", "tiles": 6}], + "why": "down column 64 to row 8, east along it to (70, 8): above Caitlin's line (61..64, 9)" + } + ] + }, + { + "id": "route10_center", + "title": "Route 10 to its Pokemon Center", + "events": [ + { + "id": "route10_ledge_end", + "kind": "route", + "variant": "run", + "target": {"certainty": "tile", "map": "Route10", "where": {"facing": "east", "kind": "tiles", "tiles": [[17, 11]]}}, + "why": "east onto Route 10, down to row 11 west of the grass and east along it to the wall (17, 11), above the fence post (17, 12)" + }, + { + "id": "below_center_door", + "kind": "legs", + "variant": "run", + "legs": [{"direction": "west", "tiles": 1}, {"direction": "south", "tiles": 12}, {"direction": "west", "tiles": 1}, {"direction": "north", "tiles": 2}, {"direction": "west", "tiles": 5}, {"direction": "east", "tiles": 3}], + "why": "into the ledge's gap (16, 11), down column 16 to row 23, a tile west, up to the Center's wall (15, 21), west along row 21 to the wall (10, 21), east to (13, 21), below the door" + }, + { + "id": "route10_nurse", + "kind": "route", + "variant": "run", + "target": {"certainty": "tile", "map": "Route10_PokemonCenter_1F", "where": {"facing": "north", "kind": "tiles", "tiles": [[7, 4]]}}, + "why": "up onto the Center's door (13, 20), to the nurse" + }, + { + "id": "heal_route10", + "kind": "heal", + "why": "full HP" + } + ] + } + ] + }, + "execution": {"menu": "full", "supplies": {"lead": "after_brock"}} +} diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.28.plan.json b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.28.plan.json new file mode 100644 index 0000000000..1ff6a8a7b6 --- /dev/null +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.28.plan.json @@ -0,0 +1,355 @@ +{ + "format": "pokesim-authored-checkpoint/1", + "game": "frlg", + "checkpoint": { + "id": "00.28", + "title": "Through Rock Tunnel: Ashton, Winston, Martha, Allen, Lenny, Sofia, Dudley, Cooper and Dana", + "notes": [ + "Rows from 00.28 on: through Rock Tunnel, without Flash, and down Route 10 to Lavender Town's Pokemon Center.", + "From Route 10's Pokemon Center through Rock Tunnel (pokefirered RockTunnel_1F, RockTunnel_B1F map.json and scripts.inc) to Route 10 south of it. The save is on Route 10 by the tunnel's south mouth: the save card's places don't include Rock Tunnel.", + "- Every floor tile of the tunnel has wild encounters, which are run from (the table has no step that uses a Repel), so the legs end on walls, ladders or someone standing still, which the walker holds again after a battle. An open leg (two tiles or more, not to a wall) is followed only by legs a tile of error in it can't send astray.", + "- Nine trainers stand where the way can't go round them. The others (1F Lucas, Oliver, Ariana, Leah; B1F Eric, Steve) are walked round.", + "- Unverified on the console: Rock Tunnel is dark without Flash, and the overworld, fade, dialog and battle detectors haven't been measured under its darkness (~/FRLGLab/notes/2026-11-09-0028-dark-measure.md). Every step from rock_tunnel_1f to route10_south depends on them." + ], + "start": {"certainty": "tile", "map": "Route10_PokemonCenter_1F", "where": {"facing": "north", "kind": "tiles", "tiles": [[7, 4]]}}, + "sections": [ + { + "id": "route10_to_mouth", + "title": "Route 10: the tree and below the north mouth", + "notes": [ + "- The tunnel's north mouth (8, 19) is reached from the Center through the tree (10, 20), cut from below; Heidi (9, 27) sees rows 28..29 below the trees and is left. Two single steps west then put the player below the mouth on (8, 20)." + ], + "events": [ + { + "id": "below_route10_tree", + "kind": "route", + "variant": "run", + "target": {"certainty": "tile", "map": "Route10", "where": {"facing": "north", "kind": "tiles", "tiles": [[10, 21]]}}, + "why": "out of the Center (13, 20), west along row 21 to the wall (9, 21), below the tree (10, 20)" + }, + { + "id": "cut_route10_tree", + "kind": "game_action", + "variant": "cut_tree", + "direction": "north", + "declared_after": {"certainty": "tile", "map": "Route10", "where": {"facing": "north", "kind": "tiles", "tiles": [[10, 20]]}}, + "why": "the tree; a step onto its tile" + }, + { + "id": "west_of_tree", + "kind": "step", + "direction": "west", + "declared_after": {"certainty": "tile", "map": "Route10", "where": {"facing": "west", "kind": "tiles", "tiles": [[9, 20]]}}, + "why": "a step west along row 20" + }, + { + "id": "below_rock_tunnel", + "kind": "step", + "direction": "west", + "declared_after": {"certainty": "tile", "map": "Route10", "where": {"facing": "west", "kind": "tiles", "tiles": [[8, 20]]}}, + "why": "a step west, below the mouth (8, 19)" + } + ] + }, + { + "id": "1f_north", + "title": "1F north: Ashton, then east to the ladder (45, 2)", + "notes": [ + "- 1F Ashton (27, 10) looks west over (24..26, 10), the only way south from the mouth's room: stepped into from (24, 9)." + ], + "events": [ + { + "id": "rock_tunnel_1f", + "kind": "route", + "variant": "run", + "target": {"certainty": "tile", "map": "RockTunnel_1F", "where": {"facing": "north", "kind": "tiles", "tiles": [[17, 2]]}}, + "why": "north into Rock Tunnel" + }, + { + "id": "above_ashton_line", + "kind": "legs", + "variant": "run", + "legs": [{"direction": "south", "tiles": 6}, {"direction": "east", "tiles": 8}, {"direction": "south", "tiles": 1}, {"direction": "west", "tiles": 1}], + "why": "down column 17 to the wall (17, 8), east along row 8 to (25, 8), onto row 9 and west to the wall (24, 9)" + }, + { + "id": "ashton_line", + "kind": "step", + "variant": "trainer_line", + "direction": "south", + "why": "onto (24, 10), in Ashton's line: he walks up to (25, 10)" + }, + { + "id": "pokemaniac_ashton", + "kind": "battle", + "declared_after": {"certainty": "tile", "map": "RockTunnel_1F", "where": {"facing": "east", "kind": "tiles", "tiles": [[24, 10]]}}, + "why": "Slowpoke, Slowpoke and Slowpoke" + }, + { + "id": "b1f_south_ladder", + "kind": "route", + "variant": "run", + "target": {"certainty": "tile", "map": "RockTunnel_B1F", "where": {"facing": "north", "kind": "tiles", "tiles": [[38, 28]]}}, + "why": "east along row 12 and up column 45 to the ladder (45, 2), down to B1F" + } + ] + }, + { + "id": "b1f_east", + "title": "B1F south and east: Winston, Martha and Allen, to the ladder (33, 3)", + "notes": [ + "- B1F Winston (29, 35) looks south over the south passage (29, 36..38): stepped into from (32, 37), after the leg down column 33 to the wall and a tile back.", + "- B1F Martha (15, 33) looks east over (16..17, 33), the corridor north: stepped into from (17, 34), the wall east of row 34.", + "- B1F Allen (36, 11) looks south over (36, 12..14), the way west to the ladder (33, 3): stepped into from (38, 12), below the wall." + ], + "events": [ + { + "id": "winston_line_end", + "kind": "legs", + "variant": "run", + "legs": [{"direction": "west", "tiles": 5}, {"direction": "south", "tiles": 10}, {"direction": "north", "tiles": 1}, {"direction": "west", "tiles": 1}], + "why": "west to the wall (33, 28), down column 33 to the wall (33, 38), up to (33, 37) and west to (32, 37)" + }, + { + "id": "winston_line", + "kind": "step", + "variant": "trainer_line", + "direction": "west", + "why": "along row 37 onto (29, 37), the end of Winston's line: he walks down to (29, 36)" + }, + { + "id": "pokemaniac_winston", + "kind": "battle", + "declared_after": {"certainty": "tile", "map": "RockTunnel_B1F", "where": {"facing": "north", "kind": "tiles", "tiles": [[29, 37]]}}, + "why": "Slowpoke and Slowpoke" + }, + { + "id": "below_martha_line", + "kind": "legs", + "variant": "run", + "legs": [{"direction": "west", "tiles": 16}, {"direction": "north", "tiles": 2}, {"direction": "west", "tiles": 2}, {"direction": "east", "tiles": 5}], + "why": "west along row 37 to (13, 37), up to the wall (13, 35), west to the corner (11, 35), east to (16, 35)", + "notes": [ + "The corner (11, 35), wall north and rock west, finds the player from any of (11..14, 35) after a battle; east to the wall (19, 35) did not (console B, 2026-11-09 13:35: found 5 tiles off)." + ] + }, + { + "id": "martha_line", + "kind": "step", + "variant": "trainer_line", + "direction": "north", + "why": "up column 16 onto (16, 33), beside Martha; from (17, 35), a tile short, up column 17 onto (17, 33), the end of her line" + }, + { + "id": "picnicker_martha", + "kind": "battle", + "declared_after": {"certainty": "tile", "map": "RockTunnel_B1F", "where": {"facing": "west", "kind": "tiles", "tiles": [[16, 33]]}}, + "why": "Oddish and Bulbasaur" + }, + { + "id": "below_allen_line", + "kind": "legs", + "variant": "run", + "legs": [ + {"direction": "east", "tiles": 1}, {"direction": "north", "tiles": 5}, {"direction": "east", "tiles": 12}, {"direction": "north", "tiles": 9}, {"direction": "east", "tiles": 11}, {"direction": "north", "tiles": 2}, + {"direction": "west", "tiles": 2}, {"direction": "north", "tiles": 5} + ], + "why": "east to the wall (17, 33), up column 17 to the wall (17, 28), east to the wall (29, 28), up column 29 past Steve's line to the wall (29, 19), east to (40, 19), up to row 17, west to the wall (38, 17) and up to the wall (38, 12)" + }, + { + "id": "allen_line", + "kind": "step", + "variant": "trainer_line", + "direction": "west", + "why": "along row 12 onto (36, 12), below Allen" + }, + { + "id": "hiker_allen", + "kind": "battle", + "declared_after": {"certainty": "tile", "map": "RockTunnel_B1F", "where": {"facing": "north", "kind": "tiles", "tiles": [[36, 12]]}}, + "why": "Geodude, Geodude and Graveler" + }, + { + "id": "west_of_b1f_ladder", + "kind": "legs", + "variant": "run", + "legs": [{"direction": "west", "tiles": 4}, {"direction": "north", "tiles": 10}], + "why": "west along row 12 to the wall (32, 12), up column 32 to the wall (32, 2)" + }, + { + "id": "1f_west_ladder", + "kind": "route", + "variant": "run", + "target": {"certainty": "tile", "map": "RockTunnel_1F", "where": {"facing": "north", "kind": "tiles", "tiles": [[4, 2]]}}, + "why": "onto the ladder (33, 3), up to 1F" + } + ] + }, + { + "id": "1f_west", + "title": "1F west: Lenny, round Lucas's line to the ladder (20, 13)", + "notes": [ + "- 1F Lenny (7, 5) looks south over (7, 6..9), the way east from the ladder (4, 2): stepped into from (6, 9), the end of column 6. The way on to the ladder (20, 13) keeps west of Lucas's line (16..19, 17): down column 11, up column 14 to row 16." + ], + "events": [ + { + "id": "above_lenny_line", + "kind": "legs", + "variant": "run", + "legs": [{"direction": "east", "tiles": 2}, {"direction": "south", "tiles": 7}], + "why": "east to the wall (6, 2), down column 6 to the wall (6, 9)" + }, + { + "id": "lenny_line", + "kind": "step", + "variant": "trainer_line", + "direction": "east", + "why": "onto (7, 9), the end of Lenny's line: he walks down to (7, 8)" + }, + { + "id": "hiker_lenny", + "kind": "battle", + "declared_after": {"certainty": "tile", "map": "RockTunnel_1F", "where": {"facing": "north", "kind": "tiles", "tiles": [[7, 9]]}}, + "why": "Machop and Onix" + }, + { + "id": "west_of_lucas_line", + "kind": "legs", + "variant": "run", + "legs": [{"direction": "east", "tiles": 4}, {"direction": "south", "tiles": 15}, {"direction": "east", "tiles": 7}, {"direction": "west", "tiles": 4}, {"direction": "north", "tiles": 8}, {"direction": "east", "tiles": 6}], + "why": "east to the wall (11, 9), down column 11 to the wall (11, 24), east to the wall (18, 24), west to (14, 24), up column 14 to the wall (14, 16), east to the wall (20, 16)" + }, + { + "id": "b1f_middle_ladder", + "kind": "route", + "variant": "run", + "target": {"certainty": "tile", "map": "RockTunnel_B1F", "where": {"facing": "north", "kind": "tiles", "tiles": [[27, 12]]}}, + "why": "up column 20 onto the ladder (20, 13), down to B1F" + } + ] + }, + { + "id": "b1f_west", + "title": "B1F west: Sofia, Dudley and past Cooper to the ladder (2, 3)", + "notes": [ + "- B1F Sofia (11, 15) looks south over (11, 16..19), the way west: stepped into along row 16 from (12..14, 16).", + "- B1F Dudley (5, 11) looks south over (5, 12..15): stepped into from (8, 15) along row 15.", + "- B1F Cooper (2, 6) looks around (sight 2) by the ladder (2, 3): the leg up column 1 to the wall (1, 2) passes him on (1, 6); if he looks west, story_interrupts() fights him and the leg is held on to its wall, as Mt. Moon's Grunt in 00.13." + ], + "events": [ + { + "id": "east_of_sofia_line", + "kind": "legs", + "variant": "run", + "legs": [{"direction": "south", "tiles": 3}, {"direction": "west", "tiles": 12}, {"direction": "south", "tiles": 1}, {"direction": "west", "tiles": 2}], + "why": "down to the wall (27, 15), west along row 15 to the wall (15, 15), down to row 16 and west to (13, 16)" + }, + { + "id": "sofia_line", + "kind": "step", + "variant": "trainer_line", + "direction": "west", + "why": "along row 16 onto (11, 16), below Sofia" + }, + { + "id": "picnicker_sofia", + "kind": "battle", + "declared_after": {"certainty": "tile", "map": "RockTunnel_B1F", "where": {"facing": "north", "kind": "tiles", "tiles": [[11, 16]]}}, + "why": "Pidgey, Pidgey and Pidgeotto" + }, + { + "id": "east_of_dudley_line", + "kind": "legs", + "variant": "run", + "legs": [{"direction": "west", "tiles": 3}, {"direction": "north", "tiles": 1}], + "why": "west to the wall (8, 16), up to (8, 15)" + }, + { + "id": "dudley_line", + "kind": "step", + "variant": "trainer_line", + "direction": "west", + "why": "along row 15 onto (5, 15), the end of Dudley's line: he walks down to (5, 14)" + }, + { + "id": "hiker_dudley", + "kind": "battle", + "declared_after": {"certainty": "tile", "map": "RockTunnel_B1F", "where": {"facing": "north", "kind": "tiles", "tiles": [[5, 15]]}}, + "why": "Geodude, Geodude and Graveler" + }, + { + "id": "past_cooper", + "kind": "legs", + "variant": "run", + "legs": [{"direction": "west", "tiles": 4}, {"direction": "north", "tiles": 13}, {"direction": "south", "tiles": 1}], + "why": "west to the wall (1, 15), up column 1 past Cooper (2, 6) to the wall (1, 2), back to (1, 3)" + }, + { + "id": "1f_east_ladder", + "kind": "route", + "variant": "run", + "target": {"certainty": "tile", "map": "RockTunnel_1F", "where": {"facing": "north", "kind": "tiles", "tiles": [[45, 21]]}}, + "why": "east onto the ladder (2, 3), up to 1F" + } + ] + }, + { + "id": "1f_south", + "title": "1F south: Dana, to the south mouth", + "notes": [ + "- 1F Dana (26, 28) looks south over (26, 29..31), the only way west to the south mouth: stepped into along row 31 from (27..29, 31)." + ], + "events": [ + { + "id": "above_dana_line", + "kind": "legs", + "variant": "run", + "legs": [ + {"direction": "west", "tiles": 6}, {"direction": "south", "tiles": 5}, {"direction": "east", "tiles": 6}, {"direction": "west", "tiles": 1}, {"direction": "south", "tiles": 4}, {"direction": "west", "tiles": 5}, + {"direction": "south", "tiles": 5}, {"direction": "west", "tiles": 2}, {"direction": "north", "tiles": 3}, {"direction": "west", "tiles": 6}, {"direction": "north", "tiles": 3}, {"direction": "west", "tiles": 3}, + {"direction": "south", "tiles": 2} + ], + "why": "west to the wall (39, 21), down column 39 to Ariana (39, 27), east to the wall (45, 26), down column 44 to the wall (44, 30), west to the wall (39, 30), down to the wall (39, 35), west to (37, 35), up to the wall (37, 32), west to the wall (31, 32), up to (31, 29), west to (28, 29) and down to the wall (28, 31)" + }, + { + "id": "dana_line", + "kind": "step", + "variant": "trainer_line", + "direction": "west", + "why": "along row 31 onto (26, 31), the end of Dana's line: she walks down to (26, 30)" + }, + { + "id": "picnicker_dana", + "kind": "battle", + "declared_after": {"certainty": "tile", "map": "RockTunnel_1F", "where": {"facing": "north", "kind": "tiles", "tiles": [[26, 31]]}}, + "why": "Meowth, Oddish and Pidgey" + }, + { + "id": "above_south_mouth", + "kind": "legs", + "variant": "run", + "legs": [ + {"direction": "west", "tiles": 6}, {"direction": "south", "tiles": 1}, {"direction": "west", "tiles": 8}, {"direction": "south", "tiles": 5}, {"direction": "east", "tiles": 2}, {"direction": "north", "tiles": 1}, + {"direction": "east", "tiles": 5}, {"direction": "west", "tiles": 1} + ], + "why": "west along row 31 to (20, 31), onto row 32 and west to the wall (12, 32), down column 12 to the wall (12, 37), east to the wall (14, 37), up to (14, 36), east to the wall (19, 36), back to (18, 36)" + } + ] + }, + { + "id": "route10_south", + "title": "Out onto Route 10 south of the tunnel", + "events": [ + { + "id": "route10_south", + "kind": "route", + "variant": "run", + "target": {"certainty": "tile", "map": "Route10", "where": {"facing": "south", "kind": "tiles", "tiles": [[8, 58]]}}, + "why": "onto the mouth (18, 37), out onto Route 10" + } + ] + } + ] + }, + "execution": {"menu": "full", "supplies": {"lead": "after_brock"}} +} diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.29.plan.json b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.29.plan.json new file mode 100644 index 0000000000..afebebf900 --- /dev/null +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.29.plan.json @@ -0,0 +1,70 @@ +{ + "format": "pokesim-authored-checkpoint/1", + "game": "frlg", + "checkpoint": { + "id": "00.29", + "title": "Route 10 south to Lavender Town's Pokemon Center", + "notes": [ + "Route 10 south of Rock Tunnel (Route10 map.json) to Lavender Town's Pokemon Center. It has no grass. Carol (7, 60) and Clark (4, 62) look around, Trent (4, 68) looks west and Herman wanders row 70 (13..17), looking west and east (sight 2, to x 19): the way keeps to the east side, columns 17..21, and crosses row 70 on column 21. The ledges of row 62 leave a gap at (18, 62); row 66's leaves (21, 66). Row 74's ledge (11, 74) is hopped, and the hold south goes on over the connection into Lavender Town to the wall (11, 9). West of the Center's building, the wall (8, 9) sets the door's column." + ], + "start": {"certainty": "tile", "map": "Route10", "where": {"facing": "south", "kind": "tiles", "tiles": [[8, 58]]}}, + "sections": [ + { + "id": "route10_south", + "title": "Route 10's east side and its last ledge", + "events": [ + { + "id": "route10_east_side", + "kind": "legs", + "variant": "run", + "legs": [ + {"direction": "east", "tiles": 10}, {"direction": "north", "tiles": 2}, {"direction": "west", "tiles": 1}, {"direction": "east", "tiles": 1}, {"direction": "south", "tiles": 8}, {"direction": "east", "tiles": 3}, + {"direction": "south", "tiles": 9}, {"direction": "west", "tiles": 10} + ], + "why": "east along row 58 to (18, 58), up to the wall (18, 56), west to the wall (17, 56), back to (18, 56), down through the ledges' gap to (18, 64), east to the wall (21, 64), down column 21 to the wall (21, 73), west along row 73 to the wall (11, 73)" + }, + { + "id": "route10_ledge_hop", + "kind": "step", + "direction": "south", + "declared_after": {"certainty": "tile", "map": "Route10", "where": {"facing": "south", "kind": "tiles", "tiles": [[11, 75]]}}, + "why": "down the ledge (11, 74)" + } + ] + }, + { + "id": "lavender", + "title": "Lavender Town to its Pokemon Center", + "events": [ + { + "id": "lavender_north_wall", + "kind": "route", + "variant": "run", + "target": {"certainty": "tile", "map": "LavenderTown", "where": {"facing": "south", "kind": "tiles", "tiles": [[11, 8]]}}, + "why": "down column 11 over the connection into Lavender Town, to the wall (11, 9)" + }, + { + "id": "below_center_door", + "kind": "legs", + "variant": "run", + "legs": [{"direction": "west", "tiles": 6}, {"direction": "south", "tiles": 1}, {"direction": "east", "tiles": 2}, {"direction": "west", "tiles": 1}], + "why": "west along row 8 to (5, 8), onto row 9, east to the wall (7, 9), west to (6, 9)" + }, + { + "id": "lavender_nurse", + "kind": "route", + "variant": "run", + "target": {"certainty": "tile", "map": "LavenderTown_PokemonCenter_1F", "where": {"facing": "north", "kind": "tiles", "tiles": [[7, 4]]}}, + "why": "up column 6 onto the Center's door (6, 5), to the nurse" + }, + { + "id": "heal_lavender", + "kind": "heal", + "why": "full HP" + } + ] + } + ] + }, + "execution": {"menu": "full", "supplies": {"lead": "after_brock"}} +} diff --git a/SerialPrograms/cmake/SourceFiles.cmake b/SerialPrograms/cmake/SourceFiles.cmake index 976060be1f..697a9e8f60 100644 --- a/SerialPrograms/cmake/SourceFiles.cmake +++ b/SerialPrograms/cmake/SourceFiles.cmake @@ -1969,6 +1969,8 @@ file(GLOB LIBRARY_SOURCES Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_StoryReplay_Executor.h Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_StoryReplay_Tests.cpp Source/VideoGames/PokemonFRLG/Programs/AutoStory/Data/LegacyJsonFormat.h + Source/VideoGames/PokemonFRLG/Programs/AutoStory/Data/AuthoredStory_Tests.cpp + Source/VideoGames/PokemonFRLG/Programs/AutoStory/Data/AuthoredStory_Tests.h Source/VideoGames/PokemonFRLG/Programs/AutoStory/Data/Json_Tests.cpp Source/VideoGames/PokemonFRLG/Programs/AutoStory/Data/Json_Tests.h Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryTable.cpp From 2c370c9dd5fbd9d579dc241731f53667acf5295d Mon Sep 17 00:00:00 2001 From: dayfine Date: Mon, 9 Nov 2026 18:29:46 -0800 Subject: [PATCH 12/79] FRLG AutoStory: load the story table from its authored plans only story_checkpoints() is now load_authored_story(): every StoryData plan, in order of id. The C++ row definitions are gone (the table's rows and the VermilionGym, Celadon and Lavender row files); the step helpers and map names stay for tests. The migration's C++ comparison and export tests go with them; the golden sim trace stays, with tests that a plan with unknown fields, variants or sections is rejected and that Rock Tunnel's events are logged with their sections. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss --- .../AutoStory/Data/AuthoredStory_Tests.cpp | 165 ++-- .../AutoStory/PokemonFRLG_AutoStoryTable.cpp | 781 +----------------- .../AutoStory/PokemonFRLG_AutoStoryTable.h | 16 +- .../PokemonFRLG_AutoStoryTableCeladon.cpp | 165 ---- .../PokemonFRLG_AutoStoryTableLavender.cpp | 134 --- .../PokemonFRLG_AutoStoryTableSteps.h | 18 - ...PokemonFRLG_AutoStoryTableVermilionGym.cpp | 158 ---- .../Programs/AutoStory/StoryData/README.md | 13 +- SerialPrograms/cmake/SourceFiles.cmake | 3 - 9 files changed, 128 insertions(+), 1325 deletions(-) delete mode 100644 SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryTableCeladon.cpp delete mode 100644 SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryTableLavender.cpp delete mode 100644 SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryTableVermilionGym.cpp diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/Data/AuthoredStory_Tests.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/Data/AuthoredStory_Tests.cpp index 8392d8d7da..8bc8b352a9 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/Data/AuthoredStory_Tests.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/Data/AuthoredStory_Tests.cpp @@ -1,9 +1,10 @@ /* FRLG Authored Story Tests * From: https://github.com/PokemonAutomation/ * - * The story table as loaded from the StoryData plans against the C++ - * rows it was exported from: the same events, and the same trace of the - * whole story on the story maps (StoryMapsSim). + * The story table as loaded from the StoryData plans: the trace of the + * whole story on the story maps (StoryMapsSim) against the golden one + * taken from the C++ rows they were exported from, what a plan may not + * say, and the sections in the log. * */ @@ -11,8 +12,6 @@ #include #include #include "Common/Cpp/Exceptions.h" -#include "Common/Cpp/Filesystem/Filesystem.h" -#include "Common/Cpp/Filesystem/FileIO.h" #include "Common/Cpp/Json/JsonArray.h" #include "Common/Cpp/Json/JsonObject.h" #include "Common/Cpp/TestRunners/UnitTest.h" @@ -21,7 +20,6 @@ #include "VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryTable.h" #include "VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_StoryReplay.h" #include "JsonParser.h" -#include "JsonWriter.h" #include "AuthoredStory_Tests.h" namespace PokemonAutomation{ @@ -101,54 +99,116 @@ std::vector story_sim_trace(const std::vector& tab namespace{ -// The row as the C++ table built it: no notes or sections. -JsonValue plain_export(StoryCheckpoint row){ - row.notes.clear(); - row.sections.clear(); - for (StoryStep& step : row.steps){ - step.notes.clear(); - step.section.clear(); +// 00.28's plan, changed by `mutate`, read as an authored plan. +StoryCheckpoint read_changed_rock_tunnel(void (*mutate)(JsonObject& root)){ + JsonValue plan; + for (const auto& [name, text] : autostory_checkpoint_json()){ + if (name == "frlg-00.28.plan"){ + plan = parse_json(text); + } } - return story_checkpoint_export(row); + mutate(plan.to_object_throw()); + return read_authored_checkpoint(plan, "frlg-00.28.plan (changed)"); } -std::string compare_rows(const StoryCheckpoint& authored, const StoryCheckpoint& table){ - const JsonValue a = plain_export(authored); - const JsonValue b = plain_export(table); - if (!(a == b)){ - return std::format("{}: authored {}\nC++ {}", table.id, a.dump(-1), b.dump(-1)); - } - if (authored.live_start != table.live_start || authored.handoff != table.handoff){ - return table.id + ": live start or handoff differ."; - } - return ""; +JsonObject& first_event(JsonObject& root){ + JsonArray& sections = root.get_object_throw("checkpoint").get_array_throw("sections"); + return sections[0].to_object_throw().get_array_throw("events")[0].to_object_throw(); +} + +void unknown_event_field(JsonObject& root){ + first_event(root)["speed"] = "fast"; +} +void unknown_variant(JsonObject& root){ + first_event(root)["variant"] = "bike"; +} +void unknown_game_action(JsonObject& root){ + JsonObject& event = first_event(root); + event["kind"] = "game_action"; + event["variant"] = "mart Nowhere"; +} +void events_beside_sections(JsonObject& root){ + root.get_object_throw("checkpoint")["events"] = JsonArray(); } +void unknown_execution_field(JsonObject& root){ + root.get_object_throw("execution")["repel"] = true; +} +void unknown_lead(JsonObject& root){ + JsonObject supplies; + supplies["lead"] = "after_misty"; + root.get_object_throw("execution")["supplies"] = std::move(supplies); +} +void empty_section(JsonObject& root){ + JsonObject section; + section["id"] = "nothing"; + section["title"] = "no events"; + section["events"] = JsonArray(); + root.get_object_throw("checkpoint").get_array_throw("sections").push_back(std::move(section)); +} +void repeated_section(JsonObject& root){ + JsonArray& sections = root.get_object_throw("checkpoint").get_array_throw("sections"); + sections[1].to_object_throw()["id"] = sections[0].to_object_throw().get_string_throw("id"); +} + +struct RejectCase{ + std::string_view name; + void (*mutate)(JsonObject& root); +}; +const RejectCase REJECT_CASES[] = { + {"an unknown event field", unknown_event_field}, + {"a variant FRLG doesn't do", unknown_variant}, + {"a GAME step FRLG doesn't do", unknown_game_action}, + {"events beside sections", events_beside_sections}, + {"an unknown execution field", unknown_execution_field}, + {"an unknown lead", unknown_lead}, + {"a section without events", empty_section}, + {"two sections with one id", repeated_section}, +}; -UnitTestResult test_rows_match(){ - const std::vector authored = load_authored_story(); - const std::vector& table = story_checkpoints(); - if (authored.size() != table.size()){ - return std::format("Expected {} authored rows, read {}.", table.size(), authored.size()); +void unchanged(JsonObject&){} + +UnitTestResult test_rejects(){ + // Unchanged, it reads: each rejection is the change's. + if (read_changed_rock_tunnel(unchanged).id != "00.28"){ + return "Expected the unchanged plan to read as 00.28."; } - for (size_t c = 0; c < table.size(); c++){ - const std::string error = compare_rows(authored[c], table[c]); - if (!error.empty()){ - return error; - } + for (const RejectCase& test : REJECT_CASES){ + try{ + read_changed_rock_tunnel(test.mutate); + return std::format("Expected {} to be rejected.", test.name); + }catch (const ParseException&){} } return true; } -UnitTestResult test_traces_match(){ - const std::vector authored = story_sim_trace(load_authored_story()); - const std::vector table = story_sim_trace(story_checkpoints()); - for (size_t c = 0; c < std::min(authored.size(), table.size()); c++){ - if (authored[c] != table[c]){ - return std::format("Trace line {}: authored \"{}\", C++ \"{}\".", c, authored[c], table[c]); +// 00.28 in its sections, numbered across them, each event's line naming +// its section: Winston is event 12 (after from_save), on B1F's east side. +UnitTestResult test_rock_tunnel_sections(){ + const StoryCheckpoint* rock_tunnel = nullptr; + for (const StoryCheckpoint& row : story_checkpoints()){ + if (row.id == "00.28"){ + rock_tunnel = &row; } } - if (authored.size() != table.size()){ - return std::format("Expected {} trace lines, read {}.", table.size(), authored.size()); + if (rock_tunnel == nullptr){ + return "Expected a checkpoint 00.28."; + } + std::vector ids; + for (const Pokemon::StorySection& section : rock_tunnel->sections){ + ids.push_back(section.id); + } + const std::vector expected{ + "route10_to_mouth", "1f_north", "b1f_east", "1f_west", "b1f_west", "1f_south", "route10_south", + }; + if (ids != expected){ + return "Expected 00.28's sections by area, read " + std::to_string(ids.size()) + " others."; + } + StoryMapsSim game; + Pokemon::Checkpoint checkpoint = Pokemon::build_story_checkpoint(*rock_tunnel, game); + const Pokemon::Event& winston = checkpoint.events[11]; + const std::string line = Pokemon::event_log_line(checkpoint.id, 12, winston.name, "start", winston.section); + if (line != "[Event] 00.28/12 [b1f_east] winston_line: start"){ + return "Expected Winston's line in b1f_east, read: " + line; } return true; } @@ -170,22 +230,6 @@ UnitTestResult test_trace_golden(){ return true; } -// Migration only: writes each C++ row as its authored plan, and the C++ -// table's trace, to frlg-story-export/ under the working directory. -UnitTestResult test_export(){ - const std::string folder = "frlg-story-export/"; - Filesystem::create_directories(Filesystem::Path(folder)); - for (const StoryCheckpoint& row : story_checkpoints()){ - string_to_file(folder + "frlg-" + row.id + ".plan.json", authored_checkpoint_json(row).dump(2)); - } - JsonArray lines; - for (const std::string& line : story_sim_trace(story_checkpoints())){ - lines.push_back(line); - } - string_to_file(folder + "frlg-story-sim-trace.json", JsonValue(std::move(lines)).dump(1)); - return true; -} - struct AuthoredCase{ std::string name; UnitTestResult (*body)(); @@ -210,10 +254,9 @@ class AuthoredTest : public UnitTest{ void add_tests_AuthoredStory(UnitTestDatabase& database){ - database.add(AuthoredCase{"every row as authored is the C++ row", test_rows_match}); - database.add(AuthoredCase{"the story sim's trace is the C++ table's", test_traces_match}); - database.add(AuthoredCase{"export the C++ rows", test_export}); database.add(AuthoredCase{"the story sim's trace is the golden one", test_trace_golden}); + database.add(AuthoredCase{"malformed plans are rejected", test_rejects}); + database.add(AuthoredCase{"Rock Tunnel's sections", test_rock_tunnel_sections}); } diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryTable.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryTable.cpp index 94437d8c5c..5ae93c0b89 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryTable.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryTable.cpp @@ -4,795 +4,16 @@ * */ -#include "PokemonFRLG_AutoStoryCapture.h" #include "Data/JsonParser.h" -#include "PokemonFRLG_AutoStoryChoice.h" -#include "PokemonFRLG_AutoStoryGrind.h" -#include "PokemonFRLG_AutoStoryMart.h" -#include "PokemonFRLG_AutoStoryPcStorage.h" #include "PokemonFRLG_AutoStoryTable.h" -#include "PokemonFRLG_AutoStoryTableSteps.h" -#include "PokemonFRLG_AutoStoryTeach.h" namespace PokemonAutomation{ namespace NintendoSwitch{ namespace PokemonFRLG{ -namespace{ - -using namespace StoryTable; - - -StoryCheckpoint new_game(){ - StoryCheckpoint checkpoint = row("00.01", "new game to the bedroom", std::nullopt, {}, StartMenu::BEFORE_POKEMON, { - // new_game.c: the bedroom at (6, 6), facing the TV. - new_game_intro(at(BEDROOM, 6, 6, NORTH), "Oak's speech, BOY, the player's name (default if none is set), rival GREEN"), - options_step(), - }); - checkpoint.handoff = StoryHandoff::SID_HELPER; - return checkpoint; -} - -// SID Helper confirms the name, finishes the intro and reads the Trainer -// Card from the START menu, without moving the player or saving. -StoryCheckpoint after_sid_helper(){ - StoryCheckpoint checkpoint = row("00.01b", "after SID Helper: close the Trainer Card, save in the bedroom", at(BEDROOM, 6, 6, NORTH), {}, StartMenu::BEFORE_POKEMON, { - game_step(CLOSE_TRAINER_CARD, at(BEDROOM, 6, 6, NORTH), "the Trainer Card SID Helper left open, or HOME"), - options_step(), - }); - checkpoint.live_start = true; - return checkpoint; -} - -StoryCheckpoint leave_house(){ - return row("00.02", "bedroom to Pallet Town", at(BEDROOM, 6, 6, NORTH), {}, StartMenu::BEFORE_POKEMON, { - route("front_door", at(PALLET, 6, 8), "down the stairs and out of the house"), - }); -} - -StoryCheckpoint oaks_trigger(){ - return row("00.03", "Oak stops the player and walks them to the lab", at(PALLET, 6, 8, SOUTH), {}, StartMenu::BEFORE_POKEMON, { - route("below_oaks_trigger", at(PALLET, 12, 2, NORTH), "below the north exit, short of Oak's trigger at (12, 1)"), - step_into("oaks_trigger", NORTH, "the trigger: \"Don't go out!\""), - // PlayerEnter walks the player up 8 tiles from the lab's door. - scene("to_the_lab", at(LAB, 6, 4, NORTH), "Oak walks the player into the lab; the scene ends at the table"), - }); -} - -// Starter RNG starts from a save south of the table, facing the ball. -StoryCheckpoint to_starter_ball(){ - StoryCheckpoint checkpoint = row("00.04", "to Squirtle's ball, south of the table", at(LAB, 6, 4, NORTH), {}, StartMenu::BEFORE_POKEMON, { - route("below_squirtle", at(LAB, 9, 5, NORTH), "under Squirtle's ball (9, 4)"), - }); - checkpoint.handoff = StoryHandoff::STARTER_RNG; - return checkpoint; -} - -StoryCheckpoint starter(){ - return row("00.04b", "Squirtle, then the rival's battle", at(LAB, 9, 5, NORTH), {}, StartMenu::BEFORE_POKEDEX, { - talk("squirtle_ball", "\"So, you want the WATER POKEMON SQUIRTLE?\""), - answer("choose_squirtle", true, "take Squirtle"), - answer("no_nickname", false, "\"give a nickname?\" NO"), - scene("rival_takes_bulbasaur", at(LAB, 9, 5, NORTH), "the rival picks his ball; the player still faces the table (console B, 2026-11-01)"), - route("above_rival_trigger", at(LAB, 7, 7, SOUTH), "short of the rival's trigger row 8"), - step_into("rival_trigger", SOUTH, "\"Wait, let's check out our POKEMON!\""), - // The rival leaves; PlayerWatchRivalExitAfterBattleRight ends facing down. - battle("rival_battle", at(LAB, 7, 8, SOUTH), true, "the tutorial battle; losing goes on too"), - }); -} - -// TODO: Load an ordered series of authored checkpoints together and construct -// a partial story table, instead of loading one file in each row factory. -StoryCheckpoint parcel(){ - return load_authored_checkpoint("frlg-parcel-00.05.plan"); -} - -StoryCheckpoint pokedex(){ - return row("00.06", "Oak's Parcel to the Pokedex", at(VIRIDIAN_MART, 4, 3, WEST), {}, StartMenu::FULL, { - route("below_oak", at(LAB, 6, 4, NORTH), "back down Route 1 to Oak"), - talk("give_parcel", "Oak takes the parcel"), - scene("pokedex_scene", at(LAB, 6, 4, SOUTH), "the rival comes in, Pokedexes from the desk; the player ends facing south (console B, 2026-11-01)"), - }); -} - -StoryCheckpoint shopping(){ - return row("00.07", "Viridian shopping, then into Viridian Forest", at(LAB, 6, 4, SOUTH), {}, StartMenu::FULL, { - route("mart_clerk", at(VIRIDIAN_MART, 4, 3, WEST), "Route 1 again"), - // 2000 of the 3000 a new game starts with, plus the rival's prize. - shop("potions_and_antidotes", {{"potion", 5}, {"antidote", 3}, {"parlyz_heal", 1}}, "5 Potions, 3 Antidotes, 1 Parlyz Heal"), - route("viridian_nurse", at(VIRIDIAN_CENTER, 7, 4, NORTH), "heal before the forest"), - heal("heal_viridian"), - route("below_old_man_trigger", at(VIRIDIAN, 20, 9, NORTH), "short of the tutorial trigger (20, 8)"), - step_into("old_man_trigger", NORTH, "the old man's catching tutorial can't be walked around"), - // TutorialTriggerLeft turns the player right, to the old man. - scene("old_man_tutorial", at(VIRIDIAN, 20, 8, EAST), "about 60 lines and his demo battle; TEACHY TV"), - // After his demo the old man stands east of the player, beside (20, 8), where - // the map doesn't have him: "east 2" from there didn't move, and the walk north - // ended under Route 2's ledge in column 8 (console B, 2026-11-01). Go north first. - route("past_old_man", at(VIRIDIAN, 20, 5, NORTH), "north along column 20, clear of the old man"), - // The gate's north warp lands on the forest's exit mat (29, 62), facing - // north. The save there keeps a forest failure from going back to Pallet. - route("forest_entrance", at(FOREST, 29, 62, NORTH), "Route 2 and the south gate, running from wild battles"), - }); -} - -StoryCheckpoint forest(){ - // The supplies bought in 00.07. - return row("00.08", "Viridian Forest to Pewter Center", at(FOREST, 29, 62, NORTH), {5, 3, 1}, StartMenu::FULL, { - // Wild battles are fought for EXP. Straight up the east side from the - // entrance, each leg ending on a wall (the Boy at (45, 58) stops the - // east one). Rick (47, 45) sees (42..46, 45), so the last leg meets - // his battle and is held on to its wall after it. The by-hand run's - // detour west to (13, 46) and back is dropped. - legs("forest_east", {{EAST, 1}, {NORTH, 4}, {EAST, 14}, {NORTH, 15}}, "up the east side to (44, 43)", WildBattles::FIGHT), - route("forest_north", at(FOREST, 39, 25), "north part", WildBattles::FIGHT), - // To the gate by legs that end on walls, which the walker holds again - // after a battle instead of estimating where it stopped: planned - // routes with open legs lost the player in the north of the forest - // (console B, 2026-11-01). The two 1-tile legs are single steps. - legs("forest_exit", { - {NORTH, 10}, {WEST, 12}, {SOUTH, 10}, {WEST, 6}, {NORTH, 20}, - {SOUTH, 1}, {WEST, 10}, {SOUTH, 27}, {WEST, 8}, {NORTH, 20}, {EAST, 1}, - }, "walls all the way to the gate's column", WildBattles::FIGHT), - route("forest_gate", at(FOREST_GATE, 7, 10, NORTH), "north onto the exit, arriving on the gate's mat", WildBattles::FIGHT), - // Out of the forest, wild battles are run from; trainers are still fought. - route("pewter_nurse", at(PEWTER_CENTER, 7, 4, NORTH), "Route 2 north to Pewter's Center"), - heal("heal_pewter"), - }); -} - -StoryCheckpoint brock(){ - // The by-hand save: 2 Potions and 1 Antidote left after the forest. - return row("00.09", "Pewter Gym: Camper Liam, then Brock", at(PEWTER_CENTER, 7, 4, NORTH), {2, 1}, StartMenu::FULL, { - // Camper Liam (3, 8) always faces east (MOVEMENT_TYPE_FACE_RIGHT, sight - // 4) and sees (4..7, 8): walking north up column 6 from the door, - // the step onto (6, 8) starts his battle. He walks up to the player, - // who stays put and keeps facing north (FRLG doesn't turn the player - // to a trainer). That step is taken on its own, so no leg is cut. - route("below_liam_line", at(GYM, 6, 9, NORTH), "in by the door, up column 6 to below Liam's row"), - step_into("liam_line", NORTH, "onto (6, 8), in Liam's line"), - battle("camper_liam", at(GYM, 6, 8, NORTH), false, "Geodude and Sandshrew; EXP before Brock"), - // On to Brock unless red HP or a status is left that no item cures. - ready("ready_for_brock", at(PEWTER_CENTER, 7, 4, NORTH), "items for a status or low HP; the nurse only if they can't"), - route("before_brock", at(GYM, 6, 6, NORTH), "below Brock (6, 5); Liam, beaten, stands at (5, 8)"), - talk("challenge_brock", "Brock's speech"), - battle("brock", at(GYM, 6, 6, NORTH), false, "Geodude and Onix, with Bubble; Boulder Badge and TM39"), - }); -} - -StoryCheckpoint running_shoes(){ - return row("00.10", "Pewter: the Running Shoes from Oak's aide", at(GYM, 6, 6, NORTH), after_brock(), StartMenu::FULL, { - // Brock's win sets VAR_MAP_SCENE_PEWTER_CITY to 1 and shows the aide at - // (46, 20); his triggers are (46, 21..23) (PewterCity map.json). The - // Gym guide's triggers at (42..43, 21..23) need the scene at 0. - route("before_aide_trigger", at(PEWTER, 45, 21, EAST), "out of the Gym, east along row 21, short of the top trigger"), - step_into("aide_trigger", EAST, "onto (46, 21), below the aide"), - // RunningShoesAideTriggerTop: the aide talks from (46, 20), no YES/NO; - // the player only turns up. He walks off and is removed; FLAG_SYS_B_DASH - // is set (console B, 2026-11-02: about 20 B presses to the overworld). - scene("shoes_from_aide", at(PEWTER, 46, 21, NORTH), "\"Oh, PLAYER!\" ... the Running Shoes; ends facing north"), - // Where the by-hand walk stopped to start 00.11 (console B, 2026-11-02). - route("below_pewter_center", at(PEWTER, 17, 26, SOUTH), "west along row 21 and down to below the Pokemon Center's door (17, 25)"), - }); -} - -// Route 3's trainers (Route3 map.json): the way east meets three of them. -// Bug Catcher Colton (12, 6) faces east, sight 3: the only way north past -// the row 7 ledges is the gap at x 14..15, below his line. Youngster Ben -// (17, 4) faces south, sight 2, so the way east keeps to row 3 past him. -// Bug Catcher Greg (25, 4) faces south, sight 2, over the way east along -// row 5. Bug Catcher James (32, 6) faces east, sight 4, over the way down -// at x 35..36. The others are kept out of: Lass Janice (19, 9) sees west -// along row 9 to x 14, Lass Sally (30, 3) west along row 3 to x 25, and -// Youngster Calvin (29, 10) west along row 10. Each line is stepped into on -// its own, so no leg is cut; the trainer walks up to the player, who stays -// put facing the way they stepped. -StoryCheckpoint route3(){ - return row("00.11", "Pewter Center, then Route 3's trainers", at(PEWTER, 17, 26, SOUTH), after_brock(), StartMenu::FULL, { - running(route("pewter_nurse", at(PEWTER_CENTER, 7, 4, NORTH), "in by the door below the player")), - heal("heal_pewter"), - // Up from row 9 west of Janice's line, which ends at x 14. - running(route("west_of_janice_line", at(ROUTE3, 13, 8), "out of Pewter by row 21, east into Route 3, short of Janice's line")), - running(legs("below_colton_line", {{EAST, 1}, {NORTH, 1}}, "to (14, 7), in the ledges' gap")), - step_into("colton_line", NORTH, "onto (14, 6), in Colton's line"), - battle("bug_catcher_colton", at(ROUTE3, 14, 6, NORTH), false, "his Bug Pokemon; Colton stops at (13, 6)"), - running(legs("past_ben", {{NORTH, 3}, {EAST, 4}, {SOUTH, 2}, {EAST, 6}}, "up to row 3 above Ben, down at x 18 east of his line, to (24, 5)")), - step_into("greg_line", EAST, "onto (25, 5), below Greg"), - battle("bug_catcher_greg", at(ROUTE3, 25, 5, EAST), false, "his Bug Pokemon; Greg is already next to the player"), - running(legs("above_james_line", {{EAST, 11}}, "along row 5 to the wall at (36, 5)")), - step_into("james_line", SOUTH, "onto (36, 6), at the end of James's line"), - battle("bug_catcher_james", at(ROUTE3, 36, 6, SOUTH), false, "his Bug Pokemon; James stops at (35, 6)"), - // Saved here, the trainers behind, so a failure on the way to Route 4 - // doesn't fight them again. - running(legs("save_spot", {{SOUTH, 2}}, "down to (36, 8), beside the wall east of it")), - }); -} - -// Route 3's north exit (x 68..75) joins Route 4 (offset 60) at x 8..15, up -// which column 12 leads to the Pokemon Center's door (12, 5). Lass Robin -// (40, 11) wanders up and down at x 40, looking north and south, sight 3. -// Rock above (y <= 8) and grass below (y >= 12) leave every way east -// across her column at y 9..11, so whether she sees the player depends on -// her facing. The walk watches for her after the leg along row 9, which -// crosses her sight on (40, 9) only; if she saw the player, her message -// goes to story_interrupts(), which fight her, and the route goes on from -// (40, 9) (run_route(); console B, 2026-11-02, she stopped the player -// there and spoke after the leg's short watch). -StoryCheckpoint magikarp_salesman(){ - StoryCheckpoint checkpoint = row("00.12", "Route 3 and 4 to the Magikarp salesman", at(ROUTE3, 36, 8, SOUTH), after_brock(), StartMenu::FULL, { - running(route("route4_nurse", at(ROUTE4_CENTER, 7, 4, NORTH), "east over Route 3, off the grass, north into Route 4 and its Pokemon Center")), - heal("heal_route4"), - // Gift RNG starts from a save facing the salesman (1, 3). - running(route("before_salesman", at(ROUTE4_CENTER, 2, 3, WEST), "beside the Magikarp salesman, facing him")), - }); - checkpoint.handoff = StoryHandoff::GIFT_RNG; - return checkpoint; -} - -// Gift RNG buys the Magikarp (500 of the money 00.12 brings) without -// moving the player and leaves its summary open, or HOME. This saves the -// shiny where 00.12 ended. A run started here with Gift RNG's handoff on -// loads the save beside the salesman and runs Gift RNG first. -StoryCheckpoint after_gift_rng(){ - StoryCheckpoint checkpoint = row("00.12b", "after Gift RNG: save with the Magikarp", at(ROUTE4_CENTER, 2, 3, WEST), after_brock(), StartMenu::FULL, { - game_step(LEAVE_GIFT_SUMMARY, at(ROUTE4_CENTER, 2, 3, WEST), "the Magikarp's summary Gift RNG left open, or HOME"), - }); - checkpoint.live_start = true; - return checkpoint; -} - -// The Magikarp goes to BOX 1 at the Center's PC (11, 1), so Mt. Moon is -// fought with the starter alone (console B, 2026-11-02: done by hand and -// saved at (11, 2), facing the PC, where this row ends). The wandering -// boy (4..6, 3..5) is walked around. The Magikarp comes from Gift RNG: -// with Gift RNG off the party is the starter alone, and the deposit is -// skipped. -StoryCheckpoint magikarp_to_box(){ - return row("00.12c", "Route 4 Center: the Magikarp into BOX 1", at(ROUTE4_CENTER, 2, 3, WEST), after_brock(), StartMenu::FULL, { - running(route("pc_front", at(ROUTE4_CENTER, 11, 2, NORTH), "below the PC (11, 1), facing it")), - pc_step("magikarp_to_box", "DEPOSIT the party's second slot into BOX 1, if it has one", PcTransfer{ - .action = PcAction::DEPOSIT, .party_slot = 1, .box = 0, .if_missing = PcMissing::SKIP, - }), - }); -} - -// Mt. Moon (pokefirered data/maps/MtMoon_1F, _B1F, _B2F). Every floor tile -// of the cave has wild encounters, which are run from, so its legs end on -// walls, ladders or someone standing still, which the walker holds again -// after a battle; the few open ones are short. The way through: up 1F's -// middle and west side, its north-west ladder, B1F's west ladder down to -// B2F's south-east, round B2F's south edge to its west, north past -// Miguel and the fossils, and the ladder up to B1F's east end, which -// leads out to Route 4 east of the mountain. -// - 1F's trainers are walked around: Youngster Josh (13, 17) sees east -// along row 17 to x 17, so the way west into the west room is down -// column 18 and up column 11; Lass Miriam walks round (32..33, 4..5), -// sight 2, so the way east keeps to row 9 and columns 38 and 40; Hiker -// Marcos wanders (5..9, 8..12) and sees one tile, so the way north is -// column 11 and row 3. -// - The Moon Stone ball (3, 2) on 1F (FLAG_HIDE_MT_MOON_1F_MOON_STONE) is -// a few tiles off the way to the ladder (5, 6). -// - The Grunt at (37, 21) on B2F looks around (sight 3) over the only way -// east round B2F. His room is crossed on legs to walls, at one tile of -// his sight each, (37, 22) and (40, 21); if he looks the player's way, -// he walks up beside the leg, story_interrupts() fights him, and the -// leg is held on to its wall. -// - The Grunt at (12, 20) faces south (sight 2) over (12, 21..22), across -// rows 21..22, the only way north to Miguel: stepped into from the -// west, he is next to the player and doesn't walk. -// - Super Nerd Miguel (13, 11) battles on the step onto (14, 11) -// (MtMoon_B2F_EventScript_MiguelTrigger, VAR_MAP_SCENE_MT_MOON_B2F 0), -// then "We'll each take one!" -// - The fossils: DOME (13, 7), HELIX (14, 7). After the HELIX, Miguel -// walks up to (13, 8) and takes the DOME, which opens the gap north. -// The save is on Route 4: the save card's places don't include Mt. Moon. -StoryCheckpoint mt_moon(){ - return row("00.13", "Mt. Moon: a Moon Stone, a Rocket, Miguel and the Helix Fossil", at(ROUTE4_CENTER, 11, 2, NORTH), after_brock(), StartMenu::FULL, { - running(route("route4_nurse", at(ROUTE4_CENTER, 7, 4, NORTH), "the nurse, below the counter")), - heal("heal_route4"), - running(route("mt_moon_entrance", at(MT_MOON_1F, 18, 37, NORTH), "out of the Center, west into Mt. Moon")), - running(legs("mt_moon_1f", { - {NORTH, 12}, {EAST, 8}, {NORTH, 12}, {EAST, 3}, {SOUTH, 1}, {EAST, 9}, - {NORTH, 1}, {EAST, 2}, {NORTH, 4}, {WEST, 24}, {EAST, 2}, {SOUTH, 12}, - {WEST, 7}, {NORTH, 18}, {WEST, 9}, {EAST, 1}, - }, "up the middle, east of Miriam, west along row 9, down column 18 past Josh, up column 11 past Marcos, to (3, 3)")), - running(route("below_moon_stone", at(MT_MOON_1F, 3, 3, NORTH), "facing the Moon Stone (3, 2)")), - talk("moon_stone_ball", "A on the item ball"), - // No reader for the text yet: the scene's end is the overworld. - scene("found_moon_stone", at(MT_MOON_1F, 3, 3, NORTH), "\" found a MOON STONE!\", then the pocket line; the ball is gone"), - running(route("b2f_ladder_foot", at(MT_MOON_B2F, 26, 21, EAST), "1F's ladder (5, 6), down B1F's west side to its ladder (22, 18), onto B2F")), - running(legs("b2f_south", { - {NORTH, 4}, {EAST, 8}, {WEST, 2}, {SOUTH, 5}, {EAST, 8}, {NORTH, 3}, {WEST, 1}, {NORTH, 5}, - {EAST, 7}, {SOUTH, 14}, {WEST, 9}, {SOUTH, 10}, {WEST, 29}, {EAST, 3}, {NORTH, 17}, - }, "through the Grunt's room at (37, 21), round the south edge, up column 11 to (11, 21)")), - step_into("grunt_line", EAST, "onto (12, 21), below the Grunt at (12, 20)"), - battle("rocket_grunt", at(MT_MOON_B2F, 12, 21, EAST), false, "Rattata and Zubat, Lv13"), - ready("ready_for_miguel", at(ROUTE4_CENTER, 7, 4, NORTH), "items for a status or low HP; the nurse, back through the cave, only if they can't"), - // Up column 13 to Miguel, who stops the leg on (13, 12), then east - // to the wall: the tile below his trigger. - running(legs("below_miguel_trigger", {{EAST, 1}, {NORTH, 9}, {EAST, 1}}, "to (14, 12), below Miguel's trigger (14, 11)")), - step_into("miguel_trigger", NORTH, "onto (14, 11), beside Miguel"), - battle("super_nerd_miguel", at(MT_MOON_B2F, 14, 11, NORTH), false, "Grimer, Voltorb and Koffing, Lv12; \"We'll each take one!\""), - running(legs("below_helix_fossil", {{NORTH, 3}}, "up column 14 to the HELIX FOSSIL (14, 7)")), - fossil_step("helix_fossil", "the HELIX FOSSIL; Miguel takes the DOME FOSSIL", Fossil::HELIX), - // The maps keep the fossils, which the game removes after the - // choice: the step onto the HELIX's tile is taken on its own. - step_into("helix_gap", NORTH, "onto (14, 7), where the HELIX FOSSIL lay"), - running(route("route4_east", at(ROUTE4, 32, 6, SOUTH), "west to B2F's ladder (5, 10), up to B1F, east to its exit onto Route 4")), - }); -} - -// Route 4 east of Mt. Moon (Route4 map.json) joins Cerulean City at its -// east end (x 107; Route 4's row 3 is the city's row 13). Its upper road -// (rows 2..8) reaches the city only by water: the way on by land is down -// the ledge row 9 at x 90..96 to the lower road (rows 10..12), which -// joins the city's rows 20..22. Lass Crissy (75, 3) faces east, sight 4, -// over row 3 from x 76 to 79; the way east keeps out of her line and off -// the grass south of the road (75..87, 11..17). -// -// On the way, the Mega Kick tutor (Black Belt (50, 3), facing west, -// Route4_EventScript_MegaKickTutor) stands in a pen (46..51, 2..4) north -// of the road, beside the Mega Punch tutor (47, 3); the pen opens south -// only on (48, 5) and (49, 5), the rest of row 5 ledges out of it. From -// Mt. Moon's exit the walk goes east and up into the pen to (50, 4), -// below the tutor, and Mega Kick takes Withdraw's slot. Cerulean can't -// be walked back to Route 4's upper road without Surf, so it is now or -// much later. -// -// The open leg east across the city's edge ended a tile short on the -// console (2026-11-03: on (6, 20), not (7, 20)), and no hold to a wall -// in the city's west end finds the player from there: the next hold -// south met the fence on (6, 23) and the walk went on a column off. So -// the entry ends on (9, 20), and only legs to walls follow: north up -// column 9 (or 8, a tile short) to row 12, west to (8, 12), east to -// (30, 12) beside the policeman (31, 12), south to (30, 17), west to -// (25, 17), and down the ledge row 18 to (25, 19), a few tiles from the -// door (22, 19). The way keeps out of the boy's (16, 18..24) and the -// balding man's (8..10, 22..24) wander boxes. -StoryCheckpoint route4_to_cerulean(){ - const TeachPlan mega_kick{.item = std::string(TEACH_TUTOR), .move = "mega-kick", .member = 0, .forget_move = "withdraw"}; - return row("00.14", "Route 4: Mega Kick from its tutor, then east to Cerulean's Pokemon Center", at(ROUTE4, 32, 6, SOUTH), after_brock(), StartMenu::FULL, { - running(route("mega_kick_tutor", at(ROUTE4, 50, 4, NORTH), "east and up through (48, 5) into the tutors' pen, below the Mega Kick tutor (50, 3)")), - teach_step("teach_mega_kick", "the tutor's Mega Kick in place of Withdraw, unless the lead knows it", mega_kick), - running(route("above_ledge", at(ROUTE4, 93, 8, SOUTH), "east along Route 4's upper road to above the ledge row 9")), - hop("ledge_hop", SOUTH, at(ROUTE4, 93, 10, SOUTH), "down the ledge (93, 9) to the lower road"), - running(route("cerulean_entry", at(CERULEAN, 9, 20, EAST), "east into Cerulean City, to (9, 20) below column 9")), - running(legs("above_city_ledge", {{NORTH, 8}, {WEST, 1}, {EAST, 22}, {SOUTH, 5}, {WEST, 5}}, "to walls: (9, 12), (8, 12), (30, 12), (30, 17), (25, 17)")), - hop("city_ledge_hop", SOUTH, at(CERULEAN, 25, 19, SOUTH), "down the ledge (25, 18)"), - running(route("cerulean_nurse", at(CERULEAN_CENTER, 7, 4, NORTH), "west along row 20 to the Pokemon Center's door (22, 19)")), - heal("heal_cerulean"), - }); -} - -// Cerulean Gym (pokefirered CeruleanCity_Gym map.json and scripts.inc): -// a pool with walkways. Misty (8, 6) stands on a platform (7..9, 6) above -// row 7. Picnicker Diana (4, 7) faces east, sight 4, over (5..8, 7), so -// misty_front (8, 7) is in her line; Swimmer Luis (10, 12) in the water -// faces west, sight 1, over (9, 12), on column 9 north of the door. No -// gym trainer has to be fought for Misty, so neither is: from the door up -// column 9 to row 13 (a route there, so the planner's walk to a wall -// doesn't run on past it through (9, 12)), west to (4, 13), and to walls -// round the pool's west and north sides, (4, 10), (12, 10), (12, 7), then -// west to (9, 7), the tile below the platform's east end, out of Diana's -// line. 00.14c steps up onto (9, 6) and talks to Misty from beside her. -// -// Misty beat a Lv20 Wartortle (console B, run m51), so first a GRIND to -// Lv23 on 00.15's patch. Gen 3 numbers (pokefirered: her mons have IV 0; -// Wartortle taken at IV 15, no EVs): Starmie Lv21 has 56 HP, Atk 36, SpA -// 47, SpD 40. Bite is Dark, special in Gen 3, no STAB, x2 on Psychic: at -// Lv23 (SpA 39) it does 23..28, three hits (two on top rolls); at Lv20, -// 20..24. Her Swift (physical, 60) does 9..11 to a Lv23 Wartortle (about -// 67 HP, Def 45) and Water Pulse (STAB, resisted) 8..10: 6 or more hits, -// though m51 saw about 20 a turn. Her Recover (28) and Super Potion undo -// a Bite, so the margin is in Bite's damage. -// -// The Mart comes before the GRIND: its wild battles are fought only with -// 2 or more Potions, and 00.14's save has none (m51 met Misty with only -// the 5 this row bought). 5 Potions (row 3, 300 each), then up to 3 Super -// Potions (row 2, 700), last so they take the Items pocket's last row; -// the battle doesn't use them yet. The money box can't be read, so the -// floor stands for it, and a floor above the money fails the step (the -// quantity box wraps). Prizes (pokefirered: 4 x last level x the class's -// factor) from a new game's 3000, less Viridian's 2000 and the Magikarp's -// 500: Liam 220, Brock 1400, Route 3's bug catchers 360, the Mt. Moon -// grunt 416 and Miguel 288 (the first rival's 80 only if won), at least -// 3184 here. Floor and budget 3000: 5 Potions and 2 Super Potions, 2900. -// Misty's 2100 (4 x 21 x 25) then leaves 00.15 its floor of 1500. Then the -// nurse, and the save before Misty, so her battle is its own checkpoint, -// 00.14c, verified and retried from it. 00.15's GRIND then fights -// until the sim beats the Cerulean rival often enough. -StoryCheckpoint cerulean_gym(){ - const MartPlan supplies{ - .map = CERULEAN_MART, - .lines = {{.item = "potion", .quantity = 5}, {.item = "super-potion", .quantity = 3}}, - .budget = 3000, - .money_floor = 3000, - }; - const GrindPlan to_lv23{.member = 0, .level = 23, .max_encounters = 100, .pace = WEST, .heal_every = 0}; - return row("00.14b", "Cerulean: Potions, a GRIND to Lv23, then into the Gym, saved below Misty's platform", at(CERULEAN_CENTER, 7, 4, NORTH), after_brock(), StartMenu::FULL, { - running(route("mart_clerk", at(CERULEAN_MART, 4, 3, WEST), "out of the Center to the Mart's clerk")), - mart_step("buy_potions", "5 Potions for the GRIND's wild battles, then Super Potions as the money allows", supplies), - running(route("grind_patch", at(ROUTE4, 86, 16, WEST), "west out of the city along Route 4's lower road onto its grass's east edge")), - grind_step("grind_to_lv23", "wild battles until the lead is Lv23, where Bite takes Starmie in three", to_lv23, at(CERULEAN_CENTER, 7, 4, NORTH)), - running(route("cerulean_nurse", at(CERULEAN_CENTER, 7, 4, NORTH), "back to the Center: Misty's battle starts at full HP and PP")), - heal("heal_cerulean"), - running(route("gym_below_luis", at(CERULEAN_GYM, 9, 13), "into the Gym, up column 9 to row 13, short of Luis's (9, 12)")), - running(legs("gym_west_walkway", {{WEST, 5}}, "west to the wall (4, 13)")), - running(legs("below_misty_platform", {{NORTH, 3}, {EAST, 8}, {NORTH, 3}, {WEST, 3}}, "walls (4, 10), (12, 10), (12, 7), then to (9, 7), out of Diana's line")), - }); -} - -// Misty (TRAINER_LEADER_MISTY: Staryu Lv18, Starmie Lv21), talked to from -// (9, 6), beside her on the platform. Her win text runs on to the CASCADE -// BADGE, TM03 (Water Pulse) and its explanation, all read with the -// battle's. Bite is chosen against her party (Starmie is Water/Psychic). -// Back to the nurse round the pool's west side, out of Luis's line; then -// Water Pulse in place of Tail Whip, last, at the Center, from the bag's -// TM CASE. Ends where 00.15 starts. -StoryCheckpoint misty(){ - const TeachPlan water_pulse{.item = "tm03", .move = "water-pulse", .member = 0, .forget_move = "tail-whip"}; - return row("00.14c", "Cerulean Gym: Misty, then Water Pulse", at(CERULEAN_GYM, 9, 7, WEST), after_brock(), StartMenu::FULL, { - running(route("beside_misty", at(CERULEAN_GYM, 9, 6, WEST), "up onto (9, 6), facing Misty (8, 6)")), - talk("challenge_misty", "Misty's speech"), - battle("misty", at(CERULEAN_GYM, 9, 6, WEST), false, "Staryu and Starmie, with Bite; CASCADE BADGE and TM03"), - running(legs("gym_way_out", {{SOUTH, 1}, {EAST, 3}, {SOUTH, 3}, {WEST, 8}, {SOUTH, 3}, {EAST, 5}}, "walls (12, 7), (12, 10), (4, 10), (4, 13), (9, 13), round Luis's (9, 12)")), - running(route("cerulean_nurse", at(CERULEAN_CENTER, 7, 4, NORTH), "down column 9 out of the Gym, to the Center")), - heal("heal_cerulean"), - teach_step("teach_water_pulse", "TM03 Water Pulse in place of Tail Whip", water_pulse), - }); -} - -// Before the rival north of Cerulean (cerulean_rival()), from the -// Center: first TM03 Water Pulse over Tail Whip, if the lead doesn't know -// it yet, so the GRIND's sim plays it (a run without TM03 from Misty -// skips the step). Then 3 Potions at the Mart -// (CeruleanCity_Mart_Items: POTION is row 3, 300 each; Mt. Moon's -// trainers leave well over the floor) and 2 Awakenings (row 6, 250 each; -// pokefirered items.json) for the rival's Bulbasaur's Sleep Powder -// (console B, m56: asleep at 34/65 HP, it fainted two turns later with -// 15 Potions), 1400 of the floor's 1500. Then a GRIND on Route 4's grass -// east of Mt. Moon (75..86, 11..17; Spearow, Rattata, Ekans and Mankey -// around Lv10, about 80 EXP each), healing at the Center, until the -// battle sim beats the rival 00.15b fights 50% or more: the win chance -// his battle refuses below. Console B's Wartortle (Lv22, 65 HP, Water -// Pulse) is about 42% there and 62% at Lv23; Lv28 (about 88%, some 120 -// battles from Lv22) is the cap. Then the nurse, and the save on (23, 7), -// the tile below his trigger: his battle is its own checkpoint, 00.15b, -// verified and retried from this save. -StoryCheckpoint cerulean_grind(){ - const TeachPlan water_pulse{.item = "tm03", .move = "water-pulse", .member = 0, .forget_move = "tail-whip"}; - const MartPlan potions{ - .map = CERULEAN_MART, - .lines = {{.item = "potion", .quantity = 3}, {.item = "awakening", .quantity = 2}}, - .budget = 1500, - .money_floor = 1500, - }; - const GrindPlan for_rival{ - .member = 0, .level = 28, .max_encounters = 150, .pace = WEST, .heal_every = 0, - .trainer = std::string(story_trainer(CERULEAN, "rival_cerulean").value_or("")), .min_chance = MIN_WIN_CHANCE, - }; - return row("00.15", "Cerulean: Water Pulse, Potions, a GRIND until the rival is winnable, then saved below his trigger", at(CERULEAN_CENTER, 7, 4, NORTH), after_brock(), StartMenu::FULL, { - teach_step("teach_water_pulse", "TM03 Water Pulse in place of Tail Whip, unless the lead knows it or there is no TM03", water_pulse), - running(route("mart_clerk", at(CERULEAN_MART, 4, 3, WEST), "out of the Center to the Mart's clerk")), - mart_step("buy_potions", "3 Potions: the GRIND fights wild battles only with 2 or more; 2 Awakenings for the rival's Sleep Powder", potions), - running(route("grind_patch", at(ROUTE4, 86, 16, WEST), "west out of the city along Route 4's lower road onto its grass's east edge")), - grind_step("grind_for_rival", "wild battles until the sim beats the rival 50% or more, Lv28 at most; the nurse when hurt or low on PP", for_rival, at(CERULEAN_CENTER, 7, 4, NORTH)), - running(route("cerulean_nurse", at(CERULEAN_CENTER, 7, 4, NORTH), "back to the Center: the rival's battle starts at full HP and PP")), - heal("heal_cerulean"), - running(route("below_rival_trigger", at(CERULEAN, 23, 7, NORTH), "out of the Center, north up to (23, 7), short of the trigger row 6")), - }); -} - -// The rival north of Cerulean (CeruleanCity scripts.inc): the only way -// north to Nugget Bridge is columns 22..24, and a step onto row 6 there -// (CeruleanCity_EventScript_RivalTrigger*, VAR_MAP_SCENE_CERULEAN_CITY_RIVAL -// 0) brings him down to the player. From the middle, (23, 6), he stops -// at (23, 5); after the battle he walks round the player and off south, -// and the player, turning to watch him, ends facing south. His FAME -// CHECKER's text is read to the overworld with the battle's. For a player -// who took Squirtle he has Pidgeotto Lv17, Abra Lv16, Rattata Lv15 and -// Bulbasaur Lv18 (sParty_RivalCeruleanBulbasaur), whose Vine Whip and -// Sleep Powder are the danger. The row starts from 00.15's save below the -// trigger, and saves after him. First TM03 Water Pulse over Tail Whip (from -// the bag, where the player stands), if the lead doesn't know it yet: -// console B's save (2026-11-03) is past Misty's TEACH, which failed there. -// Where she taught it, the step reads the moves and does nothing. -StoryCheckpoint cerulean_rival(){ - const TeachPlan water_pulse{.item = "tm03", .move = "water-pulse", .member = 0, .forget_move = "tail-whip"}; - return row("00.15b", "Cerulean: Water Pulse if not known, then the rival north of the city", at(CERULEAN, 23, 7, NORTH), after_brock(), StartMenu::FULL, { - teach_step("teach_water_pulse", "TM03 Water Pulse in place of Tail Whip, unless the lead knows it", water_pulse), - step_into("rival_trigger", NORTH, "onto (23, 6), the middle trigger: \"Yo! !\""), - battle("rival_cerulean", at(CERULEAN, 23, 6, SOUTH), false, "Pidgeotto, Abra, Rattata and Bulbasaur; then the FAME CHECKER"), - }); -} - -// Nugget Bridge (Route24 map.json) is x 10..12 from row 32 north to row -// 16, the city's columns 22..24 (offset 12). Its five trainers stand on -// it facing across, sight 2, so each line crosses the middle column 11 -// on the trainer's row: Bug Catcher Cale (12, 31), Lass Ali (10, 28), -// Youngster Timmy (12, 25), Lass Reli (10, 22) and Camper Ethan (12, 19). -// Each is fought on the step onto their row, beside them: they don't -// walk, and the player keeps facing north. Two tiles separate the rows, -// walked as one short leg; the step onto a row goes on a tile at a time -// until the trainer sees the player (into_line()), as the open leg onto -// the bridge ended a tile short twice on console B (2026-11-03), on -// (11, 33), and one step left the player out of Cale's sight. Then the -// Rocket (12, 15): the step onto (11, 15) -// (Route24_EventScript_RocketTriggerRight, VAR_MAP_SCENE_ROUTE24 0) gives -// the NUGGET, "join Team Rocket", and his battle; he only turns, and the -// player turns east to him. Camper Shane (5, 21) looks north from the -// west bank, off the way. -StoryCheckpoint nugget_bridge(){ - return row("00.16", "Nugget Bridge: the nurse, five trainers and the Rocket", at(CERULEAN, 23, 6, SOUTH), after_brock(), StartMenu::FULL, { - running(route("cerulean_nurse", at(CERULEAN_CENTER, 7, 4, NORTH), "back to the Center after the rival, before Nugget Bridge")), - heal("heal_cerulean"), - running(route("below_cale_line", at(ROUTE24, 11, 32, NORTH), "out of the Center, north past the rival's row onto the bridge, below Cale's row")), - into_line("cale_line", NORTH, "onto (11, 31), beside Cale"), - battle("bug_catcher_cale", at(ROUTE24, 11, 31, NORTH), false, "his Bug Pokemon"), - running(legs("below_ali_line", {{NORTH, 2}}, "up to (11, 29)")), - into_line("ali_line", NORTH, "onto (11, 28), beside Ali"), - battle("lass_ali", at(ROUTE24, 11, 28, NORTH), false, "her Pokemon"), - running(legs("below_timmy_line", {{NORTH, 2}}, "up to (11, 26)")), - into_line("timmy_line", NORTH, "onto (11, 25), beside Timmy"), - battle("youngster_timmy", at(ROUTE24, 11, 25, NORTH), false, "his Pokemon"), - running(legs("below_reli_line", {{NORTH, 2}}, "up to (11, 23)")), - into_line("reli_line", NORTH, "onto (11, 22), beside Reli"), - battle("lass_reli", at(ROUTE24, 11, 22, NORTH), false, "her Pokemon"), - running(legs("below_ethan_line", {{NORTH, 2}}, "up to (11, 20)")), - into_line("ethan_line", NORTH, "onto (11, 19), beside Ethan"), - battle("camper_ethan", at(ROUTE24, 11, 19, NORTH), false, "his Pokemon"), - // A route, not legs: the nurse may have been needed. - ready("ready_for_rocket", at(CERULEAN_CENTER, 7, 4, NORTH), "items for a status or low HP; the nurse only if they can't"), - running(route("below_rocket_trigger", at(ROUTE24, 11, 16, NORTH), "up the bridge to below the Rocket's trigger (11, 15)")), - step_into("rocket_trigger", NORTH, "onto (11, 15), beside the Rocket"), - battle("rocket_grunt", at(ROUTE24, 11, 15, EAST), false, "the NUGGET, then Ekans and Zubat, Lv15"), - }); -} - -// Route 24 north of Nugget Bridge (Route24 map.json) joins Route 25 by -// its rows 7..9; the ledges on Route 25's row 6 (x 0..9) leave the way -// north at x 12..13. Route 25 (Route25 map.json, scripts.inc) to Bill's -// Sea Cottage door (51, 4): of its nine trainers, four can't be walked -// around. -// - Hiker Franklin (11, 4) faces east, sight 4, over (12..15, 4), and -// Hiker Wayne (17, 7) east over (18..19, 7): the only ways east past -// x 15. Franklin is fought, from (15, 5) on the step onto (15, 4), the -// end of his line: he walks up to (14, 4). -// - Youngster Joey (18, 2) faces south over (18, 3..4): the way keeps -// off column 18, south round Wayne to (19, 6) and up to (19, 4). -// - Youngster Dan (22, 4) looks around, sight 2, over the only way east, -// (20..21, 4). On (20, 4), a one-tile leg, he may see the player and -// walk up to (21, 4); so the way goes north from there to row 2, east, -// and down column 23 past him to (23, 5), off every tile he may walk -// up to. Where his sight is crossed, the leg ends on a wall or is one -// tile; if he looks the player's way, story_interrupts() fight him. -// - Picnicker Kelsey (22, 8) faces east over (23..24, 8), across the -// only way on: fought on the step onto (24, 8); she walks up to (23, 8). -// - Hiker Nob (27, 9) faces north over (27, 6..8), Camper Flint (28, 4) -// south over (28, 5..7): every way east crosses one. Nob is fought on -// the step onto (27, 8), beside him; the way on keeps off Flint's -// column, by one-tile legs and legs to walls. -// - Youngster Chad (36, 4) walks up and down column 36 (rows 2..7), so -// he may see any tile of it down to row 9. The way crosses his column -// on row 9, a leg to the water at (42, 9), where he can only walk up -// beside it. -// - Lass Haley (42, 5) faces south over (42, 6..8), the only way east of -// x 42: fought on the step onto (42, 8); she walks up to (42, 7). -// The row saves inside the Sea Cottage, which the save card names -// ROUTE 25. -StoryCheckpoint route25(){ - return row("00.17", "Route 24 and 25 to Bill's Sea Cottage: Franklin, Kelsey, Nob and Haley", at(ROUTE24, 11, 15, EAST), after_brock(), StartMenu::FULL, { - running(route("below_franklin_line", at(ROUTE25, 15, 5, NORTH), "north off Nugget Bridge, east into Route 25, round its ledges to (15, 5), below the end of Franklin's line")), - into_line("franklin_line", NORTH, "onto (15, 4), at the end of Franklin's line"), - battle("hiker_franklin", at(ROUTE25, 15, 4, NORTH), false, "Machop and Geodude, Lv15; Franklin stops at (14, 4)"), - running(legs("west_of_dan", {{EAST, 2}, {SOUTH, 2}, {EAST, 2}, {NORTH, 2}}, "to (17, 4), short of Joey's (18, 4); round Wayne (17, 7) to (19, 6); up to (19, 4)")), - running(legs("round_dan", { - {EAST, 1}, {NORTH, 2}, {EAST, 4}, {WEST, 1}, {SOUTH, 3}, {EAST, 1}, {SOUTH, 2}, - }, "onto (20, 4); up to (20, 2), east to (24, 2), down column 23 past Dan to (23, 5), to (24, 7) above Kelsey's line")), - into_line("kelsey_line", SOUTH, "onto (24, 8), at the end of Kelsey's line"), - battle("picnicker_kelsey", at(ROUTE25, 24, 8, SOUTH), false, "Nidoran M and Nidoran F, Lv15; Kelsey stops at (23, 8)"), - running(legs("west_of_nob_line", {{EAST, 2}}, "along row 8 to (26, 8)")), - into_line("nob_line", EAST, "onto (27, 8), above Nob"), - battle("hiker_nob", at(ROUTE25, 27, 8, EAST), false, "three Geodude and a Machop, Lv13"), - running(legs("below_haley_line", { - {EAST, 1}, {SOUTH, 1}, {EAST, 1}, {NORTH, 3}, {EAST, 5}, {SOUTH, 3}, {EAST, 8}, - }, "below Flint's column to (29, 9), up to (29, 6), east to (34, 6), down to (34, 9), east along row 9 past Chad's column to the water, (42, 9)")), - into_line("haley_line", NORTH, "onto (42, 8), at the end of Haley's line"), - battle("lass_haley", at(ROUTE25, 42, 8, NORTH), false, "Oddish, Pidgey and Oddish, Lv13; Haley stops at (42, 7)"), - running(route("sea_cottage", at(SEA_COTTAGE, 7, 8, NORTH), "east along row 8, up column 51 into the Sea Cottage (51, 4), a step in from its mat")), - }); -} - -// Bill's Sea Cottage (Route25_SeaCottage scripts.inc). Bill is the -// Clefairy at (10, 6) (FLAG_HELPED_BILL_IN_SEA_COTTAGE unset): talked to -// from (10, 7), below him, he asks "Help me out!" (YES/NO; NO goes on the -// same), says to run the Cell Separation on the PC, and walks up into -// the right teleporter (10, 3); with the player facing north he walks -// straight up. The PC (4, 5) answers only from the south, (4, 6). Its -// scene: the teleporters run, Bill comes out of the left one (3, 3) and -// walks to (7, 6) (BillWalkToMiddleOfRoom); the player isn't moved. -// Talked to from (6, 6), Bill gives the S.S. TICKET, no YES/NO, and goes -// on about the S.S. ANNE (FLAG_GOT_SS_TICKET, which also hides Nugget -// Bridge's Rocket). Out by the mat (7, 9); the door puts the player on -// (51, 5), facing south. The maps keep Bill at (7, 5), but after his -// scene he stands on (7, 6), in the way from (6, 6) to the mat (console -// B, 2026-11-03), so the walk out goes around him to (7, 8) first. -StoryCheckpoint bill(){ - return row("00.18", "Bill's Sea Cottage: the Cell Separator and the S.S. Ticket", at(SEA_COTTAGE, 7, 8, NORTH), after_brock(), StartMenu::FULL, { - running(route("below_bill_clefairy", at(SEA_COTTAGE, 10, 7, NORTH), "below the Clefairy (10, 6), facing it")), - talk("bill_clefairy", "\"Hiya! I'm a POKEMON... ...No I'm not!\" ... \"Help me out!\""), - answer("help_bill", true, "YES: \"run the Cell Separation on the PC\""), - scene("bill_into_teleporter", at(SEA_COTTAGE, 10, 7, NORTH), "the Clefairy walks up into the right teleporter"), - running(route("pc_front", at(SEA_COTTAGE, 4, 6, NORTH), "below the PC (4, 5), facing it")), - talk("cell_separator", "the PC: \" initiated the TELEPORTER's CELL SEPARATOR!\""), - scene("bill_comes_out", at(SEA_COTTAGE, 4, 6, NORTH), "the teleporters run; Bill comes out of the left one and walks to (7, 6)"), - running(legs("beside_bill", {{EAST, 2}}, "to (6, 6), west of Bill, facing him")), - talk("thank_bill", "\"Thanks, bud! ... take this\""), - scene("ss_ticket", at(SEA_COTTAGE, 6, 6, EAST), "the S.S. TICKET; \"... the S.S. ANNE ... go instead\""), - running(legs("around_bill", {{SOUTH, 2}, {EAST, 1}}, "to (7, 8), above the mat; Bill stands on (7, 6) after his scene")), - running(route("out_of_cottage", at(ROUTE25, 51, 5, SOUTH), "down to the mat and out; the door puts the player below it")), - }); -} - -// Back to Cerulean by Route 25's south path (Route25 map.json): from -// below the cottage down column 51 to row 12, west along row 12 and row -// 11 into Route 24 (x 14..23, row 11), and down its column 14..16 east -// of Nugget Bridge to Cerulean's north edge (x 26..28, offset 12). No -// trainer stands on it. Cerulean's row 1 there is a ledge (26..28, 1), -// hopped south from (27, 0); then on into the city to the Pokemon Center. -StoryCheckpoint back_to_cerulean(){ - return row("00.19", "Route 25's south path back to Cerulean's Pokemon Center", at(ROUTE25, 51, 5, SOUTH), after_brock(), StartMenu::FULL, { - running(route("above_cerulean_ledge", at(CERULEAN, 27, 0, SOUTH), "Route 25's south path west, Route 24 east of the bridge south, to above Cerulean's ledge (27, 1)")), - hop("cerulean_ledge_hop", SOUTH, at(CERULEAN, 27, 2, SOUTH), "down the ledge (27, 1)"), - running(route("cerulean_nurse", at(CERULEAN_CENTER, 7, 4, NORTH), "into the city to the Pokemon Center")), - heal("heal_cerulean"), - }); -} - -// Stopgap for console B's save, which caught nothing on Route 1. A new -// playthrough should instead catch a Rattata on Route 1 or 22 early, as -// its Cut user and spare member, and drop this row (and its walk over -// Nugget Bridge and back). -// -// An Oddish for HM01 Cut, and a second member behind the lead -// (docs/design/AutoStory-FRLG-FutureEvents.md, "Console B run choices"). -// Route 24's grass (Route24 map.json: x 3..5, rows 19..31, west of Nugget -// Bridge) is the nearest to the Center with Oddish: FireRed's -// sRoute24_FireRed (pokefirered wild_encounters.json) has it in 25% of -// battles, Lv12..14, as Route 25's grass; Routes 5 and 6 aren't on the -// story's maps yet. Up the bridge, whose trainers 00.16 beat, west along -// rows 10..15 to the cliff (3, 15) and down column 3 to the grass's first -// row, (3, 19); the step paces east to (4, 19) and back. Camper Shane -// (5, 21) faces north, sight 5, over (5, 16..20): column 5 is kept off. -// The leg west ends on the cliff, not open: on console B (m63) an open -// leg west to (4, 15) ended a tile short, and the walk down column 5 -// came into Shane's sight. -// -// First 7 Poke Balls at the Mart (row 1, 200 each; the bag isn't read, so -// the step buys them whatever the bag holds). The floor, from 00.15's -// 1500 less its 1400: the rival's 288 (4 x 18 x 4), the Rocket's 480 (4 -// x 15 x 8), Franklin's 540 and Nob's 468 (hikers, 9) alone make 1876 -// (pokefirered gTrainerMoneyTable). An Oddish at full HP (catch rate 255) -// stays in a Poke Ball about 1 time in 3 (Gen 3: a = 85, four shakes of -// 0.76), so 7 balls catch it about 94% of the time; the step throws 7 at -// most, in 30 battles (none an Oddish: 0.02%). Nothing weakens it: the HP -// bar isn't read on the console yet. -// -// The Oddish joins the party second. Battles keep the lead in -// (PokemonFRLG_AutoStoryBattleDecisions.h): the Oddish is sent only when -// the lead faints in a trainer's battle, which counts as lost. Back to -// the nurse, and the save in the Center. -StoryCheckpoint oddish(){ - const MartPlan balls{ - .map = CERULEAN_MART, - .lines = {{.item = "poke-ball", .quantity = 7}}, - .budget = 1400, - .money_floor = 1500, - }; - const CapturePlan catch_oddish{.species = "oddish", .catches = 1, .max_encounters = 30, .max_balls = 7, .pace = EAST}; - return row("00.20", "Route 24's grass: an Oddish for Cut, then the Center", at(CERULEAN_CENTER, 7, 4, NORTH), after_brock(), StartMenu::FULL, { - running(route("mart_clerk", at(CERULEAN_MART, 4, 3, WEST), "out of the Center to the Mart's clerk")), - mart_step("buy_poke_balls", "7 Poke Balls for the Oddish", balls), - running(route("oddish_patch", at(ROUTE24, 3, 19), "north over Nugget Bridge, west to the cliff and down column 3 onto the grass's first row, out of Shane's column 5")), - capture_step("catch_oddish", "wild battles until an Oddish, then Poke Balls; any other species is run from", catch_oddish), - running(route("cerulean_nurse", at(CERULEAN_CENTER, 7, 4, NORTH), "back over the bridge to the Center")), - heal("heal_cerulean"), - }); -} - -// Cerulean's only way south without Cut (CeruleanCity map.json, -// scripts.inc) is through the burgled house (30, 11), whose door the -// policeman leaves once the S.S. TICKET is had, out of the hole in its -// back wall into the yard (31, 8). The Rocket there (33, 6) stops the -// player on (33, 5) or (33, 7) (CeruleanCity_EventScript_GruntTrigger*): -// from (32, 7), the step east onto (33, 7) turns the player to him; -// Machop and Drowzee, Lv17, then TM28 Dig, and he is gone. Then east -// round the yard, down to the city's south edge by the path along its -// east side (39..40, 20..31), down Route 5's east side to the -// Underground Path's north house (31, 31), through its tunnel and out of -// the south house onto Route 6, below its door (19, 14). Route 6: -// - Bug Catcher Keigo (3, 16) faces east, sight 5, over the middle path -// (4..8, 16); Bug Catcher Elijah (20, 25) faces west, sight 3, over -// the east path (17..19, 25). The way goes down column 15, through the -// grass to the wall (15, 33), out of both lines; the open leg west to -// it, a tile short, leaves the player on column 16, out of them too. -// - Camper Ricky and Picnicker Nancy (12..13, 21) battle only when -// talked to. -// - Picnicker Isabelle (13, 32) and Camper Jeff (13, 33) face west, sight -// 3, over (10..12, 32) and (10..12, 33); the only way south, (10..12, -// 34), is from Jeff's row. Up to (15, 31), west to the wall (7, 31), -// down to the wall (7, 33), east: Jeff is fought on the step onto -// (10, 33) and walks up to (11, 33). Isabelle's row is kept off. -// Then down into Vermilion City (offset 12) to its Pokemon Center. -StoryCheckpoint to_vermilion(){ - return row("00.21", "The Cerulean Rocket, Route 5, the Underground Path and Route 6 to Vermilion's Pokemon Center: Jeff", at(CERULEAN_CENTER, 7, 4, NORTH), after_brock(), StartMenu::FULL, { - running(route("west_of_rocket", at(CERULEAN, 32, 7, EAST), "through the burgled house and out of the hole in its back wall, west of the Rocket (33, 6)")), - step_into("rocket_trigger", EAST, "onto (33, 7), below the Rocket"), - battle("rocket_grunt", at(CERULEAN, 33, 7, NORTH), false, "Machop and Drowzee, Lv17; TM28 Dig"), - running(route("route6_column15", at(ROUTE6, 15, 14), "round the yard and down Cerulean's east side, Route 5 into the Underground Path, through it onto Route 6, west to column 15")), - running(legs("round_keigo_and_elijah", { - {SOUTH, 19}, {NORTH, 1}, {NORTH, 1}, {WEST, 8}, {SOUTH, 2}, {EAST, 2}, - }, "down column 15 to the wall (15, 33); up to (15, 31), west to the wall (7, 31), down to the wall (7, 33), east to (9, 33)")), - into_line("jeff_line", EAST, "onto (10, 33), in Jeff's line"), - battle("camper_jeff", at(ROUTE6, 10, 33, EAST), false, "Spearow and Raticate, Lv16; Jeff stops at (11, 33)"), - running(route("vermilion_nurse", at(VERMILION_CENTER, 7, 4, NORTH), "down Route 6's south path into Vermilion City, to the Pokemon Center")), - heal("heal_vermilion"), - }); -} - -// The S.S. Anne (VermilionCity, SSAnne_* scripts.inc). The step onto -// (23, 33) (VermilionCity_EventScript_CheckTicket) has the sailor (24, 33) -// ask for a ticket; the S.S. TICKET (00.18) is shown and the player turns -// east to him. Then onto the pier (23, 34), along the gangway, through -// 1F, by legs off its cabins' doormats on row 10, which planned routes -// cross, and up its stairs (3, 8) to 2F. The step onto (30, 6), below the -// Captain's door (30, 2) (SSAnne_2F_Corridor_EventScript_RivalTriggerLeft), -// brings the rival out and down to (30, 5); the player keeps facing -// north, and after the battle he walks round the player and off. For a -// player who took Squirtle: Pidgeotto Lv19, Raticate Lv16, Kadabra Lv18, -// Ivysaur Lv20. The ship's trainers are in its cabins and on its deck, -// off the way. The Captain (5, 4) faces up; talked to from (5, 5) he is -// rubbed on the back and gives HM01 (VAR_MAP_SCENE_VERMILION_CITY 1). -// Back out through 1F's door (19, 1): on the gangway the ship sails -// (SSAnne_Exterior_ExitSSAnne), the player is put on (23, 34) and walked -// up to (23, 32) (VermilionCity_EventScript_ExitSSAnne). Cut is taught -// later, to the Oddish. -StoryCheckpoint ss_anne(){ - return row("00.22", "The S.S. Anne: the rival, HM01 Cut from the Captain, back to Vermilion's Pokemon Center", at(VERMILION_CENTER, 7, 4, NORTH), after_brock(), StartMenu::FULL, { - running(route("above_ticket_check", at(VERMILION, 23, 32, SOUTH), "out of the Center down to the harbor, above the ticket check (23, 33)")), - step_into("ticket_check", SOUTH, "onto (23, 33): \"Do you have a ticket?\""), - scene("show_ss_ticket", at(VERMILION, 23, 33, EAST), "the S.S. TICKET; the player turns to the sailor"), - running(route("aboard", at(SS_ANNE_1F, 19, 2, SOUTH), "onto the pier, along the gangway and in by 1F's door, a step below it")), - running(legs("past_the_cabins", {{SOUTH, 8}, {NORTH, 1}, {WEST, 6}, {NORTH, 1}}, "to the wall (19, 10), up a step, west to the worker (12, 9), up a step to (13, 8): off the cabins' mats on row 10")), - running(route("below_rival_trigger", at(SS_ANNE_2F, 30, 7, NORTH), "west along 1F, up the stairs (3, 8) and along 2F below the Captain's door")), - step_into("rival_trigger", NORTH, "onto (30, 6): the rival comes out of the Captain's door"), - battle("rival_ss_anne", at(SS_ANNE_2F, 30, 6, NORTH), false, "Pidgeotto, Raticate, Kadabra and Ivysaur"), - running(route("behind_captain", at(CAPTAINS_OFFICE, 5, 5, NORTH), "into the Captain's office, behind the Captain (5, 4)")), - talk("captain", "\"Ooargh... I feel hideous... Urrp! Seasick...\""), - scene("hm01_cut", at(CAPTAINS_OFFICE, 5, 5, NORTH), "the player rubs his back; HM01, and what Cut does"), - running(route("off_2f", at(SS_ANNE_1F, 13, 8), "back along 2F, down the stairs and east along 1F's row 8")), - running(legs("round_the_sailor", {{EAST, 4}, {SOUTH, 1}, {EAST, 2}}, "to the sailor (18, 8), down a step, east to (19, 9): off the cabins' mats on row 10")), - running(route("below_ship_door", at(SS_ANNE_1F, 19, 2, NORTH), "up below the door to the gangway")), - step_into("off_the_ship", NORTH, "out onto the gangway"), - scene("ss_anne_sails", at(VERMILION, 23, 32, NORTH), "the ship sails; the player is walked off the pier to (23, 32)"), - running(route("vermilion_nurse", at(VERMILION_CENTER, 7, 4, NORTH), "back to the Pokemon Center")), - heal("heal_vermilion"), - }); -} - -} // namespace - - - const std::vector& story_checkpoints(){ - static const std::vector checkpoints{ - new_game(), after_sid_helper(), leave_house(), oaks_trigger(), to_starter_ball(), starter(), parcel(), pokedex(), shopping(), forest(), brock(), - running_shoes(), route3(), magikarp_salesman(), after_gift_rng(), magikarp_to_box(), mt_moon(), - route4_to_cerulean(), cerulean_gym(), misty(), cerulean_grind(), cerulean_rival(), nugget_bridge(), - route25(), bill(), back_to_cerulean(), oddish(), to_vermilion(), ss_anne(), - vermilion_gym(), to_lt_surge(), lt_surge(), bike_voucher(), route10_center(), rock_tunnel(), lavender_center(), - }; + static const std::vector checkpoints = load_authored_story(); return checkpoints; } diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryTable.h b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryTable.h index 0e97ce995e..88dc3cea8c 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryTable.h +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryTable.h @@ -6,9 +6,15 @@ * 3 to the Magikarp salesman in Route 4's Pokemon Center, through Mt. * Moon to Route 4 east of it, and on to Cerulean City, Misty, its rival, * Nugget Bridge and Bill, then Route 6 to Vermilion City, the S.S. - * Anne's HM01 and Lt. Surge, as story checkpoints 00.01 to 00.25, each - * saved at its end. After 00.10 every route and leg runs. Taken from a by-hand run on - * console B (2026-11-01) and the pokefirered map scripts. + * Anne's HM01 and Lt. Surge, on to Rock Tunnel and Lavender Town, as + * story checkpoints 00.01 to 00.29, each saved at its end. After 00.10 + * every route and leg runs. Taken from a by-hand run on console B + * (2026-11-01) and the pokefirered map scripts. + * + * Each checkpoint is an authored plan, StoryData/frlg-.plan.json + * (00.05: frlg-parcel-00.05.plan.json), built into the program and + * loaded by load_authored_story() (Data/JsonParser.h). Its sections, the + * notes on how each step was planned and why, live there too. * */ @@ -24,8 +30,8 @@ namespace NintendoSwitch{ namespace PokemonFRLG{ -// Checkpoints 00.01 to 00.25, in order, with 00.01b, the way back in after -// SID Helper, after 00.01, 00.04 split in two at Squirtle's ball for +// Checkpoints 00.01 to 00.29, in order of id, as authored in StoryData, +// with 00.01b, the way back in after SID Helper, after 00.01, 00.04 split in two at Squirtle's ball for // Starter RNG: 00.04 and 00.04b, 00.12b, the way back in after Gift RNG, // after 00.12, 00.12c, the Magikarp put in BOX 1, after it, 00.14b and // 00.14c, Cerulean Gym to a save below Misty's platform and Misty alone diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryTableCeladon.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryTableCeladon.cpp deleted file mode 100644 index 6406c1e857..0000000000 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryTableCeladon.cpp +++ /dev/null @@ -1,165 +0,0 @@ -/* AutoStory Table: to Celadon - * - * From: https://github.com/PokemonAutomation/ - * - * Rows from 00.26 on, after the THUNDERBADGE: the BICYCLE, and the way - * east and south to Celadon City. - * - */ - -#include "PokemonFRLG_AutoStoryMart.h" -#include "PokemonFRLG_AutoStoryTableSteps.h" - -namespace PokemonAutomation{ -namespace NintendoSwitch{ -namespace PokemonFRLG{ -namespace StoryTable{ - - -// The BIKE VOUCHER and the BICYCLE, from Vermilion's Center to -// Cerulean's (pokeguy 43:50 to 45:00). -// - The Pokemon Fan Club (VermilionCity_PokemonFanClub map.json, -// scripts.inc), in by Vermilion's (12, 17): the chairman (5, 4) sits -// above a table (5..6, 5..6) with the worker (6, 4) east of him, so he -// is talked to from (4, 4), west of him. "Did you come to hear about -// my POKEMON?" YES: his story, then the BIKE VOUCHER -// (FLAG_GOT_BIKE_VOUCHER). Oak's aide stands on Vermilion's (25, 7) -// since Lt. Surge, where the story's maps don't have him: the way -// planned from the Center's door goes east along his row 7, so the -// walk goes down to the water (14, 10) first, as 00.25 came up from -// it. From the Fan Club, up to (22, 10) first, so that the way on to -// Route 6 goes up column 22, west of him, not round by column 27. -// - Route 6 north, the trainers as 00.21 left them: Jeff (13, 33) -// beaten, Isabelle (13, 32) and Elijah (20, 25) not. As in 00.24, onto -// Jeff's row, west to the wall (7, 33) and up to row 31, above -// Isabelle's line; then east along row 31 to the wall (17, 31) and up -// column 16, west of Elijah's line (17..19, 25) and east of Keigo's -// (4..8, 16), to the ledge (16, 11). The first three legs are 00.24's, -// walked on console B; the two after end on walls, which the walker -// holds again after a wild battle in the grass. -// - The Underground Path north, Route 5's sides, which have no trainer, -// and Cerulean's south edge, whose way into the city without the -// burgled house is the tree (26, 32) (pokeguy 44:42). -// - The Bike Shop (CeruleanCity_BikeShop), in by (13, 28): the clerk -// (9, 3) is across the counter (8, 3), talked to from (7, 3). With the -// voucher he gives the BICYCLE (FLAG_GOT_BICYCLE) with no YES/NO; it -// isn't registered or ridden yet. -// - The Mart: 5 Repels (row 9, 350 each) and 2 Escape Ropes (row 8, -// 550 each; pokefirered items.json), 2850 in all. Console B had about -// 9000 after Lt. Surge (2026-11-03); the floor of 6000 leaves 3000 or -// more after them. -// - The nurse, and the save in Cerulean's Center. -StoryCheckpoint bike_voucher(){ - const MartPlan repels{ - .map = CERULEAN_MART, - .lines = {{.item = "repel", .quantity = 5}, {.item = "escape-rope", .quantity = 2}}, - .budget = 2850, - .money_floor = 6000, - }; - return row("00.26", "The BIKE VOUCHER from the Fan Club, back north to Cerulean, the BICYCLE, Repels and Escape Ropes", at(VERMILION_CENTER, 7, 4, NORTH), after_brock(), StartMenu::FULL, { - running(route("below_center", at(VERMILION, 14, 10), "out of the Center, down to the water (14, 10): off Oak's aide's row 7")), - running(route("beside_chairman", at(FAN_CLUB, 4, 4, EAST), "east along row 10, down to the Fan Club's door (12, 17), in, and up its west side beside the chairman (5, 4)")), - talk("chairman", "\"I chair the POKEMON Fan Club!\" ... \"Did you come to hear about my POKEMON?\""), - answer("hear_story", true, "YES: his story"), - scene("bike_voucher", at(FAN_CLUB, 4, 4, EAST), "the story of his Rapidash; the BIKE VOUCHER"), - running(route("west_of_oaks_aide", at(VERMILION, 22, 10), "out of the Fan Club, east along row 18 and up column 22 to (22, 10)")), - running(route("route6_south_path", at(ROUTE6, 11, 34, NORTH), "up column 22 west of Oak's aide (25, 7), out of the city onto Route 6's path, below Jeff's row")), - running(legs("round_isabelle_and_elijah", {{NORTH, 1}, {WEST, 4}, {NORTH, 2}, {EAST, 9}, {NORTH, 19}}, "onto Jeff's row (11, 33), west to the wall (7, 33), up to (7, 31), east along row 31 to the wall (16, 31), up column 16 to the ledge (16, 12): out of Isabelle's and Elijah's lines")), - running(route("below_cerulean_tree", at(CERULEAN, 26, 33, NORTH), "the Underground Path north, up Route 5's side into Cerulean, below the tree (26, 32)")), - cut_tree("cut_cerulean_tree", at(CERULEAN, 26, 32, NORTH), "the tree; a step onto its tile"), - running(route("bike_clerk", at(BIKE_SHOP, 7, 3, EAST), "west into the Bike Shop (13, 28), across the counter from the clerk (9, 3)")), - talk("talk_bike_clerk", "\"Oh, that's... A BIKE VOUCHER!\""), - scene("bicycle", at(BIKE_SHOP, 7, 3, EAST), "the voucher exchanged for a BICYCLE"), - running(route("mart_clerk", at(CERULEAN_MART, 4, 3, WEST), "out of the Bike Shop to the Mart's clerk")), - mart_step("buy_repels", "5 Repels and 2 Escape Ropes, 2850 at most", repels), - running(route("cerulean_nurse", at(CERULEAN_CENTER, 7, 4, NORTH), "out of the Mart to the Center")), - heal("heal_cerulean"), - }); -} - -// East out of Cerulean over Route 9 to Route 10's Pokemon Center -// (pokeguy 45:12 to 47:27), on foot: the Bicycle isn't registered yet. -// - Cerulean (CeruleanCity map.json): the way east, column 39..40 up -// from row 33 to rows 18..19 and out of the city's east edge, is -// reached from the city only through the tree (26, 32), grown back -// since 00.26 (its flag is a FLAG_TEMP), or the burgled house. Cut -// from above. Route 9 joins the city's rows 18..19 by its rows 8..9 -// (offset -10); its tree (2, 8) (FLAG_TEMP_12) closes them, (2, 9) -// being rock: cut from (1, 8), west of it. -// - Route 9 (Route9 map.json, scripts.inc), its ledges all facing south. -// Of its nine trainers, three can't be walked around, as in pokeguy's -// run, where Jeremy happened to look away: -// - Picnicker Alicia (14, 10) faces west, sight 3, over (11..13, 10), -// the only tiles above the ledge row 11 the way west goes down by: -// fought on the step onto (11, 10); she walks up to (12, 10). Then -// down the ledge (11, 11). -// - Hiker Jeremy (20, 17) looks north and west (FACE_UP_AND_LEFT), -// sight 4: north over (20, 13..16), every way east of column 19 -// below the rocks of row 12. Fought on (20, 13), waiting for him to -// look north (TRAINER_WAIT_VARIANT); he walks up to (20, 14). -// - Bug Catcher Conner (49, 7) faces east, sight 3, over (50..52, 7): -// the way north from row 13 is column 52 alone (the ledges of row -// 11 face south), and row 7 is the way onto the ridge. Fought on the -// step onto (52, 7); he walks up to (51, 7). -// - Hiker Brice wanders row 2 (50..56), looking west and east, sight -// 1, over (49..57, 2), and the way up from the ledges of row 4 is -// (50..51, 4) below him. The leg up column 51 ends on row 3 if he -// stands at (51, 2), else it goes on to (51, 1) past him, and he may -// see the player there; either way the legs to walls after it meet -// on (48, 1): west to the rock (48, 3) or (48, 1), up to (48, 1). -// Row 1 is clear of his sight; east along it to the rock (64, 1) -// and down column 64 past the hidden Rare Candy (63, 2), not picked -// up. A held leg down to (64, 3) would hop the ledge (64, 4) and go -// on, so the last tile is one step, then the hop. -// - Picnicker Caitlin (60, 9) faces east over (61..64, 9): the way to -// Route 10 goes along row 8, above her line, by legs to (70, 8), a -// tile short of the edge. Camper Chris (26, 7), -// Bug Catcher Brent (26, 1), Camper Drew (36, 6) and Hiker Alan (61, -// 16) are off the way; TM40 (12, 17) is left. -// - Route 10 (Route10 map.json) joins Route 9's rows 8..10 by its own; -// its north part, down to the Center's door (13, 20), has no trainer -// on the way and its grass is walked round. The trees west of the -// door (10, 20..26) stay. The walk there ends its open legs where a -// tile of error can't reach a blocker, and finds its place again on -// walls (console B, 2026-11-09, two runs "no fade" at the door): the -// step onto Route 10 is not always held up, so the player may stand a -// tile further east, and the leg along row 11 holds to the wall -// (17, 11) instead of ending on (16, 11) by count. The 12 tiles down -// column 16 may end a tile short or long: from rows 22..29 a tile west -// and up to the Center's wall (15, 20) all end on (15, 21). West along -// row 21 to the wall (9, 21) ends on (10, 21), three west of the -// door's column: the only count no wall after it checks. -// - The nurse, and the save in Route 10's Center: the save card names -// ROUTE 10. -StoryCheckpoint route10_center(){ - return row("00.27", "East over Route 9 to Route 10's Pokemon Center: the two trees, Alicia, Jeremy and Conner", at(CERULEAN_CENTER, 7, 4, NORTH), after_brock(), StartMenu::FULL, { - running(route("above_cerulean_tree", at(CERULEAN, 26, 31, SOUTH), "out of the Center, south through the city to above the tree (26, 32), grown back")), - cut_tree("cut_cerulean_tree", at(CERULEAN, 26, 32, SOUTH), "the tree; a step onto its tile"), - running(route("west_of_route9_tree", at(ROUTE9, 1, 8, EAST), "down to row 33, east and up column 39 or 40 to row 18, east out of the city onto Route 9, west of its tree (2, 8)")), - cut_tree("cut_route9_tree", at(ROUTE9, 2, 8, EAST), "Route 9's tree; a step onto its tile"), - running(route("above_alicia_line", at(ROUTE9, 11, 9, SOUTH), "east to (11, 9), above the west end of Alicia's line")), - into_line("alicia_line", SOUTH, "onto (11, 10), in Alicia's line: she walks up to (12, 10)"), - battle("picnicker_alicia", at(ROUTE9, 11, 10, EAST), false, "Oddish, Bellsprout, Oddish and Bellsprout, Lv18"), - hop("alicia_ledge_hop", SOUTH, at(ROUTE9, 11, 12, SOUTH), "down the ledge (11, 11)"), - running(route("west_of_jeremy_sight", at(ROUTE9, 19, 13, EAST), "down to row 13 and east along it to (19, 13), west of Jeremy's north line")), - into_sight("jeremy_sight", EAST, "onto (20, 13), four above Jeremy (20, 17): when he looks north he walks up to (20, 14)"), - battle("hiker_jeremy", at(ROUTE9, 20, 13, SOUTH), false, "Machop and Onix, Lv20"), - running(route("below_conner_line", at(ROUTE9, 52, 8, NORTH), "east along row 13 and up column 52 to (52, 8), below the east end of Conner's line")), - into_line("conner_line", NORTH, "onto (52, 7), the end of Conner's line: he walks up to (51, 7)"), - battle("bug_catcher_conner", at(ROUTE9, 52, 7, WEST), false, "Caterpie, Weedle and Venonat, Lv20"), - running(legs("round_brice", {{NORTH, 2}, {WEST, 1}, {NORTH, 2}, {WEST, 3}, {NORTH, 2}, {EAST, 16}, {SOUTH, 1}}, "up to the ledge (52, 4), up column 51 to Brice's row, west to the rock (48, 3) (or (48, 1)), up to (48, 1), east along row 1 to the rock (64, 1), down to (64, 2)")), - step_onto("above_east_ledge", SOUTH, at(ROUTE9, 64, 3, SOUTH), "onto (64, 3), above the ledge (64, 4)"), - hop("east_ledge_hop", SOUTH, at(ROUTE9, 64, 5, SOUTH), "down the ledge (64, 4)"), - running(legs("above_caitlin_line", {{SOUTH, 3}, {EAST, 6}}, "down column 64 to row 8, east along it to (70, 8): above Caitlin's line (61..64, 9)")), - running(route("route10_ledge_end", at(ROUTE10, 17, 11, EAST), "east onto Route 10, down to row 11 west of the grass and east along it to the wall (17, 11), above the fence post (17, 12)")), - running(legs("below_center_door", {{WEST, 1}, {SOUTH, 12}, {WEST, 1}, {NORTH, 2}, {WEST, 5}, {EAST, 3}}, "into the ledge's gap (16, 11), down column 16 to row 23, a tile west, up to the Center's wall (15, 21), west along row 21 to the wall (10, 21), east to (13, 21), below the door")), - running(route("route10_nurse", at(ROUTE10_CENTER, 7, 4, NORTH), "up onto the Center's door (13, 20), to the nurse")), - heal("heal_route10"), - }); -} - - -} // namespace StoryTable -} // namespace PokemonFRLG -} // namespace NintendoSwitch -} // namespace PokemonAutomation diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryTableLavender.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryTableLavender.cpp deleted file mode 100644 index 9ba3bf882d..0000000000 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryTableLavender.cpp +++ /dev/null @@ -1,134 +0,0 @@ -/* AutoStory Table: to Lavender Town - * - * From: https://github.com/PokemonAutomation/ - * - * Rows from 00.28 on: through Rock Tunnel, without Flash, and down Route - * 10 to Lavender Town's Pokemon Center. - * - */ - -#include "PokemonFRLG_AutoStoryTableSteps.h" - -namespace PokemonAutomation{ -namespace NintendoSwitch{ -namespace PokemonFRLG{ -namespace StoryTable{ - - -// From Route 10's Pokemon Center through Rock Tunnel (pokefirered -// RockTunnel_1F, RockTunnel_B1F map.json and scripts.inc) to Route 10 -// south of it. The save is on Route 10 by the tunnel's south mouth: the -// save card's places don't include Rock Tunnel. -// - The tunnel's north mouth (8, 19) is reached from the Center through -// the tree (10, 20), cut from below; Heidi (9, 27) sees rows 28..29 -// below the trees and is left. Two single steps west then put the -// player below the mouth on (8, 20). -// - Every floor tile of the tunnel has wild encounters, which are run -// from (the table has no step that uses a Repel), so the legs end on -// walls, ladders or someone standing still, which the walker holds -// again after a battle. An open leg (two tiles or more, not to a wall) -// is followed only by legs a tile of error in it can't send astray. -// - Nine trainers stand where the way can't go round them. The others -// (1F Lucas, Oliver, Ariana, Leah; B1F Eric, Steve) are walked round. -// - 1F Ashton (27, 10) looks west over (24..26, 10), the only way south -// from the mouth's room: stepped into from (24, 9). -// - B1F Winston (29, 35) looks south over the south passage (29, -// 36..38): stepped into from (32, 37), after the leg down column 33 -// to the wall and a tile back. -// - B1F Martha (15, 33) looks east over (16..17, 33), the corridor -// north: stepped into from (17, 34), the wall east of row 34. -// - B1F Allen (36, 11) looks south over (36, 12..14), the way west to -// the ladder (33, 3): stepped into from (38, 12), below the wall. -// - 1F Lenny (7, 5) looks south over (7, 6..9), the way east from the -// ladder (4, 2): stepped into from (6, 9), the end of column 6. -// The way on to the ladder (20, 13) keeps west of Lucas's line (16..19, -// 17): down column 11, up column 14 to row 16. -// - B1F Sofia (11, 15) looks south over (11, 16..19), the way west: -// stepped into along row 16 from (12..14, 16). -// - B1F Dudley (5, 11) looks south over (5, 12..15): stepped into from -// (8, 15) along row 15. -// - B1F Cooper (2, 6) looks around (sight 2) by the ladder (2, 3): the -// leg up column 1 to the wall (1, 2) passes him on (1, 6); if he -// looks west, story_interrupts() fights him and the leg is held on -// to its wall, as Mt. Moon's Grunt in 00.13. -// - 1F Dana (26, 28) looks south over (26, 29..31), the only way west -// to the south mouth: stepped into along row 31 from (27..29, 31). -// - Unverified on the console: Rock Tunnel is dark without Flash, and -// the overworld, fade, dialog and battle detectors haven't been -// measured under its darkness (~/FRLGLab/notes/2026-11-09-0028-dark- -// measure.md). Every step from rock_tunnel_1f to route10_south depends -// on them. -StoryCheckpoint rock_tunnel(){ - return row("00.28", "Through Rock Tunnel: Ashton, Winston, Martha, Allen, Lenny, Sofia, Dudley, Cooper and Dana", at(ROUTE10_CENTER, 7, 4, NORTH), after_brock(), StartMenu::FULL, { - running(route("below_route10_tree", at(ROUTE10, 10, 21, NORTH), "out of the Center (13, 20), west along row 21 to the wall (9, 21), below the tree (10, 20)")), - cut_tree("cut_route10_tree", at(ROUTE10, 10, 20, NORTH), "the tree; a step onto its tile"), - step_onto("west_of_tree", WEST, at(ROUTE10, 9, 20, WEST), "a step west along row 20"), - step_onto("below_rock_tunnel", WEST, at(ROUTE10, 8, 20, WEST), "a step west, below the mouth (8, 19)"), - running(route("rock_tunnel_1f", at(ROCK_TUNNEL_1F, 17, 2, NORTH), "north into Rock Tunnel")), - running(legs("above_ashton_line", {{SOUTH, 6}, {EAST, 8}, {SOUTH, 1}, {WEST, 1}}, "down column 17 to the wall (17, 8), east along row 8 to (25, 8), onto row 9 and west to the wall (24, 9)")), - into_line("ashton_line", SOUTH, "onto (24, 10), in Ashton's line: he walks up to (25, 10)"), - battle("pokemaniac_ashton", at(ROCK_TUNNEL_1F, 24, 10, EAST), false, "Slowpoke, Slowpoke and Slowpoke"), - running(route("b1f_south_ladder", at(ROCK_TUNNEL_B1F, 38, 28, NORTH), "east along row 12 and up column 45 to the ladder (45, 2), down to B1F")), - running(legs("winston_line_end", {{WEST, 5}, {SOUTH, 10}, {NORTH, 1}, {WEST, 1}}, "west to the wall (33, 28), down column 33 to the wall (33, 38), up to (33, 37) and west to (32, 37)")), - into_line("winston_line", WEST, "along row 37 onto (29, 37), the end of Winston's line: he walks down to (29, 36)"), - battle("pokemaniac_winston", at(ROCK_TUNNEL_B1F, 29, 37, NORTH), false, "Slowpoke and Slowpoke"), - // The corner (11, 35), wall north and rock west, finds the player - // from any of (11..14, 35) after a battle; east to the wall (19, - // 35) did not (console B, 2026-11-09 13:35: found 5 tiles off). - running(legs("below_martha_line", {{WEST, 16}, {NORTH, 2}, {WEST, 2}, {EAST, 5}}, "west along row 37 to (13, 37), up to the wall (13, 35), west to the corner (11, 35), east to (16, 35)")), - into_line("martha_line", NORTH, "up column 16 onto (16, 33), beside Martha; from (17, 35), a tile short, up column 17 onto (17, 33), the end of her line"), - battle("picnicker_martha", at(ROCK_TUNNEL_B1F, 16, 33, WEST), false, "Oddish and Bulbasaur"), - running(legs("below_allen_line", {{EAST, 1}, {NORTH, 5}, {EAST, 12}, {NORTH, 9}, {EAST, 11}, {NORTH, 2}, {WEST, 2}, {NORTH, 5}}, "east to the wall (17, 33), up column 17 to the wall (17, 28), east to the wall (29, 28), up column 29 past Steve's line to the wall (29, 19), east to (40, 19), up to row 17, west to the wall (38, 17) and up to the wall (38, 12)")), - into_line("allen_line", WEST, "along row 12 onto (36, 12), below Allen"), - battle("hiker_allen", at(ROCK_TUNNEL_B1F, 36, 12, NORTH), false, "Geodude, Geodude and Graveler"), - running(legs("west_of_b1f_ladder", {{WEST, 4}, {NORTH, 10}}, "west along row 12 to the wall (32, 12), up column 32 to the wall (32, 2)")), - running(route("1f_west_ladder", at(ROCK_TUNNEL_1F, 4, 2, NORTH), "onto the ladder (33, 3), up to 1F")), - running(legs("above_lenny_line", {{EAST, 2}, {SOUTH, 7}}, "east to the wall (6, 2), down column 6 to the wall (6, 9)")), - into_line("lenny_line", EAST, "onto (7, 9), the end of Lenny's line: he walks down to (7, 8)"), - battle("hiker_lenny", at(ROCK_TUNNEL_1F, 7, 9, NORTH), false, "Machop and Onix"), - running(legs("west_of_lucas_line", {{EAST, 4}, {SOUTH, 15}, {EAST, 7}, {WEST, 4}, {NORTH, 8}, {EAST, 6}}, "east to the wall (11, 9), down column 11 to the wall (11, 24), east to the wall (18, 24), west to (14, 24), up column 14 to the wall (14, 16), east to the wall (20, 16)")), - running(route("b1f_middle_ladder", at(ROCK_TUNNEL_B1F, 27, 12, NORTH), "up column 20 onto the ladder (20, 13), down to B1F")), - running(legs("east_of_sofia_line", {{SOUTH, 3}, {WEST, 12}, {SOUTH, 1}, {WEST, 2}}, "down to the wall (27, 15), west along row 15 to the wall (15, 15), down to row 16 and west to (13, 16)")), - into_line("sofia_line", WEST, "along row 16 onto (11, 16), below Sofia"), - battle("picnicker_sofia", at(ROCK_TUNNEL_B1F, 11, 16, NORTH), false, "Pidgey, Pidgey and Pidgeotto"), - running(legs("east_of_dudley_line", {{WEST, 3}, {NORTH, 1}}, "west to the wall (8, 16), up to (8, 15)")), - into_line("dudley_line", WEST, "along row 15 onto (5, 15), the end of Dudley's line: he walks down to (5, 14)"), - battle("hiker_dudley", at(ROCK_TUNNEL_B1F, 5, 15, NORTH), false, "Geodude, Geodude and Graveler"), - running(legs("past_cooper", {{WEST, 4}, {NORTH, 13}, {SOUTH, 1}}, "west to the wall (1, 15), up column 1 past Cooper (2, 6) to the wall (1, 2), back to (1, 3)")), - running(route("1f_east_ladder", at(ROCK_TUNNEL_1F, 45, 21, NORTH), "east onto the ladder (2, 3), up to 1F")), - running(legs("above_dana_line", { - {WEST, 6}, {SOUTH, 5}, {EAST, 6}, {WEST, 1}, {SOUTH, 4}, {WEST, 5}, {SOUTH, 5}, - {WEST, 2}, {NORTH, 3}, {WEST, 6}, {NORTH, 3}, {WEST, 3}, {SOUTH, 2}, - }, "west to the wall (39, 21), down column 39 to Ariana (39, 27), east to the wall (45, 26), down column 44 to the wall (44, 30), west to the wall (39, 30), down to the wall (39, 35), west to (37, 35), up to the wall (37, 32), west to the wall (31, 32), up to (31, 29), west to (28, 29) and down to the wall (28, 31)")), - into_line("dana_line", WEST, "along row 31 onto (26, 31), the end of Dana's line: she walks down to (26, 30)"), - battle("picnicker_dana", at(ROCK_TUNNEL_1F, 26, 31, NORTH), false, "Meowth, Oddish and Pidgey"), - running(legs("above_south_mouth", {{WEST, 6}, {SOUTH, 1}, {WEST, 8}, {SOUTH, 5}, {EAST, 2}, {NORTH, 1}, {EAST, 5}, {WEST, 1}}, "west along row 31 to (20, 31), onto row 32 and west to the wall (12, 32), down column 12 to the wall (12, 37), east to the wall (14, 37), up to (14, 36), east to the wall (19, 36), back to (18, 36)")), - running(route("route10_south", at(ROUTE10, 8, 58, SOUTH), "onto the mouth (18, 37), out onto Route 10")), - }); -} - -// Route 10 south of Rock Tunnel (Route10 map.json) to Lavender Town's -// Pokemon Center. It has no grass. Carol (7, 60) and Clark (4, 62) look -// around, Trent (4, 68) looks west and Herman wanders row 70 (13..17), -// looking west and east (sight 2, to x 19): the way keeps to the east -// side, columns 17..21, and crosses row 70 on column 21. The ledges of -// row 62 leave a gap at (18, 62); row 66's leaves (21, 66). Row 74's -// ledge (11, 74) is hopped, and the hold south goes on over the -// connection into Lavender Town to the wall (11, 9). West of the -// Center's building, the wall (8, 9) sets the door's column. -StoryCheckpoint lavender_center(){ - return row("00.29", "Route 10 south to Lavender Town's Pokemon Center", at(ROUTE10, 8, 58, SOUTH), after_brock(), StartMenu::FULL, { - running(legs("route10_east_side", {{EAST, 10}, {NORTH, 2}, {WEST, 1}, {EAST, 1}, {SOUTH, 8}, {EAST, 3}, {SOUTH, 9}, {WEST, 10}}, "east along row 58 to (18, 58), up to the wall (18, 56), west to the wall (17, 56), back to (18, 56), down through the ledges' gap to (18, 64), east to the wall (21, 64), down column 21 to the wall (21, 73), west along row 73 to the wall (11, 73)")), - hop("route10_ledge_hop", SOUTH, at(ROUTE10, 11, 75, SOUTH), "down the ledge (11, 74)"), - running(route("lavender_north_wall", at(LAVENDER, 11, 8, SOUTH), "down column 11 over the connection into Lavender Town, to the wall (11, 9)")), - running(legs("below_center_door", {{WEST, 6}, {SOUTH, 1}, {EAST, 2}, {WEST, 1}}, "west along row 8 to (5, 8), onto row 9, east to the wall (7, 9), west to (6, 9)")), - running(route("lavender_nurse", at(LAVENDER_CENTER, 7, 4, NORTH), "up column 6 onto the Center's door (6, 5), to the nurse")), - heal("heal_lavender"), - }); -} - - -} // namespace StoryTable -} // namespace PokemonFRLG -} // namespace NintendoSwitch -} // namespace PokemonAutomation diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryTableSteps.h b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryTableSteps.h index d0a314a2ac..53ce8fcaf4 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryTableSteps.h +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryTableSteps.h @@ -184,24 +184,6 @@ StoryStep options_step(); StoryStep cut_tree(std::string name, Pokemon::Pose tree, std::string why); -// Rows in files of their own (PokemonFRLG_AutoStoryTableVermilionGym.cpp, -// PokemonFRLG_AutoStoryTableCeladon.cpp). -StoryCheckpoint vermilion_gym(); -// Route navigation step towards Lt. Surge battle. -StoryCheckpoint to_lt_surge(); -// Lt. Surge gym leader battle checkpoint. -StoryCheckpoint lt_surge(); -// Bike Voucher retrieval checkpoint in Vermilion City Fan Club. -StoryCheckpoint bike_voucher(); -// Route 10 Pokemon Center navigation checkpoint. -StoryCheckpoint route10_center(); -// Through Rock Tunnel to Route 10 south of it (PokemonFRLG_AutoStoryTableLavender.cpp). -StoryCheckpoint rock_tunnel(); -// Route 10 south to Lavender Town's Pokemon Center. -StoryCheckpoint lavender_center(); - - - } // namespace StoryTable } // namespace PokemonFRLG } // namespace NintendoSwitch diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryTableVermilionGym.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryTableVermilionGym.cpp deleted file mode 100644 index 6c8f3d653f..0000000000 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryTableVermilionGym.cpp +++ /dev/null @@ -1,158 +0,0 @@ -/* AutoStory Table: Vermilion Gym - * - * From: https://github.com/PokemonAutomation/ - * - * Rows 00.23 to 00.25: HM01 Cut to the Oddish, the tree before Vermilion - * Gym, its three trainers and its trash cans, then Lt. Surge from a save - * in front of him. - * - * The gym (VermilionCity_Gym map.json, scripts.inc), 11 x 20, entered on - * (5, 19): the cans on rows 10, 12 and 14 at x 1, 3, 5, 7, 9 - * (PokemonFRLG_AutoStoryTrashCans.h), the beams across rows 6 and 7 that - * the two switches turn off, Lt. Surge (5, 2) facing down above them. Its - * trainers, sight 3: - * - Sailor Dwayne (8, 13) and Engineer Baily (2, 11) look around - * (MOVEMENT_TYPE_LOOK_AROUND): between them they see across rows 11 and - * 13 and down columns 2 and 8, so no way from the door to the cans - * keeps out of their sight. Each is fought from the second tile of his - * line, stepped onto from beside it, out of sight, and waited on there - * until he turns to the player (TRAINER_WAIT_VARIANT): Dwayne from - * (8, 15), stepped onto from (7, 15), Baily from (2, 13), from (3, 13). - * Each walks up a tile, Dwayne to (8, 14), Baily to (2, 12), and stays - * there while the player is in the gym. - * - Gentleman Tucker (7, 8) faces west over (4..6, 8): fought on the step - * up from (5, 9) onto (5, 8); he walks up to (6, 8). - * The cans' stands, on rows 9, 11 and 13 above each, are clear of where - * the three stand after their battles. Leaving the gym puts them back - * where the map has them, beaten, and grows the tree back. - * - */ - -#include "PokemonFRLG_AutoStoryBattleData.h" -#include "PokemonFRLG_AutoStoryGrind.h" -#include "PokemonFRLG_AutoStoryTableSteps.h" -#include "PokemonFRLG_AutoStoryTeach.h" -#include "PokemonFRLG_AutoStoryTrashCans.h" - -namespace PokemonAutomation{ -namespace NintendoSwitch{ -namespace PokemonFRLG{ -namespace StoryTable{ - - -namespace{ - -// The search for the switches (PokemonFRLG_AutoStoryTrashCans.h). It -// ends at the last can's stand, which the step's Outcome says. -StoryStep trash_cans(std::string name, std::string why){ - StoryStep step = make(StoryStepKind::GAME, std::move(name), std::move(why)); - step.variant = TRASH_CANS_VARIANT; - return step; -} - -// `step`, skipped when the run flag `flag` is set. -StoryStep unless(const char* flag, StoryStep step){ - step.skip_if.emplace_back(flag); - return step; -} - -} // namespace - - -// HM01 Cut, from the S.S. Anne (00.22), to the Oddish (00.20), second in -// the party: a wild Oddish of Lv12 to 14 knows 2 or 3 moves (Absorb, -// Sweet Scent, Poison Powder at 14), so it has room. TM28 Dig, from the -// Cerulean Rocket (00.21), to the lead in place of Withdraw: Ground, twice -// as strong on Lt. Surge's three, it takes the sim's chance against him -// for a Lv28 Wartortle with 14 Potions from 6% to 47%. Vermilion's tree -// (19, 24) (EventScript_CutTree) is the only way into the gym's yard, -// row 24 being walls but for it; the gym's door is (14, 25). In the gym, -// the trainers as above, then the trash cans until the door opens; out, -// the tree cut again from below, and back to the nurse. -StoryCheckpoint vermilion_gym(){ - const TeachPlan cut{.item = "hm01", .move = "cut", .member = 1}; - const TeachPlan dig{.item = "tm28", .move = "dig", .member = 0, .forget_move = "withdraw"}; - return row("00.23", "Vermilion Gym: Cut and Dig, the tree, Dwayne, Baily and Tucker, the trash cans", at(VERMILION_CENTER, 7, 4, NORTH), after_brock(), StartMenu::FULL, { - teach_step("teach_cut", "HM01 Cut to the Oddish, second in the party, unless it knows it", cut), - teach_step("teach_dig", "TM28 Dig in place of Withdraw, for Lt. Surge, unless the lead knows it or there is no TM28", dig), - running(route("above_gym_tree", at(VERMILION, 19, 23, SOUTH), "out of the Center, south through the city to above the tree (19, 24)")), - cut_tree("cut_gym_tree", at(VERMILION, 19, 24, SOUTH), "the Oddish cuts the tree; a step onto its tile"), - running(route("gym_door", at(VERMILION_GYM, 5, 19, NORTH), "down into the yard and in by the gym's door (14, 25)")), - running(legs("west_of_dwayne_line", {{NORTH, 4}, {EAST, 2}}, "up column 5 to the can (5, 14), east to (7, 15): out of Dwayne's and Baily's sight")), - into_sight("dwayne_sight", EAST, "onto (8, 15), two below Dwayne (8, 13): he turns to the player and walks up to (8, 14)"), - battle("sailor_dwayne", at(VERMILION_GYM, 8, 15, NORTH), false, "two Pikachu, Lv21"), - running(legs("east_of_baily_line", {{WEST, 4}, {NORTH, 2}, {WEST, 1}}, "west along row 15 to (4, 15), up to (4, 13), west to (3, 13): out of Baily's sight")), - into_sight("baily_sight", WEST, "onto (2, 13), two below Baily (2, 11): he turns to the player and walks up to (2, 12)"), - battle("engineer_baily", at(VERMILION_GYM, 2, 13, NORTH), false, "Voltorb and Magnemite, Lv21"), - running(legs("below_tucker_line", {{EAST, 2}, {NORTH, 4}, {EAST, 1}}, "east to (4, 13), up column 4 past Baily's row to (4, 9), east to (5, 9): below Tucker's line, not on it")), - into_line("tucker_line", NORTH, "onto (5, 8), in Tucker's line: he walks up to (6, 8)"), - battle("gentleman_tucker", at(VERMILION_GYM, 5, 8, EAST), false, "Pikachu, Lv23"), - trash_cans("trash_cans", "the cans until both locks open; a wrong second can resets them"), - running(route("below_gym_tree", at(VERMILION, 19, 25, NORTH), "out of the gym, east to below the tree, grown back")), - cut_tree("cut_tree_out", at(VERMILION, 19, 24, NORTH), "the tree again; a step onto its tile"), - running(route("vermilion_nurse", at(VERMILION_CENTER, 7, 4, NORTH), "north through the city to the Pokemon Center")), - heal("heal_vermilion"), - }); -} - -// Wild battles on Route 6 until the sim beats Lt. Surge half the time: -// with Dig, 47% at Lv28 and 51% at Lv29, so a lead the gym's trainers -// have brought to Lv29 passes at once, and a Lv28 one after a level. The grass nearest the city is Route 6's -// south patch (13..16, 30..33); Picnicker Isabelle (13, 32) faces west -// over (10..12, 32), on the way north from the city, so the walk goes -// along Jeff's row 33 (he is beaten) to the wall (7, 33), up to row 31 -// and east along it onto the patch's west edge, (13, 31), above -// Isabelle, out of her line. Back to the nurse the same way. -// All that is skipped when the lead, read in the Center, passes already. -// Then the tree, the gym, whose trainers stand where the map has them, -// beaten, and whose beams stay off (FLAG_FOUND_BOTH_VERMILION_GYM_SWITCHES): -// up column 5 to below Lt. Surge, and saved there. -StoryCheckpoint to_lt_surge(){ - constexpr const char* SURGE_WINNABLE = "surge_winnable"; - const GrindPlan for_surge{ - .member = 0, .level = 32, .max_encounters = 150, .pace = EAST, .heal_every = 0, - .trainer = std::string(story_trainer(VERMILION_GYM, "lt_surge").value_or("")), .min_chance = MIN_WIN_CHANCE, - }; - return row("00.24", "Route 6's grass until Lt. Surge is winnable, then through the open beams to him", at(VERMILION_CENTER, 7, 4, NORTH), after_brock(), StartMenu::FULL, { - grind_check_step(SURGE_WINNABLE, "the lead as it is: if the sim beats Lt. Surge 50% or more already, no trip to Route 6", for_surge), - unless(SURGE_WINNABLE, running(route("route6_south_path", at(ROUTE6, 11, 34, NORTH), "out of the Center, north out of the city onto Route 6's path, below Jeff's row"))), - unless(SURGE_WINNABLE, running(legs("round_isabelle_line", {{NORTH, 1}, {WEST, 4}, {NORTH, 2}, {EAST, 5}, {EAST, 1}}, "onto Jeff's row (11, 33), west to the wall (7, 33), up to (7, 31), east along row 31 to (12, 31) and a step onto the grass, (13, 31): out of Isabelle's line"))), - unless(SURGE_WINNABLE, grind_step("grind_for_surge", "wild battles until the sim beats Lt. Surge 50% or more, Lv32 at most; the nurse when hurt or low on PP", for_surge, at(VERMILION_CENTER, 7, 4, NORTH))), - unless(SURGE_WINNABLE, running(route("west_on_row_31", at(ROUTE6, 7, 31), "west along row 31, out of the grass, to the wall (7, 31)"))), - unless(SURGE_WINNABLE, running(legs("down_to_jeff_row", {{SOUTH, 2}, {EAST, 4}}, "down to the wall (7, 33), east along Jeff's row to (11, 33): out of Isabelle's line"))), - unless(SURGE_WINNABLE, running(route("vermilion_nurse", at(VERMILION_CENTER, 7, 4, NORTH), "south into the city to the Pokemon Center"))), - unless(SURGE_WINNABLE, heal("heal_vermilion")), - running(route("above_gym_tree", at(VERMILION, 19, 23, SOUTH), "out of the Center, south through the city to above the tree (19, 24)")), - cut_tree("cut_gym_tree", at(VERMILION, 19, 24, SOUTH), "the tree; a step onto its tile"), - running(route("below_lt_surge", at(VERMILION_GYM, 5, 3, NORTH), "into the gym, up round the cans and through the beams, off, to below Surge (5, 2)")), - }); -} - -// Lt. Surge (5, 2), talked to from below, from the save in front of him: -// Voltorb Lv21, Pikachu Lv18 and Raichu Lv24, Shock Wave and Thunder -// Wave, a Super Potion and a Full Heal (sParty_LeaderLtSurge); then the -// THUNDERBADGE and TM34, read to the overworld with the battle's text. -// Out, the tree, and the nurse. Surge's win also puts Oak's aide on -// Vermilion City's (25, 7) (VermilionCity_Gym_EventScript_ShowOaksAide), -// where he stays until talked to; the story's maps don't have him. The -// way to the nurse along row 7 runs into him (console B, 2026-11-03: the -// leg west stopped beside him and the step into the Center's door went -// into a house), so it goes along row 10 to the water instead, clear of -// him, and up column 14 from there. -StoryCheckpoint lt_surge(){ - return row("00.25", "Vermilion Gym: Lt. Surge, the THUNDERBADGE, then the Center", at(VERMILION_GYM, 5, 3, NORTH), after_brock(), StartMenu::FULL, { - talk("challenge_lt_surge", "\"Hey, kid! What do you think you're doing here?\""), - battle("lt_surge", at(VERMILION_GYM, 5, 3, NORTH), false, "Voltorb, Pikachu and Raichu; THUNDERBADGE and TM34"), - running(route("below_gym_tree", at(VERMILION, 19, 25, NORTH), "down through the beams, out of the gym, east to below the tree, grown back")), - cut_tree("cut_tree_out", at(VERMILION, 19, 24, NORTH), "the tree; a step onto its tile"), - running(route("below_oaks_aide", at(VERMILION, 14, 10), "north through the city and west along row 10 to the water, (14, 10): off Oak's aide's row 7")), - running(route("vermilion_nurse", at(VERMILION_CENTER, 7, 4, NORTH), "up to the Pokemon Center")), - heal("heal_vermilion"), - }); -} - - -} // namespace StoryTable -} // namespace PokemonFRLG -} // namespace NintendoSwitch -} // namespace PokemonAutomation diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/README.md b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/README.md index 55a5b23722..ae63e57e6c 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/README.md +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/README.md @@ -1,4 +1,15 @@ -# FRLG authored checkpoint pilot +# FRLG authored checkpoints + +Every story checkpoint is an authored plan here, one file per checkpoint: `frlg-.plan.json`, and `frlg-parcel-00.05.plan.json` for 00.05. `story_checkpoints()` is `load_authored_story()`: every embedded `*.plan` file, in order of id. There are no C++ row definitions; the files were exported once from the C++ table, and `ReplayData/frlg-story-sim-trace.json` keeps the whole story's sim trace from before that (`PokemonFRLG::AutoStory - Authored` tests it). + +- A checkpoint has `sections: [{id, title, notes?, events}]`, or plain `events` (one unnamed section, as 00.05 keeps so its bytes stay those PokemonSimulation pins). Events are numbered across the sections, and an event's log line names its section: `[Event] 00.28/12 [b1f_east] winston_line: start`. +- `notes` (a list of paragraphs) on the checkpoint, a section or an event hold what the C++ table's comments said: the maps, trainers, numbers and console runs a step was planned from. No executor reads them. +- `variant` says how FRLG does a step: `run` on a route or legs, `trainer_line`/`trainer_wait` on a step, and on a `game_action` the step's plan as its parser reads it (`mart ...`, `teach ...`, `grind ...`, `grind_check ...`, `capture ...`, `pc ...`, `fossil ...`, `level ...`, or `cut_tree`, `trash_cans`, `close_trainer_card`, `leave_gift_summary`). An unknown variant is rejected at load. +- `once_per_save` marks a step done once per save (a TEACH, a Mart). +- `execution` holds FRLG's fields: `menu`, and when not a new game's, `supplies` (`potions`, `antidotes`, `parlyz_heals`, `lead: "after_brock"`), `live_start` and `handoff` (`sid_helper`, `starter_rng`, `gift_rng`). +- Unknown fields anywhere are rejected. + +## The Parcel pilot `frlg-parcel-00.05.plan.json` is the production definition of checkpoint `00.05`. The story table loads it with `load_authored_checkpoint()`: there is no second C++ Parcel event list. Its `pokesim-authored-checkpoint/1` contract contains the common checkpoint plus FRLG executor configuration (`execution.menu`). It has no export revision, bookkeeping snapshot, or claimed observation. diff --git a/SerialPrograms/cmake/SourceFiles.cmake b/SerialPrograms/cmake/SourceFiles.cmake index 697a9e8f60..bb3b4cf855 100644 --- a/SerialPrograms/cmake/SourceFiles.cmake +++ b/SerialPrograms/cmake/SourceFiles.cmake @@ -1975,11 +1975,8 @@ file(GLOB LIBRARY_SOURCES Source/VideoGames/PokemonFRLG/Programs/AutoStory/Data/Json_Tests.h Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryTable.cpp Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryTable.h - Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryTableCeladon.cpp - Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryTableLavender.cpp Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryTableSteps.cpp Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryTableSteps.h - Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryTableVermilionGym.cpp Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryTeach.cpp Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryTeach.h Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryTeach_Tests.cpp From 3dcf3e8a231fce9935de5c60729272fa5347f52e Mon Sep 17 00:00:00 2001 From: dayfine Date: Mon, 9 Nov 2026 18:30:04 -0800 Subject: [PATCH 13/79] FRLG AutoStory: code health for the authored story tests Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss --- .../AutoStory/Data/AuthoredStory_Tests.cpp | 34 ++++++++++++++----- .../AutoStory/PokemonFRLG_AutoStoryEvents.cpp | 2 -- 2 files changed, 26 insertions(+), 10 deletions(-) diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/Data/AuthoredStory_Tests.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/Data/AuthoredStory_Tests.cpp index 8bc8b352a9..35cb1317c6 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/Data/AuthoredStory_Tests.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/Data/AuthoredStory_Tests.cpp @@ -230,33 +230,51 @@ UnitTestResult test_trace_golden(){ return true; } -struct AuthoredCase{ +struct AuthoredInput{ std::string name; UnitTestResult (*body)(); }; +struct AuthoredExpectation{ + std::string description; +}; + +struct AuthoredTestCase{ + AuthoredInput input; + AuthoredExpectation expectation; +}; + +const AuthoredTestCase AUTHORED_CASES[] = { + {.input = {.name = "the story sim's trace is the golden one", .body = test_trace_golden}, + .expectation = {.description = "the trace the C++ rows gave"}}, + {.input = {.name = "malformed plans are rejected", .body = test_rejects}, + .expectation = {.description = "a ParseException for each change"}}, + {.input = {.name = "Rock Tunnel's sections", .body = test_rock_tunnel_sections}, + .expectation = {.description = "00.28 split by area, sections in its log lines"}}, +}; + class AuthoredTest : public UnitTest{ public: - explicit AuthoredTest(AuthoredCase test) - : UnitTest("PokemonFRLG::AutoStory - Authored: " + test.name), m_test(std::move(test)){} + explicit AuthoredTest(AuthoredTestCase test) + : UnitTest("PokemonFRLG::AutoStory - Authored: " + test.input.name), m_test(std::move(test)){} virtual UnitTestResult run(Logger&, CancellableScope&) const override{ try{ - return m_test.body(); + return m_test.input.body(); }catch (Exception& e){ return std::string(e.name()) + ": " + e.message(); } } private: - AuthoredCase m_test; + AuthoredTestCase m_test; }; } // namespace void add_tests_AuthoredStory(UnitTestDatabase& database){ - database.add(AuthoredCase{"the story sim's trace is the golden one", test_trace_golden}); - database.add(AuthoredCase{"malformed plans are rejected", test_rejects}); - database.add(AuthoredCase{"Rock Tunnel's sections", test_rock_tunnel_sections}); + for (const AuthoredTestCase& test : AUTHORED_CASES){ + database.add(test); + } } diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryEvents.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryEvents.cpp index 97e0addd98..df858d3c49 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryEvents.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryEvents.cpp @@ -826,8 +826,6 @@ StoryCheckpoint joined_rows(const StoryCheckpoint& first, const StoryCheckpoint& row.live_start = first.live_start; row.steps = first.steps; row.steps.insert(row.steps.end(), second.steps.begin(), second.steps.end()); - row.notes = first.notes; - row.notes.insert(row.notes.end(), second.notes.begin(), second.notes.end()); row.sections = first.sections; row.sections.insert(row.sections.end(), second.sections.begin(), second.sections.end()); return row; From 2162103e5ce48e26a2b4f30ee84ffee932d655bd Mon Sep 17 00:00:00 2001 From: dayfine Date: Mon, 9 Nov 2026 19:35:06 -0800 Subject: [PATCH 14/79] FRLG AutoStory 00.30: Lavender Town to Celadon City as an authored plan From Lavender's Center: the Mart's Escape Ropes and Super Repels, Route 8 on the Bicycle with only Gamer Rich fought, the Underground Path, a Pidgey from Route 7's grass, and Celadon's Pokemon Center. The plan loader accepts the bike, Center, item and hideout variants from the merged drafts; the sim stubs a Center's way in when the Center has no map, and the fault sweep ends a row there. Route 7 and Route 8 get their land rates in the sweep; the story sim trace golden gains 00.30. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss --- .../Menus/PokemonFRLG_SaveCardReader.cpp | 1 + .../Overworld/PokemonFRLG_OverworldMaps.cpp | 1 + .../AutoStory/Data/AuthoredStory_Tests.cpp | 2 +- .../Programs/AutoStory/Data/JsonParser.cpp | 8 +- .../AutoStory/PokemonFRLG_AutoStoryEvents.cpp | 1 + .../PokemonFRLG_AutoStoryFaultSweep_Tests.cpp | 28 ++- .../PokemonFRLG_AutoStoryLavender_Tests.cpp | 49 ++++- .../AutoStory/PokemonFRLG_AutoStoryRowSim.cpp | 22 +- .../ReplayData/frlg-story-sim-trace.json | 117 +++++++++- .../Programs/AutoStory/StoryData/README.md | 2 +- .../AutoStory/StoryData/frlg-00.30.plan.json | 207 ++++++++++++++++++ 11 files changed, 421 insertions(+), 17 deletions(-) create mode 100644 SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.30.plan.json diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Inference/Menus/PokemonFRLG_SaveCardReader.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Inference/Menus/PokemonFRLG_SaveCardReader.cpp index 995ae469e7..6401dd7cc9 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Inference/Menus/PokemonFRLG_SaveCardReader.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Inference/Menus/PokemonFRLG_SaveCardReader.cpp @@ -76,6 +76,7 @@ class PlaceNameMatcher : public OCR::SmallDictionaryMatcher{ {"route-10", "Route 10"}, {"lavender-town", "Lavender Town"}, {"vermilion-city", "Vermilion City"}, + {"celadon-city", "Celadon City"}, }){ JsonArray names; names.push_back(name); diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldMaps.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldMaps.cpp index 4d83c0db45..69ac64c188 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldMaps.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldMaps.cpp @@ -83,6 +83,7 @@ const char* const MAP_NAMES[] = { "RockTunnel_B1F", "LavenderTown", "LavenderTown_PokemonCenter_1F", + "LavenderTown_Mart", // West from Lavender: Route 8, the Underground Path under Saffron and // Route 7 to Celadon City. "Route8", diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/Data/AuthoredStory_Tests.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/Data/AuthoredStory_Tests.cpp index 35cb1317c6..9cba930d66 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/Data/AuthoredStory_Tests.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/Data/AuthoredStory_Tests.cpp @@ -120,7 +120,7 @@ void unknown_event_field(JsonObject& root){ first_event(root)["speed"] = "fast"; } void unknown_variant(JsonObject& root){ - first_event(root)["variant"] = "bike"; + first_event(root)["variant"] = "skate"; } void unknown_game_action(JsonObject& root){ JsonObject& event = first_event(root); diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/Data/JsonParser.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/Data/JsonParser.cpp index e84e3eaa07..159da5b8b8 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/Data/JsonParser.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/Data/JsonParser.cpp @@ -15,10 +15,13 @@ #include "VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryCapture.h" #include "VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryChoice.h" #include "VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryGrind.h" +#include "VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryHideout.h" +#include "VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryItemUse.h" #include "VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryMart.h" #include "VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryMember.h" #include "VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryParty.h" #include "VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryPcStorage.h" +#include "VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRooms.h" #include "VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryTeach.h" #include "VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryTrashCans.h" #include "LegacyJsonFormat.h" @@ -224,7 +227,8 @@ bool known_game_variant(const std::string& variant){ } return parse_capture_variant(variant) || parse_pc_variant(variant) || parse_mart_variant(variant) || parse_teach_variant(variant) || parse_grind_variant(variant) || parse_grind_check_variant(variant) - || parse_fossil_variant(variant) || parse_level_variant(variant); + || parse_fossil_variant(variant) || parse_level_variant(variant) + || is_center_variant(variant) || is_item_use_variant(variant) || is_hideout_variant(variant); } // Whether FRLG does `step`'s kind the way its variant names. @@ -232,7 +236,7 @@ bool known_variant(const StoryStep& step){ switch (step.kind){ case StoryStepKind::ROUTE: case StoryStepKind::LEGS: - return step.variant.empty() || step.variant == RUN_VARIANT; + return step.variant.empty() || step.variant == RUN_VARIANT || step.variant == BIKE_VARIANT; case StoryStepKind::STEP: return step.variant.empty() || step.variant == TRAINER_LINE_VARIANT || step.variant == TRAINER_WAIT_VARIANT; case StoryStepKind::GAME: diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryEvents.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryEvents.cpp index 259f3beb3b..a992e5e73d 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryEvents.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryEvents.cpp @@ -393,6 +393,7 @@ std::string save_card_place(const std::string& map){ {"VermilionCity", "vermilion-city"}, {"Route10", "route-10"}, {"LavenderTown", "lavender-town"}, + {"CeladonCity", "celadon-city"}, }; for (const auto& [prefix, place] : PLACES){ if (map == prefix || map.rfind(prefix + "_", 0) == 0){ diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryFaultSweep_Tests.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryFaultSweep_Tests.cpp index bd2a0112bb..61a208d570 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryFaultSweep_Tests.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryFaultSweep_Tests.cpp @@ -98,7 +98,7 @@ const std::map KNOWN_FAILING{ // on every tile (WILD_FLOOR_MAPS). const std::map STORY_ENCOUNTER_RATES{ {"Route1", 21}, {"Route2", 21}, {"Route3", 21}, {"Route4", 21}, {"Route5", 21}, {"Route6", 21}, - {"Route9", 21}, {"Route10", 21}, {"Route11", 21}, {"Route22", 21}, {"Route24", 21}, {"Route25", 21}, + {"Route7", 21}, {"Route8", 21}, {"Route9", 21}, {"Route10", 21}, {"Route11", 21}, {"Route22", 21}, {"Route24", 21}, {"Route25", 21}, {"ViridianForest", 14}, {"MtMoon_1F", 7}, {"MtMoon_B1F", 5}, {"MtMoon_B2F", 7}, {"RockTunnel_1F", 7}, {"RockTunnel_B1F", 7}, }; @@ -161,6 +161,19 @@ struct RowRun{ // Where a stubbed step leaves the player instead of its pose_after: by step index. using Landings = std::map; +// Whether `map` is one of sweep_maps(). +bool map_loaded(const std::string& map){ + const std::vector& maps = sweep_maps(); + return std::any_of(maps.begin(), maps.end(), [&](const MapData& data){ return data.name == map; }); +} + +// Whether a step of `row` after its step `c` walks. +bool walks_after(const StoryCheckpoint& row, size_t c){ + return std::any_of(row.steps.begin() + c + 1, row.steps.end(), [](const StoryStep& next){ + return next.kind == StoryStepKind::ROUTE || next.kind == StoryStepKind::LEGS || next.kind == StoryStepKind::STEP; + }); +} + // Whether `failure` is a script the sim does not have: a scene's trigger // stepped onto (no trainer sees the player there) or a leader's battle // after a talk (no trainer's message up). @@ -180,6 +193,7 @@ RowRun run_row( const std::optional>& scripted = std::nullopt ){ RowRun out; + std::optional off_maps; StoryPose at = *story_pose(*row.start); auto sim = std::make_unique(sweep_maps(), MapPosition{at.map, at.tile}, at.facing.value_or(Direction::SOUTH), script); const auto add = [&out](const SimState& state){ @@ -204,6 +218,12 @@ RowRun run_row( at = *story_pose(*step.pose_after); const auto landing = landings.find(c); const MapPosition land{at.map, landing == landings.end() ? at.tile : landing->second}; + if (!map_loaded(land.map)){ + // A room with no map (Celadon's Pokemon Center) must end the row. + off_maps = land; + out.failure = walks_after(row, c) ? std::format("{}/{}: ends on {}, which has no map, with a walk after it.", row.id, step.name, land.map) : ""; + break; + } if (!(sim->state().position == land)){ add(sim->state()); sim = std::make_unique(sweep_maps(), land, at.facing.value_or(sim->state().facing), script); @@ -212,7 +232,7 @@ RowRun run_row( if (out.failure.empty() && !sim->state().violations.empty()){ out.failure = "a violation on the way: " + sim->state().violations.back(); } - out.end = sim->state().position; + out.end = off_maps.value_or(sim->state().position); add(sim->state()); return out; } @@ -282,9 +302,7 @@ UnitTestResult sweep_scene_end_pose(Logger& logger, const StoryCheckpoint& row, // ends where our walk did: not the game's end pose. const auto from = clean.before.find(c); // With no walk after it, nothing in the row goes on from the pose. - const bool walk_after = std::any_of(row.steps.begin() + c + 1, row.steps.end(), [](const StoryStep& next){ - return next.kind == StoryStepKind::ROUTE || next.kind == StoryStepKind::LEGS || next.kind == StoryStepKind::STEP; - }); + const bool walk_after = walks_after(row, c); if (sim_plays(step) || !walk_after || !after || (from != clean.before.end() && from->second == MapPosition{after->map, after->tile})){ continue; } diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryLavender_Tests.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryLavender_Tests.cpp index 28a8a12bb1..e8ca30c53c 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryLavender_Tests.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryLavender_Tests.cpp @@ -4,7 +4,8 @@ * * Rows from 00.28 on (PokemonFRLG_AutoStoryTableLavender.cpp) on the * overworld sim: 00.28 from Route 10's Pokemon Center through Rock Tunnel - * to its south mouth, and 00.29 down Route 10 to Lavender Town's Center. + * to its south mouth, 00.29 down Route 10 to Lavender Town's Center, and + * 00.30 west over Route 8 and under Saffron to Celadon City. * Each row whole, each open leg a tile short or long, and a wild battle * on every open leg in the tunnel. * @@ -572,6 +573,49 @@ UnitTestResult test_save_places(Logger&){ return true; } +// 00.30 on the sim: the Mart, Route 8 with only Rich fought (the walker +// keeps out of the other trainers' lines), the Underground Path, the +// Pidgey's grass and Celadon City, below its Center's door. The Center +// has no map: its way in is stubbed. +UnitTestResult test_celadon_way_row(Logger&){ + return row_on_sim("00.30", SimScript{}, {{"old_man_1"}}, MapPosition{"CeladonCity", {48, 12}}); +} + +// 00.30's walk into Route 7's grass with a wild battle on each of its +// two grass steps in turn (Route 7's land rate is 21): it still ends on +// the Pidgey's tile. +UnitTestResult test_route7_grass_battles(Logger&){ + const StoryCheckpoint& row = checkpoint("00.30"); + const size_t index = step_index(row, "pidgey_grass"); + const MapPosition end{"Route7", {14, 5}}; + for (int grass_step = 1; grass_step <= 2; grass_step++){ + SimScript script; + script.encounters.push_back(SimEncounter{.grass_step = grass_step}); + StoryPose at{"Route7", {7, 15}, Direction::SOUTH}; + OverworldSim sim(maps_after_route10(), MapPosition{at.map, at.tile}, *at.facing, script); + const std::string failure = row_step_on_sim(sim, at, row.steps[index], row.id); + if (!failure.empty()){ + return std::format("A battle on grass step {}: {}", grass_step, failure); + } + if (!(sim.state().position == end)){ + return std::format("A battle on grass step {}: ended on {}, not {}.", grass_step, to_string(sim.state().position), to_string(end)); + } + if (sim.state().wild_battles != 1){ + return std::format("A battle on grass step {}: {} wild battles, not 1.", grass_step, sim.state().wild_battles); + } + } + return true; +} + +// 00.30 saves in Celadon City's Pokemon Center: CELADON CITY on the save +// card. +UnitTestResult test_celadon_save_place(Logger&){ + if (save_card_place("CeladonCity_PokemonCenter_1F") != "celadon-city"){ + return "Wrong save card place for Celadon City's Pokemon Center."; + } + return true; +} + } // namespace @@ -590,6 +634,9 @@ const AutoStoryLavenderCase AUTO_STORY_LAVENDER_CASES[] = { {.input = {"00.29 Route 10 south, the ledge, Lavender Town's Pokemon Center", test_lavender_row}, .expectation = {}}, {.input = {"00.29 a tile off after each open leg", test_lavender_tile_off}, .expectation = {}}, {.input = {"00.28 and 00.29 save on Route 10 and in Lavender Town", test_save_places}, .expectation = {}}, + {.input = {"00.30 Lavender's Mart, Route 8 past Rich alone, the Underground Path, Route 7 to Celadon City", test_celadon_way_row}, .expectation = {}}, + {.input = {"00.30 a wild battle on each grass step into Route 7's grass", test_route7_grass_battles}, .expectation = {}}, + {.input = {"00.30 saves in Celadon City's Pokemon Center", test_celadon_save_place}, .expectation = {}}, }; void add_tests_AutoStoryLavender(UnitTestDatabase& database){ diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRowSim.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRowSim.cpp index 089904ef6a..273822e571 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRowSim.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRowSim.cpp @@ -15,6 +15,7 @@ #include "Pokemon/AutoStory/Pokemon_TilePose.h" #include "PokemonFRLG_AutoStoryActions.h" #include "PokemonFRLG_AutoStoryBattleDecisions.h" +#include "VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldMaps.h" #include "VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldWalk.h" #include "PokemonFRLG_AutoStoryHideout.h" #include "PokemonFRLG_AutoStoryRooms.h" @@ -545,9 +546,26 @@ void sim_walk_room_legs(OverworldSim& sim, const std::vector& legs){ } // namespace +namespace{ + +// Whether the sim can walk a Pokemon Center's way in or out of `step`: +// the map it ends on is built into the program. Celadon's Center has no +// map yet (00.30), so its way in is stubbed. +bool center_walkable(const StoryStep& step){ + if (!is_center_variant(step.variant)){ + return false; + } + const std::optional after = step.pose_after ? story_pose(*step.pose_after) : std::nullopt; + const std::vector>& maps = overworld_map_json(); + return after && std::any_of(maps.begin(), maps.end(), [&](const auto& map){ return map.first == after->map; }); +} + +} // namespace + // A scripted GAME step on the sim: the poster's switch, the lift's ride // (its room coded, SimScript::lift_floors, rows as on the panel), or a -// Pokemon Center's way in or out; any other GAME step is stubbed. +// Pokemon Center's way in or out (center_walkable()); any other GAME step +// is stubbed. Pokemon::StoryAction OverworldStepSim::hideout_or_stub(){ Pokemon::StoryAction stub = m_stubs.stub(); Pokemon::StoryAction sim = played([this](RunState&, const StoryStep& step){ @@ -555,7 +573,7 @@ Pokemon::StoryAction OverworldStepSim::hideout_or_stub(){ return failure.empty() ? Pokemon::outcome_ok() : Pokemon::outcome_failed("sim_failure", failure); }); sim.act = [stub, played_act = sim.act](RunState& state, const StoryStep& step){ - return is_hideout_variant(step.variant) || is_center_variant(step.variant) + return is_hideout_variant(step.variant) || center_walkable(step) ? played_act(state, step) : stub.act(state, step); }; diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/ReplayData/frlg-story-sim-trace.json b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/ReplayData/frlg-story-sim-trace.json index 282d79e0f5..13fc534f8b 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/ReplayData/frlg-story-sim-trace.json +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/ReplayData/frlg-story-sim-trace.json @@ -1,7 +1,7 @@ { - "about": "story_sim_trace() of the FRLG story table (Data/AuthoredStory_Tests.h), taken from the C++ rows before they moved to StoryData.", + "about": "story_sim_trace() of the FRLG story table (Data/AuthoredStory_Tests.h), taken from the C++ rows before they moved to StoryData; from 00.30 on, from their plans.", "trace": [ - "[Segment] 00: start, 33 checkpoints", + "[Segment] 00: start, 34 checkpoints", "begin 00.01", "[Checkpoint] 00.01: start, 2 events", "[Event] 00.01/1 intro: start", @@ -1200,9 +1200,116 @@ "save at LavenderTown_PokemonCenter_1F (7, 4) facing north (tile)", "[Checkpoint] 00.29: done, 7 run, 0 skipped", "[Checkpoint] 00.29: passed on attempt 1 (one-shot)", - "[Segment] 00: 33 of 33 checkpoints one-shot", - "[Segment] 00: done, 33 checkpoints", + "begin 00.30", + "[Checkpoint] 00.30: start, 23 events", + "[Event] 00.30/1 from_save: start", + "[Event] 00.30/1 from_save: done", + "[Event] 00.30/2 east_of_mart_door: start", + "00.30/east_of_mart_door: ok at LavenderTown (21, 16) facing east (tile)", + "[Event] 00.30/2 east_of_mart_door: done", + "[Event] 00.30/3 into_lavender_mart: start", + "00.30/into_lavender_mart: ok at LavenderTown_Mart (4, 2) facing north (tile)", + "[Event] 00.30/3 into_lavender_mart: done", + "[Event] 00.30/4 lavender_mart_clerk: start", + "00.30/lavender_mart_clerk: ok at LavenderTown_Mart (4, 3) facing west (tile)", + "[Event] 00.30/4 lavender_mart_clerk: done", + "[Event] 00.30/5 buy_ropes_and_super_repels: start", + "00.30/buy_ropes_and_super_repels: ok at LavenderTown_Mart (4, 3) facing west (tile)", + "[Event] 00.30/5 buy_ropes_and_super_repels: done", + "[Event] 00.30/6 out_of_lavender_mart: start", + "00.30/out_of_lavender_mart: ok at LavenderTown (20, 16) facing south (tile)", + "[Event] 00.30/6 out_of_lavender_mart: done", + "[Event] 00.30/7 ride_bike: start", + "00.30/ride_bike: ok at LavenderTown (20, 16) facing south (tile)", + "[Event] 00.30/7 ride_bike: done", + "[Event] 00.30/8 lavender_west_edge: start", + "00.30/lavender_west_edge: ok at LavenderTown (1, 10) facing south (tile)", + "[Event] 00.30/8 lavender_west_edge: done", + "[Event] 00.30/9 route8_east_wall: start", + "00.30/route8_east_wall: ok at Route8 (62, 10) facing west (tile)", + "[Event] 00.30/9 route8_east_wall: done", + "[Event] 00.30/10 east_of_rich_line: start", + "00.30/east_of_rich_line: ok at Route8 (57, 18) facing west (tile)", + "[Event] 00.30/10 east_of_rich_line: done", + "[Event] 00.30/11 rich_line: start", + "00.30/rich_line: ok at Route8 (55, 18) facing west (tile)", + "[Event] 00.30/11 rich_line: done", + "[Event] 00.30/12 gamer_rich: start", + "00.30/gamer_rich: ok at -", + "[Event] 00.30/12 gamer_rich: done", + "[Event] 00.30/13 west_of_glenn_column: start", + "00.30/west_of_glenn_column: ok at Route8 (48, 7) facing north (tile)", + "[Event] 00.30/13 west_of_glenn_column: done", + "[Event] 00.30/14 east_of_megan_column: start", + "00.30/east_of_megan_column: ok at Route8 (30, 13) facing south (tile)", + "[Event] 00.30/14 east_of_megan_column: done", + "[Event] 00.30/15 east_of_aidan_column: start", + "00.30/east_of_aidan_column: ok at Route8 (14, 13) facing north (tile)", + "[Event] 00.30/15 east_of_aidan_column: done", + "[Event] 00.30/16 east_of_underground_door: start", + "00.30/east_of_underground_door: ok at Route8 (14, 5) facing north (tile)", + "[Event] 00.30/16 east_of_underground_door: done", + "[Event] 00.30/17 below_underground_door: start", + "00.30/below_underground_door: ok at Route8 (13, 5) facing north (tile)", + "[Event] 00.30/17 below_underground_door: done", + "[Event] 00.30/18 route7_underground_exit: start", + "00.30/route7_underground_exit: ok at Route7 (7, 15) facing south (tile)", + "[Event] 00.30/18 route7_underground_exit: done", + "[Event] 00.30/19 pidgey_grass: start", + "00.30/pidgey_grass: ok at Route7 (14, 5) facing east (tile)", + "[Event] 00.30/19 pidgey_grass: done", + "[Event] 00.30/20 catch_pidgey: start", + "00.30/catch_pidgey: ok at Route7 (14, 5) (15, 5) (set)", + "[Event] 00.30/20 catch_pidgey: done", + "[Event] 00.30/21 celadon_below_center: start", + "00.30/celadon_below_center: ok at CeladonCity (48, 12) facing north (tile)", + "[Event] 00.30/21 celadon_below_center: done", + "[Event] 00.30/22 celadon_nurse: start", + "00.30/celadon_nurse: ok at CeladonCity (48, 12) facing north (tile)", + "[Event] 00.30/22 celadon_nurse: done", + "[Event] 00.30/23 heal_celadon: start", + "00.30/heal_celadon: ok at -", + "[Event] 00.30/23 heal_celadon: done", + "save at CeladonCity_PokemonCenter_1F (7, 4) facing north (tile)", + "[Checkpoint] 00.30: done, 23 run, 0 skipped", + "[Checkpoint] 00.30: passed on attempt 1 (one-shot)", + "[Segment] 00: 34 of 34 checkpoints one-shot", + "[Segment] 00: done, 34 checkpoints", "completed", - "00.01: 2 stubbed: intro, options\n00.02: 0 stubbed\n00.03: 1 stubbed: to_the_lab\n00.04: 5 stubbed: squirtle_ball, choose_squirtle, no_nickname, rival_takes_bulbasaur, rival_battle\n00.05: 1 stubbed: parcel_from_clerk\n00.06: 2 stubbed: give_parcel, pokedex_scene\n00.07: 2 stubbed: heal_viridian, old_man_tutorial\n00.08: 1 stubbed: heal_pewter\n00.09: 3 stubbed: camper_liam, challenge_brock, brock\n00.10: 1 stubbed: shoes_from_aide\n00.11: 4 stubbed: heal_pewter, bug_catcher_colton, bug_catcher_greg, bug_catcher_james\n00.12: 1 stubbed: heal_route4\n00.12c: 1 stubbed: magikarp_to_box\n00.13: 6 stubbed: heal_route4, moon_stone_ball, found_moon_stone, rocket_grunt, super_nerd_miguel, helix_fossil\n00.14: 2 stubbed: teach_mega_kick, heal_cerulean\n00.14b: 3 stubbed: buy_potions, grind_to_lv23, heal_cerulean\n00.14c: 4 stubbed: challenge_misty, misty, heal_cerulean, teach_water_pulse\n00.15: 4 stubbed: teach_water_pulse, buy_potions, grind_for_rival, heal_cerulean\n00.15b: 2 stubbed: teach_water_pulse, rival_cerulean\n00.16: 7 stubbed: heal_cerulean, bug_catcher_cale, lass_ali, youngster_timmy, lass_reli, camper_ethan, rocket_grunt\n00.17: 4 stubbed: hiker_franklin, picnicker_kelsey, hiker_nob, lass_haley\n00.18: 7 stubbed: bill_clefairy, help_bill, bill_into_teleporter, cell_separator, bill_comes_out, thank_bill, ss_ticket\n00.19: 1 stubbed: heal_cerulean\n00.20: 3 stubbed: buy_poke_balls, catch_oddish, heal_cerulean\n00.21: 3 stubbed: rocket_grunt, camper_jeff, heal_vermilion\n00.22: 6 stubbed: show_ss_ticket, rival_ss_anne, captain, hm01_cut, ss_anne_sails, heal_vermilion\n00.23: 9 stubbed: teach_cut, teach_dig, cut_gym_tree, sailor_dwayne, engineer_baily, gentleman_tucker, trash_cans, cut_tree_out, heal_vermilion\n00.24: 4 stubbed: surge_winnable, grind_for_surge, heal_vermilion, cut_gym_tree\n00.25: 4 stubbed: challenge_lt_surge, lt_surge, cut_tree_out, heal_vermilion\n00.26: 8 stubbed: chairman, hear_story, bike_voucher, cut_cerulean_tree, talk_bike_clerk, bicycle, buy_repels, heal_cerulean\n00.27: 6 stubbed: cut_cerulean_tree, cut_route9_tree, picnicker_alicia, hiker_jeremy, bug_catcher_conner, heal_route10\n00.28: 9 stubbed: cut_route10_tree, pokemaniac_ashton, pokemaniac_winston, picnicker_martha, hiker_allen, hiker_lenny, picnicker_sofia, hiker_dudley, picnicker_dana\n00.29: 1 stubbed: heal_lavender\n" + "00.01: 2 stubbed: intro, options", + "00.02: 0 stubbed", + "00.03: 1 stubbed: to_the_lab", + "00.04: 5 stubbed: squirtle_ball, choose_squirtle, no_nickname, rival_takes_bulbasaur, rival_battle", + "00.05: 1 stubbed: parcel_from_clerk", + "00.06: 2 stubbed: give_parcel, pokedex_scene", + "00.07: 2 stubbed: heal_viridian, old_man_tutorial", + "00.08: 1 stubbed: heal_pewter", + "00.09: 3 stubbed: camper_liam, challenge_brock, brock", + "00.10: 1 stubbed: shoes_from_aide", + "00.11: 4 stubbed: heal_pewter, bug_catcher_colton, bug_catcher_greg, bug_catcher_james", + "00.12: 1 stubbed: heal_route4", + "00.12c: 1 stubbed: magikarp_to_box", + "00.13: 6 stubbed: heal_route4, moon_stone_ball, found_moon_stone, rocket_grunt, super_nerd_miguel, helix_fossil", + "00.14: 2 stubbed: teach_mega_kick, heal_cerulean", + "00.14b: 3 stubbed: buy_potions, grind_to_lv23, heal_cerulean", + "00.14c: 4 stubbed: challenge_misty, misty, heal_cerulean, teach_water_pulse", + "00.15: 4 stubbed: teach_water_pulse, buy_potions, grind_for_rival, heal_cerulean", + "00.15b: 2 stubbed: teach_water_pulse, rival_cerulean", + "00.16: 7 stubbed: heal_cerulean, bug_catcher_cale, lass_ali, youngster_timmy, lass_reli, camper_ethan, rocket_grunt", + "00.17: 4 stubbed: hiker_franklin, picnicker_kelsey, hiker_nob, lass_haley", + "00.18: 7 stubbed: bill_clefairy, help_bill, bill_into_teleporter, cell_separator, bill_comes_out, thank_bill, ss_ticket", + "00.19: 1 stubbed: heal_cerulean", + "00.20: 3 stubbed: buy_poke_balls, catch_oddish, heal_cerulean", + "00.21: 3 stubbed: rocket_grunt, camper_jeff, heal_vermilion", + "00.22: 6 stubbed: show_ss_ticket, rival_ss_anne, captain, hm01_cut, ss_anne_sails, heal_vermilion", + "00.23: 9 stubbed: teach_cut, teach_dig, cut_gym_tree, sailor_dwayne, engineer_baily, gentleman_tucker, trash_cans, cut_tree_out, heal_vermilion", + "00.24: 4 stubbed: surge_winnable, grind_for_surge, heal_vermilion, cut_gym_tree", + "00.25: 4 stubbed: challenge_lt_surge, lt_surge, cut_tree_out, heal_vermilion", + "00.26: 8 stubbed: chairman, hear_story, bike_voucher, cut_cerulean_tree, talk_bike_clerk, bicycle, buy_repels, heal_cerulean", + "00.27: 6 stubbed: cut_cerulean_tree, cut_route9_tree, picnicker_alicia, hiker_jeremy, bug_catcher_conner, heal_route10", + "00.28: 9 stubbed: cut_route10_tree, pokemaniac_ashton, pokemaniac_winston, picnicker_martha, hiker_allen, hiker_lenny, picnicker_sofia, hiker_dudley, picnicker_dana", + "00.29: 1 stubbed: heal_lavender", + "00.30: 6 stubbed: buy_ropes_and_super_repels, ride_bike, gamer_rich, catch_pidgey, celadon_nurse, heal_celadon", + "" ] } diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/README.md b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/README.md index ae63e57e6c..6802726fb5 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/README.md +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/README.md @@ -4,7 +4,7 @@ Every story checkpoint is an authored plan here, one file per checkpoint: `frlg- - A checkpoint has `sections: [{id, title, notes?, events}]`, or plain `events` (one unnamed section, as 00.05 keeps so its bytes stay those PokemonSimulation pins). Events are numbered across the sections, and an event's log line names its section: `[Event] 00.28/12 [b1f_east] winston_line: start`. - `notes` (a list of paragraphs) on the checkpoint, a section or an event hold what the C++ table's comments said: the maps, trainers, numbers and console runs a step was planned from. No executor reads them. -- `variant` says how FRLG does a step: `run` on a route or legs, `trainer_line`/`trainer_wait` on a step, and on a `game_action` the step's plan as its parser reads it (`mart ...`, `teach ...`, `grind ...`, `grind_check ...`, `capture ...`, `pc ...`, `fossil ...`, `level ...`, or `cut_tree`, `trash_cans`, `close_trainer_card`, `leave_gift_summary`). An unknown variant is rejected at load. +- `variant` says how FRLG does a step: `run` or `bike` on a route or legs, `trainer_line`/`trainer_wait` on a step, and on a `game_action` the step's plan as its parser reads it (`mart ...`, `teach ...`, `grind ...`, `grind_check ...`, `capture ...`, `pc ...`, `fossil ...`, `level ...`, or `cut_tree`, `trash_cans`, `close_trainer_card`, `leave_gift_summary`, `center_enter`, `center_exit`, `ride_bike`, `use_item ...` and the Rocket Hideout's steps from `PokemonFRLG_AutoStoryHideout.h`). An unknown variant is rejected at load. - `once_per_save` marks a step done once per save (a TEACH, a Mart). - `execution` holds FRLG's fields: `menu`, and when not a new game's, `supplies` (`potions`, `antidotes`, `parlyz_heals`, `lead: "after_brock"`), `live_start` and `handoff` (`sid_helper`, `starter_rng`, `gift_rng`). - Unknown fields anywhere are rejected. diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.30.plan.json b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.30.plan.json new file mode 100644 index 0000000000..c5e5f335e2 --- /dev/null +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.30.plan.json @@ -0,0 +1,207 @@ +{ + "format": "pokesim-authored-checkpoint/1", + "game": "frlg", + "checkpoint": { + "id": "00.30", + "title": "Lavender Mart, then west over Route 8 on the Bicycle, the Underground Path, a Pidgey on Route 7, Celadon's Pokemon Center", + "notes": [ + "PokeGuy's way from Lavender Town to Celadon City (pokeguy 54:18 on): the Lavender Mart, Route 8 west on the BICYCLE (00.26), Gamer Rich, the Underground Path's east-west tunnel to Route 7, a Pidgey from Route 7's grass to carry HM02 Fly later, and Celadon's Pokemon Center.", + "No Repel: the way keeps off grass. Route 8's grass (34..46, 9..18) is penned in by the Cut trees (47, 12) and (33, 15); Route 7's (11..18, 2..6) is east of the way north from the Underground Path's door (7, 14). The Underground Path has no wild Pokemon (pokefirered wild_encounters.json lists none), and the Pidgey is caught where Route 7's grass is walked on purpose.", + "Route 8's trainers (Route8 map.json): Julia (62, 14) looks west 6, Rich (55, 15) south 3, Glenn (51, 6) all ways 4, Paige (29, 3) and Andrea (29, 5) west 3, Leslie (29, 4) and Megan (29, 6) east 6, Stan (21, 3) all ways 1, Eli and Anne (40, 3), (41, 3) south 1, Ricardo (14, 16) and Jaren (24, 17) all ways 1, Aidan (9, 6) east 4. Below the wall (56..61, 6..13) the only ways west are row 14, Julia's line, and rows 15..18, which cross Rich's column: his line (55, 16..18) is the one taken." + ], + "start": {"certainty": "tile", "map": "LavenderTown_PokemonCenter_1F", "where": {"facing": "north", "kind": "tiles", "tiles": [[7, 4]]}}, + "sections": [ + { + "id": "lavender_mart", + "title": "From Lavender's Center to the Mart: Escape Ropes and Super Repels", + "events": [ + { + "id": "east_of_mart_door", + "kind": "route", + "variant": "run", + "target": {"certainty": "tile", "map": "LavenderTown", "where": {"facing": "east", "kind": "tiles", "tiles": [[21, 16]]}}, + "why": "out of the Center's door (6, 5), east and down to the wall (22, 16), east of the Mart's door (20, 15)" + }, + { + "id": "into_lavender_mart", + "kind": "route", + "variant": "run", + "target": {"certainty": "tile", "map": "LavenderTown_Mart", "where": {"facing": "north", "kind": "tiles", "tiles": [[4, 2]]}}, + "why": "a tile west, in at the Mart's door (20, 15) and up column 4 to the wall (4, 1)" + }, + { + "id": "lavender_mart_clerk", + "kind": "route", + "variant": "run", + "target": {"certainty": "tile", "map": "LavenderTown_Mart", "where": {"facing": "west", "kind": "tiles", "tiles": [[4, 3]]}}, + "why": "a tile back down, facing the clerk (2, 3) over the counter (3, 3)" + }, + { + "id": "buy_ropes_and_super_repels", + "kind": "game_action", + "variant": "mart LavenderTown_Mart budget=5700 floor=9000 escape-rope=4 super-repel=7", + "once_per_save": true, + "why": "pokeguy 54:18: 4 Escape Ropes (the Rocket Hideout, 00.31) and 7 Super Repels (Pokemon Tower)" + }, + { + "id": "out_of_lavender_mart", + "kind": "route", + "variant": "run", + "target": {"certainty": "tile", "map": "LavenderTown", "where": {"facing": "south", "kind": "tiles", "tiles": [[20, 16]]}}, + "why": "down to the mat and out of the door (20, 15)" + } + ] + }, + { + "id": "route8_rich", + "title": "On the Bicycle onto Route 8, Gamer Rich", + "events": [ + { + "id": "ride_bike", + "kind": "game_action", + "variant": "ride_bike", + "why": "on the BICYCLE (00.26, Key Items) for Route 8" + }, + { + "id": "lavender_west_edge", + "kind": "legs", + "variant": "bike", + "legs": [ + {"direction": "west", "tiles": 7}, {"direction": "north", "tiles": 9}, {"direction": "south", "tiles": 1}, {"direction": "west", "tiles": 12}, {"direction": "south", "tiles": 2} + ], + "why": "west along row 16 to the wall (12, 16), up column 13 to the wall (13, 6), back onto row 8, west along it to the wall (0, 8) and down to (1, 10), mid-way along the way out (rows 9..11)" + }, + { + "id": "route8_east_wall", + "kind": "route", + "variant": "bike", + "target": {"certainty": "tile", "map": "Route8", "where": {"facing": "west", "kind": "tiles", "tiles": [[62, 10]]}}, + "why": "west over the connection onto Route 8, to the wall (56..61, 6..13): a row off still ends on this wall" + }, + { + "id": "east_of_rich_line", + "kind": "legs", + "variant": "bike", + "legs": [ + {"direction": "south", "tiles": 3}, {"direction": "east", "tiles": 1}, {"direction": "south", "tiles": 5}, {"direction": "west", "tiles": 6} + ], + "why": "down column 62 to Julia (62, 14), who looks west, a tile east and down column 63 to the wall (63, 19), west along row 18 to (57, 18), two tiles short of Rich's line" + }, + { + "id": "rich_line", + "kind": "step", + "variant": "trainer_line", + "direction": "west", + "why": "a tile at a time over (56, 18) onto (55, 18), the end of Rich's line (55, 16..18): he walks down to (55, 17)" + }, + { + "id": "gamer_rich", + "kind": "battle", + "declared_after": {"certainty": "tile", "map": "Route8", "where": {"facing": "north", "kind": "tiles", "tiles": [[55, 18]]}}, + "why": "Gamer Rich (TRAINER_GAMER_RICH): Growlithe, Vulpix Lv24" + } + ] + }, + { + "id": "route8_west", + "title": "Route 8 west to the Underground Path", + "events": [ + { + "id": "west_of_glenn_column", + "kind": "route", + "variant": "bike", + "target": {"certainty": "tile", "map": "Route8", "where": {"facing": "north", "kind": "tiles", "tiles": [[48, 7]]}}, + "why": "west along row 18 past Rich (55, 17) and up column 48 to row 7, west of Glenn's south line (51, 7..10) and below his west line (47..50, 6)" + }, + { + "id": "east_of_megan_column", + "kind": "route", + "variant": "bike", + "target": {"certainty": "tile", "map": "Route8", "where": {"facing": "south", "kind": "tiles", "tiles": [[30, 13]]}}, + "why": "west along row 7, below Megan's line (30..35, 6), and down column 30 to (30, 13), west of the pen's wall (33, 8..18)" + }, + { + "id": "east_of_aidan_column", + "kind": "route", + "variant": "bike", + "target": {"certainty": "tile", "map": "Route8", "where": {"facing": "north", "kind": "tiles", "tiles": [[14, 13]]}}, + "why": "down onto row 14, west along it above Jaren (24, 17) and Ricardo (14, 16), who see a tile, and up onto (14, 13)" + }, + { + "id": "east_of_underground_door", + "kind": "route", + "variant": "bike", + "target": {"certainty": "tile", "map": "Route8", "where": {"facing": "north", "kind": "tiles", "tiles": [[14, 5]]}}, + "why": "up column 14, east of Aidan's line (10..13, 6), to the wall (14, 4)" + }, + { + "id": "below_underground_door", + "kind": "route", + "variant": "bike", + "target": {"certainty": "tile", "map": "Route8", "where": {"facing": "north", "kind": "tiles", "tiles": [[13, 5]]}}, + "why": "a tile west, below the Underground Path's door (13, 4)" + } + ] + }, + { + "id": "underground_path", + "title": "The Underground Path to Route 7", + "events": [ + { + "id": "route7_underground_exit", + "kind": "route", + "variant": "run", + "target": {"certainty": "tile", "map": "Route7", "where": {"facing": "south", "kind": "tiles", "tiles": [[7, 15]]}}, + "why": "through the door (the game takes the player off the Bicycle indoors), the east entrance, the east-west tunnel and the west entrance, out onto Route 7" + } + ] + }, + { + "id": "route7_pidgey", + "title": "A Pidgey in Route 7's grass", + "events": [ + { + "id": "pidgey_grass", + "kind": "route", + "variant": "run", + "target": {"certainty": "tile", "map": "Route7", "where": {"facing": "east", "kind": "tiles", "tiles": [[14, 5]]}}, + "why": "north round the ledges into Route 7's grass (11..18, 2..6), a grass tile east of it free" + }, + { + "id": "catch_pidgey", + "kind": "game_action", + "variant": "capture pidgey catches=1 encounters=30 balls=5 pace=east", + "once_per_save": true, + "why": "a Pidgey to carry HM02 Fly (pokeguy flies with a Pidgey from 1:03 on); the party has no other flier" + } + ] + }, + { + "id": "celadon", + "title": "Celadon City's Pokemon Center", + "events": [ + { + "id": "celadon_below_center", + "kind": "route", + "variant": "run", + "target": {"certainty": "tile", "map": "CeladonCity", "where": {"facing": "north", "kind": "tiles", "tiles": [[48, 12]]}}, + "why": "out of the grass, west onto Celadon (rows 12..15) and along row 12 to below the Center's door (48, 11)" + }, + { + "id": "celadon_nurse", + "kind": "game_action", + "variant": "center_enter", + "declared_after": {"certainty": "tile", "map": "CeladonCity_PokemonCenter_1F", "where": {"facing": "north", "kind": "tiles", "tiles": [[7, 4]]}}, + "why": "the Center script in: through the door and up to the nurse; no map of the Center" + }, + { + "id": "heal_celadon", + "kind": "heal", + "why": "the nurse heals the party" + } + ] + } + ] + }, + "execution": {"menu": "full", "supplies": {"lead": "after_brock"}} +} From ddb1e7217ac177795ac0dfd68ba1548a88a7448b Mon Sep 17 00:00:00 2001 From: dayfine Date: Mon, 9 Nov 2026 19:44:50 -0800 Subject: [PATCH 15/79] FRLG AutoStory 00.30: the story-wide tests count 00.30 The run plans, the checkpoint count, Rich among the trainers fought, a bike leg after the BICYCLE, and the Pidgey's route ending on the first grass tile; the sim trace golden regenerated with the stub report whole. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss --- .../PokemonFRLG_AutoStoryLavender_Tests.cpp | 33 ++++++--------- .../PokemonFRLG_AutoStoryRunPlan_Tests.cpp | 8 ++-- .../AutoStory/PokemonFRLG_AutoStory_Tests.cpp | 17 ++++---- .../ReplayData/frlg-story-sim-trace.json | 40 ++----------------- .../AutoStory/StoryData/frlg-00.30.plan.json | 4 +- 5 files changed, 32 insertions(+), 70 deletions(-) diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryLavender_Tests.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryLavender_Tests.cpp index e8ca30c53c..99cd1fb3af 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryLavender_Tests.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryLavender_Tests.cpp @@ -581,28 +581,21 @@ UnitTestResult test_celadon_way_row(Logger&){ return row_on_sim("00.30", SimScript{}, {{"old_man_1"}}, MapPosition{"CeladonCity", {48, 12}}); } -// 00.30's walk into Route 7's grass with a wild battle on each of its -// two grass steps in turn (Route 7's land rate is 21): it still ends on -// the Pidgey's tile. +// 00.30's walk into Route 7's grass with a wild battle on its one grass +// step (Route 7's land rate is 21): it still ends on the Pidgey's tile. UnitTestResult test_route7_grass_battles(Logger&){ const StoryCheckpoint& row = checkpoint("00.30"); const size_t index = step_index(row, "pidgey_grass"); - const MapPosition end{"Route7", {14, 5}}; - for (int grass_step = 1; grass_step <= 2; grass_step++){ - SimScript script; - script.encounters.push_back(SimEncounter{.grass_step = grass_step}); - StoryPose at{"Route7", {7, 15}, Direction::SOUTH}; - OverworldSim sim(maps_after_route10(), MapPosition{at.map, at.tile}, *at.facing, script); - const std::string failure = row_step_on_sim(sim, at, row.steps[index], row.id); - if (!failure.empty()){ - return std::format("A battle on grass step {}: {}", grass_step, failure); - } - if (!(sim.state().position == end)){ - return std::format("A battle on grass step {}: ended on {}, not {}.", grass_step, to_string(sim.state().position), to_string(end)); - } - if (sim.state().wild_battles != 1){ - return std::format("A battle on grass step {}: {} wild battles, not 1.", grass_step, sim.state().wild_battles); - } + const MapPosition end{"Route7", {14, 6}}; + SimScript script; + script.encounters.push_back(SimEncounter{.grass_step = 1}); + StoryPose at{"Route7", {7, 15}, Direction::SOUTH}; + OverworldSim sim(maps_after_route10(), MapPosition{at.map, at.tile}, *at.facing, script); + if (const std::string failure = row_step_on_sim(sim, at, row.steps[index], row.id); !failure.empty()){ + return failure; + } + if (!(sim.state().position == end) || sim.state().wild_battles != 1){ + return std::format("Ended on {} after {} wild battles, not on {} after 1.", to_string(sim.state().position), sim.state().wild_battles, to_string(end)); } return true; } @@ -635,7 +628,7 @@ const AutoStoryLavenderCase AUTO_STORY_LAVENDER_CASES[] = { {.input = {"00.29 a tile off after each open leg", test_lavender_tile_off}, .expectation = {}}, {.input = {"00.28 and 00.29 save on Route 10 and in Lavender Town", test_save_places}, .expectation = {}}, {.input = {"00.30 Lavender's Mart, Route 8 past Rich alone, the Underground Path, Route 7 to Celadon City", test_celadon_way_row}, .expectation = {}}, - {.input = {"00.30 a wild battle on each grass step into Route 7's grass", test_route7_grass_battles}, .expectation = {}}, + {.input = {"00.30 a wild battle on the step into Route 7's grass", test_route7_grass_battles}, .expectation = {}}, {.input = {"00.30 saves in Celadon City's Pokemon Center", test_celadon_save_place}, .expectation = {}}, }; diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRunPlan_Tests.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRunPlan_Tests.cpp index e595c875e0..778035ecdf 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRunPlan_Tests.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRunPlan_Tests.cpp @@ -138,7 +138,7 @@ class Test_RunPlan : public UnitTest{ const RunPlanScenario m_scenario; }; -const std::string TODAY = "00.01 00.02 00.03 00.04 00.05 00.06 00.07 00.08 00.09 00.10 00.11 00.12 00.12c 00.13 00.14 00.14b 00.14c 00.15 00.15b 00.16 00.17 00.18 00.19 00.20 00.21 00.22 00.23 00.24 00.25 00.26 00.27 00.28 00.29"; +const std::string TODAY = "00.01 00.02 00.03 00.04 00.05 00.06 00.07 00.08 00.09 00.10 00.11 00.12 00.12c 00.13 00.14 00.14b 00.14c 00.15 00.15b 00.16 00.17 00.18 00.19 00.20 00.21 00.22 00.23 00.24 00.25 00.26 00.27 00.28 00.29 00.30"; const RunPlanScenario RUN_PLAN_CASES[] = { { @@ -229,11 +229,11 @@ const RunPlanScenario RUN_PLAN_CASES[] = { }, { .input = {.name = "Gift RNG off: 00.12b is passed over", .first = "00.11"}, - .expectation = {.expected_ids = "00.11 00.12 00.12c 00.13 00.14 00.14b 00.14c 00.15 00.15b 00.16 00.17 00.18 00.19 00.20 00.21 00.22 00.23 00.24 00.25 00.26 00.27 00.28 00.29"}, + .expectation = {.expected_ids = "00.11 00.12 00.12c 00.13 00.14 00.14b 00.14c 00.15 00.15b 00.16 00.17 00.18 00.19 00.20 00.21 00.22 00.23 00.24 00.25 00.26 00.27 00.28 00.29 00.30"}, }, { .input = {.name = "Gift RNG off: 00.12b runs when started at", .first = "00.12b"}, - .expectation = {.expected_ids = "00.12b 00.12c 00.13 00.14 00.14b 00.14c 00.15 00.15b 00.16 00.17 00.18 00.19 00.20 00.21 00.22 00.23 00.24 00.25 00.26 00.27 00.28 00.29"}, + .expectation = {.expected_ids = "00.12b 00.12c 00.13 00.14 00.14b 00.14c 00.15 00.15b 00.16 00.17 00.18 00.19 00.20 00.21 00.22 00.23 00.24 00.25 00.26 00.27 00.28 00.29 00.30"}, }, { .input = { .name = "Gift RNG: started at 00.12b, from the save beside the salesman", @@ -258,7 +258,7 @@ const RunPlanScenario RUN_PLAN_CASES[] = { }, { .input = {.name = "Starter RNG alone: 00.12b runs when started at", .first = "00.12b", .handoffs = {.starter_rng = true}}, - .expectation = {.expected_ids = "00.12b 00.12c 00.13 00.14 00.14b 00.14c 00.15 00.15b 00.16 00.17 00.18 00.19 00.20 00.21 00.22 00.23 00.24 00.25 00.26 00.27 00.28 00.29"}, + .expectation = {.expected_ids = "00.12b 00.12c 00.13 00.14 00.14b 00.14c 00.15 00.15b 00.16 00.17 00.18 00.19 00.20 00.21 00.22 00.23 00.24 00.25 00.26 00.27 00.28 00.29 00.30"}, }, { .input = { .name = "Starter RNG first, with both on", diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStory_Tests.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStory_Tests.cpp index da54867cd9..e7c5039cae 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStory_Tests.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStory_Tests.cpp @@ -230,8 +230,8 @@ UnitTestResult check_checkpoint(const StoryCheckpoint& checkpoint, StoryPose& po UnitTestResult test_routes_and_chain(){ const std::vector& checkpoints = story_checkpoints(); - if (checkpoints.size() != 36 || checkpoints[0].start){ - return "Expected 36 checkpoints, the first from a new game."; + if (checkpoints.size() != 37 || checkpoints[0].start){ + return "Expected 37 checkpoints, the first from a new game."; } StoryPose pose; for (size_t c = 0; c < checkpoints.size(); c++){ @@ -351,9 +351,11 @@ UnitTestResult test_pewter_aide_walk(){ return true; } -// Every ROUTE and LEGS after the Running Shoes (00.10) runs; none before. +// Every ROUTE and LEGS after the Running Shoes (00.10) runs, or after the +// BICYCLE (00.26) may ride; none before. UnitTestResult test_runs_after_shoes(){ bool has_shoes = false; + bool has_bike = false; size_t runs = 0; for (const StoryCheckpoint& checkpoint : story_checkpoints()){ for (const StoryStep& step : checkpoint.steps){ @@ -361,12 +363,13 @@ UnitTestResult test_runs_after_shoes(){ continue; } const MoveSpeed expected = has_shoes ? MoveSpeed::RUN : MoveSpeed::WALK; - if (move_speed(step) != expected){ + if (move_speed(step) != expected && !(has_bike && move_speed(step) == MoveSpeed::BIKE)){ return checkpoint.id + "/" + step.name + ": expected to " + move_speed_name(expected) + ", it would " + move_speed_name(move_speed(step)) + "."; } runs += has_shoes ? 1 : 0; } has_shoes = has_shoes || checkpoint.id == "00.10"; + has_bike = has_bike || checkpoint.id == "00.26"; } if (!has_shoes || runs == 0){ return "No checkpoint 00.10, where the player gets the Running Shoes, or no route after it."; @@ -600,7 +603,7 @@ UnitTestResult check_lines(const StoryCheckpoint& checkpoint, std::set Date: Mon, 9 Nov 2026 19:47:23 -0800 Subject: [PATCH 16/79] FRLG AutoStory 00.30: Gamer Rich in the story's trainers Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss --- .../Programs/AutoStory/PokemonFRLG_AutoStoryBattleData.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryBattleData.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryBattleData.cpp index 17281e2e83..a70c1da706 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryBattleData.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryBattleData.cpp @@ -86,6 +86,7 @@ constexpr StoryTrainer STORY_TRAINERS[] = { {.map = "RockTunnel_B1F", .battle = "hiker_dudley", .trainer = "TRAINER_HIKER_DUDLEY"}, {.map = "RockTunnel_B1F", .battle = "pokemaniac_cooper", .trainer = "TRAINER_POKEMANIAC_COOPER"}, {.map = "RockTunnel_1F", .battle = "picnicker_dana", .trainer = "TRAINER_PICNICKER_DANA"}, + {.map = "Route8", .battle = "gamer_rich", .trainer = "TRAINER_GAMER_RICH"}, // The Rocket Hideout, as PokeGuy's run fights it (the 00.31 and 00.32 // drafts): the Grunt at the Game Corner's poster (11, 2) // (CeladonCity_GameCorner_EventScript_RocketGrunt); on B4F, Grunt1 at From 43d1e50eb36002e34a105716fd465ce0e320faef Mon Sep 17 00:00:00 2001 From: dayfine Date: Mon, 9 Nov 2026 21:12:45 -0800 Subject: [PATCH 17/79] Story JSON: keep story_step_json() and event_log_line() within code health Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss --- .../Pokemon/AutoStory/Pokemon_StoryLog.h | 5 +-- .../AutoStory/Pokemon_StoryStepJson.cpp | 34 ++++++++++++------- 2 files changed, 23 insertions(+), 16 deletions(-) diff --git a/SerialPrograms/Source/Pokemon/AutoStory/Pokemon_StoryLog.h b/SerialPrograms/Source/Pokemon/AutoStory/Pokemon_StoryLog.h index 474603b51e..099626610a 100644 --- a/SerialPrograms/Source/Pokemon/AutoStory/Pokemon_StoryLog.h +++ b/SerialPrograms/Source/Pokemon/AutoStory/Pokemon_StoryLog.h @@ -28,10 +28,7 @@ namespace Pokemon{ // [Event] 00.04/3 talk_mom: failed: expect_failed: has_parcel // An event in a section of the checkpoint names it before the event: // [Event] 00.28/12 [b1f_east] winston_line: start -std::string event_log_line( - std::string_view checkpoint, size_t number, std::string_view event, std::string_view status, - std::string_view section = {} -); +std::string event_log_line(std::string_view checkpoint, size_t number, std::string_view event, std::string_view status, std::string_view section = {}); // A checkpoint starts: // [Checkpoint] 00.04: start diff --git a/SerialPrograms/Source/Pokemon/AutoStory/Pokemon_StoryStepJson.cpp b/SerialPrograms/Source/Pokemon/AutoStory/Pokemon_StoryStepJson.cpp index 9bb70fc43d..1f4bdfad48 100644 --- a/SerialPrograms/Source/Pokemon/AutoStory/Pokemon_StoryStepJson.cpp +++ b/SerialPrograms/Source/Pokemon/AutoStory/Pokemon_StoryStepJson.cpp @@ -284,6 +284,27 @@ Pose read_story_pose(const JsonValue& value, std::string_view source){ return result; } +namespace{ + +// What `step` says about running it, not doing it: when to skip it, where +// it ends, once per save, the author's notes. +void add_run_fields(JsonObject& result, const StoryStep& step){ + if (!step.skip_if.empty()){ + result["skip_if"] = strings_json(step.skip_if); + } + if (step.pose_after){ + result["declared_after"] = story_pose_json(*step.pose_after); + } + if (step.once_per_save){ + result["once_per_save"] = true; + } + if (!step.notes.empty()){ + result["notes"] = strings_json(step.notes); + } +} + +} // namespace + JsonValue story_step_json(const StoryStep& step){ JsonObject result; result["id"] = step.name; @@ -321,18 +342,7 @@ JsonValue story_step_json(const StoryStep& step){ if (!step.args.empty()){ result["args"] = args_json(step.args); } - if (!step.skip_if.empty()){ - result["skip_if"] = strings_json(step.skip_if); - } - if (step.pose_after){ - result["declared_after"] = story_pose_json(*step.pose_after); - } - if (step.once_per_save){ - result["once_per_save"] = true; - } - if (!step.notes.empty()){ - result["notes"] = strings_json(step.notes); - } + add_run_fields(result, step); return result; } From c5ee094663d2bc33bef9e6c5f2f0adadfdb06770 Mon Sep 17 00:00:00 2001 From: dayfine Date: Mon, 9 Nov 2026 21:17:22 -0800 Subject: [PATCH 18/79] FRLG walker: no turn tap on the Bicycle On the bike a tap never only turns the player: it takes a step. The walker's turn tap before each leg made every open leg one tile long on the bike, and 00.30's walk to Route 8 ended on Route 12 (console B, 2026-11-09). turns_first() now skips the tap on the bike, for the walker and the sim walker alike. The sim models the bike: a tap steps facing either way, a hold through a turn loses no tile, and no step tap is ignored. Bike holds measured on Route 12's pier go in the movement mechanics table. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss --- .../Overworld/PokemonFRLG_MovementMechanics.h | 6 ++++++ .../PokemonFRLG_OverworldRecoveryWalk.cpp | 3 ++- .../Overworld/PokemonFRLG_OverworldSim.cpp | 16 +++++++++------- .../Overworld/PokemonFRLG_OverworldSim.h | 10 ++++++++++ .../Overworld/PokemonFRLG_OverworldWalk.cpp | 10 +++++++++- .../Overworld/PokemonFRLG_OverworldWalk.h | 6 ++++++ .../PokemonFRLG_OverworldWalk_Tests.cpp | 11 +++++++++++ 7 files changed, 53 insertions(+), 9 deletions(-) diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_MovementMechanics.h b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_MovementMechanics.h index de3c682440..aadf6fcef6 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_MovementMechanics.h +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_MovementMechanics.h @@ -54,6 +54,12 @@ inline constexpr Milliseconds SURF_TILE_TIME(133); // from rest in 600 ms (120 ms a tile, the start up included). Not the // decompilation's 4 frames a tile (67 ms): the bike speeds up from rest. inline constexpr Milliseconds BIKE_TILE_TIME(112); +// On the Bicycle a tap never only turns the player: from rest, a 40ms tap +// moved a tile facing either way, and holds of 112, 150, 200, 250, 300, +// 336 and 400ms moved 1, 2, 2, 3, 3, 4 and 4 tiles (console B, +// 2026-11-09, Route 12's north pier). So a bike leg has no turn tap: its +// hold turns the player too, and loses no tile for it. +inline constexpr bool BIKE_TAP_ONLY_TURNS = false; // The longest tap measured to only turn a player facing another way, and // to take exactly one step for one facing its way. inline constexpr Milliseconds LONGEST_TAP(133); diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldRecoveryWalk.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldRecoveryWalk.cpp index 9200c0e02b..ca51c44820 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldRecoveryWalk.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldRecoveryWalk.cpp @@ -85,7 +85,8 @@ StepWalk walk_step( // Turning first, with a tap, makes the hold start from a standstill // facing the right way: holding through a turn lost a tile on the // console, while holds from a standstill were exact over 15 tiles. - if (facing != step.direction){ + // Not on the Bicycle, where the tap is a step. + if (turns_first(step, speed, facing)){ turn_to(console, context, step.direction); } if (const std::string note = speed_note(step, speed); !note.empty()){ diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSim.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSim.cpp index 2e9b85afac..ecc7a6eff8 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSim.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSim.cpp @@ -470,9 +470,11 @@ void OverworldSim::walk_hold(Direction direction, Milliseconds duration, int sho const Milliseconds end = m_now + duration; Milliseconds pressed = m_now; if (m_state.facing != direction){ - // Holding through a turn lost a tile on the console. + // Holding through a turn lost a tile on the console, on foot. + if (!m_script.on_bike){ + pressed += tile; + } m_state.facing = direction; - pressed += tile; } take_steps(direction, pressed, end, (int)((end - pressed + tile - 1ms) / tile) - short_by); } @@ -546,9 +548,9 @@ void OverworldSim::tap(Direction direction, Milliseconds duration, Milliseconds m_last_tap.reset(); }else if (m_last_tap && m_last_tap->direction == direction && m_last_tap->end == start){ hold_on(direction, start + duration); - }else if (m_state.facing != direction){ + }else if (m_state.facing != direction && !m_script.on_bike){ // From a standstill a tap only turns the player, even one as long - // as LONGEST_TAP. + // as LONGEST_TAP. Not on the Bicycle: there it steps. m_last_tap = TapPress{direction, start, start + duration, m_state.facing, 0}; if (drops_turn_tap()){ m_state.turn_taps_dropped++; @@ -567,7 +569,7 @@ void OverworldSim::tap(Direction direction, Milliseconds duration, Milliseconds void OverworldSim::step_tap(Direction direction, Milliseconds duration){ const Milliseconds start = m_now; m_last_tap = TapPress{direction, start, start + duration, direction, 0}; - if (m_last_step_tap && start < *m_last_step_tap + MovementMechanics::STEP_TAP_LOCKOUT){ + if (!m_script.on_bike && m_last_step_tap && start < *m_last_step_tap + MovementMechanics::STEP_TAP_LOCKOUT){ m_state.step_taps_ignored++; note(std::format( "the step tap {} is ignored, {} ms after the last.", @@ -813,7 +815,7 @@ std::optional OverworldSimWalker::walk_step(const RouteStep& step, if (step.action != RouteAction::WALK){ fail("Sim: Surf isn't modelled."); } - if (facing != step.direction){ + if (turns_first(step, m_rules.speed, facing)){ sim_turn_to(m_sim, step.direction, m_rules.confirm_turn); } const int warps_before = m_sim.state().warps; @@ -822,7 +824,7 @@ std::optional OverworldSimWalker::walk_step(const RouteStep& step, leg.direction = step.direction; leg.tiles = step.tiles + step.warp_slack; leg.to_wall = step.to_wall; - leg.tile_time = TILE_TIME; + leg.tile_time = tile_time(step, m_rules.speed); leg.stop_on_interrupt = !step.to_wall; leg.stop_if_blocked = step.to_wall && m_rules.stop_if_blocked; if (m_rules.hold_over_connections){ diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSim.h b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSim.h index 94fdd1d063..e1761f1248 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSim.h +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSim.h @@ -132,6 +132,13 @@ struct SimScript{ // (SimWalkerRules::confirm_turn) after 00.28 run 2 (console B, // 2026-11-09), where a one-tile leg only turned the player. std::set dropped_turn_taps; + // The player rides the Bicycle: a tap facing another way takes a step + // too, a hold through a turn loses no tile + // (MovementMechanics::BIKE_TAP_ONLY_TURNS), and no step tap is + // ignored: a 40ms turn tap and a 56ms hold 340ms after it took two + // tiles (console B, 2026-11-09, 00.30). Set timing.tile to + // MovementMechanics::BIKE_TILE_TIME with it. + bool on_bike = false; // Caves dark without Flash (Rock Tunnel): the overworld is black but // for a lit circle on the player, which the walker's battle text box // check and screen observer read as a battle on its way (console B, @@ -449,6 +456,9 @@ struct SimWalkerRules{ // Without it a dropped tap left a one-tile leg turning the player // only, taken as walked (console B, 2026-11-09, 00.28 run 2). bool confirm_turn = true; + // The speed the walker goes at: its turn taps + // (OverworldWalkSteps::turns_first()) and its holds' tile time. + MoveSpeed speed = MoveSpeed::WALK; // A dark cave's overworld isn't a battle on its way // (OverworldWalkSteps::dark_cave_screen()). Without it the check // before each step watched for a battle on it (console B, 2026-11-09, diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldWalk.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldWalk.cpp index 35214508be..92c49a4ed5 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldWalk.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldWalk.cpp @@ -202,6 +202,13 @@ Milliseconds tile_time(const RouteStep& step, MoveSpeed speed){ return TILE_TIME; } +bool turns_first(const RouteStep& step, MoveSpeed speed, std::optional facing){ + if (facing == step.direction){ + return false; + } + return step.surfing || step_speed(step, speed) != MoveSpeed::BIKE || BIKE_TAP_ONLY_TURNS; +} + Pokemon::LegMover leg_mover(const RouteStep& step, MoveSpeed speed){ if (step_speed(step, speed) == MoveSpeed::RUN && !step.surfing){ return hold_dpad_running; @@ -580,7 +587,8 @@ void walk_overworld_route( // Turning first, with a tap, makes the hold start from a standstill // facing the right way: holding through a turn lost a tile on the // console, while holds from a standstill were exact over 15 tiles. - if (facing != step.direction){ + // Not on the Bicycle, where the tap is a step. + if (turns_first(step, speed, facing)){ turn_to(console, context, step.direction); } if (const std::string note = speed_note(step, speed); !note.empty()){ diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldWalk.h b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldWalk.h index 22eb2eea05..7be9b789cb 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldWalk.h +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldWalk.h @@ -154,6 +154,12 @@ MoveSpeed step_speed(const RouteStep& step, MoveSpeed speed); // pace whatever the speed; where running isn't allowed, the walking pace. Milliseconds tile_time(const RouteStep& step, MoveSpeed speed); +// Whether a WALK `step` at `speed` starts with a turn tap, for a player +// facing `facing`: on foot facing another way (or an unknown way), so the +// hold starts facing the right way. Never on the Bicycle, where a tap +// takes a step (MovementMechanics::BIKE_TAP_ONLY_TURNS). +bool turns_first(const RouteStep& step, MoveSpeed speed, std::optional facing); + // The mover for `step` at `speed`: hold_dpad_running() for a run on foot // where the map allows it, hold_dpad() otherwise (B does nothing on the // water). diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldWalk_Tests.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldWalk_Tests.cpp index a488f376ae..a70e8b363a 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldWalk_Tests.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldWalk_Tests.cpp @@ -127,6 +127,8 @@ struct TurnTapInput{ std::set dropped_turn_taps; // SimWalkerRules::confirm_turn. bool confirm_turn = true; + // On the Bicycle (SimScript::on_bike, SimWalkerRules::speed). + bool on_bike = false; }; struct TurnTapExpectation{ @@ -162,6 +164,11 @@ class Test_OverworldTurnTap : public UnitTest{ script.dropped_turn_taps = m_case.input.dropped_turn_taps; SimWalkerRules rules; rules.confirm_turn = m_case.input.confirm_turn; + if (m_case.input.on_bike){ + script.on_bike = true; + script.timing.tile = BIKE_TILE_TIME; + rules.speed = MoveSpeed::BIKE; + } OverworldSim sim(MAPS, TURN_START, Direction::NORTH, script); OverworldSimWalker walker(sim, rules); const RoutePlanning planning{.maps = &MAPS, .costs = default_route_costs(), .start = TURN_START, .label = "Sim"}; @@ -184,6 +191,10 @@ const TurnTapCase TURN_TAP_CASES[] = { {.input = {.name = "dropped, tapped again", .dropped_turn_taps = {1}}, .expectation = {.end = TURN_END}}, {.input = {.name = "dropped twice, tapped again", .dropped_turn_taps = {1, 2}}, .expectation = {.end = TURN_END}}, {.input = {.name = "dropped, not checked: the leg only turns", .dropped_turn_taps = {1}, .confirm_turn = false}, .expectation = {.end = TURN_START}}, + // Console B, 2026-11-09 (00.30): on the Bicycle the turn tap took a + // step, each one-tile leg went two, and the walk to Route 8 ended on + // Route 12. + {.input = {.name = "on the bike, no turn tap", .on_bike = true}, .expectation = {.end = TURN_END}}, }; From e615aaabb5e481665bab53cb23f1aa70613e881f Mon Sep 17 00:00:00 2001 From: dayfine Date: Mon, 9 Nov 2026 21:19:37 -0800 Subject: [PATCH 19/79] FRLG walker: keep the bike change inside the file and function limits Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss --- .../Overworld/PokemonFRLG_OverworldRecoveryWalk.cpp | 1 - .../PokemonFRLG/Overworld/PokemonFRLG_OverworldSim.cpp | 4 +--- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldRecoveryWalk.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldRecoveryWalk.cpp index ca51c44820..5a0e782939 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldRecoveryWalk.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldRecoveryWalk.cpp @@ -85,7 +85,6 @@ StepWalk walk_step( // Turning first, with a tap, makes the hold start from a standstill // facing the right way: holding through a turn lost a tile on the // console, while holds from a standstill were exact over 15 tiles. - // Not on the Bicycle, where the tap is a step. if (turns_first(step, speed, facing)){ turn_to(console, context, step.direction); } diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSim.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSim.cpp index ecc7a6eff8..0bbc6fdce8 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSim.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSim.cpp @@ -471,9 +471,7 @@ void OverworldSim::walk_hold(Direction direction, Milliseconds duration, int sho Milliseconds pressed = m_now; if (m_state.facing != direction){ // Holding through a turn lost a tile on the console, on foot. - if (!m_script.on_bike){ - pressed += tile; - } + pressed += m_script.on_bike ? Milliseconds(0) : tile; m_state.facing = direction; } take_steps(direction, pressed, end, (int)((end - pressed + tile - 1ms) / tile) - short_by); From c35b6839624a3995ddf6c4eed394289c36ed682e Mon Sep 17 00:00:00 2001 From: dayfine Date: Mon, 9 Nov 2026 21:30:35 -0800 Subject: [PATCH 20/79] FRLG AutoStory: GAME steps carry their arguments in args A GAME step's variant is now only its action's name (mart, teach, pc, grind, grind_check, capture, fossil, level); what the action reads moves to StoryStep::args, and a Mart's purchases to the step's items. Each action declares its args in the action table, so lint_story_checkpoint() checks every step against them, and each step reads its plan with parse__step(). The story's plans are converted; the sim trace is unchanged. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss --- .../Programs/AutoStory/Data/JsonParser.cpp | 17 +-- .../PokemonFRLG_AutoStoryAbilities.cpp | 20 +-- .../PokemonFRLG_AutoStoryAbilities_Tests.cpp | 39 ++++-- .../PokemonFRLG_AutoStoryCapture.cpp | 123 +++++++----------- .../AutoStory/PokemonFRLG_AutoStoryCapture.h | 32 +++-- .../PokemonFRLG_AutoStoryCapture_Tests.cpp | 23 ++-- .../PokemonFRLG_AutoStoryCeladon_Tests.cpp | 4 +- .../AutoStory/PokemonFRLG_AutoStoryChoice.cpp | 15 +-- .../AutoStory/PokemonFRLG_AutoStoryChoice.h | 15 ++- .../PokemonFRLG_AutoStoryChoice_Tests.cpp | 11 +- .../AutoStory/PokemonFRLG_AutoStoryEvents.cpp | 6 +- .../AutoStory/PokemonFRLG_AutoStoryGrind.cpp | 121 ++++++++--------- .../AutoStory/PokemonFRLG_AutoStoryGrind.h | 42 +++--- .../PokemonFRLG_AutoStoryGrind_Tests.cpp | 42 +++--- .../AutoStory/PokemonFRLG_AutoStoryMart.cpp | 65 ++++----- .../AutoStory/PokemonFRLG_AutoStoryMart.h | 25 ++-- .../PokemonFRLG_AutoStoryMart_Tests.cpp | 38 ++++-- .../AutoStory/PokemonFRLG_AutoStoryMember.cpp | 45 +++---- .../AutoStory/PokemonFRLG_AutoStoryMember.h | 15 ++- .../PokemonFRLG_AutoStoryPcStorage.cpp | 103 ++++++--------- .../PokemonFRLG_AutoStoryPcStorage.h | 31 +++-- .../PokemonFRLG_AutoStoryPcStorage_Tests.cpp | 20 +-- .../PokemonFRLG_AutoStoryRunPlan_Tests.cpp | 18 +-- .../PokemonFRLG_AutoStoryStepTable.cpp | 20 ++- .../PokemonFRLG_AutoStoryStepTable.h | 5 +- .../AutoStory/PokemonFRLG_AutoStoryTeach.cpp | 66 ++++------ .../AutoStory/PokemonFRLG_AutoStoryTeach.h | 26 ++-- .../PokemonFRLG_AutoStoryTeach_Tests.cpp | 22 ++-- .../PokemonFRLG_AutoStoryVariantWords.cpp | 29 +++++ .../PokemonFRLG_AutoStoryVariantWords.h | 27 +++- ...okemonFRLG_AutoStoryVermilionGym_Tests.cpp | 2 +- .../AutoStory/PokemonFRLG_AutoStory_Tests.cpp | 4 +- .../Programs/AutoStory/StoryData/README.md | 3 +- .../AutoStory/StoryData/frlg-00.12c.plan.json | 3 +- .../AutoStory/StoryData/frlg-00.13.plan.json | 3 +- .../AutoStory/StoryData/frlg-00.14.plan.json | 3 +- .../AutoStory/StoryData/frlg-00.14b.plan.json | 7 +- .../AutoStory/StoryData/frlg-00.14c.plan.json | 3 +- .../AutoStory/StoryData/frlg-00.15.plan.json | 10 +- .../AutoStory/StoryData/frlg-00.15b.plan.json | 3 +- .../AutoStory/StoryData/frlg-00.20.plan.json | 7 +- .../AutoStory/StoryData/frlg-00.23.plan.json | 6 +- .../AutoStory/StoryData/frlg-00.24.plan.json | 6 +- .../AutoStory/StoryData/frlg-00.26.plan.json | 4 +- 44 files changed, 619 insertions(+), 510 deletions(-) diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/Data/JsonParser.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/Data/JsonParser.cpp index e84e3eaa07..8f6c63ecaf 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/Data/JsonParser.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/Data/JsonParser.cpp @@ -215,16 +215,17 @@ Supplies read_authored_supplies(const JsonValue& value, std::string_view source) return result; } -// Whether `variant` names a GAME step FRLG's executor does. -bool known_game_variant(const std::string& variant){ +// Whether `step` is a GAME step FRLG's executor does, with args its +// action reads. +bool known_game_step(const StoryStep& step){ for (const std::string& name : {CLOSE_TRAINER_CARD, LEAVE_GIFT_SUMMARY, CUT_TREE_VARIANT, TRASH_CANS_VARIANT}){ - if (variant == name){ - return true; + if (step.variant == name){ + return step.args.empty(); } } - return parse_capture_variant(variant) || parse_pc_variant(variant) || parse_mart_variant(variant) - || parse_teach_variant(variant) || parse_grind_variant(variant) || parse_grind_check_variant(variant) - || parse_fossil_variant(variant) || parse_level_variant(variant); + return parse_capture_step(step) || parse_pc_step(step) || parse_mart_step(step) + || parse_teach_step(step) || parse_grind_step(step) || parse_grind_check_step(step) + || parse_fossil_step(step) || parse_level_step(step); } // Whether FRLG does `step`'s kind the way its variant names. @@ -236,7 +237,7 @@ bool known_variant(const StoryStep& step){ case StoryStepKind::STEP: return step.variant.empty() || step.variant == TRAINER_LINE_VARIANT || step.variant == TRAINER_WAIT_VARIANT; case StoryStepKind::GAME: - return known_game_variant(step.variant); + return known_game_step(step); default: return step.variant.empty(); } diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryAbilities.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryAbilities.cpp index c6463b2ae8..65cb4b8644 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryAbilities.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryAbilities.cpp @@ -83,27 +83,27 @@ std::optional run_ability_game_step( Logger& logger, VideoStream* stream, const Pokemon::StoryStep& step, StoryAbilities& abilities ){ const std::string_view variant = step.variant; - if (variant.starts_with(MART_VARIANT_PREFIX)){ - const std::optional plan = parse_mart_variant(variant); + if (variant == MART_VARIANT){ + const std::optional plan = parse_mart_step(step); return plan ? mart(logger, *plan, abilities) : Pokemon::outcome_failed("bad_variant", step.variant); } - if (variant.starts_with(TEACH_VARIANT_PREFIX)){ - const std::optional plan = parse_teach_variant(variant); + if (variant == TEACH_VARIANT){ + const std::optional plan = parse_teach_step(step); return plan ? teach(logger, *plan, abilities) : Pokemon::outcome_failed("bad_variant", step.variant); } - if (variant.starts_with(LEVEL_VARIANT_PREFIX)){ - const std::optional check = parse_level_variant(variant); + if (variant == LEVEL_VARIANT){ + const std::optional check = parse_level_step(step); return check ? level(logger, *check, abilities) : Pokemon::outcome_failed("bad_variant", step.variant); } - if (variant.starts_with(GRIND_VARIANT_PREFIX)){ - const std::optional plan = parse_grind_variant(variant); + if (variant == GRIND_VARIANT){ + const std::optional plan = parse_grind_step(step); if (!plan || !step.target){ return Pokemon::outcome_failed("bad_variant", step.variant + (step.target ? "" : " (no nurse)")); } return grind(logger, stream, *plan, abilities); } - if (variant.starts_with(FOSSIL_VARIANT_PREFIX)){ - const std::optional choice = parse_fossil_variant(variant); + if (variant == FOSSIL_VARIANT){ + const std::optional choice = parse_fossil_step(step); return choice ? fossil(logger, *choice, abilities) : Pokemon::outcome_failed("bad_variant", step.variant); } return std::nullopt; diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryAbilities_Tests.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryAbilities_Tests.cpp index de19009225..2cf3cdb24b 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryAbilities_Tests.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryAbilities_Tests.cpp @@ -9,11 +9,15 @@ #include #include +#include +#include #include +#include #include "Common/Cpp/Exceptions.h" #include "Common/Cpp/TestRunners/UnitTest.h" #include "CommonFramework/Exceptions/ProgramFinishedException.h" #include "PokemonFRLG_AutoStoryAbilities.h" +#include "PokemonFRLG_AutoStoryVariantWords.h" namespace PokemonAutomation{ namespace NintendoSwitch{ @@ -115,11 +119,27 @@ class Test_AutoStoryAbilities : public UnitTest{ }; -Pokemon::StoryStep game_step(std::string variant){ - Pokemon::StoryStep step; - step.kind = Pokemon::StoryStepKind::GAME; +// A GAME step written the old way ("mart PewterCity_Mart budget=2000 +// potion=5"), a Mart's purchases as its items. +Pokemon::StoryStep game_step(std::string_view text){ + static const std::map> POSITIONAL{ + {MART_VARIANT, {"map"}}, {TEACH_VARIANT, {"item", "move"}}, {"capture", {"species"}}, + }; + const auto found = POSITIONAL.find(text.substr(0, text.find(' '))); + Pokemon::StoryStep step = legacy_game_step(text, found == POSITIONAL.end() ? std::span() : found->second); step.name = "test"; - step.variant = std::move(variant); + if (step.variant != MART_VARIANT){ + return step; + } + for (auto it = step.args.begin(); it != step.args.end();){ + const std::optional quantity = Pokemon::story_arg_number(step.args, it->first); + if (!quantity || it->first == "budget" || it->first == "floor"){ + ++it; + continue; + } + step.items.push_back({it->first, static_cast(*quantity)}); + it = step.args.erase(it); + } return step; } @@ -218,13 +238,14 @@ UnitTestResult test_grind_shiny_stops(){ UnitTestResult test_level_variant(){ - const std::string variant = level_variant({.slot = 1, .level = 23}); - const std::optional back = parse_level_variant(variant); - if (variant != "level slot=2 min=23" || !back || back->slot != 1 || back->level != 23){ - return "Unexpected level variant \"" + variant + "\"."; + const Pokemon::StoryStep step = level_step("level", "", {.slot = 1, .level = 23}); + const std::optional back = parse_level_step(step); + const Pokemon::StoryArgs expected{{"slot", int64_t(2)}, {"min", int64_t(23)}}; + if (step.variant != LEVEL_VARIANT || step.args != expected || !back || back->slot != 1 || back->level != 23){ + return "Unexpected LEVEL step \"" + step.variant + "\"."; } for (std::string_view bad : {"level", "level slot=1", "level min=5", "level slot=0 min=5", "level slot=1 min=101"}){ - if (parse_level_variant(bad)){ + if (parse_level_step(legacy_game_step(bad))){ return "Expected \"" + std::string(bad) + "\" refused."; } } diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryCapture.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryCapture.cpp index f292e12fd2..877265def1 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryCapture.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryCapture.cpp @@ -22,6 +22,7 @@ #include "VideoGames/PokemonFRLG/Programs/PokemonFRLG_BattleMenuNavigation.h" #include "PokemonFRLG_AutoStoryActions.h" #include "PokemonFRLG_AutoStoryCapture.h" +#include "PokemonFRLG_AutoStoryVariantWords.h" namespace PokemonAutomation{ namespace NintendoSwitch{ @@ -36,35 +37,8 @@ namespace{ constexpr size_t PARTY_SIZE = 6; constexpr size_t MOVE_COUNT = 4; -std::vector words_of(std::string_view text){ - std::vector words; - while (!text.empty()){ - const size_t space = text.find(' '); - const std::string_view word = text.substr(0, space); - if (!word.empty()){ - words.push_back(word); - } - if (space == std::string_view::npos){ - break; - } - text.remove_prefix(space + 1); - } - return words; -} - -std::optional number_of(std::string_view text){ - if (text.empty() || text.size() > 4){ - return std::nullopt; - } - size_t value = 0; - for (char c : text){ - if (c < '0' || c > '9'){ - return std::nullopt; - } - value = value * 10 + size_t(c - '0'); - } - return value; -} +// The most a count names: four digits. +constexpr int64_t MAX_COUNT = 9999; std::optional direction_of(std::string_view text){ for (Direction direction : Pokemon::ALL_DIRECTIONS){ @@ -110,59 +84,50 @@ const char* capture_end_name(CaptureEnd end){ } -std::string capture_variant(const CapturePlan& plan){ - std::string variant = std::format( - "{}{} catches={} encounters={} balls={} pace={}", - CAPTURE_VARIANT_PREFIX, plan.species, plan.catches, plan.max_encounters, plan.max_balls, direction_name(plan.pace) - ); +Pokemon::StoryArgs capture_args(const CapturePlan& plan){ + Pokemon::StoryArgs args{ + {"species", plan.species}, + {"catches", static_cast(plan.catches)}, + {"encounters", static_cast(plan.max_encounters)}, + {"balls", static_cast(plan.max_balls)}, + {"pace", std::string(direction_name(plan.pace))}, + }; if (plan.weaken_move){ - variant += std::format(" move={} turns={}", *plan.weaken_move + 1, plan.max_weaken_turns); + args["move"] = static_cast(*plan.weaken_move + 1); + args["turns"] = static_cast(plan.max_weaken_turns); } - return variant; + return args; } -std::optional parse_capture_variant(std::string_view variant){ - if (!variant.starts_with(CAPTURE_VARIANT_PREFIX)){ +std::optional parse_capture_step(const Pokemon::StoryStep& step){ + const Pokemon::StoryArgs* args = game_step_args(step, CAPTURE_VARIANT, CAPTURE_ARGS); + if (args == nullptr + || !arg_number_within(*args, "catches", 1, MAX_COUNT) || !arg_number_within(*args, "encounters", 1, MAX_COUNT) + || !arg_number_within(*args, "balls", 1, MAX_COUNT) || !arg_number_within(*args, "move", 1, static_cast(MOVE_COUNT)) + || !arg_number_within(*args, "turns", 0, MAX_COUNT) + ){ return std::nullopt; } - const std::vector words = words_of(variant.substr(CAPTURE_VARIANT_PREFIX.size())); - if (words.empty() || words[0].find('=') != std::string_view::npos){ + CapturePlan plan; + plan.species = std::string(*Pokemon::story_arg_text(*args, "species")); + if (plan.species.empty()){ return std::nullopt; } - CapturePlan plan; - plan.species = std::string(words[0]); - for (size_t c = 1; c < words.size(); c++){ - const size_t equals = words[c].find('='); - if (equals == std::string_view::npos){ - return std::nullopt; - } - const std::string_view key = words[c].substr(0, equals); - const std::string_view value = words[c].substr(equals + 1); - if (key == "pace"){ - const std::optional pace = direction_of(value); - if (!pace){ - return std::nullopt; - } - plan.pace = *pace; - continue; - } - const std::optional number = number_of(value); - if (!number){ - return std::nullopt; - } - if (key == "catches" && *number >= 1){ - plan.catches = *number; - }else if (key == "encounters" && *number >= 1){ - plan.max_encounters = *number; - }else if (key == "balls" && *number >= 1){ - plan.max_balls = *number; - }else if (key == "move" && *number >= 1 && *number <= MOVE_COUNT){ - plan.weaken_move = *number - 1; - }else if (key == "turns"){ - plan.max_weaken_turns = *number; - }else{ + plan.catches = static_cast(*Pokemon::story_arg_number(*args, "catches")); + plan.max_encounters = static_cast(*Pokemon::story_arg_number(*args, "encounters")); + plan.max_balls = static_cast(*Pokemon::story_arg_number(*args, "balls")); + if (const std::optional pace = Pokemon::story_arg_text(*args, "pace")){ + const std::optional direction = direction_of(*pace); + if (!direction){ return std::nullopt; } + plan.pace = *direction; + } + if (const std::optional move = Pokemon::story_arg_number(*args, "move")){ + plan.weaken_move = static_cast(*move) - 1; + } + if (const std::optional turns = Pokemon::story_arg_number(*args, "turns")){ + plan.max_weaken_turns = static_cast(*turns); } return plan; } @@ -172,7 +137,8 @@ Pokemon::StoryStep capture_step(std::string name, std::string why, const Capture step.kind = Pokemon::StoryStepKind::GAME; step.name = std::move(name); step.why = std::move(why); - step.variant = capture_variant(plan); + step.variant = CAPTURE_VARIANT; + step.args = capture_args(plan); return step; } @@ -181,7 +147,8 @@ Pokemon::StoryStep pc_step(std::string name, std::string why, const PcTransfer& step.kind = Pokemon::StoryStepKind::GAME; step.name = std::move(name); step.why = std::move(why); - step.variant = pc_variant(transfer); + step.variant = PC_VARIANT; + step.args = pc_args(transfer); return step; } @@ -396,8 +363,8 @@ std::optional run_storage_game_step( Logger& logger, VideoStream* stream, const Pokemon::StoryStep& step, CaptureActions& capture, PcStorageActions& pc ){ - if (step.variant.starts_with(CAPTURE_VARIANT_PREFIX)){ - const std::optional plan = parse_capture_variant(step.variant); + if (step.variant == CAPTURE_VARIANT){ + const std::optional plan = parse_capture_step(step); if (!plan){ return Pokemon::outcome_failed("bad_variant", step.variant); } @@ -416,8 +383,8 @@ std::optional run_storage_game_step( } return Pokemon::outcome_failed(std::string("capture_") + capture_end_name(result.end), message); } - if (step.variant.starts_with(PC_VARIANT_PREFIX)){ - const std::optional transfer = parse_pc_variant(step.variant); + if (step.variant == PC_VARIANT){ + const std::optional transfer = parse_pc_step(step); if (!transfer){ return Pokemon::outcome_failed("bad_variant", step.variant); } diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryCapture.h b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryCapture.h index 26b99c5df5..b273878c59 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryCapture.h +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryCapture.h @@ -65,17 +65,27 @@ struct CapturePlan{ size_t max_weaken_turns = 2; }; -// The prefix of a GAME step's variant that names a capture step. -inline constexpr std::string_view CAPTURE_VARIANT_PREFIX = "capture "; - -// `plan` as a GAME step's variant, e.g. "capture rattata catches=1 -// encounters=20 balls=5 pace=east", with " move=1 turns=2" when it -// weakens (the move counted from 1). -std::string capture_variant(const CapturePlan& plan); -// A variant from capture_variant(), whose keys after the species may come -// in any order or be left out (their defaults); nothing if `variant` isn't -// one or has a key or value it doesn't know. -std::optional parse_capture_variant(std::string_view variant); +// The variant of a GAME step that is a capture step. +inline constexpr std::string_view CAPTURE_VARIANT = "capture"; +// Its args: the species, how many, the encounters and balls to spend, +// the pace, and the move to weaken with for how many turns. +inline constexpr Pokemon::StoryArgSpec CAPTURE_ARGS[] = { + {"species", Pokemon::StoryArgType::TEXT, true}, + {"catches", Pokemon::StoryArgType::NUMBER, true}, + {"encounters", Pokemon::StoryArgType::NUMBER, true}, + {"balls", Pokemon::StoryArgType::NUMBER, true}, + {"pace", Pokemon::StoryArgType::TEXT, false}, + {"move", Pokemon::StoryArgType::NUMBER, false}, + {"turns", Pokemon::StoryArgType::NUMBER, false}, +}; + +// `plan` as a capture step's args, e.g. {"species": "rattata", "catches": +// 1, "encounters": 20, "balls": 5, "pace": "east"}, with "move": 1, +// "turns": 2 when it weakens (the move counted from 1). +Pokemon::StoryArgs capture_args(const CapturePlan& plan); +// The plan a capture step (capture_step()) runs, the pace east and no +// weakening unless it says; nothing if it isn't one. +std::optional parse_capture_step(const Pokemon::StoryStep& step); // The table's step that runs `plan`. Pokemon::StoryStep capture_step(std::string name, std::string why, const CapturePlan& plan); diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryCapture_Tests.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryCapture_Tests.cpp index 39310cd804..27ae84a690 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryCapture_Tests.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryCapture_Tests.cpp @@ -22,6 +22,7 @@ #include "Pokemon/AutoStory/Pokemon_StorySegments.h" #include "Pokemon/AutoStory/Pokemon_StorySteps.h" #include "PokemonFRLG_AutoStoryCapture.h" +#include "PokemonFRLG_AutoStoryVariantWords.h" namespace PokemonAutomation{ namespace NintendoSwitch{ @@ -349,30 +350,32 @@ UnitTestResult test_capture_variant(){ .weaken_move = 3, .max_weaken_turns = 1}, }; for (const CapturePlan& plan : plans){ - const std::string variant = capture_variant(plan); - const std::optional back = parse_capture_variant(variant); + const std::optional back = parse_capture_step(capture_step("catch", "", plan)); if (!back || back->species != plan.species || back->catches != plan.catches || back->max_encounters != plan.max_encounters || back->max_balls != plan.max_balls || back->pace != plan.pace || back->weaken_move != plan.weaken_move || (plan.weaken_move && back->max_weaken_turns != plan.max_weaken_turns) ){ - return "\"" + variant + "\" didn't read back as the plan it was made from."; + return "The capture step for " + plan.species + " didn't read back as the plan it was made from."; } } - const std::optional short_form = parse_capture_variant("capture rattata"); - if (!short_form || short_form->species != "rattata" || short_form->max_balls != 5 || short_form->weaken_move){ - return "Expected \"capture rattata\" to read with the defaults."; + const std::string_view positional[] = {"species"}; + const std::optional short_form = parse_capture_step(legacy_game_step("capture rattata catches=1 encounters=20 balls=5", positional)); + if (!short_form || short_form->species != "rattata" || short_form->pace != Direction::EAST || short_form->weaken_move){ + return "Expected a capture step without a pace or a move to pace east and not weaken."; } for (std::string_view bad : { - "capture", "capture ", "capture balls=3", "capture rattata balls=0", "capture rattata move=5", - "capture rattata pace=up", "capture rattata colour=red", "capture rattata balls", "pc deposit slot=2 box=1", + "capture", "capture rattata", "capture catches=1 encounters=20 balls=3", "capture rattata catches=1 encounters=20 balls=0", + "capture rattata catches=1 encounters=20 balls=5 move=5", "capture rattata catches=1 encounters=20 balls=5 pace=up", + "capture rattata catches=1 encounters=20 balls=5 colour=red", "capture rattata catches=1 encounters=20 balls", + "pc deposit slot=2 box=1", }){ - if (parse_capture_variant(bad)){ + if (parse_capture_step(legacy_game_step(bad, positional))){ return "Expected \"" + std::string(bad) + "\" refused."; } } const Pokemon::StoryStep step = capture_step("catch_rattata", "Cut user", RATTATA); - if (step.kind != Pokemon::StoryStepKind::GAME || !parse_capture_variant(step.variant)){ + if (step.kind != Pokemon::StoryStepKind::GAME || !parse_capture_step(step)){ return "Expected capture_step() to be a GAME step with a capture variant."; } return true; diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryCeladon_Tests.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryCeladon_Tests.cpp index 922b9c0e18..f1f8f71bf6 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryCeladon_Tests.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryCeladon_Tests.cpp @@ -209,12 +209,12 @@ UnitTestResult test_bike_voucher_row(){ UnitTestResult test_repels_and_escape_ropes(){ const StoryCheckpoint& row = checkpoint("00.26"); const auto step = std::find_if(row.steps.begin(), row.steps.end(), [](const StoryStep& data){ - return parse_mart_variant(data.variant).has_value(); + return parse_mart_step(data).has_value(); }); if (step == row.steps.end()){ return "00.26: expected a Mart step."; } - const MartPlan plan = *parse_mart_variant(step->variant); + const MartPlan plan = *parse_mart_step(*step); if (plan.map != StoryTable::CERULEAN_MART || !plan.money_floor){ return "00.26: expected the Mart step at Cerulean's Mart, with a money floor."; } diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryChoice.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryChoice.cpp index 7bd64d3949..f147661dcd 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryChoice.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryChoice.cpp @@ -11,6 +11,7 @@ #include "NintendoSwitch/Commands/NintendoSwitch_Commands_PushButtons.h" #include "PokemonFRLG_AutoStoryActions.h" #include "PokemonFRLG_AutoStoryChoice.h" +#include "PokemonFRLG_AutoStoryVariantWords.h" namespace PokemonAutomation{ namespace NintendoSwitch{ @@ -50,15 +51,12 @@ const char* choice_end_name(ChoiceEnd end){ } -std::string fossil_variant(Fossil fossil){ - return std::string(FOSSIL_VARIANT_PREFIX) + fossil_name(fossil); -} - -std::optional parse_fossil_variant(std::string_view variant){ - if (!variant.starts_with(FOSSIL_VARIANT_PREFIX)){ +std::optional parse_fossil_step(const Pokemon::StoryStep& step){ + const Pokemon::StoryArgs* args = game_step_args(step, FOSSIL_VARIANT, FOSSIL_ARGS); + if (args == nullptr){ return std::nullopt; } - return fossil_from_name(variant.substr(FOSSIL_VARIANT_PREFIX.size())); + return fossil_from_name(*Pokemon::story_arg_text(*args, "fossil")); } Pokemon::StoryStep fossil_step(std::string name, std::string why, Fossil fossil){ @@ -66,7 +64,8 @@ Pokemon::StoryStep fossil_step(std::string name, std::string why, Fossil fossil) step.kind = Pokemon::StoryStepKind::GAME; step.name = std::move(name); step.why = std::move(why); - step.variant = fossil_variant(fossil); + step.variant = FOSSIL_VARIANT; + step.args = {{"fossil", std::string(fossil_name(fossil))}}; return step; } diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryChoice.h b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryChoice.h index 59443c6675..d748efe1f1 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryChoice.h +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryChoice.h @@ -54,13 +54,16 @@ std::optional fossil_from_name(std::string_view name); // Where `fossil` lies on MtMoon_B2F (map.json object_events). Pokemon::TilePos fossil_tile(Fossil fossil); -// The prefix of a GAME step's variant that names the fossil CHOICE. -inline constexpr std::string_view FOSSIL_VARIANT_PREFIX = "fossil "; +// The variant of a GAME step that is the fossil CHOICE. +inline constexpr std::string_view FOSSIL_VARIANT = "fossil"; +// Its args: the fossil, "helix" or "dome". +inline constexpr Pokemon::StoryArgSpec FOSSIL_ARGS[] = { + {"fossil", Pokemon::StoryArgType::TEXT, true}, +}; -// "fossil helix" or "fossil dome". -std::string fossil_variant(Fossil fossil); -// Parses a fossil CHOICE variant string. -std::optional parse_fossil_variant(std::string_view variant); +// The fossil a fossil CHOICE step (fossil_step()) takes; nothing if it +// isn't one. +std::optional parse_fossil_step(const Pokemon::StoryStep& step); // The table's CHOICE(fossil) step, the player facing the fossil. Pokemon::StoryStep fossil_step(std::string name, std::string why, Fossil fossil); diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryChoice_Tests.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryChoice_Tests.cpp index 432ff26b00..c144af3703 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryChoice_Tests.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryChoice_Tests.cpp @@ -14,6 +14,7 @@ #include "Common/Cpp/Exceptions.h" #include "Common/Cpp/TestRunners/UnitTest.h" #include "PokemonFRLG_AutoStoryChoice.h" +#include "PokemonFRLG_AutoStoryVariantWords.h" namespace PokemonAutomation{ namespace NintendoSwitch{ @@ -179,11 +180,15 @@ UnitTestResult test_fossil_choice(){ UnitTestResult test_fossil_variant(){ - if (fossil_variant(Fossil::HELIX) != "fossil helix" || parse_fossil_variant("fossil dome") != Fossil::DOME){ - return "Expected \"fossil helix\" and \"fossil dome\"."; + const std::string_view positional[] = {"fossil"}; + const Pokemon::StoryStep helix = fossil_step("fossil", "", Fossil::HELIX); + if (helix.variant != FOSSIL_VARIANT || Pokemon::story_arg_text(helix.args, "fossil") != "helix" + || parse_fossil_step(helix) != Fossil::HELIX || parse_fossil_step(legacy_game_step("fossil dome", positional)) != Fossil::DOME + ){ + return "Expected the helix and dome fossil steps."; } for (std::string_view bad : {"fossil", "fossil old_amber", "fossil helix dome", "grind level=18"}){ - if (parse_fossil_variant(bad)){ + if (parse_fossil_step(legacy_game_step(bad, positional))){ return "Expected \"" + std::string(bad) + "\" refused."; } } diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryEvents.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryEvents.cpp index df858d3c49..2aad5b3368 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryEvents.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryEvents.cpp @@ -479,9 +479,9 @@ std::optional> fixed_route( Pokemon::Pose paced_pose(const Pokemon::Pose& patch, const StoryStep& step){ std::optional pace; - if (const std::optional grind = parse_grind_variant(step.variant)){ + if (const std::optional grind = parse_grind_step(step)){ pace = grind->pace; - }else if (const std::optional capture = parse_capture_variant(step.variant)){ + }else if (const std::optional capture = parse_capture_step(step)){ pace = capture->pace; } const std::vector tiles = Pokemon::tiles_of(patch); @@ -600,7 +600,7 @@ std::optional run_abilities(StoryEnv& env, RunState& state, const Story ); ConsoleChoiceActions choice(env.console, env.context); StoryAbilities abilities{console_member_reader(env.console, env.context, env.language), mart, teach, grind, choice}; - if (const std::optional plan = parse_grind_check_variant(step.variant)){ + if (const std::optional plan = parse_grind_check_step(step)){ if (grind_reached_already(env.console.logger(), grind, abilities.members, *plan)){ state.flags.insert(step.name); } diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryGrind.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryGrind.cpp index 38f4afba33..670a4dbe47 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryGrind.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryGrind.cpp @@ -5,6 +5,7 @@ */ #include +#include #include #include "CommonFramework/Exceptions/OperationFailedException.h" #include "PokemonFRLG_AutoStoryActions.h" @@ -35,96 +36,85 @@ const char* grind_end_name(GrindEnd end){ } -std::string grind_variant(const GrindPlan& plan){ - std::string variant = std::format( - "{}slot={} level={} encounters={} pace={} heal_every={}", - GRIND_VARIANT_PREFIX, plan.member + 1, plan.level, plan.max_encounters, - direction_name(plan.pace), plan.heal_every - ); +Pokemon::StoryArgs grind_args(const GrindPlan& plan){ + Pokemon::StoryArgs args{ + {"slot", static_cast(plan.member + 1)}, + {"level", static_cast(plan.level)}, + {"encounters", static_cast(plan.max_encounters)}, + {"pace", std::string(direction_name(plan.pace))}, + {"heal_every", static_cast(plan.heal_every)}, + }; if (!plan.trainer.empty()){ - variant += std::format(" beat={} chance={:.0f}", plan.trainer, 100 * plan.min_chance); + args["beat"] = plan.trainer; + args["chance"] = static_cast(std::llround(100 * plan.min_chance)); } - return variant; + return args; } namespace{ -bool set_grind_word(GrindPlan& plan, std::string_view word){ - const std::optional pair = variant_pair(word); - if (!pair){ - return false; - } - if (pair->key == "beat"){ - plan.trainer = std::string(pair->value); - return !plan.trainer.empty(); - } - if (pair->key == "pace"){ - for (Direction direction : Pokemon::ALL_DIRECTIONS){ - if (pair->value == direction_name(direction)){ - plan.pace = direction; - return true; - } +// The most a count names: four digits. +constexpr int64_t MAX_COUNT = 9999; + +std::optional direction_from_name(std::string_view name){ + for (Direction direction : Pokemon::ALL_DIRECTIONS){ + if (name == direction_name(direction)){ + return direction; } - return false; } - const std::optional number = variant_number(pair->value, 4); - if (!number){ - return false; - } - if (pair->key == "slot" && *number >= 1 && *number <= PARTY_SLOTS){ - plan.member = *number - 1; - }else if (pair->key == "level" && *number >= 2 && *number <= 100){ - plan.level = (unsigned)*number; - }else if (pair->key == "encounters" && *number >= 1){ - plan.max_encounters = *number; - }else if (pair->key == "heal_every"){ - plan.heal_every = *number; - }else if (pair->key == "chance" && *number >= 1 && *number <= 100){ - plan.min_chance = static_cast(*number) / 100; - }else{ - return false; - } - return true; + return std::nullopt; } -} // namespace - -std::optional parse_grind_variant(std::string_view variant){ - if (!variant.starts_with(GRIND_VARIANT_PREFIX)){ +// `args` (checked against GRIND_ARGS) as a plan; nothing if a value is out +// of range, or a chance has no trainer to be against. +std::optional grind_plan(const Pokemon::StoryArgs& args){ + using Pokemon::story_arg_number; + if (!arg_number_within(args, "slot", 1, static_cast(PARTY_SLOTS)) || !arg_number_within(args, "level", 2, 100) + || !arg_number_within(args, "encounters", 1, MAX_COUNT) || !arg_number_within(args, "heal_every", 0, MAX_COUNT) + || !arg_number_within(args, "chance", 1, 100) + ){ return std::nullopt; } - GrindPlan plan; - bool level_seen = false; - bool chance_seen = false; - for (std::string_view word : variant_words(variant.substr(GRIND_VARIANT_PREFIX.size()))){ - if (!set_grind_word(plan, word)){ - return std::nullopt; - } - level_seen |= word.starts_with("level="); - chance_seen |= word.starts_with("chance="); - } - // A chance needs a trainer to be against. - if (!level_seen || (chance_seen && plan.trainer.empty())){ + const std::optional pace = direction_from_name(*Pokemon::story_arg_text(args, "pace")); + const std::optional trainer = Pokemon::story_arg_text(args, "beat"); + const std::optional chance = story_arg_number(args, "chance"); + if (!pace || (trainer && trainer->empty()) || (chance && !trainer)){ return std::nullopt; } + GrindPlan plan; + plan.member = static_cast(*story_arg_number(args, "slot")) - 1; + plan.level = static_cast(*story_arg_number(args, "level")); + plan.max_encounters = static_cast(*story_arg_number(args, "encounters")); + plan.pace = *pace; + plan.heal_every = static_cast(story_arg_number(args, "heal_every").value_or(0)); + plan.trainer = std::string(trainer.value_or("")); + if (chance){ + plan.min_chance = static_cast(*chance) / 100; + } return plan; } +} // namespace + +std::optional parse_grind_step(const Pokemon::StoryStep& step){ + const Pokemon::StoryArgs* args = game_step_args(step, GRIND_VARIANT, GRIND_ARGS); + return args == nullptr ? std::nullopt : grind_plan(*args); +} + Pokemon::StoryStep grind_step(std::string name, std::string why, const GrindPlan& plan, Pokemon::Pose nurse){ Pokemon::StoryStep step; step.kind = Pokemon::StoryStepKind::GAME; step.name = std::move(name); step.why = std::move(why); - step.variant = grind_variant(plan); + step.variant = GRIND_VARIANT; + step.args = grind_args(plan); step.target = std::move(nurse); return step; } -std::optional parse_grind_check_variant(std::string_view variant){ - if (!variant.starts_with(GRIND_CHECK_VARIANT_PREFIX)){ - return std::nullopt; - } - return parse_grind_variant(std::string(GRIND_VARIANT_PREFIX) + std::string(variant.substr(GRIND_CHECK_VARIANT_PREFIX.size()))); +std::optional parse_grind_check_step(const Pokemon::StoryStep& step){ + const Pokemon::StoryArgs* args = game_step_args(step, GRIND_CHECK_VARIANT, GRIND_ARGS); + return args == nullptr ? std::nullopt : grind_plan(*args); } Pokemon::StoryStep grind_check_step(std::string name, std::string why, const GrindPlan& plan){ @@ -132,7 +122,8 @@ Pokemon::StoryStep grind_check_step(std::string name, std::string why, const Gri step.kind = Pokemon::StoryStepKind::GAME; step.name = std::move(name); step.why = std::move(why); - step.variant = std::string(GRIND_CHECK_VARIANT_PREFIX) + grind_variant(plan).substr(GRIND_VARIANT_PREFIX.size()); + step.variant = GRIND_CHECK_VARIANT; + step.args = grind_args(plan); return step; } diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryGrind.h b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryGrind.h index 34953a85f2..8c02694d9b 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryGrind.h +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryGrind.h @@ -72,26 +72,38 @@ struct GrindPlan{ double min_chance = MIN_WIN_CHANCE; }; -// The prefix of a GAME step's variant that names a GRIND step. -inline constexpr std::string_view GRIND_VARIANT_PREFIX = "grind "; +// The variant of a GAME step that is a GRIND step. +inline constexpr std::string_view GRIND_VARIANT = "grind"; +// Its args, and a GRIND_CHECK step's: the lead's slot, the level, the +// encounters and the pace; the nurse's visits, and the trainer to beat +// with the chance to reach. +inline constexpr Pokemon::StoryArgSpec GRIND_ARGS[] = { + {"slot", Pokemon::StoryArgType::NUMBER, true}, + {"level", Pokemon::StoryArgType::NUMBER, true}, + {"encounters", Pokemon::StoryArgType::NUMBER, true}, + {"pace", Pokemon::StoryArgType::TEXT, true}, + {"heal_every", Pokemon::StoryArgType::NUMBER, false}, + {"beat", Pokemon::StoryArgType::TEXT, false}, + {"chance", Pokemon::StoryArgType::NUMBER, false}, +}; -// `plan` as a variant: "grind slot=1 level=18 encounters=60 pace=east -// heal_every=8", the slot counted from 1, and with a trainer -// " beat=TRAINER_RIVAL_CERULEAN_BULBASAUR chance=70", the chance in -// percent. The step's target is the nurse. -std::string grind_variant(const GrindPlan& plan); -// Parses a grinding plan from a variant string. -std::optional parse_grind_variant(std::string_view variant); +// `plan` as a GRIND step's args: {"slot": 1, "level": 18, "encounters": +// 60, "pace": "east", "heal_every": 8}, the slot counted from 1, and with +// a trainer "beat": "TRAINER_RIVAL_CERULEAN_BULBASAUR", "chance": 70, the +// chance in percent. The step's target is the nurse. +Pokemon::StoryArgs grind_args(const GrindPlan& plan); +// The plan a GRIND step (grind_step()) runs; nothing if it isn't one. +std::optional parse_grind_step(const Pokemon::StoryStep& step); // The table's GRIND step: `nurse` is where the player faces the nurse. Pokemon::StoryStep grind_step(std::string name, std::string why, const GrindPlan& plan, Pokemon::Pose nurse); -// The prefix of a GAME step's variant that checks a GRIND step's plan -// before the walk out to its patch, e.g. "grind_check slot=1 level=32 -// ...", the rest as grind_variant()'s. -inline constexpr std::string_view GRIND_CHECK_VARIANT_PREFIX = "grind_check "; -// Parses a grind check variant string into its GrindPlan. -std::optional parse_grind_check_variant(std::string_view variant); +// The variant of a GAME step that checks a GRIND step's plan before the +// walk out to its patch, with grind_args() as its args. +inline constexpr std::string_view GRIND_CHECK_VARIANT = "grind_check"; +// The plan a grind check step (grind_check_step()) checks; nothing if it +// isn't one. +std::optional parse_grind_check_step(const Pokemon::StoryStep& step); // The table's check before the walk out to a GRIND step's patch: when the // lead already has what `plan` grinds for, the step sets a run flag named diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryGrind_Tests.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryGrind_Tests.cpp index 963f819dfd..e9337729e7 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryGrind_Tests.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryGrind_Tests.cpp @@ -18,6 +18,7 @@ #include "Common/Cpp/TestRunners/UnitTest.h" #include "PokemonFRLG_AutoStoryBattleSim.h" #include "PokemonFRLG_AutoStoryGrind.h" +#include "PokemonFRLG_AutoStoryVariantWords.h" namespace PokemonAutomation{ namespace NintendoSwitch{ @@ -437,33 +438,42 @@ UnitTestResult test_grind_variant(){ plan.max_encounters = 60; plan.pace = Pokemon::Direction::NORTH; plan.heal_every = 8; - const std::string variant = grind_variant(plan); - if (variant != "grind slot=1 level=18 encounters=60 pace=north heal_every=8"){ - return "Unexpected variant \"" + variant + "\"."; + const Pokemon::StoryStep step = grind_step("grind", "", plan, Pokemon::Pose{}); + const Pokemon::StoryArgs expected{ + {"slot", int64_t(1)}, {"level", int64_t(18)}, {"encounters", int64_t(60)}, {"pace", "north"}, {"heal_every", int64_t(8)}, + }; + if (step.variant != GRIND_VARIANT || step.args != expected){ + return "Unexpected GRIND step \"" + step.variant + "\"."; } - const std::optional back = parse_grind_variant(variant); + const std::optional back = parse_grind_step(step); if (!back || back->level != 18 || back->max_encounters != 60 || back->pace != Pokemon::Direction::NORTH || back->heal_every != 8 || back->member != 0 ){ - return "\"" + variant + "\" didn't read back as its plan."; + return "The GRIND step didn't read back as its plan."; } GrindPlan rival = beat_rival(30); rival.max_encounters = 100; rival.pace = Pokemon::Direction::WEST; - const std::string rival_variant = grind_variant(rival); - if (rival_variant != "grind slot=1 level=30 encounters=100 pace=west heal_every=0 beat=TRAINER_RIVAL_CERULEAN_BULBASAUR chance=50"){ - return "Unexpected variant \"" + rival_variant + "\"."; + Pokemon::StoryStep rival_step = grind_step("grind", "", rival, Pokemon::Pose{}); + if (Pokemon::story_arg_text(rival_step.args, "beat") != "TRAINER_RIVAL_CERULEAN_BULBASAUR" + || Pokemon::story_arg_number(rival_step.args, "chance") != 50 + ){ + return "Expected the rival's GRIND step to name the rival and a 50% chance."; } - const std::optional rival_back = parse_grind_variant(rival_variant + " chance=75"); + rival_step.args["chance"] = int64_t(75); + const std::optional rival_back = parse_grind_step(rival_step); if (!rival_back || rival_back->trainer != RIVAL || rival_back->level != 30 || rival_back->min_chance != 0.75){ - return "\"" + rival_variant + " chance=75\" didn't read back as its plan."; + return "The rival's GRIND step with a 75% chance didn't read back as its plan."; } for (std::string_view bad : { - "grind", "grind slot=1", "grind slot=1 level=101", "grind slot=7 level=18", "grind level=18 pace=up", - "grind level=18 encounters=0", "capture rattata", "grind level=30 beat=", "grind level=30 chance=70", - "grind level=30 beat=TRAINER_X chance=0", "grind level=30 beat=TRAINER_X chance=101", + "grind", "grind slot=1", "grind slot=1 level=101 encounters=60 pace=east", "grind slot=7 level=18 encounters=60 pace=east", + "grind slot=1 level=18 encounters=60 pace=up", "grind slot=1 level=18 encounters=0 pace=east", + "capture rattata", "grind slot=1 level=30 encounters=60 pace=east beat=", + "grind slot=1 level=30 encounters=60 pace=east chance=70", + "grind slot=1 level=30 encounters=60 pace=east beat=TRAINER_X chance=0", + "grind slot=1 level=30 encounters=60 pace=east beat=TRAINER_X chance=101", }){ - if (parse_grind_variant(bad)){ + if (parse_grind_step(legacy_game_step(bad))){ return "Expected \"" + std::string(bad) + "\" refused."; } } @@ -487,8 +497,8 @@ UnitTestResult test_grind_reached_already(){ } } const Pokemon::StoryStep check = grind_check_step("rival_winnable", "", beat_rival(30)); - const std::optional back = parse_grind_check_variant(check.variant); - if (!back || back->trainer != RIVAL || back->level != 30 || parse_grind_variant(check.variant)){ + const std::optional back = parse_grind_check_step(check); + if (!back || back->trainer != RIVAL || back->level != 30 || parse_grind_step(check)){ return "\"" + check.variant + "\" didn't read back as its plan, or read as a GRIND step."; } return true; diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryMart.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryMart.cpp index 937ae6c217..e79a5241ce 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryMart.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryMart.cpp @@ -79,24 +79,8 @@ std::optional stock_row(const std::vector& stock, std::st return std::nullopt; } -// Sets one "key=value" of a Mart variant into `plan`. False if it can't. -bool set_mart_word(MartPlan& plan, std::string_view word){ - const std::optional pair = variant_pair(word); - const std::optional number = pair ? variant_number(pair->value) : std::nullopt; - if (!number){ - return false; - } - if (pair->key == "budget"){ - plan.budget = *number; - }else if (pair->key == "floor"){ - plan.money_floor = *number; - }else if (*number >= 1 && *number <= MAX_QUANTITY && stock_row(mart_stock(plan.map), pair->key)){ - plan.lines.push_back({std::string(pair->key), *number}); - }else{ - return false; - } - return true; -} +// The most money a budget or floor names: six digits. +constexpr int64_t MAX_MONEY = 999999; } // namespace @@ -118,34 +102,37 @@ const char* mart_end_name(MartEnd end){ } -std::string mart_variant(const MartPlan& plan){ - std::string variant = std::format("{}{} budget={}", MART_VARIANT_PREFIX, plan.map, plan.budget); +Pokemon::StoryArgs mart_args(const MartPlan& plan){ + Pokemon::StoryArgs args{ + {"map", plan.map}, + {"budget", static_cast(plan.budget)}, + }; if (plan.money_floor){ - variant += std::format(" floor={}", *plan.money_floor); - } - for (const MartLine& line : plan.lines){ - variant += std::format(" {}={}", line.item, line.quantity); + args["floor"] = static_cast(*plan.money_floor); } - return variant; + return args; } -std::optional parse_mart_variant(std::string_view variant){ - if (!variant.starts_with(MART_VARIANT_PREFIX)){ +std::optional parse_mart_step(const Pokemon::StoryStep& step){ + const Pokemon::StoryArgs* args = game_step_args(step, MART_VARIANT, MART_ARGS); + if (args == nullptr || !arg_number_within(*args, "budget", 0, MAX_MONEY) || !arg_number_within(*args, "floor", 0, MAX_MONEY)){ return std::nullopt; } - const std::vector words = variant_words(variant.substr(MART_VARIANT_PREFIX.size())); - if (words.empty() || mart_stock(words[0]).empty()){ + MartPlan plan; + plan.map = std::string(*Pokemon::story_arg_text(*args, "map")); + const std::vector& stock = mart_stock(plan.map); + if (stock.empty() || step.items.empty()){ return std::nullopt; } - MartPlan plan; - plan.map = std::string(words[0]); - for (size_t c = 1; c < words.size(); c++){ - if (!set_mart_word(plan, words[c])){ + plan.budget = static_cast(*Pokemon::story_arg_number(*args, "budget")); + if (const std::optional floor = Pokemon::story_arg_number(*args, "floor")){ + plan.money_floor = static_cast(*floor); + } + for (const Pokemon::StoryItem& item : step.items){ + if (item.quantity < 1 || item.quantity > MAX_QUANTITY || !stock_row(stock, item.item)){ return std::nullopt; } - } - if (plan.lines.empty()){ - return std::nullopt; + plan.lines.push_back({item.item, item.quantity}); } return plan; } @@ -155,7 +142,11 @@ Pokemon::StoryStep mart_step(std::string name, std::string why, const MartPlan& step.kind = Pokemon::StoryStepKind::GAME; step.name = std::move(name); step.why = std::move(why); - step.variant = mart_variant(plan); + step.variant = MART_VARIANT; + step.args = mart_args(plan); + for (const MartLine& line : plan.lines){ + step.items.push_back({line.item, line.quantity}); + } step.once_per_save = true; return step; } diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryMart.h b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryMart.h index 70b137b0ec..6d4761f9b6 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryMart.h +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryMart.h @@ -84,15 +84,22 @@ struct MartPlan{ std::optional money_floor = std::nullopt; }; -// The prefix of a GAME step's variant that names a Mart step. -inline constexpr std::string_view MART_VARIANT_PREFIX = "mart "; - -// `plan` as a variant: "mart PewterCity_Mart budget=2000 floor=2400 -// potion=5 repel=3", the lines in order. -std::string mart_variant(const MartPlan& plan); -// A variant from mart_variant(); nothing if it isn't one, has no line, or -// names an item its Mart doesn't sell. -std::optional parse_mart_variant(std::string_view variant); +// The variant of a GAME step that is a Mart step. +inline constexpr std::string_view MART_VARIANT = "mart"; +// Its args: the Mart's map, the budget and the money floor. What it buys +// is the step's items, in priority order. +inline constexpr Pokemon::StoryArgSpec MART_ARGS[] = { + {"map", Pokemon::StoryArgType::TEXT, true}, + {"budget", Pokemon::StoryArgType::NUMBER, true}, + {"floor", Pokemon::StoryArgType::NUMBER, false}, +}; + +// `plan`'s map, budget and floor as a Mart step's args, e.g. {"map": +// "PewterCity_Mart", "budget": 2000, "floor": 2400}. +Pokemon::StoryArgs mart_args(const MartPlan& plan); +// The plan a Mart step (mart_step()) buys; nothing if it isn't one, has no +// item, or names an item its Mart doesn't sell. +std::optional parse_mart_step(const Pokemon::StoryStep& step); // The table's Mart step, once per save (StoryStep::once_per_save): a // retry from the same save skips it when it had nothing to buy. diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryMart_Tests.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryMart_Tests.cpp index 53e24da076..45f5dab77d 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryMart_Tests.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryMart_Tests.cpp @@ -19,6 +19,7 @@ #include "Common/Cpp/Exceptions.h" #include "Common/Cpp/TestRunners/UnitTest.h" #include "PokemonFRLG_AutoStoryMart.h" +#include "PokemonFRLG_AutoStoryVariantWords.h" namespace PokemonAutomation{ namespace NintendoSwitch{ @@ -337,23 +338,36 @@ UnitTestResult test_quantity_presses(){ UnitTestResult test_mart_variant(){ const MartPlan plan = pewter_plan(2000, {{"potion", 5}, {"repel", 3}}, 2400); - const std::string variant = mart_variant(plan); - if (variant != "mart PewterCity_Mart budget=2000 floor=2400 potion=5 repel=3"){ - return "Unexpected variant \"" + variant + "\"."; + const Pokemon::StoryStep step = mart_step("buy", "", plan); + const Pokemon::StoryArgs expected{{"map", "PewterCity_Mart"}, {"budget", int64_t(2000)}, {"floor", int64_t(2400)}}; + if (step.variant != MART_VARIANT || step.args != expected || step.items.size() != 2 || step.items[0].item != "potion"){ + return "Unexpected Mart step \"" + step.variant + "\"."; } - const std::optional back = parse_mart_variant(variant); + const std::optional back = parse_mart_step(step); if (!back || back->map != plan.map || back->budget != 2000 || back->money_floor != plan.money_floor || back->lines.size() != 2 || back->lines[1].item != "repel" || back->lines[1].quantity != 3 ){ - return "\"" + variant + "\" didn't read back as its plan."; + return "The Mart step didn't read back as its plan."; } - for (std::string_view bad : { - "mart", "mart PewterCity_Mart budget=2000", "mart Nowhere_Mart potion=1", - "mart ViridianCity_Mart repel=1", "mart PewterCity_Mart potion=0", "mart PewterCity_Mart potion=100", - "mart PewterCity_Mart potion", "teach hm03 surf slot=1", - }){ - if (parse_mart_variant(bad)){ - return "Expected \"" + std::string(bad) + "\" refused."; + // Each with what makes it bad; items as {item, quantity}. + const std::vector>> bad_steps = { + {"mart", {{"potion", 1}}}, + {"mart PewterCity_Mart budget=2000", {}}, + {"mart PewterCity_Mart", {{"potion", 1}}}, + {"mart Nowhere_Mart budget=2000", {{"potion", 1}}}, + {"mart ViridianCity_Mart budget=2000", {{"repel", 1}}}, + {"mart PewterCity_Mart budget=2000", {{"potion", 0}}}, + {"mart PewterCity_Mart budget=2000", {{"potion", 100}}}, + {"mart PewterCity_Mart budget=2000 potion", {{"potion", 1}}}, + {"mart PewterCity_Mart budget=2000 colour=red", {{"potion", 1}}}, + {"teach hm03 surf budget=2000", {{"potion", 1}}}, + }; + const std::string_view positional[] = {"map"}; + for (const auto& [text, items] : bad_steps){ + Pokemon::StoryStep bad = legacy_game_step(text, positional); + bad.items = items; + if (parse_mart_step(bad)){ + return "Expected \"" + std::string(text) + "\" refused."; } } return true; diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryMember.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryMember.cpp index 6d3f71dd1e..350950cc47 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryMember.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryMember.cpp @@ -30,37 +30,18 @@ MemberReader console_member_reader(ConsoleHandle& console, ProControllerContext& } -std::string level_variant(const LevelCheck& check){ - return std::format("{}slot={} min={}", LEVEL_VARIANT_PREFIX, check.slot + 1, check.level); -} - -std::optional parse_level_variant(std::string_view variant){ - if (!variant.starts_with(LEVEL_VARIANT_PREFIX)){ +std::optional parse_level_step(const Pokemon::StoryStep& step){ + const Pokemon::StoryArgs* args = game_step_args(step, LEVEL_VARIANT, LEVEL_ARGS); + if (args == nullptr + || !arg_number_within(*args, "slot", 1, static_cast(PARTY_SLOTS)) + || !arg_number_within(*args, "min", 1, 100) + ){ return std::nullopt; } - LevelCheck check; - bool slot_seen = false; - bool level_seen = false; - for (std::string_view word : variant_words(variant.substr(LEVEL_VARIANT_PREFIX.size()))){ - const std::optional pair = variant_pair(word); - const std::optional number = pair ? variant_number(pair->value, 3) : std::nullopt; - if (!number){ - return std::nullopt; - } - if (pair->key == "slot" && *number >= 1 && *number <= PARTY_SLOTS){ - check.slot = *number - 1; - slot_seen = true; - }else if (pair->key == "min" && *number >= 1 && *number <= 100){ - check.level = (unsigned)*number; - level_seen = true; - }else{ - return std::nullopt; - } - } - if (!slot_seen || !level_seen){ - return std::nullopt; - } - return check; + return LevelCheck{ + .slot = static_cast(*Pokemon::story_arg_number(*args, "slot")) - 1, + .level = static_cast(*Pokemon::story_arg_number(*args, "min")), + }; } Pokemon::StoryStep level_step(std::string name, std::string why, const LevelCheck& check){ @@ -68,7 +49,11 @@ Pokemon::StoryStep level_step(std::string name, std::string why, const LevelChec step.kind = Pokemon::StoryStepKind::GAME; step.name = std::move(name); step.why = std::move(why); - step.variant = level_variant(check); + step.variant = LEVEL_VARIANT; + step.args = { + {"slot", static_cast(check.slot + 1)}, + {"min", static_cast(check.level)}, + }; return step; } diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryMember.h b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryMember.h index 937c4962f7..c165ad66e0 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryMember.h +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryMember.h @@ -72,13 +72,16 @@ struct LevelCheck{ unsigned level = 1; }; -// The prefix of a GAME step's variant that names a LEVEL step. -inline constexpr std::string_view LEVEL_VARIANT_PREFIX = "level "; +// The variant of a GAME step that is a LEVEL step. +inline constexpr std::string_view LEVEL_VARIANT = "level"; +// Its args: the party slot, counted from 1, and the least level. +inline constexpr Pokemon::StoryArgSpec LEVEL_ARGS[] = { + {"slot", Pokemon::StoryArgType::NUMBER, true}, + {"min", Pokemon::StoryArgType::NUMBER, true}, +}; -// `check` as a variant: "level slot=1 min=16", the slot counted from 1. -std::string level_variant(const LevelCheck& check); -// A variant from level_variant(); nothing if it isn't one. -std::optional parse_level_variant(std::string_view variant); +// The check a LEVEL step (level_step()) makes; nothing if it isn't one. +std::optional parse_level_step(const Pokemon::StoryStep& step); // The table's LEVEL step. Pokemon::StoryStep level_step(std::string name, std::string why, const LevelCheck& check); diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryPcStorage.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryPcStorage.cpp index 380cdaed9a..92ca4debe4 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryPcStorage.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryPcStorage.cpp @@ -10,6 +10,7 @@ #include "VideoGames/PokemonFRLG/PokemonFRLG_Navigation.h" #include "PokemonFRLG_AutoStoryActions.h" #include "PokemonFRLG_AutoStoryPcStorage.h" +#include "PokemonFRLG_AutoStoryVariantWords.h" namespace PokemonAutomation{ namespace NintendoSwitch{ @@ -30,85 +31,57 @@ constexpr size_t STORAGE_MENU_ROWS = 5; // A second look at a frame that reads as the overworld. constexpr Milliseconds OVERWORLD_CONFIRM = 800ms; -std::vector split_words(std::string_view text){ - std::vector words; - while (!text.empty()){ - const size_t space = text.find(' '); - const std::string_view word = text.substr(0, space); - if (!word.empty()){ - words.push_back(word); - } - if (space == std::string_view::npos){ - break; - } - text.remove_prefix(space + 1); - } - return words; -} - -// "key=N" with N from 1 to `max`, as N - 1. -std::optional counted_value(std::string_view word, std::string_view key, size_t max){ - if (!word.starts_with(key) || word.size() <= key.size() + 1 || word[key.size()] != '='){ - return std::nullopt; - } - size_t value = 0; - for (char c : word.substr(key.size() + 1)){ - if (c < '0' || c > '9' || value > max){ - return std::nullopt; - } - value = value * 10 + size_t(c - '0'); - } - if (value < 1 || value > max){ - return std::nullopt; - } - return value - 1; -} - } // namespace -std::string pc_variant(const PcTransfer& transfer){ +std::string pc_transfer_text(const PcTransfer& transfer){ if (transfer.action == PcAction::DEPOSIT){ return std::format( - "{}deposit slot={} box={}{}", PC_VARIANT_PREFIX, transfer.party_slot + 1, transfer.box + 1, + "pc deposit slot={} box={}{}", transfer.party_slot + 1, transfer.box + 1, transfer.if_missing == PcMissing::SKIP ? " if_present" : "" ); } - return std::format("{}withdraw box={} slot={}", PC_VARIANT_PREFIX, transfer.box + 1, transfer.box_slot + 1); + return std::format("pc withdraw box={} slot={}", transfer.box + 1, transfer.box_slot + 1); } -std::optional parse_pc_variant(std::string_view variant){ - if (!variant.starts_with(PC_VARIANT_PREFIX)){ - return std::nullopt; - } - std::vector words = split_words(variant.substr(PC_VARIANT_PREFIX.size())); - PcTransfer transfer; - if (words.size() == 4 && words[0] == "deposit" && words[3] == "if_present"){ - transfer.if_missing = PcMissing::SKIP; - words.pop_back(); - } - if (words.size() != 3){ +Pokemon::StoryArgs pc_args(const PcTransfer& transfer){ + const bool deposit = transfer.action == PcAction::DEPOSIT; + Pokemon::StoryArgs args{ + {"op", std::string(deposit ? "deposit" : "withdraw")}, + {"slot", static_cast((deposit ? transfer.party_slot : transfer.box_slot) + 1)}, + {"box", static_cast(transfer.box + 1)}, + }; + if (deposit && transfer.if_missing == PcMissing::SKIP){ + args["if_present"] = true; + } + return args; +} + +std::optional parse_pc_step(const Pokemon::StoryStep& step){ + const Pokemon::StoryArgs* args = game_step_args(step, PC_VARIANT, PC_ARGS); + if (args == nullptr){ return std::nullopt; } - std::optional slot; - std::optional box; - if (words[0] == "deposit"){ - transfer.action = PcAction::DEPOSIT; - slot = counted_value(words[1], "slot", PARTY_SIZE); - box = counted_value(words[2], "box", BOX_COUNT); - }else if (words[0] == "withdraw"){ - transfer.action = PcAction::WITHDRAW; - box = counted_value(words[1], "box", BOX_COUNT); - slot = counted_value(words[2], "slot", BOX_SLOTS); - } - if (!slot || !box){ + const std::string_view op = *Pokemon::story_arg_text(*args, "op"); + const bool deposit = op == "deposit"; + const bool if_present = Pokemon::story_arg_flag(*args, "if_present"); + if ((!deposit && op != "withdraw") || (!deposit && if_present) + || !arg_number_within(*args, "slot", 1, static_cast(deposit ? PARTY_SIZE : BOX_SLOTS)) + || !arg_number_within(*args, "box", 1, static_cast(BOX_COUNT)) + ){ return std::nullopt; } - transfer.box = *box; - if (transfer.action == PcAction::DEPOSIT){ - transfer.party_slot = *slot; + PcTransfer transfer; + transfer.action = deposit ? PcAction::DEPOSIT : PcAction::WITHDRAW; + transfer.box = static_cast(*Pokemon::story_arg_number(*args, "box")) - 1; + const size_t slot = static_cast(*Pokemon::story_arg_number(*args, "slot")) - 1; + if (deposit){ + transfer.party_slot = slot; }else{ - transfer.box_slot = *slot; + transfer.box_slot = slot; + } + if (if_present){ + transfer.if_missing = PcMissing::SKIP; } return transfer; } @@ -317,7 +290,7 @@ PcDecision PcStorageDialog::on_box_chooser(const PcView& view){ PcResult run_pc_transfer(Logger& logger, PcStorageActions& actions, const PcTransfer& transfer){ - const std::string name = pc_variant(transfer); + const std::string name = pc_transfer_text(transfer); const std::vector party = actions.read_party(); if (transfer.action == PcAction::DEPOSIT && transfer.if_missing == PcMissing::SKIP && transfer.party_slot >= party.size()){ logger.log(std::format("PC: skipped \"{}\": the party has {} Pokemon.", name, party.size())); diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryPcStorage.h b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryPcStorage.h index 453c78b1d8..003b50a122 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryPcStorage.h +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryPcStorage.h @@ -51,6 +51,8 @@ #include "Common/Cpp/TestRunners/UnitTestDatabase.h" #include "NintendoSwitch/Controllers/Procon/NintendoSwitch_ProController.h" #include "NintendoSwitch/NintendoSwitch_ConsoleHandle.h" +#include "Pokemon/AutoStory/Types/Pokemon_StoryArgs.h" +#include "Pokemon/AutoStory/Types/Pokemon_StoryStep.h" #include "VideoGames/PokemonFRLG/Inference/Box/PokemonFRLG_PcScreenReader.h" namespace PokemonAutomation{ @@ -84,16 +86,27 @@ struct PcTransfer{ PcMissing if_missing = PcMissing::REFUSE; }; -// The prefix of a GAME step's variant that names a PC step. -inline constexpr std::string_view PC_VARIANT_PREFIX = "pc "; +// The variant of a GAME step that is a PC step. +inline constexpr std::string_view PC_VARIANT = "pc"; +// Its args: "deposit" or "withdraw", the slot (the party's for a deposit, +// the box's for a withdrawal) and the box; a deposit with if_present skips +// a slot the party hasn't got. +inline constexpr Pokemon::StoryArgSpec PC_ARGS[] = { + {"op", Pokemon::StoryArgType::TEXT, true}, + {"slot", Pokemon::StoryArgType::NUMBER, true}, + {"box", Pokemon::StoryArgType::NUMBER, true}, + {"if_present", Pokemon::StoryArgType::FLAG, false}, +}; -// `transfer` as a GAME step's variant: "pc deposit slot=2 box=1" or -// "pc withdraw box=1 slot=7", slots and boxes counted from 1 as the game -// shows them; a deposit with PcMissing::SKIP ends in " if_present". -std::string pc_variant(const PcTransfer& transfer); -// A variant from pc_variant(); nothing if `variant` isn't one, or names a -// slot or box the game hasn't got. -std::optional parse_pc_variant(std::string_view variant); +// `transfer` for the log: "pc deposit slot=2 box=1" or "pc withdraw box=1 +// slot=7", slots and boxes counted from 1 as the game shows them; a +// deposit with PcMissing::SKIP ends in " if_present". +std::string pc_transfer_text(const PcTransfer& transfer); +// `transfer` as a PC step's args, counted from 1 as pc_transfer_text(). +Pokemon::StoryArgs pc_args(const PcTransfer& transfer); +// The transfer a PC step (pc_step()) makes; nothing if it isn't one, or +// names a slot or box the game hasn't got. +std::optional parse_pc_step(const Pokemon::StoryStep& step); // A party member as far as a PC step needs to know. diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryPcStorage_Tests.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryPcStorage_Tests.cpp index c3af11e750..99b97f3594 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryPcStorage_Tests.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryPcStorage_Tests.cpp @@ -18,7 +18,9 @@ #include #include "Common/Cpp/Exceptions.h" #include "Common/Cpp/TestRunners/UnitTest.h" +#include "PokemonFRLG_AutoStoryCapture.h" #include "PokemonFRLG_AutoStoryPcStorage.h" +#include "PokemonFRLG_AutoStoryVariantWords.h" namespace PokemonAutomation{ namespace NintendoSwitch{ @@ -524,23 +526,25 @@ UnitTestResult test_pc_variant(){ {.action = PcAction::DEPOSIT, .party_slot = 1, .box = 0, .if_missing = PcMissing::SKIP}, }; for (const PcTransfer& transfer : transfers){ - const std::string variant = pc_variant(transfer); - const std::optional back = parse_pc_variant(variant); - if (!back || back->action != transfer.action || back->box != transfer.box + const Pokemon::StoryStep step = pc_step("pc", "", transfer); + const std::optional back = parse_pc_step(step); + if (step.variant != PC_VARIANT || !back || back->action != transfer.action || back->box != transfer.box || back->party_slot != transfer.party_slot || back->box_slot != transfer.box_slot || back->if_missing != transfer.if_missing ){ - return "\"" + variant + "\" didn't read back as the transfer it was made from."; + return "\"" + pc_transfer_text(transfer) + "\" didn't read back as the transfer it was made from."; } } - if (pc_variant(transfers[0]) != "pc deposit slot=2 box=1"){ - return "Expected \"pc deposit slot=2 box=1\", got \"" + pc_variant(transfers[0]) + "\"."; + const Pokemon::StoryArgs expected{{"op", "deposit"}, {"slot", int64_t(2)}, {"box", int64_t(1)}}; + if (pc_args(transfers[0]) != expected || pc_transfer_text(transfers[0]) != "pc deposit slot=2 box=1"){ + return "Expected \"pc deposit slot=2 box=1\", got \"" + pc_transfer_text(transfers[0]) + "\"."; } + const std::string_view positional[] = {"op"}; for (std::string_view bad : { "pc", "pc deposit", "pc deposit slot=7 box=1", "pc deposit slot=0 box=1", "pc deposit slot=2 box=15", - "pc withdraw box=1 slot=31", "pc release slot=1 box=1", "pc deposit box=1 slot=2", "capture rattata", + "pc withdraw box=1 slot=31", "pc release slot=1 box=1", "pc withdraw box=1 slot=2 if_present", "capture rattata", }){ - if (parse_pc_variant(bad)){ + if (parse_pc_step(legacy_game_step(bad, positional))){ return "Expected \"" + std::string(bad) + "\" refused."; } } diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRunPlan_Tests.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRunPlan_Tests.cpp index e595c875e0..c6344b076a 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRunPlan_Tests.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRunPlan_Tests.cpp @@ -371,24 +371,24 @@ UnitTestResult test_cerulean_mart_and_grind(){ if (!start || start->map != "CeruleanCity_PokemonCenter_1F"){ return "00.15: expected it to start in Cerulean's Center."; } - const std::optional teach = steps.empty() ? std::nullopt : parse_teach_variant(steps[0].variant); + const std::optional teach = steps.empty() ? std::nullopt : parse_teach_step(steps[0]); if (!teach || teach->item != "tm03" || teach->move != "water-pulse" || teach->member != 0 || teach->forget_move != "tail-whip"){ return "00.15: expected it to start with TM03 Water Pulse over the lead's Tail Whip."; } const size_t mart = find_step(steps, 0, [](const StoryStep& step){ - const std::optional plan = parse_mart_variant(step.variant); + const std::optional plan = parse_mart_step(step); return plan && plan->map == "CeruleanCity_Mart" && !plan->lines.empty() && plan->lines[0].item == "potion"; }); const std::optional rival = story_trainer("CeruleanCity", "rival_cerulean"); const size_t grind = find_step(steps, mart, [&](const StoryStep& step){ - const std::optional plan = parse_grind_variant(step.variant); + const std::optional plan = parse_grind_step(step); return plan && plan->member == 0 && rival && plan->trainer == *rival && plan->min_chance == MIN_WIN_CHANCE && plan->level > 25; }); if (mart == steps.size() || grind == steps.size()){ return "00.15: expected a Cerulean Mart step buying Potions, then a GRIND of the lead until the rival is 50%, capped above Lv25."; } - const MartPlan plan = *parse_mart_variant(steps[mart].variant); + const MartPlan plan = *parse_mart_step(steps[mart]); const std::optional> buys = plan.money_floor ? plan_mart_buys(mart_stock(plan.map), plan, *plan.money_floor) : std::nullopt; @@ -437,7 +437,7 @@ UnitTestResult test_cerulean_rival_row(){ if (battles != " rival_cerulean" || rival.steps.size() != 3 || rival.steps[1].name != "rival_trigger"){ return "00.15b: expected a TEACH, the step onto his trigger and his battle; its battles:" + battles; } - const std::optional teach = parse_teach_variant(rival.steps[0].variant); + const std::optional teach = parse_teach_step(rival.steps[0]); if (rival.steps[0].kind != StoryStepKind::GAME || !teach || teach->item != "tm03" || teach->move != "water-pulse" || teach->member != 0 || teach->forget_move != "tail-whip" ){ @@ -482,7 +482,7 @@ UnitTestResult test_misty_rows(){ } const std::vector& steps = gym.steps; const size_t mart = find_step(steps, 0, [](const StoryStep& step){ - const std::optional plan = parse_mart_variant(step.variant); + const std::optional plan = parse_mart_step(step); return plan && plan->map == "CeruleanCity_Mart" && !plan->lines.empty() && plan->lines[0].item == "potion"; }); if (mart == steps.size() || !battle_names(gym).empty()){ @@ -504,7 +504,7 @@ UnitTestResult test_misty_rows(){ return "00.14c: expected the talk from (9, 6), facing Misty (8, 6)."; } const size_t teach = find_step(misty.steps, 0, [](const StoryStep& step){ - const std::optional plan = parse_teach_variant(step.variant); + const std::optional plan = parse_teach_step(step); return plan && plan->item == "tm03" && plan->move == "water-pulse" && plan->member == 0 && plan->forget_move == "tail-whip"; }); if (teach == misty.steps.size()){ @@ -523,7 +523,7 @@ UnitTestResult test_misty_grind_order(){ const std::vector& steps = story_checkpoints()[row_index("00.14b")].steps; std::optional plan; const size_t mart = find_step(steps, 0, [&](const StoryStep& step){ - plan = parse_mart_variant(step.variant); + plan = parse_mart_step(step); return plan && plan->map == "CeruleanCity_Mart"; }); if (mart == steps.size() || plan->lines.size() < 2 || plan->lines[0].item != "potion" || plan->lines[1].item != "super-potion" @@ -536,7 +536,7 @@ UnitTestResult test_misty_grind_order(){ return "00.14b: expected the money floor to buy 2 or more Potions and a Super Potion."; } const size_t grind = find_step(steps, mart, [](const StoryStep& step){ - const std::optional grind_plan = parse_grind_variant(step.variant); + const std::optional grind_plan = parse_grind_step(step); return grind_plan && grind_plan->member == 0 && grind_plan->level >= 23; }); if (grind == steps.size() || !steps[grind - 1].target || !steps[grind].target){ diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryStepTable.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryStepTable.cpp index 3781630bd9..5981e1b290 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryStepTable.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryStepTable.cpp @@ -5,8 +5,15 @@ */ #include "Common/Cpp/Exceptions.h" +#include "PokemonFRLG_AutoStoryCapture.h" +#include "PokemonFRLG_AutoStoryChoice.h" #include "PokemonFRLG_AutoStoryEvents.h" +#include "PokemonFRLG_AutoStoryGrind.h" +#include "PokemonFRLG_AutoStoryMart.h" +#include "PokemonFRLG_AutoStoryMember.h" +#include "PokemonFRLG_AutoStoryPcStorage.h" #include "PokemonFRLG_AutoStoryStepTable.h" +#include "PokemonFRLG_AutoStoryTeach.h" #include "PokemonFRLG_AutoStoryTrashCans.h" namespace PokemonAutomation{ @@ -57,6 +64,15 @@ const std::vector& story_action_rows(){ {StoryStepKind::GAME, LEAVE_GIFT_SUMMARY, StoryActionId::LEAVE_GIFT_SUMMARY}, {StoryStepKind::GAME, CUT_TREE_VARIANT, StoryActionId::CUT_TREE}, {StoryStepKind::GAME, TRASH_CANS_VARIANT, StoryActionId::TRASH_CANS}, + // The GAME action's steps that carry args, each with its own. + {StoryStepKind::GAME, std::string(MART_VARIANT), StoryActionId::GAME, MART_ARGS}, + {StoryStepKind::GAME, std::string(TEACH_VARIANT), StoryActionId::GAME, TEACH_ARGS}, + {StoryStepKind::GAME, std::string(PC_VARIANT), StoryActionId::GAME, PC_ARGS}, + {StoryStepKind::GAME, std::string(GRIND_VARIANT), StoryActionId::GAME, GRIND_ARGS}, + {StoryStepKind::GAME, std::string(GRIND_CHECK_VARIANT), StoryActionId::GAME, GRIND_ARGS}, + {StoryStepKind::GAME, std::string(CAPTURE_VARIANT), StoryActionId::GAME, CAPTURE_ARGS}, + {StoryStepKind::GAME, std::string(FOSSIL_VARIANT), StoryActionId::GAME, FOSSIL_ARGS}, + {StoryStepKind::GAME, std::string(LEVEL_VARIANT), StoryActionId::GAME, LEVEL_ARGS}, {StoryStepKind::GAME, "", StoryActionId::GAME}, }; return ROWS; @@ -65,7 +81,9 @@ const std::vector& story_action_rows(){ Pokemon::StoryActionTable make_story_action_table(const StoryActionBinding& bind){ Pokemon::StoryActionTable table; for (const StoryActionRow& row : story_action_rows()){ - table.add(row.kind, row.variant, bind(row.id)); + Pokemon::StoryAction action = bind(row.id); + action.args = row.args; + table.add(row.kind, row.variant, std::move(action)); } return table; } diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryStepTable.h b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryStepTable.h index 515bc5c3ce..0356dbc361 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryStepTable.h +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryStepTable.h @@ -14,6 +14,7 @@ #define PokemonAutomation_PokemonFRLG_AutoStoryStepTable_H #include +#include #include #include #include "Common/Cpp/TestRunners/UnitTestDatabase.h" @@ -59,11 +60,13 @@ enum class StoryActionId{ const char* story_action_name(StoryActionId id); // A row of FRLG's table: the action for steps of `kind` whose variant is -// named `variant`, or for every other step of `kind` if it is empty. +// named `variant`, or for every other step of `kind` if it is empty, and +// the args its steps carry. struct StoryActionRow{ Pokemon::StoryStepKind kind; std::string variant; StoryActionId id; + std::span args = {}; }; // Every row. TRAIN and SAVE have none: FRLG's story doesn't use them. const std::vector& story_action_rows(); diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryTeach.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryTeach.cpp index fb487e8f09..1e4095b3f9 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryTeach.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryTeach.cpp @@ -37,14 +37,18 @@ const char* teach_end_name(TeachEnd end){ } -std::string teach_variant(const TeachPlan& plan){ - std::string variant = std::format("{}{} {} slot={}", TEACH_VARIANT_PREFIX, plan.item, plan.move, plan.member + 1); +Pokemon::StoryArgs teach_args(const TeachPlan& plan){ + Pokemon::StoryArgs args{ + {"item", plan.item}, + {"move", plan.move}, + {"slot", static_cast(plan.member + 1)}, + }; if (!plan.forget_move.empty()){ - variant += " forget=" + plan.forget_move; + args["forget"] = plan.forget_move; }else if (plan.forget_slot){ - variant += std::format(" forget_slot={}", *plan.forget_slot + 1); + args["forget_slot"] = static_cast(*plan.forget_slot + 1); } - return variant; + return args; } namespace{ @@ -54,47 +58,32 @@ bool is_tm_or_hm(std::string_view item){ && variant_number(item.substr(2), 2).has_value(); } -bool set_teach_word(TeachPlan& plan, std::string_view word){ - const std::optional pair = variant_pair(word); - if (!pair){ - return false; - } - if (pair->key == "forget" && !pair->value.empty()){ - plan.forget_move = std::string(pair->value); - return true; - } - const std::optional number = variant_number(pair->value, 1); - if (pair->key == "slot" && number && *number >= 1 && *number <= PARTY_SLOTS){ - plan.member = *number - 1; - return true; - } - if (pair->key == "forget_slot" && number && *number >= 1 && *number <= MOVE_SLOTS){ - plan.forget_slot = *number - 1; - return true; - } - return false; -} - } // namespace -std::optional parse_teach_variant(std::string_view variant){ - if (!variant.starts_with(TEACH_VARIANT_PREFIX)){ +std::optional parse_teach_step(const Pokemon::StoryStep& step){ + const Pokemon::StoryArgs* args = game_step_args(step, TEACH_VARIANT, TEACH_ARGS); + if (args == nullptr + || !arg_number_within(*args, "slot", 1, static_cast(PARTY_SLOTS)) + || !arg_number_within(*args, "forget_slot", 1, static_cast(MOVE_SLOTS)) + ){ return std::nullopt; } - const std::vector words = variant_words(variant.substr(TEACH_VARIANT_PREFIX.size())); - if (words.size() < 3 || !(is_tm_or_hm(words[0]) || words[0] == TEACH_TUTOR) || variant_pair(words[1])){ + TeachPlan plan{ + .item = std::string(*Pokemon::story_arg_text(*args, "item")), + .move = std::string(*Pokemon::story_arg_text(*args, "move")), + .member = static_cast(*Pokemon::story_arg_number(*args, "slot")) - 1, + }; + if (!(is_tm_or_hm(plan.item) || plan.item == TEACH_TUTOR) || plan.move.empty()){ return std::nullopt; } - TeachPlan plan{.item = std::string(words[0]), .move = std::string(words[1])}; - bool slot_seen = false; - for (size_t c = 2; c < words.size(); c++){ - if (!set_teach_word(plan, words[c])){ + if (const std::optional forget = Pokemon::story_arg_text(*args, "forget")){ + if (forget->empty()){ return std::nullopt; } - slot_seen |= words[c].starts_with("slot="); + plan.forget_move = std::string(*forget); } - if (!slot_seen){ - return std::nullopt; + if (const std::optional forget_slot = Pokemon::story_arg_number(*args, "forget_slot")){ + plan.forget_slot = static_cast(*forget_slot) - 1; } return plan; } @@ -104,7 +93,8 @@ Pokemon::StoryStep teach_step(std::string name, std::string why, const TeachPlan step.kind = Pokemon::StoryStepKind::GAME; step.name = std::move(name); step.why = std::move(why); - step.variant = teach_variant(plan); + step.variant = TEACH_VARIANT; + step.args = teach_args(plan); step.once_per_save = true; return step; } diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryTeach.h b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryTeach.h index 614a3c725d..a0d1c9bf3e 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryTeach.h +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryTeach.h @@ -84,14 +84,24 @@ inline constexpr std::string_view TEACH_TUTOR = "tutor"; // Whether `move` is an HM's, which the game won't let a Pokemon forget. bool is_hm_move(std::string_view move); -// The prefix of a GAME step's variant that names a TEACH step. -inline constexpr std::string_view TEACH_VARIANT_PREFIX = "teach "; - -// `plan` as a variant: "teach hm03 surf slot=1 forget=tail-whip" or -// "... forget_slot=2", slots counted from 1, no forget when it has room. -std::string teach_variant(const TeachPlan& plan); -// Parses a move teaching plan from a variant string. -std::optional parse_teach_variant(std::string_view variant); +// The variant of a GAME step that is a TEACH step. +inline constexpr std::string_view TEACH_VARIANT = "teach"; +// Its args: the TM, HM or tutor, the move, the party slot, and the move +// to forget by name or by slot. +inline constexpr Pokemon::StoryArgSpec TEACH_ARGS[] = { + {"item", Pokemon::StoryArgType::TEXT, true}, + {"move", Pokemon::StoryArgType::TEXT, true}, + {"slot", Pokemon::StoryArgType::NUMBER, true}, + {"forget", Pokemon::StoryArgType::TEXT, false}, + {"forget_slot", Pokemon::StoryArgType::NUMBER, false}, +}; + +// `plan` as a TEACH step's args: {"item": "hm03", "move": "surf", "slot": +// 1, "forget": "tail-whip"} or "forget_slot": 2, slots counted from 1, no +// forget when it has room. +Pokemon::StoryArgs teach_args(const TeachPlan& plan); +// The plan a TEACH step (teach_step()) runs; nothing if it isn't one. +std::optional parse_teach_step(const Pokemon::StoryStep& step); // The table's TEACH step, once per save (StoryStep::once_per_save): a // retry from the same save skips it when the lead knew the move or there diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryTeach_Tests.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryTeach_Tests.cpp index 202e979a0b..d2eacb97a1 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryTeach_Tests.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryTeach_Tests.cpp @@ -22,6 +22,7 @@ #include "Common/Cpp/TestRunners/UnitTest.h" #include "PokemonFRLG_AutoStoryTeach.h" #include "PokemonFRLG_AutoStoryTeachScreens.h" +#include "PokemonFRLG_AutoStoryVariantWords.h" namespace PokemonAutomation{ namespace NintendoSwitch{ @@ -377,27 +378,30 @@ UnitTestResult test_tm_used_up(){ UnitTestResult test_teach_variant(){ const TeachPlan plan{.item = "hm03", .move = "surf", .member = 0, .forget_move = "tail-whip"}; - const std::string variant = teach_variant(plan); - if (variant != "teach hm03 surf slot=1 forget=tail-whip"){ - return "Unexpected variant \"" + variant + "\"."; + const Pokemon::StoryStep step = teach_step("teach_surf", "", plan); + const Pokemon::StoryArgs expected{{"item", "hm03"}, {"move", "surf"}, {"slot", int64_t(1)}, {"forget", "tail-whip"}}; + if (step.variant != TEACH_VARIANT || step.args != expected){ + return "Unexpected TEACH step \"" + step.variant + "\"."; } - const std::optional back = parse_teach_variant(variant); + const std::optional back = parse_teach_step(step); if (!back || back->item != "hm03" || back->move != "surf" || back->member != 0 || back->forget_move != "tail-whip"){ - return "\"" + variant + "\" didn't read back as its plan."; + return "The TEACH step didn't read back as its plan."; } - const std::optional by_slot = parse_teach_variant("teach tm28 dig slot=2 forget_slot=4"); + const std::string_view positional[] = {"item", "move"}; + const std::optional by_slot = parse_teach_step(legacy_game_step("teach tm28 dig slot=2 forget_slot=4", positional)); if (!by_slot || by_slot->member != 1 || by_slot->forget_slot != 3u){ return "\"teach tm28 dig slot=2 forget_slot=4\" didn't read back."; } - const std::optional tutor = parse_teach_variant("teach tutor mega-kick slot=1 forget=withdraw"); + const std::optional tutor = parse_teach_step(legacy_game_step("teach tutor mega-kick slot=1 forget=withdraw", positional)); if (!tutor || tutor->item != TEACH_TUTOR || tutor->move != "mega-kick" || tutor->forget_move != "withdraw"){ return "\"teach tutor mega-kick slot=1 forget=withdraw\" didn't read back."; } for (std::string_view bad : { "teach", "teach hm03 surf", "teach potion surf slot=1", "teach hm03 surf slot=7", "teach tutors mega-kick slot=1", - "teach hm03 surf slot=1 forget_slot=5", "teach hm03 slot=1", "mart PewterCity_Mart potion=1", + "teach hm03 surf slot=1 forget_slot=5", "teach hm03 slot=1", "teach hm03 surf slot=1 forget=", + "mart PewterCity_Mart potion=1", }){ - if (parse_teach_variant(bad)){ + if (parse_teach_step(legacy_game_step(bad, positional))){ return "Expected \"" + std::string(bad) + "\" refused."; } } diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryVariantWords.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryVariantWords.cpp index 975658f892..3c57e706d0 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryVariantWords.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryVariantWords.cpp @@ -4,6 +4,7 @@ * */ +#include "Pokemon/AutoStory/Pokemon_StoryVariant.h" #include "PokemonFRLG_AutoStoryVariantWords.h" namespace PokemonAutomation{ @@ -50,6 +51,34 @@ std::optional variant_number(std::string_view text, size_t max_digits){ } +const Pokemon::StoryArgs* game_step_args( + const Pokemon::StoryStep& step, std::string_view name, std::span specs +){ + if (step.variant != name || !Pokemon::story_args_error(step.args, specs).empty()){ + return nullptr; + } + return &step.args; +} + +bool arg_number_within(const Pokemon::StoryArgs& args, std::string_view key, int64_t min, int64_t max){ + const std::optional value = Pokemon::story_arg_number(args, key); + return !value || (*value >= min && *value <= max); +} + +Pokemon::StoryStep legacy_game_step(std::string_view text, std::span positional){ + Pokemon::StoryStep step; + step.kind = Pokemon::StoryStepKind::GAME; + Pokemon::LegacyVariant split = Pokemon::split_legacy_variant(text, positional); + if (!split.error.empty()){ + step.variant = std::string(text); + return step; + } + step.variant = std::move(split.name); + step.args = std::move(split.args); + return step; +} + + } // namespace PokemonFRLG } // namespace NintendoSwitch diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryVariantWords.h b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryVariantWords.h index 3618657a27..9433a37168 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryVariantWords.h +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryVariantWords.h @@ -2,9 +2,10 @@ * * From: https://github.com/PokemonAutomation/ * - * Reading a GAME step's variant: words split on spaces, "key=value" - * pairs, and small numbers. The table writes variants such as - * "mart PewterCity_Mart budget=2000 potion=5"; the steps read them back. + * Reading a GAME step: its variant names the action ("mart") and its + * args (StoryStep::args) hold what the action reads, checked against the + * action's specs. Also the old variant words ("key=value" pairs and small + * numbers), for the item slugs that carry digits ("tm28"). * */ @@ -12,9 +13,13 @@ #define PokemonAutomation_PokemonFRLG_AutoStoryVariantWords_H #include +#include #include +#include #include #include +#include "Pokemon/AutoStory/Types/Pokemon_StoryArgs.h" +#include "Pokemon/AutoStory/Types/Pokemon_StoryStep.h" namespace PokemonAutomation{ namespace NintendoSwitch{ @@ -37,6 +42,22 @@ std::optional variant_pair(std::string_view word); std::optional variant_number(std::string_view text, size_t max_digits = 6); +// `step`'s args when its variant is `name` and they fit `specs` +// (Pokemon::story_args_error()); nullptr otherwise. +const Pokemon::StoryArgs* game_step_args( + const Pokemon::StoryStep& step, std::string_view name, std::span specs +); + +// Whether `args` has no number `key`, or one from `min` to `max`. +bool arg_number_within(const Pokemon::StoryArgs& args, std::string_view key, int64_t min, int64_t max); + +// A GAME step written the old way, e.g. "teach hm03 surf slot=1": its +// first word the variant, the rest its args (Pokemon::split_legacy_variant()), +// the plain words after the name taking `positional`'s keys. One that +// can't be split keeps `text` as its variant, which no action reads. +Pokemon::StoryStep legacy_game_step(std::string_view text, std::span positional = {}); + + } // namespace PokemonFRLG } // namespace NintendoSwitch diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryVermilionGym_Tests.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryVermilionGym_Tests.cpp index b59faf6d75..af918f809d 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryVermilionGym_Tests.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryVermilionGym_Tests.cpp @@ -496,7 +496,7 @@ UnitTestResult test_surge_dig_two_turns(){ UnitTestResult test_surge_winnable_skips_grind(){ const StoryCheckpoint& row = checkpoint("00.24"); const StoryStep& check = row.steps.front(); - if (!parse_grind_check_variant(check.variant)){ + if (!parse_grind_check_step(check)){ return "Expected 00.24 to start with the grind's check, not " + check.name + "."; } StoryPose at = *story_pose(*row.start); diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStory_Tests.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStory_Tests.cpp index da54867cd9..2eb4e20f90 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStory_Tests.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStory_Tests.cpp @@ -567,7 +567,7 @@ UnitTestResult check_lines(const StoryCheckpoint& checkpoint, std::set{}){ const StoryPose end = to_patch ? one_tile(*step.target) : StoryPose{}; const bool patch = to_patch && tile.map == end.map && tile.point == end.tile; @@ -914,7 +914,7 @@ UnitTestResult test_magikarp_deposit_skippable(){ continue; } for (const StoryStep& step : checkpoint.steps){ - const std::optional transfer = parse_pc_variant(step.variant); + const std::optional transfer = parse_pc_step(step); if (transfer && transfer->party_slot == 1 && transfer->if_missing == PcMissing::SKIP){ return true; } diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/README.md b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/README.md index ae63e57e6c..09c85ee01b 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/README.md +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/README.md @@ -4,7 +4,8 @@ Every story checkpoint is an authored plan here, one file per checkpoint: `frlg- - A checkpoint has `sections: [{id, title, notes?, events}]`, or plain `events` (one unnamed section, as 00.05 keeps so its bytes stay those PokemonSimulation pins). Events are numbered across the sections, and an event's log line names its section: `[Event] 00.28/12 [b1f_east] winston_line: start`. - `notes` (a list of paragraphs) on the checkpoint, a section or an event hold what the C++ table's comments said: the maps, trainers, numbers and console runs a step was planned from. No executor reads them. -- `variant` says how FRLG does a step: `run` on a route or legs, `trainer_line`/`trainer_wait` on a step, and on a `game_action` the step's plan as its parser reads it (`mart ...`, `teach ...`, `grind ...`, `grind_check ...`, `capture ...`, `pc ...`, `fossil ...`, `level ...`, or `cut_tree`, `trash_cans`, `close_trainer_card`, `leave_gift_summary`). An unknown variant is rejected at load. +- `variant` says how FRLG does a step: `run` on a route or legs, `trainer_line`/`trainer_wait` on a step, and on a `game_action` the action's name (`mart`, `teach`, `grind`, `grind_check`, `capture`, `pc`, `fossil`, `level`, or `cut_tree`, `trash_cans`, `close_trainer_card`, `leave_gift_summary`). An unknown variant is rejected at load. +- `args` holds what the action reads, e.g. a Mart's `{"map": "CeruleanCity_Mart", "budget": 1500, "floor": 1500}`, with what it buys in `items`. Each action declares its args in the action table (`PokemonFRLG_AutoStoryStepTable.cpp`); a step with an unknown, mistyped or missing one is rejected at load. - `once_per_save` marks a step done once per save (a TEACH, a Mart). - `execution` holds FRLG's fields: `menu`, and when not a new game's, `supplies` (`potions`, `antidotes`, `parlyz_heals`, `lead: "after_brock"`), `live_start` and `handoff` (`sid_helper`, `starter_rng`, `gift_rng`). - Unknown fields anywhere are rejected. diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.12c.plan.json b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.12c.plan.json index 0c547fa4f5..3dc4e28dcb 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.12c.plan.json +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.12c.plan.json @@ -23,7 +23,8 @@ { "id": "magikarp_to_box", "kind": "game_action", - "variant": "pc deposit slot=2 box=1 if_present", + "variant": "pc", + "args": {"op": "deposit", "slot": 2, "box": 1, "if_present": true}, "why": "DEPOSIT the party's second slot into BOX 1, if it has one" } ] diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.13.plan.json b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.13.plan.json index 4f9d2e6bab..e4421f1376 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.13.plan.json +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.13.plan.json @@ -156,7 +156,8 @@ { "id": "helix_fossil", "kind": "game_action", - "variant": "fossil helix", + "variant": "fossil", + "args": {"fossil": "helix"}, "why": "the HELIX FOSSIL; Miguel takes the DOME FOSSIL" }, { diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.14.plan.json b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.14.plan.json index a2d58040b7..efa26977d1 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.14.plan.json +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.14.plan.json @@ -25,7 +25,8 @@ { "id": "teach_mega_kick", "kind": "game_action", - "variant": "teach tutor mega-kick slot=1 forget=withdraw", + "variant": "teach", + "args": {"item": "tutor", "move": "mega-kick", "slot": 1, "forget": "withdraw"}, "once_per_save": true, "why": "the tutor's Mega Kick in place of Withdraw, unless the lead knows it" } diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.14b.plan.json b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.14b.plan.json index fa88ff60fa..886a21b4be 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.14b.plan.json +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.14b.plan.json @@ -25,7 +25,9 @@ { "id": "buy_potions", "kind": "game_action", - "variant": "mart CeruleanCity_Mart budget=3000 floor=3000 potion=5 super-potion=3", + "variant": "mart", + "args": {"map": "CeruleanCity_Mart", "budget": 3000, "floor": 3000}, + "items": [{"item": "potion", "quantity": 5}, {"item": "super-potion", "quantity": 3}], "once_per_save": true, "why": "5 Potions for the GRIND's wild battles, then Super Potions as the money allows" } @@ -45,7 +47,8 @@ { "id": "grind_to_lv23", "kind": "game_action", - "variant": "grind slot=1 level=23 encounters=100 pace=west heal_every=0", + "variant": "grind", + "args": {"slot": 1, "level": 23, "encounters": 100, "pace": "west", "heal_every": 0}, "target": {"certainty": "tile", "map": "CeruleanCity_PokemonCenter_1F", "where": {"facing": "north", "kind": "tiles", "tiles": [[7, 4]]}}, "why": "wild battles until the lead is Lv23, where Bite takes Starmie in three" }, diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.14c.plan.json b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.14c.plan.json index 989e062d93..3e0b63c4bc 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.14c.plan.json +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.14c.plan.json @@ -59,7 +59,8 @@ { "id": "teach_water_pulse", "kind": "game_action", - "variant": "teach tm03 water-pulse slot=1 forget=tail-whip", + "variant": "teach", + "args": {"item": "tm03", "move": "water-pulse", "slot": 1, "forget": "tail-whip"}, "once_per_save": true, "why": "TM03 Water Pulse in place of Tail Whip" } diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.15.plan.json b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.15.plan.json index e5d41285fe..d6f298d308 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.15.plan.json +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.15.plan.json @@ -16,7 +16,8 @@ { "id": "teach_water_pulse", "kind": "game_action", - "variant": "teach tm03 water-pulse slot=1 forget=tail-whip", + "variant": "teach", + "args": {"item": "tm03", "move": "water-pulse", "slot": 1, "forget": "tail-whip"}, "once_per_save": true, "why": "TM03 Water Pulse in place of Tail Whip, unless the lead knows it or there is no TM03" } @@ -36,7 +37,9 @@ { "id": "buy_potions", "kind": "game_action", - "variant": "mart CeruleanCity_Mart budget=1500 floor=1500 potion=3 awakening=2", + "variant": "mart", + "args": {"map": "CeruleanCity_Mart", "budget": 1500, "floor": 1500}, + "items": [{"item": "potion", "quantity": 3}, {"item": "awakening", "quantity": 2}], "once_per_save": true, "why": "3 Potions: the GRIND fights wild battles only with 2 or more; 2 Awakenings for the rival's Sleep Powder" } @@ -56,7 +59,8 @@ { "id": "grind_for_rival", "kind": "game_action", - "variant": "grind slot=1 level=28 encounters=150 pace=west heal_every=0 beat=TRAINER_RIVAL_CERULEAN_BULBASAUR chance=50", + "variant": "grind", + "args": {"slot": 1, "level": 28, "encounters": 150, "pace": "west", "heal_every": 0, "beat": "TRAINER_RIVAL_CERULEAN_BULBASAUR", "chance": 50}, "target": {"certainty": "tile", "map": "CeruleanCity_PokemonCenter_1F", "where": {"facing": "north", "kind": "tiles", "tiles": [[7, 4]]}}, "why": "wild battles until the sim beats the rival 50% or more, Lv28 at most; the nurse when hurt or low on PP" }, diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.15b.plan.json b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.15b.plan.json index e2fe43c68b..0fdff3f869 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.15b.plan.json +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.15b.plan.json @@ -16,7 +16,8 @@ { "id": "teach_water_pulse", "kind": "game_action", - "variant": "teach tm03 water-pulse slot=1 forget=tail-whip", + "variant": "teach", + "args": {"item": "tm03", "move": "water-pulse", "slot": 1, "forget": "tail-whip"}, "once_per_save": true, "why": "TM03 Water Pulse in place of Tail Whip, unless the lead knows it" }, diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.20.plan.json b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.20.plan.json index d8a251d0aa..5cd12caf93 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.20.plan.json +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.20.plan.json @@ -26,7 +26,9 @@ { "id": "buy_poke_balls", "kind": "game_action", - "variant": "mart CeruleanCity_Mart budget=1400 floor=1500 poke-ball=7", + "variant": "mart", + "args": {"map": "CeruleanCity_Mart", "budget": 1400, "floor": 1500}, + "items": [{"item": "poke-ball", "quantity": 7}], "once_per_save": true, "why": "7 Poke Balls for the Oddish" } @@ -46,7 +48,8 @@ { "id": "catch_oddish", "kind": "game_action", - "variant": "capture oddish catches=1 encounters=30 balls=7 pace=east", + "variant": "capture", + "args": {"species": "oddish", "catches": 1, "encounters": 30, "balls": 7, "pace": "east"}, "why": "wild battles until an Oddish, then Poke Balls; any other species is run from" } ] diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.23.plan.json b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.23.plan.json index 7ddd9c356c..1406e832dd 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.23.plan.json +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.23.plan.json @@ -20,14 +20,16 @@ { "id": "teach_cut", "kind": "game_action", - "variant": "teach hm01 cut slot=2", + "variant": "teach", + "args": {"item": "hm01", "move": "cut", "slot": 2}, "once_per_save": true, "why": "HM01 Cut to the Oddish, second in the party, unless it knows it" }, { "id": "teach_dig", "kind": "game_action", - "variant": "teach tm28 dig slot=1 forget=withdraw", + "variant": "teach", + "args": {"item": "tm28", "move": "dig", "slot": 1, "forget": "withdraw"}, "once_per_save": true, "why": "TM28 Dig in place of Withdraw, for Lt. Surge, unless the lead knows it or there is no TM28" } diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.24.plan.json b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.24.plan.json index e7c920ab07..9a72ee5c5e 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.24.plan.json +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.24.plan.json @@ -16,7 +16,8 @@ { "id": "surge_winnable", "kind": "game_action", - "variant": "grind_check slot=1 level=32 encounters=150 pace=east heal_every=0 beat=TRAINER_LEADER_LT_SURGE chance=50", + "variant": "grind_check", + "args": {"slot": 1, "level": 32, "encounters": 150, "pace": "east", "heal_every": 0, "beat": "TRAINER_LEADER_LT_SURGE", "chance": 50}, "why": "the lead as it is: if the sim beats Lt. Surge 50% or more already, no trip to Route 6" } ] @@ -44,7 +45,8 @@ { "id": "grind_for_surge", "kind": "game_action", - "variant": "grind slot=1 level=32 encounters=150 pace=east heal_every=0 beat=TRAINER_LEADER_LT_SURGE chance=50", + "variant": "grind", + "args": {"slot": 1, "level": 32, "encounters": 150, "pace": "east", "heal_every": 0, "beat": "TRAINER_LEADER_LT_SURGE", "chance": 50}, "target": {"certainty": "tile", "map": "VermilionCity_PokemonCenter_1F", "where": {"facing": "north", "kind": "tiles", "tiles": [[7, 4]]}}, "skip_if": ["surge_winnable"], "why": "wild battles until the sim beats Lt. Surge 50% or more, Lv32 at most; the nurse when hurt or low on PP" diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.26.plan.json b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.26.plan.json index 34d8de5dd6..5a49347c84 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.26.plan.json +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.26.plan.json @@ -132,7 +132,9 @@ { "id": "buy_repels", "kind": "game_action", - "variant": "mart CeruleanCity_Mart budget=2850 floor=6000 repel=5 escape-rope=2", + "variant": "mart", + "args": {"map": "CeruleanCity_Mart", "budget": 2850, "floor": 6000}, + "items": [{"item": "repel", "quantity": 5}, {"item": "escape-rope", "quantity": 2}], "once_per_save": true, "why": "5 Repels and 2 Escape Ropes, 2850 at most" }, From f7273a8078d4a3b9aaa4bd54a5c7fb3b09c59857 Mon Sep 17 00:00:00 2001 From: dayfine Date: Mon, 9 Nov 2026 21:35:25 -0800 Subject: [PATCH 21/79] FRLG AutoStory: 00.30's GAME steps, use_item and lift_floor carry args The use_item and lift_floor actions read their item and floors from StoryStep::args and declare them in the action table, as #314's actions do. 00.30's Mart and capture steps and the draft plans are converted; the sim trace is unchanged. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss --- .../Programs/AutoStory/Data/JsonParser.cpp | 2 +- .../PokemonFRLG_AutoStoryHideout.cpp | 29 +++++++------------ .../AutoStory/PokemonFRLG_AutoStoryHideout.h | 25 +++++++++------- .../PokemonFRLG_AutoStoryHideout_Tests.cpp | 28 +++++++++++++----- .../PokemonFRLG_AutoStoryItemUse.cpp | 15 +++++----- .../AutoStory/PokemonFRLG_AutoStoryItemUse.h | 26 ++++++++++------- .../PokemonFRLG_AutoStoryItemUse_Tests.cpp | 15 +++++++--- .../AutoStory/PokemonFRLG_AutoStoryRowSim.cpp | 4 +-- .../PokemonFRLG_AutoStoryStepTable.cpp | 4 +++ .../PokemonFRLG_AutoStoryTableSteps.cpp | 8 +++-- .../PokemonFRLG_AutoStoryTableSteps.h | 4 +-- .../AutoStory/StoryData/Draft/README.md | 10 +++---- .../StoryData/Draft/frlg-00.30.plan.json | 10 +++++-- .../StoryData/Draft/frlg-00.32.plan.json | 12 +++++--- .../AutoStory/StoryData/frlg-00.30.plan.json | 7 +++-- 15 files changed, 119 insertions(+), 80 deletions(-) diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/Data/JsonParser.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/Data/JsonParser.cpp index 060aa1a899..efc9dfe566 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/Data/JsonParser.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/Data/JsonParser.cpp @@ -229,7 +229,7 @@ bool known_game_step(const StoryStep& step){ return parse_capture_step(step) || parse_pc_step(step) || parse_mart_step(step) || parse_teach_step(step) || parse_grind_step(step) || parse_grind_check_step(step) || parse_fossil_step(step) || parse_level_step(step) - || is_center_variant(step.variant) || is_item_use_variant(step.variant) || is_hideout_variant(step.variant); + || (is_center_variant(step.variant) && step.args.empty()) || is_item_use_step(step) || is_hideout_step(step); } // Whether FRLG does `step`'s kind the way its variant names. diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryHideout.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryHideout.cpp index 8c11c1fa7d..d3eda919e7 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryHideout.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryHideout.cpp @@ -10,6 +10,7 @@ #include "PokemonFRLG_AutoStoryHideout.h" #include "PokemonFRLG_AutoStoryItemUse.h" #include "PokemonFRLG_AutoStoryRooms.h" +#include "PokemonFRLG_AutoStoryVariantWords.h" namespace PokemonAutomation{ namespace NintendoSwitch{ @@ -24,10 +25,6 @@ const std::vector& rocket_hideout_lift_menu(){ return MENU; } -std::string lift_floor_variant(std::string_view from, std::string_view to){ - return std::string(LIFT_FLOOR_PREFIX) + std::string(from) + " " + std::string(to); -} - namespace{ // The row of `floor` on the panel's menu, if it is a floor (not EXIT). @@ -43,17 +40,13 @@ std::optional floor_row(std::string_view floor){ } // namespace -std::optional parse_lift_floor_variant(std::string_view variant){ - if (!variant.starts_with(LIFT_FLOOR_PREFIX)){ - return std::nullopt; - } - const std::string_view floors = variant.substr(LIFT_FLOOR_PREFIX.size()); - const size_t space = floors.find(' '); - if (space == std::string_view::npos){ +std::optional parse_lift_floor_step(const Pokemon::StoryStep& step){ + const Pokemon::StoryArgs* args = game_step_args(step, LIFT_FLOOR_VARIANT, LIFT_FLOOR_ARGS); + if (args == nullptr){ return std::nullopt; } - const std::optional from = floor_row(floors.substr(0, space)); - const std::optional to = floor_row(floors.substr(space + 1)); + const std::optional from = floor_row(*Pokemon::story_arg_text(*args, "from")); + const std::optional to = floor_row(*Pokemon::story_arg_text(*args, "to")); if (!from || !to){ return std::nullopt; } @@ -72,8 +65,8 @@ MenuPresses lift_menu_presses(const LiftRide& ride, size_t entries){ return down <= up ? MenuPresses{Pokemon::Direction::SOUTH, down} : MenuPresses{Pokemon::Direction::NORTH, up}; } -bool is_hideout_variant(std::string_view variant){ - return variant == POSTER_SWITCH_VARIANT || parse_lift_floor_variant(variant).has_value(); +bool is_hideout_step(const Pokemon::StoryStep& step){ + return (step.variant == POSTER_SWITCH_VARIANT && step.args.empty()) || parse_lift_floor_step(step).has_value(); } @@ -123,7 +116,7 @@ std::optional run_field_game_step( const auto done = [&step]{ return step.pose_after ? Pokemon::outcome_ok(*step.pose_after) : Pokemon::outcome_ok(); }; - if (const std::optional ride = parse_lift_floor_variant(step.variant)){ + if (const std::optional ride = parse_lift_floor_step(step)){ ride_lift(console, context, *ride); return done(); } @@ -136,10 +129,10 @@ std::optional run_field_game_step( push_poster_switch(console, context); return Pokemon::outcome_ok(); } - if (!is_item_use_variant(step.variant)){ + if (!is_item_use_step(step)){ return std::nullopt; } - const std::string item = parse_use_item_variant(step.variant).value_or("bicycle"); + const std::string item = parse_use_item_step(step).value_or("bicycle"); ConsoleItemUseActions bag(console, context, language); const ItemUseEnd end = use_item_from_bag(console.logger(), bag, item); if (end != ItemUseEnd::USED){ diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryHideout.h b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryHideout.h index bf8ed55c83..475c5cc9cd 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryHideout.h +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryHideout.h @@ -37,13 +37,18 @@ namespace PokemonFRLG{ // beaten first. inline const std::string POSTER_SWITCH_VARIANT = "poster_switch"; -// The GAME step that rides the Rocket Hideout's lift with the LIFT KEY: -// "lift_floor ", floors as the panel names them (B1F, B2F, +// The GAME step that rides the Rocket Hideout's lift with the LIFT KEY, +// its args `from` and `to`, floors as the panel names them (B1F, B2F, // B4F). `from` is the floor the lift stands at, where the panel's cursor // starts. The player starts below `from`'s lift door, facing north, and // ends on `to`'s lift door (rocket_hideout_lift_doors()): the lift is // walked by a script (lift_in_legs(), lift_out_legs()), not a map. -inline constexpr std::string_view LIFT_FLOOR_PREFIX = "lift_floor "; +inline constexpr std::string_view LIFT_FLOOR_VARIANT = "lift_floor"; +// Its args: the floors it rides from and to. +inline constexpr Pokemon::StoryArgSpec LIFT_FLOOR_ARGS[] = { + {"from", Pokemon::StoryArgType::TEXT, true}, + {"to", Pokemon::StoryArgType::TEXT, true}, +}; // The lift panel's menu, top first (pokefirered // sMultichoiceList_RocketHideoutElevator): B1F, B2F, B4F, EXIT. @@ -54,11 +59,9 @@ struct LiftRide{ size_t from = 0; size_t to = 0; }; -// The variant for a ride from floor `from` to `to`. -std::string lift_floor_variant(std::string_view from, std::string_view to); -// The ride a "lift_floor " variant names, or nothing if it is -// not one, or names a floor the panel hasn't. -std::optional parse_lift_floor_variant(std::string_view variant); +// The ride a lift_floor step names, or nothing if it is not one, or names +// a floor the panel hasn't. +std::optional parse_lift_floor_step(const Pokemon::StoryStep& step); // Presses of the D-pad on a menu: which way, how many. struct MenuPresses{ @@ -70,8 +73,8 @@ struct MenuPresses{ // wraps round (pokefirered DrawVerticalMultichoiceMenu()). MenuPresses lift_menu_presses(const LiftRide& ride, size_t entries); -// Whether `variant` is one of this file's steps. -bool is_hideout_variant(std::string_view variant); +// Whether `step` is one of this file's steps. +bool is_hideout_step(const Pokemon::StoryStep& step); // On the console: A on the panel, the floor picked, the ride waited out // back to the overworld, the player still in the lift. @@ -84,7 +87,7 @@ void ride_lift(ConsoleHandle& console, ProControllerContext& context, const Lift void push_poster_switch(ConsoleHandle& console, ProControllerContext& context); // On the console, a GAME step of this file's, a Pokemon Center's -// (is_center_variant()) or an item from the bag (is_item_use_variant()); +// (is_center_variant()) or an item from the bag (is_item_use_step()); // nothing for another GAME step. The step ends on its pose_after, if it // has one (an Escape Rope's, a lift ride's, a Center's). std::optional run_field_game_step( diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryHideout_Tests.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryHideout_Tests.cpp index ae6b342f3e..0df832e8fb 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryHideout_Tests.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryHideout_Tests.cpp @@ -15,6 +15,7 @@ #include "PokemonFRLG_AutoStoryHideout.h" #include "PokemonFRLG_AutoStoryRowSim.h" #include "PokemonFRLG_AutoStoryTableSteps.h" +#include "PokemonFRLG_AutoStoryVariantWords.h" namespace PokemonAutomation{ namespace NintendoSwitch{ @@ -43,7 +44,9 @@ class Test_AutoStoryHideout : public UnitTest{ , m_case(std::move(test_case)) {} virtual UnitTestResult run(Logger&, CancellableScope&) const override{ - const std::optional ride = parse_lift_floor_variant(m_case.input.variant); + const std::string_view floors[] = {"from", "to"}; + const StoryStep step = legacy_game_step(m_case.input.variant, floors); + const std::optional ride = parse_lift_floor_step(step); const std::optional& expected = m_case.expectation.presses; if (!ride || !expected){ if (ride.has_value() != expected.has_value()){ @@ -58,8 +61,8 @@ class Test_AutoStoryHideout : public UnitTest{ got.presses, Pokemon::direction_name(got.direction), expected->presses, Pokemon::direction_name(expected->direction) ); } - if (!is_hideout_variant(m_case.input.variant)){ - return "A ride that isn't a hideout variant."; + if (!is_hideout_step(step)){ + return "A ride that isn't a hideout step."; } return true; } @@ -69,11 +72,22 @@ class Test_AutoStoryHideout : public UnitTest{ }; UnitTestResult test_variants(){ - if (!is_hideout_variant(POSTER_SWITCH_VARIANT) || is_hideout_variant("cut_tree") || is_hideout_variant("")){ - return "Expected only the poster switch and lift rides as hideout variants."; + const auto game_step = [](std::string variant, Pokemon::StoryArgs args){ + StoryStep step; + step.kind = Pokemon::StoryStepKind::GAME; + step.variant = std::move(variant); + step.args = std::move(args); + return step; + }; + if (!is_hideout_step(game_step(POSTER_SWITCH_VARIANT, {})) || is_hideout_step(game_step("cut_tree", {})) + || is_hideout_step(game_step("", {})) || is_hideout_step(game_step(POSTER_SWITCH_VARIANT, {{"from", "B1F"}})) + ){ + return "Expected only the poster switch and lift rides as hideout steps."; } - if (lift_floor_variant("B2F", "B4F") != "lift_floor B2F B4F"){ - return "Expected \"lift_floor B2F B4F\", got \"" + lift_floor_variant("B2F", "B4F") + "\"."; + const StoryStep ride = StoryTable::lift_floor("ride", "B2F", "B4F", ""); + const Pokemon::StoryArgs expected{{"from", "B2F"}, {"to", "B4F"}}; + if (ride.variant != LIFT_FLOOR_VARIANT || ride.args != expected){ + return "Expected lift_floor with {from: B2F, to: B4F}, got \"" + ride.variant + "\"."; } // A three-row menu doesn't wrap. const MenuPresses no_wrap = lift_menu_presses(LiftRide{0, 2}, 3); diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryItemUse.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryItemUse.cpp index 3bce9b0ae6..59e0c00b81 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryItemUse.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryItemUse.cpp @@ -10,6 +10,7 @@ #include "PokemonFRLG_AutoStoryActions.h" #include "PokemonFRLG_AutoStoryEvents.h" #include "PokemonFRLG_AutoStoryItemUse.h" +#include "PokemonFRLG_AutoStoryVariantWords.h" namespace PokemonAutomation{ namespace NintendoSwitch{ @@ -39,21 +40,19 @@ bool is_repel(std::string_view item){ return item == "repel" || item == "super-repel" || item == "max-repel"; } -std::string use_item_variant(std::string_view item){ - return std::string(USE_ITEM_PREFIX) + std::string(item); -} -std::optional parse_use_item_variant(std::string_view variant){ - if (!variant.starts_with(USE_ITEM_PREFIX)){ +std::optional parse_use_item_step(const Pokemon::StoryStep& step){ + const Pokemon::StoryArgs* args = game_step_args(step, USE_ITEM_VARIANT, USE_ITEM_ARGS); + if (args == nullptr || args->contains("slot")){ return std::nullopt; } - const std::string_view item = variant.substr(USE_ITEM_PREFIX.size()); + const std::string_view item = *Pokemon::story_arg_text(*args, "item"); if (!usable_item_pocket(item)){ return std::nullopt; } return std::string(item); } -bool is_item_use_variant(std::string_view variant){ - return variant == RIDE_BIKE_VARIANT || parse_use_item_variant(variant).has_value(); +bool is_item_use_step(const Pokemon::StoryStep& step){ + return (step.variant == RIDE_BIKE_VARIANT && step.args.empty()) || parse_use_item_step(step).has_value(); } std::optional bag_row_of(const std::vector& rows, std::string_view item){ diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryItemUse.h b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryItemUse.h index 3836b7a78a..74949be3d8 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryItemUse.h +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryItemUse.h @@ -23,6 +23,8 @@ #include "CommonFramework/Language.h" #include "NintendoSwitch/Controllers/Procon/NintendoSwitch_ProController.h" #include "NintendoSwitch/NintendoSwitch_ConsoleHandle.h" +#include "Pokemon/AutoStory/Types/Pokemon_StoryArgs.h" +#include "Pokemon/AutoStory/Types/Pokemon_StoryStep.h" #include "VideoGames/PokemonFRLG/Inference/Menus/PokemonFRLG_ItemListReader.h" namespace PokemonAutomation{ @@ -30,9 +32,15 @@ namespace NintendoSwitch{ namespace PokemonFRLG{ -// The GAME step that uses an item from the bag on the overworld: -// "use_item ", the slug as read_item_list_name() names it. -inline constexpr std::string_view USE_ITEM_PREFIX = "use_item "; +// The GAME step that uses an item from the bag on the overworld, its +// args the item's slug as read_item_list_name() names it, and for an item +// used on a Pokemon the party slot (none the story uses yet). +inline constexpr std::string_view USE_ITEM_VARIANT = "use_item"; +// Its args: the item, and the party slot it is used on. +inline constexpr Pokemon::StoryArgSpec USE_ITEM_ARGS[] = { + {"item", Pokemon::StoryArgType::TEXT, true}, + {"slot", Pokemon::StoryArgType::NUMBER, false}, +}; // The GAME step that gets on the Bicycle (the Key Items pocket's BICYCLE, // USE). The ROUTE steps after it ride (BIKE_VARIANT). inline const std::string RIDE_BIKE_VARIANT = "ride_bike"; @@ -51,13 +59,11 @@ std::optional usable_item_pocket(std::string_view item); // Whether `item` is a Repel of any kind. bool is_repel(std::string_view item); -// The variant that uses `item`. -std::string use_item_variant(std::string_view item); -// The item a "use_item " variant uses, or nothing if it isn't one -// or the item isn't one the story uses from the bag. -std::optional parse_use_item_variant(std::string_view variant); -// Whether `variant` is one of this file's steps. -bool is_item_use_variant(std::string_view variant); +// The item a use_item step uses, or nothing if it isn't one, the item +// isn't one the story uses from the bag, or it names a slot. +std::optional parse_use_item_step(const Pokemon::StoryStep& step); +// Whether `step` is one of this file's steps. +bool is_item_use_step(const Pokemon::StoryStep& step); // The row of `item` in `rows` (read_bag_pocket()'s, from the top), if it // has one left: a count of -1 (unread) counts as some. diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryItemUse_Tests.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryItemUse_Tests.cpp index ab33b1a43c..96674e8fd6 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryItemUse_Tests.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryItemUse_Tests.cpp @@ -17,6 +17,7 @@ #include "VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldWalk.h" #include "PokemonFRLG_AutoStoryEvents.h" #include "PokemonFRLG_AutoStoryItemUse.h" +#include "PokemonFRLG_AutoStoryVariantWords.h" namespace PokemonAutomation{ namespace NintendoSwitch{ @@ -25,6 +26,9 @@ namespace PokemonFRLG{ namespace{ +// A use_item step's positional key, for legacy_game_step(). +const std::string_view ITEM[] = {"item"}; + // A bag on the sim: its pockets, each item used takes one, a bag that may // not open. class SimBag : public ItemUseActions{ @@ -87,7 +91,7 @@ class Test_AutoStoryItemUse : public UnitTest{ bag.pockets[BagPocket::KEY_ITEMS] = m_case.input.key_items; bag.opens = m_case.input.opens; const std::string variant = m_case.input.variant; - const std::string item = variant == RIDE_BIKE_VARIANT ? "bicycle" : parse_use_item_variant(variant).value_or(variant); + const std::string item = variant == RIDE_BIKE_VARIANT ? "bicycle" : parse_use_item_step(legacy_game_step(variant, ITEM)).value_or(variant); const ItemUseEnd end = m_case.input.renew ? renew_repel(logger, bag, item) : use_item_from_bag(logger, bag, item); if (end != m_case.expectation.end || bag.used != m_case.expectation.used || bag.open){ return std::format( @@ -176,10 +180,13 @@ const ItemUseCase ITEM_USE_CASES[] = { }; UnitTestResult test_variants_and_bike(){ - if (parse_use_item_variant("use_item potion") || parse_use_item_variant("use_item") || !parse_use_item_variant(use_item_variant("super-repel"))){ - return "Expected only the story's bag items as use_item variants."; + if (parse_use_item_step(legacy_game_step("use_item potion", ITEM)) || parse_use_item_step(legacy_game_step("use_item", ITEM)) + || parse_use_item_step(legacy_game_step("use_item repel slot=1", ITEM)) + || !parse_use_item_step(legacy_game_step("use_item super-repel", ITEM)) + ){ + return "Expected only the story's bag items as use_item steps."; } - if (!is_item_use_variant(RIDE_BIKE_VARIANT) || is_item_use_variant("poster_switch")){ + if (!is_item_use_step(legacy_game_step(RIDE_BIKE_VARIANT)) || is_item_use_step(legacy_game_step("poster_switch"))){ return "Expected ride_bike, not poster_switch, as an item use."; } StoryStep ride; diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRowSim.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRowSim.cpp index 273822e571..e8e33c6b4a 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRowSim.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRowSim.cpp @@ -573,7 +573,7 @@ Pokemon::StoryAction OverworldStepSim::hideout_or_stub(){ return failure.empty() ? Pokemon::outcome_ok() : Pokemon::outcome_failed("sim_failure", failure); }); sim.act = [stub, played_act = sim.act](RunState& state, const StoryStep& step){ - return is_hideout_variant(step.variant) || center_walkable(step) + return is_hideout_step(step) || center_walkable(step) ? played_act(state, step) : stub.act(state, step); }; @@ -589,7 +589,7 @@ std::string OverworldStepSim::hideout(const StoryStep& step){ sim_walk_room_legs(m_sim, center_legs(step.variant)); return ended_on(step); } - const std::optional ride = parse_lift_floor_variant(step.variant); + const std::optional ride = parse_lift_floor_step(step); if (!ride){ return "no lift ride \"" + step.variant + "\"."; } diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryStepTable.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryStepTable.cpp index 5981e1b290..1e6ef673ce 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryStepTable.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryStepTable.cpp @@ -9,6 +9,8 @@ #include "PokemonFRLG_AutoStoryChoice.h" #include "PokemonFRLG_AutoStoryEvents.h" #include "PokemonFRLG_AutoStoryGrind.h" +#include "PokemonFRLG_AutoStoryHideout.h" +#include "PokemonFRLG_AutoStoryItemUse.h" #include "PokemonFRLG_AutoStoryMart.h" #include "PokemonFRLG_AutoStoryMember.h" #include "PokemonFRLG_AutoStoryPcStorage.h" @@ -73,6 +75,8 @@ const std::vector& story_action_rows(){ {StoryStepKind::GAME, std::string(CAPTURE_VARIANT), StoryActionId::GAME, CAPTURE_ARGS}, {StoryStepKind::GAME, std::string(FOSSIL_VARIANT), StoryActionId::GAME, FOSSIL_ARGS}, {StoryStepKind::GAME, std::string(LEVEL_VARIANT), StoryActionId::GAME, LEVEL_ARGS}, + {StoryStepKind::GAME, std::string(USE_ITEM_VARIANT), StoryActionId::GAME, USE_ITEM_ARGS}, + {StoryStepKind::GAME, std::string(LIFT_FLOOR_VARIANT), StoryActionId::GAME, LIFT_FLOOR_ARGS}, {StoryStepKind::GAME, "", StoryActionId::GAME}, }; return ROWS; diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryTableSteps.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryTableSteps.cpp index 70d3a2b8f0..d9815af8dc 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryTableSteps.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryTableSteps.cpp @@ -166,8 +166,9 @@ StoryStep poster_switch(std::string name, std::string why){ StoryStep lift_floor(std::string name, std::string_view from, std::string_view to, std::string why){ StoryStep step = make(StoryStepKind::GAME, std::move(name), std::move(why)); - step.variant = lift_floor_variant(from, to); - if (const std::optional ride = parse_lift_floor_variant(step.variant)){ + step.variant = LIFT_FLOOR_VARIANT; + step.args = {{"from", std::string(from)}, {"to", std::string(to)}}; + if (const std::optional ride = parse_lift_floor_step(step)){ const MapPosition& door = rocket_hideout_lift_doors()[ride->to]; step.pose_after = to_pose(StoryPose{door.map, door.point, Direction::SOUTH}); } @@ -190,7 +191,8 @@ StoryStep center_exit(std::string name, Pokemon::Pose below_door, std::string wh StoryStep use_item(std::string name, std::string_view item, std::string why, std::optional pose_after){ StoryStep step = make(StoryStepKind::GAME, std::move(name), std::move(why)); - step.variant = use_item_variant(item); + step.variant = USE_ITEM_VARIANT; + step.args = {{"item", std::string(item)}}; step.pose_after = std::move(pose_after); return step; } diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryTableSteps.h b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryTableSteps.h index db580bd96b..f562000d58 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryTableSteps.h +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryTableSteps.h @@ -187,7 +187,7 @@ StoryStep cut_tree(std::string name, Pokemon::Pose tree, std::string why); // (POSTER_SWITCH_VARIANT). StoryStep poster_switch(std::string name, std::string why); // Rides the Rocket Hideout's lift from the floor it stands at to `to` -// (lift_floor_variant()): "B1F", "B2F", "B4F". The player starts below +// (LIFT_FLOOR_VARIANT): "B1F", "B2F", "B4F". The player starts below // `from`'s lift door, facing north, and ends on `to`'s, facing south. StoryStep lift_floor(std::string name, std::string_view from, std::string_view to, std::string why); // Into the Pokemon Center `center` (a map name) from below its door, @@ -197,7 +197,7 @@ StoryStep center_enter(std::string name, const char* center, std::string why); // Out of the Center from below the nurse's counter (CENTER_EXIT_VARIANT) // to `below_door`, the tile below its door outside, facing south. StoryStep center_exit(std::string name, Pokemon::Pose below_door, std::string why); -// Uses `item` from the bag on the overworld (use_item_variant()): a +// Uses `item` from the bag on the overworld (USE_ITEM_VARIANT): a // Repel, or an Escape Rope, which leaves the player on `pose_after`. StoryStep use_item(std::string name, std::string_view item, std::string why, std::optional pose_after = std::nullopt); // Gets on the Bicycle (RIDE_BIKE_VARIANT). diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/Draft/README.md b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/Draft/README.md index 0d23b8ff91..3ebe665a43 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/Draft/README.md +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/Draft/README.md @@ -78,7 +78,7 @@ code (`PokemonFRLG_CodedRooms.h`): `center_exit`: south 4 and out; the game walks the player back onto the tile below the door. 00.30 and 00.31 use them for Lavender's and Celadon's Centers; no `CeladonCity_PokemonCenter_1F` map is needed. -- `lift_floor `: from below `from`'s lift door, facing north: in +- `lift_floor` (args `from`, `to`): from below `from`'s lift door, facing north: in onto (2, 5), north 2, west 2 to below the panel (0, 2), the floor picked, east 2, south 2 and south through the arrow warp onto `to`'s lift door (`setdynamicwarp`: B1F (24, 25), B2F (28, 16), B4F (20, 23)). No @@ -120,12 +120,12 @@ drafts become table rows, their battle steps take those names. Fossil (00.38b), the Hitmonchan (00.41) and the Lapras (00.42). The authored format can't yet say `handoff`/`live_start` as 00.12/00.12b do in C++. - `game_action` variants the C++ executor now has (no console run yet): - `poster_switch`, `lift_floor ` (PokemonFRLG_AutoStoryHideout.h), + `poster_switch`, `lift_floor` (PokemonFRLG_AutoStoryHideout.h), `center_enter`, `center_exit` (PokemonFRLG_AutoStoryRooms.h), - `use_item ` and `ride_bike` + `use_item` with `item` repel, super-repel, max-repel or escape-rope, and `ride_bike` (PokemonFRLG_AutoStoryItemUse.h), and the `bike` route variant. Variants - that no executor has yet: `party_room`, `gift_rng`, `use_item rare-candy - slot=N` (an item used on a party member), `fly`, `flee_wild`, `surf`, + that no executor has yet: `party_room`, `gift_rng`, `use_item` with a + `slot` (rare-candy, an item used on a party member), `fly`, `flee_wild`, `surf`, `strength_puzzle`, `reenter_map`. The `mart` variants name Marts the Mart table doesn't list yet (Lavender, Celadon 5F, Indigo Plateau). - HMs and key items come in story order: LIFT KEY, SILPH SCOPE, HM02 Fly, TEA, diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/Draft/frlg-00.30.plan.json b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/Draft/frlg-00.30.plan.json index 6ccbd8d610..9dfd0a659c 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/Draft/frlg-00.30.plan.json +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/Draft/frlg-00.30.plan.json @@ -23,13 +23,16 @@ { "id": "buy_ropes_and_super_repels", "kind": "game_action", - "variant": "mart LavenderTown_Mart budget=5700 floor=9000 escape-rope=4 super-repel=7", + "variant": "mart", + "args": {"map": "LavenderTown_Mart", "budget": 5700, "floor": 9000}, + "items": [{"item": "escape-rope", "quantity": 4}, {"item": "super-repel", "quantity": 7}], "why": "pokeguy 54:18: 4 Escape Ropes and 7 Super Repels" }, { "id": "repel_route8", "kind": "game_action", - "variant": "use_item repel", + "variant": "use_item", + "args": {"item": "repel"}, "why": "a Repel (5 bought in 00.26) for Route 8's grass and the Underground Path; renewed when it wears off" }, { @@ -82,7 +85,8 @@ { "id": "catch_pidgey", "kind": "game_action", - "variant": "capture pidgey catches=1 encounters=30 balls=5 pace=east", + "variant": "capture", + "args": {"species": "pidgey", "catches": 1, "encounters": 30, "balls": 5, "pace": "east"}, "why": "a Pidgey to carry HM02 Fly (pokeguy flies with a Pidgey from 1:03 on); the party has no other flier" }, { diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/Draft/frlg-00.32.plan.json b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/Draft/frlg-00.32.plan.json index d5170089d4..fcb107b1f7 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/Draft/frlg-00.32.plan.json +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/Draft/frlg-00.32.plan.json @@ -17,7 +17,8 @@ "id": "lift_to_b4f", "kind": "game_action", "declared_after": {"certainty": "tile", "map": "RocketHideout_B4F", "where": {"facing": "south", "kind": "tiles", "tiles": [[20, 23]]}}, - "variant": "lift_floor B2F B4F", + "variant": "lift_floor", + "args": {"from": "B2F", "to": "B4F"}, "why": "the lift script: in through the door (28, 16), to the panel, B4F with the LIFT KEY, out onto B4F's lift door; no map of the lift" }, { @@ -52,13 +53,15 @@ { "id": "rare_candy_1", "kind": "game_action", - "variant": "use_item rare-candy slot=1", + "variant": "use_item", + "args": {"item": "rare-candy", "slot": 1}, "why": "Rare Candy: Lv35 (pokeguy 1:00:25)" }, { "id": "rare_candy_2", "kind": "game_action", - "variant": "use_item rare-candy slot=1", + "variant": "use_item", + "args": {"item": "rare-candy", "slot": 1}, "why": "Rare Candy: Lv36, Wartortle evolves" }, { @@ -98,7 +101,8 @@ "id": "escape_rope_hideout", "kind": "game_action", "declared_after": {"certainty": "tile", "map": "CeladonCity", "where": {"facing": "south", "kind": "tiles", "tiles": [[34, 22]]}}, - "variant": "use_item escape-rope", + "variant": "use_item", + "args": {"item": "escape-rope"}, "why": "out to the Game Corner's door (pokeguy 1:02:10)" } ] diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.30.plan.json b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.30.plan.json index d49cbdf492..41268209a3 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.30.plan.json +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.30.plan.json @@ -39,7 +39,9 @@ { "id": "buy_ropes_and_super_repels", "kind": "game_action", - "variant": "mart LavenderTown_Mart budget=5700 floor=9000 escape-rope=4 super-repel=7", + "variant": "mart", + "args": {"map": "LavenderTown_Mart", "budget": 5700, "floor": 9000}, + "items": [{"item": "escape-rope", "quantity": 4}, {"item": "super-repel", "quantity": 7}], "once_per_save": true, "why": "pokeguy 54:18: 4 Escape Ropes (the Rocket Hideout, 00.31) and 7 Super Repels (Pokemon Tower)" }, @@ -170,7 +172,8 @@ { "id": "catch_pidgey", "kind": "game_action", - "variant": "capture pidgey catches=1 encounters=30 balls=5 pace=east", + "variant": "capture", + "args": {"species": "pidgey", "catches": 1, "encounters": 30, "balls": 5, "pace": "east"}, "once_per_save": true, "why": "a Pidgey to carry HM02 Fly (pokeguy flies with a Pidgey from 1:03 on); the party has no other flier" } From 2f999190c699e414e8cf2b3b59de5c205c1284a2 Mon Sep 17 00:00:00 2001 From: dayfine Date: Mon, 9 Nov 2026 21:44:09 -0800 Subject: [PATCH 22/79] FRLG walker: the Bicycle moves a tile per 100ms Holds counted back with one-tile taps on console B (Lavender Town, 2026-11-09) moved a tile per 100ms from rest, the same each time. At 112ms a tile, 00.30's "west 16 (open)" on Route 8 went 17 or 18 tiles and the walk missed the Underground Path's door. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss --- .../Overworld/PokemonFRLG_MovementMechanics.h | 16 ++++++++++------ .../PokemonFRLG_OverworldWalk_Tests.cpp | 10 ++++++++++ 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_MovementMechanics.h b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_MovementMechanics.h index aadf6fcef6..bfcda76680 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_MovementMechanics.h +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_MovementMechanics.h @@ -48,12 +48,16 @@ inline constexpr Milliseconds TILE_TIME(267); inline constexpr Milliseconds RUN_TILE_TIME(133); // Surfing: a tile per 8 frames. inline constexpr Milliseconds SURF_TILE_TIME(133); -// Riding the Bicycle, measured on console B (2026-11-09, Lavender Town -// row 13, wall to wall, from rest): 16 tiles (1, 13) to (17, 13) in -// 1800 ms of motion, east and back west alike, 112 ms a tile; 5 tiles -// from rest in 600 ms (120 ms a tile, the start up included). Not the -// decompilation's 4 frames a tile (67 ms): the bike speeds up from rest. -inline constexpr Milliseconds BIKE_TILE_TIME(112); +// Riding the Bicycle, measured on console B (2026-11-09, Lavender Town, +// east from the rock west of the Center, from rest, counted back with +// one-tile taps): holds of 450, 500, 650, 700, 900, 950, 1100, 1250, +// 1300, 1450 and 1500ms moved 5, 5, 7, 7, 9, 10, 11, 13, 13, 15 and 15 +// tiles, the same each time: a tile per 100ms, so an open leg's hold of +// (n - 1) tiles and a half moves n. 112ms a tile (a wall-to-wall time +// of the motion on screen) held "west 16 (open)" for 17 or 18 tiles on +// Route 8 (00.30 run 2). Not the decompilation's 4 frames a tile (67ms): +// the bike speeds up from rest. +inline constexpr Milliseconds BIKE_TILE_TIME(100); // On the Bicycle a tap never only turns the player: from rest, a 40ms tap // moved a tile facing either way, and holds of 112, 150, 200, 250, 300, // 336 and 400ms moved 1, 2, 2, 3, 3, 4 and 4 tiles (console B, diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldWalk_Tests.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldWalk_Tests.cpp index a70e8b363a..aa659b6101 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldWalk_Tests.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldWalk_Tests.cpp @@ -118,6 +118,16 @@ const OverworldWalkTestCase OVERWORLD_WALK_CASES[] = { .input = {.name = "walk, surfing", .speed = MoveSpeed::WALK, .tiles = 3, .to_wall = false, .surfing = true}, .expectation = {.hold = Milliseconds(2 * 133 + 66), .note = ""}, }, + // Console B, 2026-11-09: on the bike, 1450ms moved 15 tiles and 50ms + // (a tap) one; 1736ms, held for "west 16 (open)", went past 16. + { + .input = {.name = "bike, open 16", .speed = MoveSpeed::BIKE, .tiles = 16, .to_wall = false, .surfing = false}, + .expectation = {.hold = Milliseconds(1550), .note = ""}, + }, + { + .input = {.name = "bike, open 1", .speed = MoveSpeed::BIKE, .tiles = 1, .to_wall = false, .surfing = false}, + .expectation = {.hold = Milliseconds(50), .note = ""}, + }, }; From 7aff29c105ca970653ceb827fbdfaa075a6e1ee1 Mon Sep 17 00:00:00 2001 From: dayfine Date: Mon, 9 Nov 2026 22:22:27 -0800 Subject: [PATCH 23/79] FRLG AutoStory: sim test for 00.30's Route 8 walk from a start off by 3 Console B, 2026-11-09: three 00.30 runs stood 3 tiles east of the walker's belief after Route 8's open legs, the hold north to the Underground Path's door ran up to the cliff (16, 2), and the step onto the door bumped the house. The test starts the steps after Rich's battle from tiles up to 3 off the table's and expects Route 7 with no trainer met. Red on the current plan: from (45, 7) it fails as the console did. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss --- .../PokemonFRLG_AutoStoryLavender_Tests.cpp | 101 ++++++++++++++++++ 1 file changed, 101 insertions(+) diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryLavender_Tests.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryLavender_Tests.cpp index 99cd1fb3af..3b4c0f3fc6 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryLavender_Tests.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryLavender_Tests.cpp @@ -16,10 +16,12 @@ #include #include #include +#include #include #include #include #include +#include #include #include "Common/Cpp/Exceptions.h" #include "Common/Cpp/TestRunners/UnitTest.h" @@ -600,6 +602,104 @@ UnitTestResult test_route7_grass_battles(Logger&){ return true; } +// The maps after Gamer Rich's battle: Rich, beaten, stands where he +// walked down to (55, 17). +std::vector maps_after_rich(){ + std::vector maps = maps_after_route10(); + for (MapData& map : maps){ + if (map.name != "Route8"){ + continue; + } + for (MapObject& object : map.objects){ + if (object.name == "old_man_1"){ + object.y = 17; + object.trainer.reset(); + } + } + } + return maps; +} + +// The walker believes the player stands on `believed`, a tile 00.30's +// steps from Rich's battle on pass through, while the player stands on +// `actual`. +struct OffStart{ + TilePos believed; + TilePos actual; +}; + +const OffStart ROUTE8_OFF_STARTS[] = { + {{55, 18}, {58, 18}}, + {{55, 18}, {52, 18}}, + {{48, 7}, {45, 7}}, + {{48, 7}, {50, 7}}, + {{26, 7}, {29, 7}}, + {{26, 7}, {26, 6}}, + {{26, 7}, {26, 9}}, + {{26, 7}, {28, 10}}, +}; + +// 00.30's steps from `first` to `last`, as the table lays them out from +// `at`: the first that starts on `tile`, and where the table says the +// player stands then. Nothing if none does. +std::optional> step_starting_on( + const StoryCheckpoint& row, size_t first, size_t last, StoryPose at, const TilePos& tile +){ + for (size_t c = first; c <= last; c++){ + if (at.map == "Route8" && at.tile == tile){ + return std::make_pair(c, at); + } + const std::optional> route = walked_route(at, row.steps[c]); + if (!route || route->empty()){ + return std::nullopt; + } + at = StoryPose{route->back().end.map, route->back().end.point, route->back().facing_after}; + } + return std::nullopt; +} + +// Console B, 2026-11-09 (00.30, three runs): after Route 8's open legs +// the player stood 3 tiles east of where the walker believed, the hold +// north to the Underground Path's door ran up column 17 to the cliff +// (16, 2), and the step onto the door bumped the house: "no fade in and +// out after walking onto the warp". From a start up to 3 tiles off, the +// steps on to Route 7 meet no trainer and come out of the Underground +// Path where the table says. +UnitTestResult test_route8_west_off_start(Logger&){ + const StoryCheckpoint& row = checkpoint("00.30"); + const size_t first = step_index(row, "west_of_glenn_column"); + const size_t last = step_index(row, "route7_underground_exit"); + const StoryPose after_rich{"Route8", {55, 18}, Direction::NORTH}; + const std::vector maps = maps_after_rich(); + const MapPosition end{"Route7", {7, 15}}; + std::string failures; + for (const OffStart& off : ROUTE8_OFF_STARTS){ + const std::optional> from = step_starting_on(row, first, last, after_rich, off.believed); + std::string failure = from ? "" : "no step starts there."; + StoryPose at = from ? from->second : after_rich; + OverworldSim sim(maps, MapPosition{at.map, off.actual}, at.facing.value_or(Direction::NORTH)); + for (size_t c = from ? from->first : last + 1; c <= last && failure.empty(); c++){ + failure = row_step_on_sim(sim, at, row.steps[c], row.id); + } + if (failure.empty() && !(sim.state().position == end)){ + failure = std::format("ended on {}, not {}.", to_string(sim.state().position), to_string(end)); + } + if (failure.empty() && !sim.state().trainers_beaten.empty()){ + failure = "fought " + sim.state().trainers_beaten.front() + "."; + } + if (failure.empty() && !sim.state().violations.empty()){ + failure = "a violation on the way: " + sim.state().violations.back(); + } + if (!failure.empty()){ + failures += std::format("{}from {}, not {}: {}", failures.empty() ? "" : " | ", to_string(off.actual), to_string(off.believed), failure); + } + } + if (!failures.empty()){ + return failures; + } + return true; +} + // 00.30 saves in Celadon City's Pokemon Center: CELADON CITY on the save // card. UnitTestResult test_celadon_save_place(Logger&){ @@ -629,6 +729,7 @@ const AutoStoryLavenderCase AUTO_STORY_LAVENDER_CASES[] = { {.input = {"00.28 and 00.29 save on Route 10 and in Lavender Town", test_save_places}, .expectation = {}}, {.input = {"00.30 Lavender's Mart, Route 8 past Rich alone, the Underground Path, Route 7 to Celadon City", test_celadon_way_row}, .expectation = {}}, {.input = {"00.30 a wild battle on the step into Route 7's grass", test_route7_grass_battles}, .expectation = {}}, + {.input = {"00.30 Route 8 west from a start up to 3 tiles off", test_route8_west_off_start}, .expectation = {}}, {.input = {"00.30 saves in Celadon City's Pokemon Center", test_celadon_save_place}, .expectation = {}}, }; From 87f2e85bc4a4e9f5c27fd270e6c39ab95bc836fb Mon Sep 17 00:00:00 2001 From: dayfine Date: Mon, 9 Nov 2026 22:22:28 -0800 Subject: [PATCH 24/79] FRLG AutoStory: 00.30 re-anchors on Route 8's walls before the door The open legs from (48, 7) to (14, 13) had no wall between them, so an error anywhere on them reached the door. Now row 7 is held west to its wall (26, 7), column 26 south to the bottom wall, and row 14 west to its wall (12, 14); from there 2 Bicycle taps east and a hold north to the house's wall (14, 5) put the player below the door. Each hold that ends on a wall puts the player back on a known tile, so a start up to 3 tiles off still reaches the door. The golden trace changes only for events 14 and 15, which are new. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss --- .../ReplayData/frlg-story-sim-trace.json | 12 +++---- .../AutoStory/StoryData/frlg-00.30.plan.json | 36 +++++++++++-------- 2 files changed, 28 insertions(+), 20 deletions(-) diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/ReplayData/frlg-story-sim-trace.json b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/ReplayData/frlg-story-sim-trace.json index 4bb19c09de..179242eb0b 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/ReplayData/frlg-story-sim-trace.json +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/ReplayData/frlg-story-sim-trace.json @@ -1240,12 +1240,12 @@ "[Event] 00.30/13 west_of_glenn_column: start", "00.30/west_of_glenn_column: ok at Route8 (48, 7) facing north (tile)", "[Event] 00.30/13 west_of_glenn_column: done", - "[Event] 00.30/14 east_of_megan_column: start", - "00.30/east_of_megan_column: ok at Route8 (30, 13) facing south (tile)", - "[Event] 00.30/14 east_of_megan_column: done", - "[Event] 00.30/15 east_of_aidan_column: start", - "00.30/east_of_aidan_column: ok at Route8 (14, 13) facing north (tile)", - "[Event] 00.30/15 east_of_aidan_column: done", + "[Event] 00.30/14 route8_row7_west_wall: start", + "00.30/route8_row7_west_wall: ok at Route8 (26, 7) facing west (tile)", + "[Event] 00.30/14 route8_row7_west_wall: done", + "[Event] 00.30/15 route8_row14_west_wall: start", + "00.30/route8_row14_west_wall: ok at Route8 (12, 14) facing west (tile)", + "[Event] 00.30/15 route8_row14_west_wall: done", "[Event] 00.30/16 east_of_underground_door: start", "00.30/east_of_underground_door: ok at Route8 (14, 5) facing north (tile)", "[Event] 00.30/16 east_of_underground_door: done", diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.30.plan.json b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.30.plan.json index 41268209a3..cd34645f8a 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.30.plan.json +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.30.plan.json @@ -110,31 +110,39 @@ "events": [ { "id": "west_of_glenn_column", - "kind": "route", + "kind": "legs", "variant": "bike", - "target": {"certainty": "tile", "map": "Route8", "where": {"facing": "north", "kind": "tiles", "tiles": [[48, 7]]}}, - "why": "west along row 18 past Rich (55, 17) and up column 48 to row 7, west of Glenn's south line (51, 7..10) and below his west line (47..50, 6)" + "legs": [ + {"direction": "west", "tiles": 7}, {"direction": "north", "tiles": 11} + ], + "why": "west along row 18 past Rich (55, 17) to the wall (47, 18), then up column 48 to row 7, west of Glenn's south line (51, 7..10) and below his west line (47..50, 6): the wall puts the player on column 48 wherever on row 18 the battle left them" }, { - "id": "east_of_megan_column", - "kind": "route", + "id": "route8_row7_west_wall", + "kind": "legs", "variant": "bike", - "target": {"certainty": "tile", "map": "Route8", "where": {"facing": "south", "kind": "tiles", "tiles": [[30, 13]]}}, - "why": "west along row 7, below Megan's line (30..35, 6), and down column 30 to (30, 13), west of the pen's wall (33, 8..18)" + "legs": [ + {"direction": "west", "tiles": 22} + ], + "why": "west along row 7, below Megan's line (30..35, 6) and Andrea's (26..28, 5), to the wall (25, 7): column 26 from anywhere on the row" }, { - "id": "east_of_aidan_column", - "kind": "route", + "id": "route8_row14_west_wall", + "kind": "legs", "variant": "bike", - "target": {"certainty": "tile", "map": "Route8", "where": {"facing": "north", "kind": "tiles", "tiles": [[14, 13]]}}, - "why": "down onto row 14, west along it above Jaren (24, 17) and Ricardo (14, 16), who see a tile, and up onto (14, 13)" + "legs": [ + {"direction": "south", "tiles": 11}, {"direction": "north", "tiles": 4}, {"direction": "west", "tiles": 14} + ], + "why": "down column 26 to the wall (26, 19), east of Jaren's line (25, 17), 4 tiles back up onto row 14, and west along it above Jaren (24, 17) and Ricardo (14, 16), who see a tile, to the wall (11, 14): the walls put the player on row 18, then on column 12, wherever the walk along row 7 ended (console B, 2026-11-09: open legs from (48, 7) to (14, 13) ended 3 tiles east, and the door step bumped the house)" }, { "id": "east_of_underground_door", - "kind": "route", + "kind": "legs", "variant": "bike", - "target": {"certainty": "tile", "map": "Route8", "where": {"facing": "north", "kind": "tiles", "tiles": [[14, 5]]}}, - "why": "up column 14, east of Aidan's line (10..13, 6), to the wall (14, 4)" + "legs": [ + {"direction": "east", "tiles": 2}, {"direction": "north", "tiles": 9} + ], + "why": "2 taps east (a Bicycle tap is a tile) onto column 14, east of Aidan's line (10..13, 6), and up it to the house's wall (14, 4)" }, { "id": "below_underground_door", From 83d3be7294dcec06beb5207d0232ee5e38e805f5 Mon Sep 17 00:00:00 2001 From: dayfine Date: Mon, 9 Nov 2026 22:57:48 -0800 Subject: [PATCH 25/79] FRLG walker: count open Bicycle legs in taps, get on with SELECT Console B, 2026-11-09: on the Bicycle a 40ms tap is always one tile, tap chains are exact at one per 100ms and drop one tap in 12 at one per 60ms, and the registered Bicycle gets on with SELECT in about 1s. Open legs on the Bicycle are now walked a tap at a time (40ms press, 120ms period, judged after a settle by the screen scrolling). A tap that doesn't move ends the leg blocked: run_route() finds the player on the tiles the count gives, up to 3 further for a start that was off, ahead of a block. An interrupted tap ends it with the count and one more. A warp takes the walker off the Bicycle; the next leg where it may be ridden gets on again with SELECT, checked by the standing sprite no longer showing. The sim models the taps (dropped under 80ms), SELECT and doors. New OverworldBike tests: tap chains, an 11-tile leg from a start 2 off (red with one hold), SELECT onto the registered Bicycle, speed after a door. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss --- .../Overworld/PokemonFRLG_MovementMechanics.h | 29 +++ .../PokemonFRLG_OverworldBike_Tests.cpp | 234 ++++++++++++++++++ .../PokemonFRLG_OverworldRecovery.cpp | 50 +++- .../Overworld/PokemonFRLG_OverworldRecovery.h | 34 +++ .../PokemonFRLG_OverworldRecoveryWalk.cpp | 107 +++++++- .../Overworld/PokemonFRLG_OverworldSim.cpp | 117 ++++++++- .../Overworld/PokemonFRLG_OverworldSim.h | 62 ++++- .../PokemonFRLG_OverworldSim_Tests.cpp | 1 + .../Overworld/PokemonFRLG_OverworldWalk.cpp | 56 +++++ .../Overworld/PokemonFRLG_OverworldWalk.h | 36 +++ SerialPrograms/cmake/SourceFiles.cmake | 1 + 11 files changed, 699 insertions(+), 28 deletions(-) create mode 100644 SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldBike_Tests.cpp diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_MovementMechanics.h b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_MovementMechanics.h index bfcda76680..aa9fafaa3f 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_MovementMechanics.h +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_MovementMechanics.h @@ -64,6 +64,18 @@ inline constexpr Milliseconds BIKE_TILE_TIME(100); // 2026-11-09, Route 12's north pier). So a bike leg has no turn tap: its // hold turns the player too, and loses no tile for it. inline constexpr bool BIKE_TAP_ONLY_TURNS = false; +// Chains of 40ms taps on the Bicycle (console B, 2026-11-09): one tap per +// 100ms (60ms release) moved exactly a tile each; at one per 60ms, one +// tap in 12 was dropped. Somewhere between the two the game starts +// dropping taps; the sim drops one in BIKE_FAST_TAP_DROP_EVERY of the taps +// that start sooner than this after the last one. +inline constexpr Milliseconds BIKE_TAP_PERIOD_WORKED(100); +inline constexpr Milliseconds BIKE_TAP_DROP_PERIOD(80); +inline constexpr int BIKE_FAST_TAP_DROP_EVERY = 12; +// With the Bicycle registered (Key Items, BICYCLE, REGISTER), SELECT gets +// on and off in about 1s (console B, 2026-11-09). Going through a door +// takes the player off (not measured); a battle leaves them on. +inline constexpr Milliseconds BIKE_SELECT_TIME(1000); // The longest tap measured to only turn a player facing another way, and // to take exactly one step for one facing its way. inline constexpr Milliseconds LONGEST_TAP(133); @@ -104,6 +116,20 @@ inline constexpr Milliseconds STEP_TAP(66); // STEP_TAP_RELEASE after it, past the lockout. inline constexpr Milliseconds STEP_TAP_RELEASE(700); +// An open leg on the Bicycle is counted out in taps, each a tile: a 40ms +// press, released to a BIKE_TAP_PERIOD period, slower than the chains +// that worked, so none is dropped. +inline constexpr Milliseconds BIKE_TAP(40); +inline constexpr Milliseconds BIKE_TAP_PERIOD(120); +// After a tap, how long until the screen shows whether it moved: the +// tile's 100ms and video lag. The Command File Runner's tap check judged +// its first tap too early, as unmoved. Not measured: a guess. +inline constexpr Milliseconds BIKE_TAP_SETTLE(250); +// SELECT, pressed to get on the registered Bicycle, and the wait after +// it for the player to be up on it. +inline constexpr Milliseconds BIKE_SELECT_PRESS(160); +inline constexpr Milliseconds BIKE_SELECT_SETTLE(1200); + // How long the overworld must show nothing (no box, fade or battle) after // a battle before the next tap: twice the lockout. inline constexpr Milliseconds AFTER_BATTLE_QUIET(1000); @@ -115,6 +141,9 @@ static_assert(TURN_TAP <= LONGEST_TAP && FACE_HOLD <= LONGEST_TAP && STEP_TAP <= static_assert(STEP_TAP + STEP_TAP_RELEASE > STEP_TAP_SPACING_WORKED); static_assert(STEP_TAP_SPACING_WORKED > STEP_TAP_LOCKOUT); static_assert(AFTER_BATTLE_QUIET > BATTLE_EXIT_LOCKOUT); +static_assert(BIKE_TAP_PERIOD > BIKE_TAP_PERIOD_WORKED && BIKE_TAP_PERIOD_WORKED > BIKE_TAP_DROP_PERIOD); +static_assert(BIKE_TAP < BIKE_TILE_TIME && BIKE_TAP <= LONGEST_TAP); +static_assert(BIKE_SELECT_SETTLE > BIKE_SELECT_TIME); } // namespace MovementMechanics diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldBike_Tests.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldBike_Tests.cpp new file mode 100644 index 0000000000..03d1e829a4 --- /dev/null +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldBike_Tests.cpp @@ -0,0 +1,234 @@ +/* Overworld Bicycle Tests + * + * From: https://github.com/PokemonAutomation/ + * + * The Bicycle on the sim, on small made-up maps: its taps, each a tile + * and some dropped when they come too fast, open legs counted out a tap + * at a time, and SELECT getting on (console B, 2026-11-09). + * + */ + +#include +#include +#include +#include "Common/Cpp/Exceptions.h" +#include "Common/Cpp/TestRunners/UnitTest.h" +#include "PokemonFRLG_MovementMechanics.h" +#include "PokemonFRLG_OverworldMaps.h" +#include "PokemonFRLG_OverworldRecovery.h" +#include "PokemonFRLG_OverworldRoute.h" +#include "PokemonFRLG_OverworldSim.h" + +namespace PokemonAutomation{ +namespace NintendoSwitch{ +namespace PokemonFRLG{ + + +namespace{ + +using namespace MovementMechanics; +using OverworldWalkSteps::BikeSelectCalls; + +struct BikeInput{ + std::string name; + UnitTestResult (*body)(); +}; +struct BikeExpectation{ + const char* description; +}; +struct BikeCase{ + BikeInput input; + BikeExpectation expectation; +}; + +class Test_OverworldBike : public UnitTest{ +public: + explicit Test_OverworldBike(BikeCase test_case) + : UnitTest("PokemonFRLG::OverworldBike - " + test_case.input.name) + , m_case(std::move(test_case)) + {} + virtual UnitTestResult run(Logger&, CancellableScope&) const override{ + try{ + return m_case.input.body(); + }catch (Exception& e){ + return std::string(e.name()) + ": " + e.message(); + } + } + +private: + BikeCase m_case; +}; + +// A field 28 tiles wide with a rock at (7, 2). +const std::vector& field(){ + static const std::vector MAPS{parse_map(R"({ + "name": "BikeField", "source": {"decomp_file": "", "revision": "test", "date": "2026-11-09"}, + "tiles": [ + "##############################", + "#............................#", + "#......#.....................#", + "#............................#", + "##############################" + ] + })", "BikeField")}; + return MAPS; +} + +MapPosition at(int x, int y){ + return MapPosition{"BikeField", {x, y}}; +} + +std::string log_text(const std::vector& lines){ + std::string text; + for (const std::string& line : lines){ + text += "\n " + line; + } + return text; +} + +// `taps` taps west on the Bicycle, `period` apart, start to start. +SimState tap_chain(int taps, Milliseconds period){ + SimScript script; + script.on_bike = true; + OverworldSim sim(field(), at(28, 1), Direction::WEST, script); + for (int c = 0; c < taps; c++){ + sim.tap(Direction::WEST, BIKE_TAP, period - BIKE_TAP); + } + return sim.state(); +} + +// Console B, 2026-11-09: a chain of 40ms taps one per 100ms moved a tile +// a tap; one per 60ms dropped one tap in 12. The walker taps one per +// BIKE_TAP_PERIOD. +UnitTestResult test_tap_chains(){ + const SimState fast = tap_chain(25, Milliseconds(60)); + if (fast.bike_taps_dropped != 2 || fast.steps != 23){ + return std::format("25 taps 60ms apart: {} dropped, {} tiles; expected 2 and 23.", fast.bike_taps_dropped, fast.steps); + } + for (const Milliseconds period : {BIKE_TAP_PERIOD_WORKED, BIKE_TAP_PERIOD}){ + const SimState state = tap_chain(25, period); + if (state.bike_taps_dropped != 0 || state.steps != 25){ + return std::format("25 taps {}ms apart: {} dropped, {} tiles; expected none and 25.", period.count(), state.bike_taps_dropped, state.steps); + } + } + return true; +} + +RouteStep open_leg(Direction direction, int tiles, MapPosition end){ + RouteStep step; + step.direction = direction; + step.tiles = tiles; + step.facing_after = direction; + step.end = std::move(end); + return step; +} + +// An open leg of 11 tiles west from (20, 2), believed, then a tile north. +// The player starts 2 tiles further west, on (18, 2), and the rock at +// (7, 2) stops them a tile past the leg's end. Counted in taps, the +// blocked tap places them against the rock, and the route walks back. +// One hold ends against the rock too, taken for the leg's end, and the +// tile north ends a column off. +SimState walk_off_start(bool count_taps, std::string& failure, std::vector& log){ + const std::vector route{ + open_leg(Direction::WEST, 11, at(9, 2)), + open_leg(Direction::NORTH, 1, at(9, 1)), + }; + SimScript script; + script.on_bike = true; + OverworldSim sim(field(), at(18, 2), Direction::WEST, script); + SimWalkerRules rules; + rules.speed = MoveSpeed::BIKE; + rules.count_bike_taps = count_taps; + OverworldSimWalker walker(sim, rules); + const RoutePlanning planning{.maps = &field(), .costs = default_route_costs(), .start = at(20, 2), .label = "Sim"}; + failure = walker.run(route, planning); + log = walker.log(); + log.insert(log.end(), sim.state().log.begin(), sim.state().log.end()); + return sim.state(); +} + +UnitTestResult test_counted_leg_off_start(){ + std::string failure; + std::vector log; + const SimState held = walk_off_start(false, failure, log); + if (failure.empty() && held.position == at(9, 1)){ + return "One hold should end off: the sim doesn't reproduce the start's error." + log_text(log); + } + const SimState counted = walk_off_start(true, failure, log); + if (!failure.empty()){ + return "Counted in taps: " + failure + log_text(log); + } + if (!(counted.position == at(9, 1))){ + return "Counted in taps, ended on " + to_string(counted.position) + ", not " + to_string(at(9, 1)) + "." + log_text(log); + } + if (counted.bike_taps_dropped != 0 || !counted.violations.empty()){ + return "Counted in taps: a tap dropped or a violation." + log_text(log); + } + return true; +} + +// SELECT gets on the registered Bicycle only: a reload of a save made +// before REGISTER loses it. +UnitTestResult test_select_onto_bike(){ + for (const bool registered : {false, true}){ + SimScript script; + script.bike_registered = registered; + OverworldSim sim(field(), at(10, 1), Direction::WEST, script); + BikeSelectCalls calls; + int presses = 0; + calls.press_select = [&]{ presses++; sim.press_select(); }; + calls.riding = [&]{ return sim.state().on_bike; }; + calls.log = [](const std::string&){}; + const bool riding = OverworldWalkSteps::select_onto_bike(calls); + if (riding != registered || presses != (registered ? 1 : 2)){ + return std::format( + "Registered {}: riding {} after {} press(es).", registered, riding, presses + ); + } + } + return true; +} + +// A door takes the player off the Bicycle: legs after it go on foot, +// until one where the Bicycle may be ridden gets on again. +UnitTestResult test_speed_after_door(){ + RouteStep outdoors = open_leg(Direction::WEST, 3, at(7, 1)); + RouteStep indoors = outdoors; + indoors.walk_only = true; + using OverworldWalkSteps::gets_on_bike; + if (!gets_on_bike(outdoors, MoveSpeed::BIKE, false) || gets_on_bike(outdoors, MoveSpeed::BIKE, true) + || gets_on_bike(indoors, MoveSpeed::BIKE, false) || gets_on_bike(outdoors, MoveSpeed::RUN, false) + ){ + return "Expected to get on again outdoors only, off the Bicycle, on a ride."; + } + if (on_foot(MoveSpeed::BIKE) != MoveSpeed::RUN || on_foot(MoveSpeed::WALK) != MoveSpeed::WALK){ + return "Expected a run off the Bicycle."; + } + if (!OverworldWalkSteps::counts_bike_taps(outdoors, MoveSpeed::BIKE) || OverworldWalkSteps::counts_bike_taps(outdoors, MoveSpeed::RUN)){ + return "Expected open legs counted in taps on the Bicycle only."; + } + return true; +} + +const BikeCase OVERWORLD_BIKE_CASES[] = { + {.input = {"taps a tile each, one in 12 dropped 60ms apart", test_tap_chains}, .expectation = {"23 of 25 tiles at 60ms; 25 at 100 and 120ms"}}, + {.input = {"an open leg of 11 from a start 2 off, counted in taps", test_counted_leg_off_start}, .expectation = {"found against the rock and walked back"}}, + {.input = {"SELECT onto the registered Bicycle", test_select_onto_bike}, .expectation = {"one press registered; two and off unregistered"}}, + {.input = {"on foot after a door, on again outdoors", test_speed_after_door}, .expectation = {"gets_on_bike(), on_foot()"}}, +}; + +} // namespace + + +void add_tests_OverworldBike(UnitTestDatabase& database){ + for (const BikeCase& item : OVERWORLD_BIKE_CASES){ + database.add(item); + } +} + + + +} // namespace PokemonFRLG +} // namespace NintendoSwitch +} // namespace PokemonAutomation diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldRecovery.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldRecovery.cpp index cddb0e2026..08492373f2 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldRecovery.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldRecovery.cpp @@ -313,7 +313,34 @@ class RouteRun{ return false; } const WalkedTiles walked = outcome.walked.value_or(whole_leg(step)); - return rejoin(step, candidates_on(step, start, walked), walked); + if (!outcome.blocked){ + return rejoin(step, candidates_on(step, start, walked), walked); + } + // Past the leg's end too: a start that was off ahead takes the + // taps there. + RouteStep longer = step; + longer.tiles += BLOCKED_TAP_SLACK; + return rejoin(step, blocked_ahead(step, candidates_on(longer, start, walked)), walked); + } + + // Of `candidates`, where a Bicycle tap along `step` stopped the + // player, those the maps block the way ahead of; all of them if none. + std::vector blocked_ahead(const RouteStep& step, std::vector candidates) const{ + std::vector blocked; + for (const StopCandidate& candidate : candidates){ + RouteStep ahead; + ahead.direction = step.direction; + ahead.tiles = 1; + ahead.surfing = step.surfing; + if (!candidate.trainer && leg_tiles(*maps(), candidate.player, ahead).size() < 2){ + blocked.push_back(candidate); + } + } + if (blocked.empty()){ + m_calls.log("Route: a Bicycle tap was blocked where the maps show the way open: finding the player from the tiles the taps put them on."); + return candidates; + } + return blocked; } // Whether `step`, a leg with wild battles stopped part-way, was stopped @@ -550,6 +577,27 @@ std::optional trainer_crossing( return crossing; } +StepOutcome count_bike_taps(const RouteStep& step, const BikeTapCalls& calls){ + int moved = 0; + for (int tap = 1; tap <= step.tiles; tap++){ + const BikeTap result = calls.tap(); + if (result.interrupt || result.cleared_late){ + calls.log(std::format("Bike: tap {} of {}: interrupted after {} tile(s).", tap, step.tiles, moved)); + if (result.interrupt){ + calls.clear(*result.interrupt); + } + const int most = std::min(moved + 1, step.tiles); + return StepOutcome{.end = StepEnd::STOPPED, .walked = WalkedTiles{moved, most}}; + } + if (!result.moved){ + calls.log(std::format("Bike: tap {} of {} didn't move: blocked after {} tile(s).", tap, step.tiles, moved)); + return StepOutcome{.end = StepEnd::STOPPED, .walked = WalkedTiles{moved, moved + BLOCKED_TAP_SLACK}, .blocked = true}; + } + moved++; + } + return StepOutcome{}; +} + void run_route( const std::vector& route, std::optional facing, const RoutePlanning* planning, const RouteCalls& calls diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldRecovery.h b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldRecovery.h index 18325a293a..8744c0089f 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldRecovery.h +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldRecovery.h @@ -68,8 +68,42 @@ enum class StepEnd{ struct StepOutcome{ StepEnd end = StepEnd::DONE; std::optional walked; + // STOPPED by a Bicycle tap that didn't move the player: the tile + // ahead of where they stand is blocked (count_bike_taps()). + bool blocked = false; }; + +// One tap of an open leg on the Bicycle, counted out a tile a tap: whether +// the screen moved, and which of the leg's interrupts showed, if one did. +struct BikeTap{ + bool moved = false; + std::optional interrupt; + // The tap didn't move, and then an interrupt showed, which the tap + // cleared already: a trainer who saw the player, a battle seen late. + bool cleared_late = false; +}; +// The console side of count_bike_taps(): `tap` taps once and judges it; +// `clear` clears interrupt i. +struct BikeTapCalls{ + std::function tap; + std::function clear; + std::function log; +}; +// How far a sure start may be off before a blocked tap finds the player: +// three runs of 00.30 stood 3 tiles off (console B, 2026-11-09). +constexpr int BLOCKED_TAP_SLACK = 3; + +// Walks the open leg `step` a tap at a time: on the Bicycle each tap is +// exactly a tile (MovementMechanics::BIKE_TAP). A tap that doesn't move +// the player ends the leg there, blocked, and one with an interrupt ends +// it once that is cleared. DONE once all of the leg's taps moved; else +// STOPPED, with the tiles walked: blocked, the taps that moved, and up +// to BLOCKED_TAP_SLACK more for a start that was off (run_route() keeps +// the tiles with a blocked one ahead); interrupted, the taps that moved +// and one more, which may have moved before its battle showed. +StepOutcome count_bike_taps(const RouteStep& step, const BikeTapCalls& calls); + // Whether, after each leg to a wall, the walker taps once more toward the // wall and logs whether the player moved (see RouteCalls). enum class WallCheck{ diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldRecoveryWalk.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldRecoveryWalk.cpp index 5a0e782939..08e449666c 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldRecoveryWalk.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldRecoveryWalk.cpp @@ -54,8 +54,80 @@ struct StepWalk{ std::optional stopped; WallClock hold_start; bool dark = false; + // Stopped by a Bicycle tap that didn't move (StepOutcome::blocked). + bool blocked = false; }; +// TODO(forest drift, 2026-11-01): the threshold is a diagnostic's guess. +// How much the game screen's top quarter, clear of the player in the +// middle, may change when a tap toward a wall only bumps the player (the +// player's own animation, an animated tile). A step scrolls the whole map +// by a tile. Not yet measured on the console: a guess on the safe side. +constexpr double WALL_TAP_MOVED_RMSD = 20.0; + +// How much the top quarter of the game screen changed from `before` to +// `after`: a step scrolls it by a tile. +double top_band_change(const ImageViewRGB32& before, const ImageViewRGB32& after){ + const ImageFloatBox game = GameSettings::instance().GAME_BOX; + const ImageFloatBox band(game.x, game.y, game.width, game.height * 0.25); + return ImageMatch::pixel_RMSD(extract_box_reference(before, band), extract_box_reference(after, band)); +} + +// One tap of a leg counted out on the Bicycle (count_bike_taps()): a +// BIKE_TAP press released to a BIKE_TAP_PERIOD period, then +// BIKE_TAP_SETTLE for the screen to show the step, watching `interrupts` +// throughout. A tap that didn't scroll the screen is watched on for a +// late interrupt, which is cleared. +BikeTap console_bike_tap( + ConsoleHandle& console, ProControllerContext& context, + const RouteStep& step, const OverworldInterrupts& interrupts +){ + context.wait_for_all_requests(); + const VideoSnapshot before = console.video().snapshot(); + std::vector> watchers; + std::vector callbacks; + for (const auto& interrupt : interrupts){ + watchers.emplace_back(interrupt->make_watcher()); + callbacks.emplace_back(*watchers.back()); + } + const int ret = run_until( + console, context, + [&](ProControllerContext& context){ + pbf_press_dpad(context, dpad(step.direction), BIKE_TAP, BIKE_TAP_PERIOD - BIKE_TAP); + pbf_wait(context, BIKE_TAP_SETTLE); + context.wait_for_all_requests(); + }, + callbacks + ); + if (ret >= 0){ + console.log("Bike: " + interrupts[ret]->name() + " on a tap of " + to_string(step) + ".", COLOR_ORANGE); + return BikeTap{.moved = false, .interrupt = (size_t)ret}; + } + const VideoSnapshot after = console.video().snapshot(); + if (before && after && top_band_change(before, after) > WALL_TAP_MOVED_RMSD){ + return BikeTap{.moved = true}; + } + const bool late = Pokemon::clear_late_interrupts(console, context, interrupts, AFTER_LEG_WATCH, MAX_INTERRUPTIONS_PER_LEG) > 0; + return BikeTap{.moved = false, .interrupt = std::nullopt, .cleared_late = late}; +} + +// An open leg on the Bicycle, a tap at a time (count_bike_taps()). +StepWalk walk_bike_taps( + ConsoleHandle& console, ProControllerContext& context, + const RouteStep& step, const OverworldInterruptSet& interrupts +){ + StepWalk out{std::nullopt, current_time(), false, false}; + const OverworldInterrupts& watched = step.wild ? interrupts.wild : interrupts.other; + BikeTapCalls calls; + calls.tap = [&]{ return console_bike_tap(console, context, step, watched); }; + calls.clear = [&](size_t index){ watched[index]->clear(console, context); }; + calls.log = [&](const std::string& message){ console.log(message, COLOR_ORANGE); }; + const StepOutcome outcome = count_bike_taps(step, calls); + out.stopped = outcome.walked; + out.blocked = outcome.blocked; + return out; +} + // stop_tiles(), logged when the leg started in a dark cave. WalkedTiles logged_stop_tiles(ConsoleHandle& console, const RouteStep& step, bool dark, WalkedTiles timed){ if (dark){ @@ -79,7 +151,10 @@ StepWalk walk_step( const RouteStep& step, std::optional facing, const OverworldInterruptSet& interrupts, MoveSpeed speed ){ - StepWalk out{std::nullopt, current_time(), false}; + if (counts_bike_taps(step, speed)){ + return walk_bike_taps(console, context, step, interrupts); + } + StepWalk out{std::nullopt, current_time(), false, false}; switch (step.action){ case RouteAction::WALK:{ // Turning first, with a tap, makes the hold start from a standstill @@ -191,7 +266,7 @@ StepOutcome walk_and_watch( const LegRecorder recorder(console, context, interrupts, step); const StepWalk walked = walk_step(console, context, step, facing, interrupts, speed); if (walked.stopped){ - return StepOutcome{.end = StepEnd::STOPPED, .walked = walked.stopped}; + return StepOutcome{.end = StepEnd::STOPPED, .walked = walked.stopped, .blocked = walked.blocked}; } if (step.action == RouteAction::FACE){ return StepOutcome{}; @@ -285,12 +360,6 @@ StepEnd watch_for_trainer( } // TODO(forest drift, 2026-11-01): diagnostic; remove or turn into a recovery once the cause is known. -// How much the game screen's top quarter, clear of the player in the -// middle, may change when a tap toward a wall only bumps the player (the -// player's own animation, an animated tile). A step scrolls the whole map -// by a tile. Not yet measured on the console: a guess on the safe side. -constexpr double WALL_TAP_MOVED_RMSD = 20.0; - // Taps once toward the wall `step` ended at (the player faces it, so a tap // steps if it can) and says whether the map scrolled: whether the player // moved instead of bumping into the wall. @@ -303,9 +372,7 @@ bool moved_past_wall(ConsoleHandle& console, ProControllerContext& context, cons if (!before || !after){ return false; } - const ImageFloatBox game = GameSettings::instance().GAME_BOX; - const ImageFloatBox band(game.x, game.y, game.width, game.height * 0.25); - const double change = ImageMatch::pixel_RMSD(extract_box_reference(before, band), extract_box_reference(after, band)); + const double change = top_band_change(before, after); console.log(std::format("Position check: a tap toward the wall of {} changed the screen by {:.1f}.", to_string(step), change)); return change > WALL_TAP_MOVED_RMSD; } @@ -327,12 +394,26 @@ void walk_overworld_route_with_recovery( if (!facing){ facing = read_facing(console, context); } + // A door takes the player off the Bicycle; the next leg where it may + // be ridden gets on again with SELECT. A battle leaves them on. + bool riding = speed == MoveSpeed::BIKE; RouteCalls calls; calls.walk = [&](const RouteStep& step, std::optional from_facing){ - return walk_and_watch(console, context, step, from_facing, interrupts, speed); + if (gets_on_bike(step, speed, riding)){ + get_on_bike(console, context); + riding = true; + from_facing = std::nullopt; + } + const StepOutcome outcome = walk_and_watch(console, context, step, from_facing, interrupts, riding ? speed : on_foot(speed)); + if (riding && step.warps){ + console.log("Bike: through the warp to " + step.end.map + ", off the Bicycle."); + riding = false; + } + return outcome; }; calls.hold_to_warp = [&](const RouteStep& step){ - hold_to_warp(console, context, step, step.wild ? interrupts.wild : interrupts.other, speed); + hold_to_warp(console, context, step, step.wild ? interrupts.wild : interrupts.other, riding ? speed : on_foot(speed)); + riding = false; }; calls.log = [&](const std::string& message){ console.log(message, COLOR_ORANGE); }; calls.fail = [&](const std::string& message){ diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSim.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSim.cpp index 0bbc6fdce8..bce5aa34b0 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSim.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSim.cpp @@ -148,6 +148,7 @@ OverworldSim::OverworldSim(std::vector maps, MapPosition start, Directi add_coded_field(); m_player = PlayerState{start.point, elevation_at(map(), start.point), false}; m_state.facing = facing; + m_state.on_bike = m_script.on_bike; show(m_script.start_menu_open ? SimScreen::START_MENU : SimScreen::OVERWORLD, m_now); update_view(); } @@ -366,6 +367,12 @@ bool OverworldSim::after_step(const Step& step, Milliseconds pressed){ m_maps[index].objects.push_back(tree); } m_cut_trees.clear(); + if (m_state.on_bike){ + // A door takes the player off the Bicycle (the user's + // knowledge, not measured). + m_state.on_bike = false; + note("the warp takes the player off the Bicycle."); + } m_frozen = true; schedule(pressed + timing.tile, SimScreen::FADE, false); schedule(pressed + timing.tile + timing.fade, SimScreen::OVERWORLD, true); @@ -466,12 +473,12 @@ void OverworldSim::bump(Direction direction, Milliseconds pressed){ // The steps a hold of `duration` takes, `short_by` fewer. void OverworldSim::walk_hold(Direction direction, Milliseconds duration, int short_by){ - const Milliseconds tile = m_script.timing.tile; + const Milliseconds tile = tile_time(); const Milliseconds end = m_now + duration; Milliseconds pressed = m_now; if (m_state.facing != direction){ // Holding through a turn lost a tile on the console, on foot. - pressed += m_script.on_bike ? Milliseconds(0) : tile; + pressed += m_state.on_bike ? Milliseconds(0) : tile; m_state.facing = direction; } take_steps(direction, pressed, end, (int)((end - pressed + tile - 1ms) / tile) - short_by); @@ -480,7 +487,7 @@ void OverworldSim::walk_hold(Direction direction, Milliseconds duration, int sho // Up to `left` steps of a hold of `direction` until `end`, the first // pressed at `pressed`. void OverworldSim::take_steps(Direction direction, Milliseconds pressed, Milliseconds end, int left){ - const Milliseconds tile = m_script.timing.tile; + const Milliseconds tile = tile_time(); for (; left > 0 && pressed < end; left--){ const std::optional step = press(direction); if (!step){ @@ -528,6 +535,8 @@ std::optional OverworldSim::hold( m_last_tap.reset(); if (m_state.screen != SimScreen::OVERWORLD || m_frozen){ stuck_hold(direction); + }else if (m_state.on_bike && duration <= MovementMechanics::LONGEST_TAP && drops_bike_tap(start)){ + // Dropped: no step. }else if (duration <= MovementMechanics::LONGEST_TAP && m_state.facing == direction){ // A hold as short as a tap is one (a one-tile leg). step_tap(direction, duration); @@ -546,7 +555,9 @@ void OverworldSim::tap(Direction direction, Milliseconds duration, Milliseconds m_last_tap.reset(); }else if (m_last_tap && m_last_tap->direction == direction && m_last_tap->end == start){ hold_on(direction, start + duration); - }else if (m_state.facing != direction && !m_script.on_bike){ + }else if (m_state.on_bike && drops_bike_tap(start)){ + m_last_tap.reset(); + }else if (m_state.facing != direction && !m_state.on_bike){ // From a standstill a tap only turns the player, even one as long // as LONGEST_TAP. Not on the Bicycle: there it steps. m_last_tap = TapPress{direction, start, start + duration, m_state.facing, 0}; @@ -567,7 +578,7 @@ void OverworldSim::tap(Direction direction, Milliseconds duration, Milliseconds void OverworldSim::step_tap(Direction direction, Milliseconds duration){ const Milliseconds start = m_now; m_last_tap = TapPress{direction, start, start + duration, direction, 0}; - if (!m_script.on_bike && m_last_step_tap && start < *m_last_step_tap + MovementMechanics::STEP_TAP_LOCKOUT){ + if (!m_state.on_bike && m_last_step_tap && start < *m_last_step_tap + MovementMechanics::STEP_TAP_LOCKOUT){ m_state.step_taps_ignored++; note(std::format( "the step tap {} is ignored, {} ms after the last.", @@ -587,7 +598,7 @@ void OverworldSim::step_tap(Direction direction, Milliseconds duration){ // hold, from the last one's start until `end`. void OverworldSim::hold_on(Direction direction, Milliseconds end){ TapPress& press = *m_last_tap; - const Milliseconds tile = m_script.timing.tile; + const Milliseconds tile = tile_time(); Milliseconds pressed = press.start; if (press.facing_before != direction){ pressed += tile; @@ -602,6 +613,35 @@ void OverworldSim::hold_on(Direction direction, Milliseconds end){ press.end = end; } +bool OverworldSim::drops_bike_tap(Milliseconds start){ + const bool fast = m_last_bike_tap && start - *m_last_bike_tap < MovementMechanics::BIKE_TAP_DROP_PERIOD; + m_last_bike_tap = start; + if (!fast || ++m_fast_bike_taps % MovementMechanics::BIKE_FAST_TAP_DROP_EVERY != 0){ + return false; + } + m_state.bike_taps_dropped++; + note(std::format("a Bicycle tap is dropped, {} fast taps in.", m_fast_bike_taps)); + return true; +} + +bool OverworldSim::press_select(){ + const Milliseconds start = m_now; + if (m_state.screen != SimScreen::OVERWORLD || m_frozen || !m_script.bike_registered){ + note(m_script.bike_registered ? "SELECT does nothing off the overworld." : "SELECT does nothing: the Bicycle isn't registered."); + advance_to(start + MovementMechanics::BIKE_SELECT_PRESS); + return false; + } + if (!m_state.on_bike && !map().allow_running){ + note("SELECT: the Bicycle can't be ridden here."); + advance_to(start + MovementMechanics::BIKE_SELECT_TIME); + return false; + } + m_state.on_bike = !m_state.on_bike; + note(m_state.on_bike ? "gets on the Bicycle." : "gets off the Bicycle."); + advance_to(start + MovementMechanics::BIKE_SELECT_TIME); + return true; +} + bool OverworldSim::drops_turn_tap(){ m_turn_taps++; return m_script.dropped_turn_taps.contains(m_turn_taps); @@ -689,6 +729,8 @@ Milliseconds delay_of(const OverworldInterrupts& interrupts, size_t index){ OverworldSimWalker::OverworldSimWalker(OverworldSim& sim, SimWalkerRules rules, const OverworldInterruptSet& walker) : m_sim(sim) , m_rules(rules) + , m_riding(rules.speed == MoveSpeed::BIKE) + , m_speed(rules.speed) { // In the walker's order: battles first. m_wild = { @@ -813,7 +855,7 @@ std::optional OverworldSimWalker::walk_step(const RouteStep& step, if (step.action != RouteAction::WALK){ fail("Sim: Surf isn't modelled."); } - if (turns_first(step, m_rules.speed, facing)){ + if (turns_first(step, m_speed, facing)){ sim_turn_to(m_sim, step.direction, m_rules.confirm_turn); } const int warps_before = m_sim.state().warps; @@ -822,7 +864,7 @@ std::optional OverworldSimWalker::walk_step(const RouteStep& step, leg.direction = step.direction; leg.tiles = step.tiles + step.warp_slack; leg.to_wall = step.to_wall; - leg.tile_time = tile_time(step, m_rules.speed); + leg.tile_time = tile_time(step, m_speed); leg.stop_on_interrupt = !step.to_wall; leg.stop_if_blocked = step.to_wall && m_rules.stop_if_blocked; if (m_rules.hold_over_connections){ @@ -856,8 +898,56 @@ std::optional OverworldSimWalker::walk_step(const RouteStep& step, return std::nullopt; } -// walk_and_watch(). +BikeTap OverworldSimWalker::bike_tap(const RouteStep& step){ + const MapPosition before = m_sim.state().position; + const std::vector& ints = interrupts(step); + const Milliseconds release = m_rules.bike_tap_period - BIKE_TAP; + const std::optional seen = m_sim.hold(step.direction, BIKE_TAP, release, m_rules.bike_tap_period + BIKE_TAP_SETTLE, watchers(ints)); + if (seen){ + m_log.push_back("Bike: " + ints[seen->watcher].name + " on a tap of " + to_string(step) + "."); + return BikeTap{.moved = false, .interrupt = seen->watcher}; + } + if (!(m_sim.state().position == before)){ + return BikeTap{.moved = true}; + } + return BikeTap{.moved = false, .interrupt = std::nullopt, .cleared_late = clear_late(ints, AFTER_LEG_WATCH, MAX_INTERRUPTIONS_PER_LEG) > 0}; +} + +StepOutcome OverworldSimWalker::walk_bike_taps(const RouteStep& step){ + const std::vector& ints = interrupts(step); + BikeTapCalls calls; + calls.tap = [&]{ return bike_tap(step); }; + calls.clear = [&](size_t index){ clear(ints[index]); }; + calls.log = [&](const std::string& message){ m_log.push_back(message); }; + m_leg_start = m_sim.state().time; + m_leg_dark = m_sim.state().dark; + return count_bike_taps(step, calls); +} + +// walk_and_watch(), getting on the Bicycle first where +// walk_overworld_route_with_recovery() does. StepOutcome OverworldSimWalker::walk(const RouteStep& step, std::optional facing){ + if (m_rules.get_back_on_bike && gets_on_bike(step, m_rules.speed, m_riding)){ + BikeSelectCalls select; + select.press_select = [&]{ m_sim.press_select(); }; + select.riding = [&]{ return m_sim.state().on_bike; }; + select.log = [&](const std::string& message){ m_log.push_back(message); }; + if (!select_onto_bike(select)){ + fail("get_on_bike(): not on the Bicycle after SELECT twice. Is it registered?"); + } + m_riding = true; + facing = std::nullopt; + } + m_speed = m_riding || !m_rules.get_back_on_bike ? m_rules.speed : on_foot(m_rules.speed); + const StepOutcome outcome = walk_ridden(step, facing); + if (m_riding && step.warps){ + m_log.push_back("Bike: through the warp to " + step.end.map + ", off the Bicycle."); + m_riding = false; + } + return outcome; +} + +StepOutcome OverworldSimWalker::walk_ridden(const RouteStep& step, std::optional facing){ if (m_rules.battle_before_step && battle_on_its_way()){ m_log.push_back("Route: " + std::string(sim_screen_name(m_sim.state().screen)) + " before " + to_string(step) + ": watching on for a wild battle set off before it."); if (clear_late(m_wild, UNSEEN_BATTLE_WATCH, MAX_INTERRUPTIONS_PER_LEG) > 0){ @@ -869,7 +959,12 @@ StepOutcome OverworldSimWalker::walk(const RouteStep& step, std::optional walked = walk_step(step, facing)){ + if (m_rules.count_bike_taps && counts_bike_taps(step, m_speed)){ + const StepOutcome outcome = walk_bike_taps(step); + if (outcome.end != StepEnd::DONE){ + return outcome; + } + }else if (const std::optional walked = walk_step(step, facing)){ return StepOutcome{.end = StepEnd::STOPPED, .walked = walked}; } if (step.action == RouteAction::FACE){ @@ -920,6 +1015,8 @@ size_t OverworldSimWalker::clear_unseen_battle(const RouteStep& step){ } void OverworldSimWalker::hold_to_warp(const RouteStep& step){ + // The warp it holds on to takes the player off the Bicycle. + m_riding = false; const std::vector& ints = interrupts(step); std::vector fade_first{SimWatcher::FADE}; for (const SimWatcher watcher : watchers(ints)){ diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSim.h b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSim.h index e1761f1248..2f6c0c83df 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSim.h +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSim.h @@ -20,8 +20,10 @@ * A step onto a connected map waits a tile first, as the console does * while the game loads the map. * - * Not modelled: Surf, bikes, running, HP and status. Wandering people - * stand on their tile. + * Not modelled: Surf, running, HP and status. Wandering people stand on + * their tile. The Bicycle is: its pace, its taps (each a tile, some + * dropped when they come too fast), SELECT and doors taking the player + * off it. * */ @@ -87,6 +89,8 @@ struct SimEncounter{ // at these. struct SimTiming{ Milliseconds tile = MovementMechanics::TILE_TIME; + // A tile on the Bicycle. + Milliseconds bike_tile = MovementMechanics::BIKE_TILE_TIME; Milliseconds flash{300}; Milliseconds battle_screen{3700}; // A wild battle's text box, before the HP boxes (battle_screen). Not @@ -136,9 +140,15 @@ struct SimScript{ // too, a hold through a turn loses no tile // (MovementMechanics::BIKE_TAP_ONLY_TURNS), and no step tap is // ignored: a 40ms turn tap and a 56ms hold 340ms after it took two - // tiles (console B, 2026-11-09, 00.30). Set timing.tile to - // MovementMechanics::BIKE_TILE_TIME with it. + // tiles (console B, 2026-11-09, 00.30). At the start: SELECT gets on + // and off (OverworldSim::press_select()), a warp gets off. Each tap is + // a tile; one in MovementMechanics::BIKE_FAST_TAP_DROP_EVERY of those + // that start sooner than BIKE_TAP_DROP_PERIOD after the last is + // dropped. Its pace is timing.bike_tile. bool on_bike = false; + // The Bicycle is registered (Key Items, REGISTER): SELECT gets on. A + // reload of a save made before it was registered loses it. + bool bike_registered = false; // Caves dark without Flash (Rock Tunnel): the overworld is black but // for a lit circle on the player, which the walker's battle text box // check and screen observer read as a battle on its way (console B, @@ -180,6 +190,10 @@ struct SimState{ Milliseconds in_wild_battles{0}; int signs_read = 0; int turn_taps_dropped = 0; + // On the Bicycle (SimScript::on_bike). + bool on_bike = false; + // Bicycle taps the game dropped, too soon after the last one. + int bike_taps_dropped = 0; // Step taps the game ignored, inside the lockout after the last one // (MovementMechanics::STEP_TAP_LOCKOUT). int step_taps_ignored = 0; @@ -268,6 +282,13 @@ class OverworldSim{ Milliseconds release = MovementMechanics::TURN_SETTLE ); + // SELECT on the overworld: with the Bicycle registered, gets on it + // where running is allowed, or off it, taking about + // MovementMechanics::BIKE_SELECT_TIME. Returns whether it did. + bool press_select(); + // REGISTER on the Bicycle in the bag (SimScript::bike_registered). + void register_bike(){ m_script.bike_registered = true; } + // Watches `watchers` for `duration`, as wait_until(). std::optional watch(const std::vector& watchers, Milliseconds duration); @@ -344,6 +365,13 @@ class OverworldSim{ std::optional next_encounter(); bool rolls_encounter(int rate); bool drops_turn_tap(); + // Whether the Bicycle tap starting at `start` is dropped, too soon + // after the last one. + bool drops_bike_tap(Milliseconds start); + // How long a tile takes: on the Bicycle or on foot. + Milliseconds tile_time() const{ + return m_state.on_bike ? m_script.timing.bike_tile : m_script.timing.tile; + } bool trainer_sees(Milliseconds pressed); void update_view(); void note(const std::string& line); @@ -378,6 +406,9 @@ class OverworldSim{ int m_turn_taps = 0; // The last tap, until a hold. std::optional m_last_tap; + // When the last Bicycle tap started, and how many came too soon. + std::optional m_last_bike_tap; + int m_fast_bike_taps = 0; // When the last tap that stepped started. std::optional m_last_step_tap; // The end of the lockout after the last battle. @@ -459,6 +490,19 @@ struct SimWalkerRules{ // The speed the walker goes at: its turn taps // (OverworldWalkSteps::turns_first()) and its holds' tile time. MoveSpeed speed = MoveSpeed::WALK; + // An open leg on the Bicycle is counted out a tap at a time, each a + // tile (count_bike_taps()), and one that doesn't move finds the player + // ahead of a block. Without it the leg is one hold, and a start off + // along the leg ends it off with nothing to show it (console B, + // 2026-11-09, 00.30: three runs 3 tiles east after Route 8's legs). + bool count_bike_taps = true; + // How far apart, start to start, the counted taps are + // (MovementMechanics::BIKE_TAP_PERIOD). + Milliseconds bike_tap_period = MovementMechanics::BIKE_TAP_PERIOD; + // After a warp, which takes the player off the Bicycle, the next leg + // where it may be ridden gets on again with SELECT. Without it the + // walker held on-foot legs at the Bicycle's pace. + bool get_back_on_bike = true; // A dark cave's overworld isn't a battle on its way // (OverworldWalkSteps::dark_cave_screen()). Without it the check // before each step watched for a battle on it (console B, 2026-11-09, @@ -522,6 +566,10 @@ class OverworldSimWalker{ bool battle; }; StepOutcome walk(const RouteStep& step, std::optional facing); + StepOutcome walk_ridden(const RouteStep& step, std::optional facing); + // count_bike_taps() on the sim. + StepOutcome walk_bike_taps(const RouteStep& step); + BikeTap bike_tap(const RouteStep& step); std::optional late_stop(const RouteStep& step); // stop_tiles(); without SimWalkerRules::whole_leg_in_dark, the dark // screen places the stop at the hold's start. @@ -559,6 +607,10 @@ class OverworldSimWalker{ // and whether its map was dark then. Milliseconds m_leg_start{0}; bool m_leg_dark = false; + // Whether the walker takes the player to ride the Bicycle, and the + // speed of the step under way. + bool m_riding = false; + MoveSpeed m_speed = MoveSpeed::WALK; }; @@ -569,6 +621,8 @@ void add_tests_OverworldWarpFade(UnitTestDatabase& database); // Register the tests of spinner tiles, the lift's panel and the poster // switch on made-up maps. void add_tests_OverworldSpin(UnitTestDatabase& database); +// Register the tests of the Bicycle's taps and SELECT on a made-up map. +void add_tests_OverworldBike(UnitTestDatabase& database); diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSim_Tests.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSim_Tests.cpp index ce0f2054ae..cfa1e6b021 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSim_Tests.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSim_Tests.cpp @@ -987,6 +987,7 @@ void add_tests_OverworldSim(UnitTestDatabase& database){ add_tests_OverworldLateBattle(database); add_tests_OverworldWarpFade(database); add_tests_OverworldSpin(database); + add_tests_OverworldBike(database); } diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldWalk.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldWalk.cpp index 92c49a4ed5..99296be9bd 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldWalk.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldWalk.cpp @@ -209,6 +209,58 @@ bool turns_first(const RouteStep& step, MoveSpeed speed, std::optional 0; +} + +bool gets_on_bike(const RouteStep& step, MoveSpeed speed, bool riding){ + return speed == MoveSpeed::BIKE && !riding && step.action == RouteAction::WALK + && !step.walk_only && !step.surfing; +} + +bool select_onto_bike(const BikeSelectCalls& calls){ + for (int press = 1; press <= 2; press++){ + calls.press_select(); + if (calls.riding()){ + return true; + } + calls.log(std::format("Bike: not riding after SELECT press {}.", press)); + } + return false; +} + +bool screen_shows_riding(const ImageViewRGB32& screen){ + if (StartMenuDetector(COLOR_RED).detect(screen) || SelectionDialogDetector(COLOR_RED).detect(screen) + || WhiteDialogDetector(COLOR_RED).detect(screen) + ){ + return false; + } + return !read_player_facing(screen).has_value(); +} + +void get_on_bike(ConsoleHandle& console, ProControllerContext& context){ + BikeSelectCalls calls; + calls.press_select = [&]{ + pbf_press_button(context, BUTTON_MINUS, BIKE_SELECT_PRESS, BIKE_SELECT_SETTLE); + }; + calls.riding = [&]{ + context.wait_for_all_requests(); + VideoSnapshot screen = console.video().snapshot(); + return screen && screen_shows_riding(*screen.frame); + }; + calls.log = [&](const std::string& message){ console.log(message, COLOR_ORANGE); }; + console.log("Bike: SELECT (MINUS) onto the Bicycle."); + if (!select_onto_bike(calls)){ + OperationFailedExceptionWithScreenshot::fire( + ErrorReportMode::SEND_ERROR_REPORT, + "get_on_bike(): not on the Bicycle after SELECT twice. Is it registered?", + console + ); + } +} + Pokemon::LegMover leg_mover(const RouteStep& step, MoveSpeed speed){ if (step_speed(step, speed) == MoveSpeed::RUN && !step.surfing){ return hold_dpad_running; @@ -490,6 +542,10 @@ const char* move_speed_name(MoveSpeed speed){ return "?"; } +MoveSpeed on_foot(MoveSpeed speed){ + return speed == MoveSpeed::BIKE ? MoveSpeed::RUN : speed; +} + OverworldInterruptSet overworld_interrupts_with_repel(int max_repel_slot){ OverworldInterruptSet ret; ret.wild.emplace_back(std::make_unique()); diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldWalk.h b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldWalk.h index 7be9b789cb..990f7656d0 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldWalk.h +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldWalk.h @@ -82,6 +82,9 @@ enum class MoveSpeed{ }; // Name of a movement speed. const char* move_speed_name(MoveSpeed speed); +// The speed walked at instead of `speed` while off the Bicycle (a door +// took the player off): a run. +MoveSpeed on_foot(MoveSpeed speed); // Walks `route` from where it was planned, at `speed`. The player must be @@ -160,6 +163,39 @@ Milliseconds tile_time(const RouteStep& step, MoveSpeed speed); // takes a step (MovementMechanics::BIKE_TAP_ONLY_TURNS). bool turns_first(const RouteStep& step, MoveSpeed speed, std::optional facing); +// Whether `step` at `speed` is walked a tap at a time, each a tile +// (count_bike_taps()): an open leg on the Bicycle, outdoors, not onto a +// warp or a spinner, and not over a map connection, where the game holds +// the player up a tile (a tap there isn't measured). Legs to a wall are +// held: the wall ends them. +bool counts_bike_taps(const RouteStep& step, MoveSpeed speed); + +// Whether, walking a route at `speed` and riding the Bicycle or not +// (`riding`), the player gets on with SELECT before `step`: a WALK where +// the Bicycle may be ridden, after a door took them off. +bool gets_on_bike(const RouteStep& step, MoveSpeed speed, bool riding); + +// The console side of select_onto_bike(): presses SELECT and waits it +// out; reads whether the player rides. +struct BikeSelectCalls{ + std::function press_select; + std::function riding; + std::function log; +}; +// Gets on the registered Bicycle with SELECT, checks the player rides, +// and presses again once if not. Returns whether they ride. +bool select_onto_bike(const BikeSelectCalls& calls); + +// Whether the player rides the Bicycle, from the screen: the overworld +// is up, and no standing player's sprite shows where the player stands +// (read_player_facing()). False under a message or a menu. +bool screen_shows_riding(const ImageViewRGB32& screen); + +// select_onto_bike() on the console: SELECT is the Switch's MINUS. +// Throws OperationFailedException if the player doesn't ride after two +// presses. +void get_on_bike(ConsoleHandle& console, ProControllerContext& context); + // The mover for `step` at `speed`: hold_dpad_running() for a run on foot // where the map allows it, hold_dpad() otherwise (B does nothing on the // water). diff --git a/SerialPrograms/cmake/SourceFiles.cmake b/SerialPrograms/cmake/SourceFiles.cmake index cbf6bbdbf8..ec96fcbca3 100644 --- a/SerialPrograms/cmake/SourceFiles.cmake +++ b/SerialPrograms/cmake/SourceFiles.cmake @@ -1887,6 +1887,7 @@ file(GLOB LIBRARY_SOURCES Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSim.cpp Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSim.h Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSimField.cpp + Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldBike_Tests.cpp Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSim_Tests.cpp Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSpin_Tests.cpp Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldWalk.cpp From 0a9bb40e98274f3ae2d34109ff28f9dee760fe7b Mon Sep 17 00:00:00 2001 From: dayfine Date: Mon, 9 Nov 2026 23:00:37 -0800 Subject: [PATCH 26/79] FRLG AutoStory: register the Bicycle in 00.30, ride_bike presses SELECT A new GAME step, register_bike, REGISTERs the BICYCLE from Key Items (its menu's second option) once a save. It sits at the start of 00.30's plan until 00.26's plan (frlg/stage7-celadon, #224) can take it right after the Bicycle. ride_bike now gets on with SELECT (MINUS) and checks the player rides (get_on_bike()) instead of using the bag. The golden story sim trace gains register_bike's three lines and its stub, and 00.30's later events are numbered one up. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss --- .../PokemonFRLG_AutoStoryHideout.cpp | 10 +- .../PokemonFRLG_AutoStoryItemUse.cpp | 39 +++++++- .../AutoStory/PokemonFRLG_AutoStoryItemUse.h | 15 ++- .../PokemonFRLG_AutoStoryItemUse_Tests.cpp | 4 + .../ReplayData/frlg-story-sim-trace.json | 97 ++++++++++--------- .../AutoStory/StoryData/frlg-00.30.plan.json | 9 +- 6 files changed, 118 insertions(+), 56 deletions(-) diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryHideout.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryHideout.cpp index d3eda919e7..77d1aac88c 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryHideout.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryHideout.cpp @@ -6,6 +6,7 @@ #include #include "NintendoSwitch/Commands/NintendoSwitch_Commands_PushButtons.h" +#include "VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldWalk.h" #include "PokemonFRLG_AutoStoryActions.h" #include "PokemonFRLG_AutoStoryHideout.h" #include "PokemonFRLG_AutoStoryItemUse.h" @@ -132,9 +133,14 @@ std::optional run_field_game_step( if (!is_item_use_step(step)){ return std::nullopt; } - const std::string item = parse_use_item_step(step).value_or("bicycle"); + if (step.variant == RIDE_BIKE_VARIANT){ + OverworldWalkSteps::get_on_bike(console, context); + return done(); + } ConsoleItemUseActions bag(console, context, language); - const ItemUseEnd end = use_item_from_bag(console.logger(), bag, item); + const ItemUseEnd end = step.variant == REGISTER_BIKE_VARIANT + ? register_item_in_bag(console.logger(), bag, "bicycle") + : use_item_from_bag(console.logger(), bag, *parse_use_item_step(step)); if (end != ItemUseEnd::USED){ return Pokemon::outcome_failed(std::string("use_item_") + item_use_end_name(end), step.variant); } diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryItemUse.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryItemUse.cpp index 59e0c00b81..5f8ecc77aa 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryItemUse.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryItemUse.cpp @@ -52,7 +52,8 @@ std::optional parse_use_item_step(const Pokemon::StoryStep& step){ return std::string(item); } bool is_item_use_step(const Pokemon::StoryStep& step){ - return (step.variant == RIDE_BIKE_VARIANT && step.args.empty()) || parse_use_item_step(step).has_value(); + const bool bike = step.variant == RIDE_BIKE_VARIANT || step.variant == REGISTER_BIKE_VARIANT; + return (bike && step.args.empty()) || parse_use_item_step(step).has_value(); } std::optional bag_row_of(const std::vector& rows, std::string_view item){ @@ -78,7 +79,13 @@ const char* item_use_end_name(ItemUseEnd end){ return "?"; } -ItemUseEnd use_item_from_bag(Logger& logger, ItemUseActions& actions, std::string_view item){ +namespace{ + +// Opens the item's pocket, finds it and `uses` it, then back to the +// overworld. +ItemUseEnd with_bag_row( + Logger& logger, ItemUseActions& actions, std::string_view item, bool registers +){ const std::optional pocket = usable_item_pocket(item); if (!pocket){ return ItemUseEnd::UNKNOWN_ITEM; @@ -93,12 +100,25 @@ ItemUseEnd use_item_from_bag(Logger& logger, ItemUseActions& actions, std::strin actions.close_bag(); return ItemUseEnd::NONE_LEFT; } - logger.log("Bag: using the " + std::string(item) + " on row " + std::to_string(*row + 1) + "."); - actions.use_row(*row); + logger.log("Bag: " + std::string(registers ? "registering" : "using") + " the " + std::string(item) + " on row " + std::to_string(*row + 1) + "."); + if (registers){ + actions.register_row(*row); + }else{ + actions.use_row(*row); + } actions.close_bag(); return ItemUseEnd::USED; } +} // namespace + +ItemUseEnd use_item_from_bag(Logger& logger, ItemUseActions& actions, std::string_view item){ + return with_bag_row(logger, actions, item, false); +} +ItemUseEnd register_item_in_bag(Logger& logger, ItemUseActions& actions, std::string_view item){ + return with_bag_row(logger, actions, item, true); +} + ItemUseEnd renew_repel(Logger& logger, ItemUseActions& actions, std::string_view item){ if (!is_repel(item)){ return ItemUseEnd::UNKNOWN_ITEM; @@ -166,6 +186,17 @@ void ConsoleItemUseActions::use_row(size_t row){ pbf_press_button(m_context, BUTTON_A, 160ms, 1500ms); } +void ConsoleItemUseActions::register_row(size_t row){ + for (size_t c = 0; c < row; c++){ + pbf_press_dpad(m_context, DPAD_DOWN, CURSOR_TAP, CURSOR_WAIT); + } + // The item's menu: USE, REGISTER, ... Not timed on the console: the + // USE waits. + pbf_press_button(m_context, BUTTON_A, 160ms, 800ms); + pbf_press_dpad(m_context, DPAD_DOWN, CURSOR_TAP, CURSOR_WAIT); + pbf_press_button(m_context, BUTTON_A, 160ms, 1500ms); +} + void ConsoleItemUseActions::close_bag(){ // B until the overworld: past " used the REPEL.", out of the // bag and the START menu. The Escape Rope and the Bicycle leave the diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryItemUse.h b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryItemUse.h index 74949be3d8..780a5ce463 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryItemUse.h +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryItemUse.h @@ -41,9 +41,15 @@ inline constexpr Pokemon::StoryArgSpec USE_ITEM_ARGS[] = { {"item", Pokemon::StoryArgType::TEXT, true}, {"slot", Pokemon::StoryArgType::NUMBER, false}, }; -// The GAME step that gets on the Bicycle (the Key Items pocket's BICYCLE, -// USE). The ROUTE steps after it ride (BIKE_VARIANT). +// The GAME step that gets on the registered Bicycle with SELECT +// (OverworldWalkSteps::get_on_bike()). The ROUTE steps after it ride +// (BIKE_VARIANT). inline const std::string RIDE_BIKE_VARIANT = "ride_bike"; +// The GAME step that registers the Bicycle for SELECT: the Key Items +// pocket's BICYCLE, REGISTER, its menu's second option. Once a save: +// the registration is saved with the game, and a save made before it +// doesn't have it. +inline const std::string REGISTER_BIKE_VARIANT = "register_bike"; // The bag's pockets, in the order LEFT and RIGHT go through them. enum class BagPocket{ @@ -80,6 +86,8 @@ class ItemUseActions{ virtual std::vector read_pocket() = 0; // Moves to row `row`, USE, and through what the item says. virtual void use_row(size_t row) = 0; + // Moves to row `row` and REGISTERs it for SELECT. + virtual void register_row(size_t row) = 0; // Back to the overworld (nothing to do if the item closed the bag). virtual void close_bag() = 0; }; @@ -100,6 +108,8 @@ const char* item_use_end_name(ItemUseEnd end); // Opens the item's pocket, finds it and uses it, then back to the // overworld. ItemUseEnd use_item_from_bag(Logger& logger, ItemUseActions& actions, std::string_view item); +// The same, REGISTERing it for SELECT (the Bicycle) instead of USE. +ItemUseEnd register_item_in_bag(Logger& logger, ItemUseActions& actions, std::string_view item); // After "REPEL's effect wore off..." has closed: FRLG asks nothing, so // another of the same Repel is used if the bag has one. NONE_LEFT is no @@ -115,6 +125,7 @@ class ConsoleItemUseActions : public ItemUseActions{ virtual bool open_pocket(BagPocket pocket) override; virtual std::vector read_pocket() override; virtual void use_row(size_t row) override; + virtual void register_row(size_t row) override; virtual void close_bag() override; private: diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryItemUse_Tests.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryItemUse_Tests.cpp index 96674e8fd6..66c2f36a92 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryItemUse_Tests.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryItemUse_Tests.cpp @@ -36,6 +36,7 @@ class SimBag : public ItemUseActions{ std::map> pockets; bool opens = true; std::vector used; + std::vector registered; bool open = false; virtual bool open_pocket(BagPocket pocket) override{ @@ -53,6 +54,9 @@ class SimBag : public ItemUseActions{ item.count--; } } + virtual void register_row(size_t row) override{ + registered.push_back(pockets[m_pocket][row].item); + } virtual void close_bag() override{ open = false; } diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/ReplayData/frlg-story-sim-trace.json b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/ReplayData/frlg-story-sim-trace.json index 179242eb0b..da375eaaf3 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/ReplayData/frlg-story-sim-trace.json +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/ReplayData/frlg-story-sim-trace.json @@ -1201,81 +1201,84 @@ "[Checkpoint] 00.29: done, 7 run, 0 skipped", "[Checkpoint] 00.29: passed on attempt 1 (one-shot)", "begin 00.30", - "[Checkpoint] 00.30: start, 23 events", + "[Checkpoint] 00.30: start, 24 events", "[Event] 00.30/1 from_save: start", "[Event] 00.30/1 from_save: done", - "[Event] 00.30/2 east_of_mart_door: start", + "[Event] 00.30/2 register_bike: start", + "00.30/register_bike: ok at -", + "[Event] 00.30/2 register_bike: done", + "[Event] 00.30/3 east_of_mart_door: start", "00.30/east_of_mart_door: ok at LavenderTown (21, 16) facing east (tile)", - "[Event] 00.30/2 east_of_mart_door: done", - "[Event] 00.30/3 into_lavender_mart: start", + "[Event] 00.30/3 east_of_mart_door: done", + "[Event] 00.30/4 into_lavender_mart: start", "00.30/into_lavender_mart: ok at LavenderTown_Mart (4, 2) facing north (tile)", - "[Event] 00.30/3 into_lavender_mart: done", - "[Event] 00.30/4 lavender_mart_clerk: start", + "[Event] 00.30/4 into_lavender_mart: done", + "[Event] 00.30/5 lavender_mart_clerk: start", "00.30/lavender_mart_clerk: ok at LavenderTown_Mart (4, 3) facing west (tile)", - "[Event] 00.30/4 lavender_mart_clerk: done", - "[Event] 00.30/5 buy_ropes_and_super_repels: start", + "[Event] 00.30/5 lavender_mart_clerk: done", + "[Event] 00.30/6 buy_ropes_and_super_repels: start", "00.30/buy_ropes_and_super_repels: ok at LavenderTown_Mart (4, 3) facing west (tile)", - "[Event] 00.30/5 buy_ropes_and_super_repels: done", - "[Event] 00.30/6 out_of_lavender_mart: start", + "[Event] 00.30/6 buy_ropes_and_super_repels: done", + "[Event] 00.30/7 out_of_lavender_mart: start", "00.30/out_of_lavender_mart: ok at LavenderTown (20, 16) facing south (tile)", - "[Event] 00.30/6 out_of_lavender_mart: done", - "[Event] 00.30/7 ride_bike: start", + "[Event] 00.30/7 out_of_lavender_mart: done", + "[Event] 00.30/8 ride_bike: start", "00.30/ride_bike: ok at LavenderTown (20, 16) facing south (tile)", - "[Event] 00.30/7 ride_bike: done", - "[Event] 00.30/8 lavender_west_edge: start", + "[Event] 00.30/8 ride_bike: done", + "[Event] 00.30/9 lavender_west_edge: start", "00.30/lavender_west_edge: ok at LavenderTown (1, 10) facing south (tile)", - "[Event] 00.30/8 lavender_west_edge: done", - "[Event] 00.30/9 route8_east_wall: start", + "[Event] 00.30/9 lavender_west_edge: done", + "[Event] 00.30/10 route8_east_wall: start", "00.30/route8_east_wall: ok at Route8 (62, 10) facing west (tile)", - "[Event] 00.30/9 route8_east_wall: done", - "[Event] 00.30/10 east_of_rich_line: start", + "[Event] 00.30/10 route8_east_wall: done", + "[Event] 00.30/11 east_of_rich_line: start", "00.30/east_of_rich_line: ok at Route8 (57, 18) facing west (tile)", - "[Event] 00.30/10 east_of_rich_line: done", - "[Event] 00.30/11 rich_line: start", + "[Event] 00.30/11 east_of_rich_line: done", + "[Event] 00.30/12 rich_line: start", "00.30/rich_line: ok at Route8 (55, 18) facing west (tile)", - "[Event] 00.30/11 rich_line: done", - "[Event] 00.30/12 gamer_rich: start", + "[Event] 00.30/12 rich_line: done", + "[Event] 00.30/13 gamer_rich: start", "00.30/gamer_rich: ok at -", - "[Event] 00.30/12 gamer_rich: done", - "[Event] 00.30/13 west_of_glenn_column: start", + "[Event] 00.30/13 gamer_rich: done", + "[Event] 00.30/14 west_of_glenn_column: start", "00.30/west_of_glenn_column: ok at Route8 (48, 7) facing north (tile)", - "[Event] 00.30/13 west_of_glenn_column: done", - "[Event] 00.30/14 route8_row7_west_wall: start", + "[Event] 00.30/14 west_of_glenn_column: done", + "[Event] 00.30/15 route8_row7_west_wall: start", "00.30/route8_row7_west_wall: ok at Route8 (26, 7) facing west (tile)", - "[Event] 00.30/14 route8_row7_west_wall: done", - "[Event] 00.30/15 route8_row14_west_wall: start", + "[Event] 00.30/15 route8_row7_west_wall: done", + "[Event] 00.30/16 route8_row14_west_wall: start", "00.30/route8_row14_west_wall: ok at Route8 (12, 14) facing west (tile)", - "[Event] 00.30/15 route8_row14_west_wall: done", - "[Event] 00.30/16 east_of_underground_door: start", + "[Event] 00.30/16 route8_row14_west_wall: done", + "[Event] 00.30/17 east_of_underground_door: start", "00.30/east_of_underground_door: ok at Route8 (14, 5) facing north (tile)", - "[Event] 00.30/16 east_of_underground_door: done", - "[Event] 00.30/17 below_underground_door: start", + "[Event] 00.30/17 east_of_underground_door: done", + "[Event] 00.30/18 below_underground_door: start", "00.30/below_underground_door: ok at Route8 (13, 5) facing north (tile)", - "[Event] 00.30/17 below_underground_door: done", - "[Event] 00.30/18 route7_underground_exit: start", + "[Event] 00.30/18 below_underground_door: done", + "[Event] 00.30/19 route7_underground_exit: start", "00.30/route7_underground_exit: ok at Route7 (7, 15) facing south (tile)", - "[Event] 00.30/18 route7_underground_exit: done", - "[Event] 00.30/19 pidgey_grass: start", + "[Event] 00.30/19 route7_underground_exit: done", + "[Event] 00.30/20 pidgey_grass: start", "00.30/pidgey_grass: ok at Route7 (14, 6) facing east (tile)", - "[Event] 00.30/19 pidgey_grass: done", - "[Event] 00.30/20 catch_pidgey: start", + "[Event] 00.30/20 pidgey_grass: done", + "[Event] 00.30/21 catch_pidgey: start", "00.30/catch_pidgey: ok at Route7 (14, 6) (15, 6) (set)", - "[Event] 00.30/20 catch_pidgey: done", - "[Event] 00.30/21 celadon_below_center: start", + "[Event] 00.30/21 catch_pidgey: done", + "[Event] 00.30/22 celadon_below_center: start", "00.30/celadon_below_center: ok at CeladonCity (48, 12) facing north (tile)", - "[Event] 00.30/21 celadon_below_center: done", - "[Event] 00.30/22 celadon_nurse: start", + "[Event] 00.30/22 celadon_below_center: done", + "[Event] 00.30/23 celadon_nurse: start", "00.30/celadon_nurse: ok at CeladonCity (48, 12) facing north (tile)", - "[Event] 00.30/22 celadon_nurse: done", - "[Event] 00.30/23 heal_celadon: start", + "[Event] 00.30/23 celadon_nurse: done", + "[Event] 00.30/24 heal_celadon: start", "00.30/heal_celadon: ok at -", - "[Event] 00.30/23 heal_celadon: done", + "[Event] 00.30/24 heal_celadon: done", "save at CeladonCity_PokemonCenter_1F (7, 4) facing north (tile)", - "[Checkpoint] 00.30: done, 23 run, 0 skipped", + "[Checkpoint] 00.30: done, 24 run, 0 skipped", "[Checkpoint] 00.30: passed on attempt 1 (one-shot)", "[Segment] 00: 34 of 34 checkpoints one-shot", "[Segment] 00: done, 34 checkpoints", "completed", - "00.01: 2 stubbed: intro, options\n00.02: 0 stubbed\n00.03: 1 stubbed: to_the_lab\n00.04: 5 stubbed: squirtle_ball, choose_squirtle, no_nickname, rival_takes_bulbasaur, rival_battle\n00.05: 1 stubbed: parcel_from_clerk\n00.06: 2 stubbed: give_parcel, pokedex_scene\n00.07: 2 stubbed: heal_viridian, old_man_tutorial\n00.08: 1 stubbed: heal_pewter\n00.09: 3 stubbed: camper_liam, challenge_brock, brock\n00.10: 1 stubbed: shoes_from_aide\n00.11: 4 stubbed: heal_pewter, bug_catcher_colton, bug_catcher_greg, bug_catcher_james\n00.12: 1 stubbed: heal_route4\n00.12c: 1 stubbed: magikarp_to_box\n00.13: 6 stubbed: heal_route4, moon_stone_ball, found_moon_stone, rocket_grunt, super_nerd_miguel, helix_fossil\n00.14: 2 stubbed: teach_mega_kick, heal_cerulean\n00.14b: 3 stubbed: buy_potions, grind_to_lv23, heal_cerulean\n00.14c: 4 stubbed: challenge_misty, misty, heal_cerulean, teach_water_pulse\n00.15: 4 stubbed: teach_water_pulse, buy_potions, grind_for_rival, heal_cerulean\n00.15b: 2 stubbed: teach_water_pulse, rival_cerulean\n00.16: 7 stubbed: heal_cerulean, bug_catcher_cale, lass_ali, youngster_timmy, lass_reli, camper_ethan, rocket_grunt\n00.17: 4 stubbed: hiker_franklin, picnicker_kelsey, hiker_nob, lass_haley\n00.18: 7 stubbed: bill_clefairy, help_bill, bill_into_teleporter, cell_separator, bill_comes_out, thank_bill, ss_ticket\n00.19: 1 stubbed: heal_cerulean\n00.20: 3 stubbed: buy_poke_balls, catch_oddish, heal_cerulean\n00.21: 3 stubbed: rocket_grunt, camper_jeff, heal_vermilion\n00.22: 6 stubbed: show_ss_ticket, rival_ss_anne, captain, hm01_cut, ss_anne_sails, heal_vermilion\n00.23: 9 stubbed: teach_cut, teach_dig, cut_gym_tree, sailor_dwayne, engineer_baily, gentleman_tucker, trash_cans, cut_tree_out, heal_vermilion\n00.24: 4 stubbed: surge_winnable, grind_for_surge, heal_vermilion, cut_gym_tree\n00.25: 4 stubbed: challenge_lt_surge, lt_surge, cut_tree_out, heal_vermilion\n00.26: 8 stubbed: chairman, hear_story, bike_voucher, cut_cerulean_tree, talk_bike_clerk, bicycle, buy_repels, heal_cerulean\n00.27: 6 stubbed: cut_cerulean_tree, cut_route9_tree, picnicker_alicia, hiker_jeremy, bug_catcher_conner, heal_route10\n00.28: 9 stubbed: cut_route10_tree, pokemaniac_ashton, pokemaniac_winston, picnicker_martha, hiker_allen, hiker_lenny, picnicker_sofia, hiker_dudley, picnicker_dana\n00.29: 1 stubbed: heal_lavender\n00.30: 6 stubbed: buy_ropes_and_super_repels, ride_bike, gamer_rich, catch_pidgey, celadon_nurse, heal_celadon\n" + "00.01: 2 stubbed: intro, options\n00.02: 0 stubbed\n00.03: 1 stubbed: to_the_lab\n00.04: 5 stubbed: squirtle_ball, choose_squirtle, no_nickname, rival_takes_bulbasaur, rival_battle\n00.05: 1 stubbed: parcel_from_clerk\n00.06: 2 stubbed: give_parcel, pokedex_scene\n00.07: 2 stubbed: heal_viridian, old_man_tutorial\n00.08: 1 stubbed: heal_pewter\n00.09: 3 stubbed: camper_liam, challenge_brock, brock\n00.10: 1 stubbed: shoes_from_aide\n00.11: 4 stubbed: heal_pewter, bug_catcher_colton, bug_catcher_greg, bug_catcher_james\n00.12: 1 stubbed: heal_route4\n00.12c: 1 stubbed: magikarp_to_box\n00.13: 6 stubbed: heal_route4, moon_stone_ball, found_moon_stone, rocket_grunt, super_nerd_miguel, helix_fossil\n00.14: 2 stubbed: teach_mega_kick, heal_cerulean\n00.14b: 3 stubbed: buy_potions, grind_to_lv23, heal_cerulean\n00.14c: 4 stubbed: challenge_misty, misty, heal_cerulean, teach_water_pulse\n00.15: 4 stubbed: teach_water_pulse, buy_potions, grind_for_rival, heal_cerulean\n00.15b: 2 stubbed: teach_water_pulse, rival_cerulean\n00.16: 7 stubbed: heal_cerulean, bug_catcher_cale, lass_ali, youngster_timmy, lass_reli, camper_ethan, rocket_grunt\n00.17: 4 stubbed: hiker_franklin, picnicker_kelsey, hiker_nob, lass_haley\n00.18: 7 stubbed: bill_clefairy, help_bill, bill_into_teleporter, cell_separator, bill_comes_out, thank_bill, ss_ticket\n00.19: 1 stubbed: heal_cerulean\n00.20: 3 stubbed: buy_poke_balls, catch_oddish, heal_cerulean\n00.21: 3 stubbed: rocket_grunt, camper_jeff, heal_vermilion\n00.22: 6 stubbed: show_ss_ticket, rival_ss_anne, captain, hm01_cut, ss_anne_sails, heal_vermilion\n00.23: 9 stubbed: teach_cut, teach_dig, cut_gym_tree, sailor_dwayne, engineer_baily, gentleman_tucker, trash_cans, cut_tree_out, heal_vermilion\n00.24: 4 stubbed: surge_winnable, grind_for_surge, heal_vermilion, cut_gym_tree\n00.25: 4 stubbed: challenge_lt_surge, lt_surge, cut_tree_out, heal_vermilion\n00.26: 8 stubbed: chairman, hear_story, bike_voucher, cut_cerulean_tree, talk_bike_clerk, bicycle, buy_repels, heal_cerulean\n00.27: 6 stubbed: cut_cerulean_tree, cut_route9_tree, picnicker_alicia, hiker_jeremy, bug_catcher_conner, heal_route10\n00.28: 9 stubbed: cut_route10_tree, pokemaniac_ashton, pokemaniac_winston, picnicker_martha, hiker_allen, hiker_lenny, picnicker_sofia, hiker_dudley, picnicker_dana\n00.29: 1 stubbed: heal_lavender\n00.30: 7 stubbed: register_bike, buy_ropes_and_super_repels, ride_bike, gamer_rich, catch_pidgey, celadon_nurse, heal_celadon\n" ] } diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.30.plan.json b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.30.plan.json index cd34645f8a..1f5f7e7850 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.30.plan.json +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.30.plan.json @@ -15,6 +15,13 @@ "id": "lavender_mart", "title": "From Lavender's Center to the Mart: Escape Ropes and Super Repels", "events": [ + { + "id": "register_bike", + "kind": "game_action", + "variant": "register_bike", + "once_per_save": true, + "why": "the BICYCLE (00.26) registered for SELECT, which gets on and off in about 1 s (console B, 2026-11-09); here until 00.26's plan (frlg/stage7-celadon, #224) takes it right after the Bicycle" + }, { "id": "east_of_mart_door", "kind": "route", @@ -62,7 +69,7 @@ "id": "ride_bike", "kind": "game_action", "variant": "ride_bike", - "why": "on the BICYCLE (00.26, Key Items) for Route 8" + "why": "on the BICYCLE with SELECT (registered by register_bike) for Route 8" }, { "id": "lavender_west_edge", From 388bfff97c53444217477be2940621030ef9a250 Mon Sep 17 00:00:00 2001 From: dayfine Date: Mon, 9 Nov 2026 23:03:41 -0800 Subject: [PATCH 27/79] FRLG walker: code health for the Bicycle taps; register_bike's trace line The sim's taps (turn, step, Bicycle) move to PokemonFRLG_OverworldSimTaps.cpp, SELECT goes through use_field(SimField::BIKE_SELECT), the counted taps are chosen in walk_and_watch(), and each new constant has its own comment. The golden trace places register_bike where 00.30 starts. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss --- .../Overworld/PokemonFRLG_MovementMechanics.h | 19 +-- .../PokemonFRLG_OverworldBike_Tests.cpp | 3 +- .../PokemonFRLG_OverworldRecoveryWalk.cpp | 7 +- .../Overworld/PokemonFRLG_OverworldSim.cpp | 100 +-------------- .../Overworld/PokemonFRLG_OverworldSim.h | 12 +- .../PokemonFRLG_OverworldSimField.cpp | 2 + .../PokemonFRLG_OverworldSimTaps.cpp | 120 ++++++++++++++++++ .../ReplayData/frlg-story-sim-trace.json | 2 +- SerialPrograms/cmake/SourceFiles.cmake | 1 + 9 files changed, 147 insertions(+), 119 deletions(-) create mode 100644 SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSimTaps.cpp diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_MovementMechanics.h b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_MovementMechanics.h index aa9fafaa3f..1b29078224 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_MovementMechanics.h +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_MovementMechanics.h @@ -65,12 +65,14 @@ inline constexpr Milliseconds BIKE_TILE_TIME(100); // hold turns the player too, and loses no tile for it. inline constexpr bool BIKE_TAP_ONLY_TURNS = false; // Chains of 40ms taps on the Bicycle (console B, 2026-11-09): one tap per -// 100ms (60ms release) moved exactly a tile each; at one per 60ms, one -// tap in 12 was dropped. Somewhere between the two the game starts -// dropping taps; the sim drops one in BIKE_FAST_TAP_DROP_EVERY of the taps -// that start sooner than this after the last one. +// 100ms (60ms release) moved exactly a tile each. inline constexpr Milliseconds BIKE_TAP_PERIOD_WORKED(100); +// At one tap per 60ms, one tap in 12 was dropped. Somewhere between that +// and BIKE_TAP_PERIOD_WORKED the game starts dropping taps; the sim drops +// taps that start sooner than this after the last one. inline constexpr Milliseconds BIKE_TAP_DROP_PERIOD(80); +// Of the taps that come sooner than BIKE_TAP_DROP_PERIOD, the sim drops +// one in this many. inline constexpr int BIKE_FAST_TAP_DROP_EVERY = 12; // With the Bicycle registered (Key Items, BICYCLE, REGISTER), SELECT gets // on and off in about 1s (console B, 2026-11-09). Going through a door @@ -117,17 +119,18 @@ inline constexpr Milliseconds STEP_TAP(66); inline constexpr Milliseconds STEP_TAP_RELEASE(700); // An open leg on the Bicycle is counted out in taps, each a tile: a 40ms -// press, released to a BIKE_TAP_PERIOD period, slower than the chains -// that worked, so none is dropped. +// press each. inline constexpr Milliseconds BIKE_TAP(40); +// The taps' period, start to start, slower than the chains that worked, +// so none is dropped. inline constexpr Milliseconds BIKE_TAP_PERIOD(120); // After a tap, how long until the screen shows whether it moved: the // tile's 100ms and video lag. The Command File Runner's tap check judged // its first tap too early, as unmoved. Not measured: a guess. inline constexpr Milliseconds BIKE_TAP_SETTLE(250); -// SELECT, pressed to get on the registered Bicycle, and the wait after -// it for the player to be up on it. +// SELECT, pressed to get on the registered Bicycle. inline constexpr Milliseconds BIKE_SELECT_PRESS(160); +// The wait after SELECT for the player to be up on the Bicycle. inline constexpr Milliseconds BIKE_SELECT_SETTLE(1200); // How long the overworld must show nothing (no box, fade or battle) after diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldBike_Tests.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldBike_Tests.cpp index 03d1e829a4..13c094c7d0 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldBike_Tests.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldBike_Tests.cpp @@ -114,6 +114,7 @@ UnitTestResult test_tap_chains(){ return true; } +// An open leg of `tiles` toward `direction`, ending on `end`. RouteStep open_leg(Direction direction, int tiles, MapPosition end){ RouteStep step; step.direction = direction; @@ -177,7 +178,7 @@ UnitTestResult test_select_onto_bike(){ OverworldSim sim(field(), at(10, 1), Direction::WEST, script); BikeSelectCalls calls; int presses = 0; - calls.press_select = [&]{ presses++; sim.press_select(); }; + calls.press_select = [&]{ presses++; sim.use_field(SimField::BIKE_SELECT); }; calls.riding = [&]{ return sim.state().on_bike; }; calls.log = [](const std::string&){}; const bool riding = OverworldWalkSteps::select_onto_bike(calls); diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldRecoveryWalk.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldRecoveryWalk.cpp index 08e449666c..8038545d93 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldRecoveryWalk.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldRecoveryWalk.cpp @@ -151,9 +151,6 @@ StepWalk walk_step( const RouteStep& step, std::optional facing, const OverworldInterruptSet& interrupts, MoveSpeed speed ){ - if (counts_bike_taps(step, speed)){ - return walk_bike_taps(console, context, step, interrupts); - } StepWalk out{std::nullopt, current_time(), false, false}; switch (step.action){ case RouteAction::WALK:{ @@ -264,7 +261,9 @@ StepOutcome walk_and_watch( clear_open_message(console, context, step.wild ? interrupts.wild : interrupts.other, step); check_overworld(console, context, step); const LegRecorder recorder(console, context, interrupts, step); - const StepWalk walked = walk_step(console, context, step, facing, interrupts, speed); + const StepWalk walked = counts_bike_taps(step, speed) + ? walk_bike_taps(console, context, step, interrupts) + : walk_step(console, context, step, facing, interrupts, speed); if (walked.stopped){ return StepOutcome{.end = StepEnd::STOPPED, .walked = walked.stopped, .blocked = walked.blocked}; } diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSim.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSim.cpp index bce5aa34b0..fc523332db 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSim.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSim.cpp @@ -368,8 +368,7 @@ bool OverworldSim::after_step(const Step& step, Milliseconds pressed){ } m_cut_trees.clear(); if (m_state.on_bike){ - // A door takes the player off the Bicycle (the user's - // knowledge, not measured). + // A door takes the player off (the user's; not measured). m_state.on_bike = false; note("the warp takes the player off the Bicycle."); } @@ -613,35 +612,6 @@ void OverworldSim::hold_on(Direction direction, Milliseconds end){ press.end = end; } -bool OverworldSim::drops_bike_tap(Milliseconds start){ - const bool fast = m_last_bike_tap && start - *m_last_bike_tap < MovementMechanics::BIKE_TAP_DROP_PERIOD; - m_last_bike_tap = start; - if (!fast || ++m_fast_bike_taps % MovementMechanics::BIKE_FAST_TAP_DROP_EVERY != 0){ - return false; - } - m_state.bike_taps_dropped++; - note(std::format("a Bicycle tap is dropped, {} fast taps in.", m_fast_bike_taps)); - return true; -} - -bool OverworldSim::press_select(){ - const Milliseconds start = m_now; - if (m_state.screen != SimScreen::OVERWORLD || m_frozen || !m_script.bike_registered){ - note(m_script.bike_registered ? "SELECT does nothing off the overworld." : "SELECT does nothing: the Bicycle isn't registered."); - advance_to(start + MovementMechanics::BIKE_SELECT_PRESS); - return false; - } - if (!m_state.on_bike && !map().allow_running){ - note("SELECT: the Bicycle can't be ridden here."); - advance_to(start + MovementMechanics::BIKE_SELECT_TIME); - return false; - } - m_state.on_bike = !m_state.on_bike; - note(m_state.on_bike ? "gets on the Bicycle." : "gets off the Bicycle."); - advance_to(start + MovementMechanics::BIKE_SELECT_TIME); - return true; -} - bool OverworldSim::drops_turn_tap(){ m_turn_taps++; return m_script.dropped_turn_taps.contains(m_turn_taps); @@ -730,7 +700,6 @@ OverworldSimWalker::OverworldSimWalker(OverworldSim& sim, SimWalkerRules rules, : m_sim(sim) , m_rules(rules) , m_riding(rules.speed == MoveSpeed::BIKE) - , m_speed(rules.speed) { // In the walker's order: battles first. m_wild = { @@ -898,55 +867,7 @@ std::optional OverworldSimWalker::walk_step(const RouteStep& step, return std::nullopt; } -BikeTap OverworldSimWalker::bike_tap(const RouteStep& step){ - const MapPosition before = m_sim.state().position; - const std::vector& ints = interrupts(step); - const Milliseconds release = m_rules.bike_tap_period - BIKE_TAP; - const std::optional seen = m_sim.hold(step.direction, BIKE_TAP, release, m_rules.bike_tap_period + BIKE_TAP_SETTLE, watchers(ints)); - if (seen){ - m_log.push_back("Bike: " + ints[seen->watcher].name + " on a tap of " + to_string(step) + "."); - return BikeTap{.moved = false, .interrupt = seen->watcher}; - } - if (!(m_sim.state().position == before)){ - return BikeTap{.moved = true}; - } - return BikeTap{.moved = false, .interrupt = std::nullopt, .cleared_late = clear_late(ints, AFTER_LEG_WATCH, MAX_INTERRUPTIONS_PER_LEG) > 0}; -} - -StepOutcome OverworldSimWalker::walk_bike_taps(const RouteStep& step){ - const std::vector& ints = interrupts(step); - BikeTapCalls calls; - calls.tap = [&]{ return bike_tap(step); }; - calls.clear = [&](size_t index){ clear(ints[index]); }; - calls.log = [&](const std::string& message){ m_log.push_back(message); }; - m_leg_start = m_sim.state().time; - m_leg_dark = m_sim.state().dark; - return count_bike_taps(step, calls); -} - -// walk_and_watch(), getting on the Bicycle first where -// walk_overworld_route_with_recovery() does. -StepOutcome OverworldSimWalker::walk(const RouteStep& step, std::optional facing){ - if (m_rules.get_back_on_bike && gets_on_bike(step, m_rules.speed, m_riding)){ - BikeSelectCalls select; - select.press_select = [&]{ m_sim.press_select(); }; - select.riding = [&]{ return m_sim.state().on_bike; }; - select.log = [&](const std::string& message){ m_log.push_back(message); }; - if (!select_onto_bike(select)){ - fail("get_on_bike(): not on the Bicycle after SELECT twice. Is it registered?"); - } - m_riding = true; - facing = std::nullopt; - } - m_speed = m_riding || !m_rules.get_back_on_bike ? m_rules.speed : on_foot(m_rules.speed); - const StepOutcome outcome = walk_ridden(step, facing); - if (m_riding && step.warps){ - m_log.push_back("Bike: through the warp to " + step.end.map + ", off the Bicycle."); - m_riding = false; - } - return outcome; -} - +// walk_and_watch(). StepOutcome OverworldSimWalker::walk_ridden(const RouteStep& step, std::optional facing){ if (m_rules.battle_before_step && battle_on_its_way()){ m_log.push_back("Route: " + std::string(sim_screen_name(m_sim.state().screen)) + " before " + to_string(step) + ": watching on for a wild battle set off before it."); @@ -1063,23 +984,6 @@ RouteCalls OverworldSimWalker::calls(){ return calls; } -void sim_turn_to(OverworldSim& sim, Direction direction, bool confirm){ - for (size_t tap = 1; tap <= MAX_TURN_TAPS; tap++){ - sim.tap(direction); - const SimState& state = sim.state(); - if (!confirm || state.screen != SimScreen::OVERWORLD || state.facing == direction){ - return; - } - } -} - -void sim_step_once(OverworldSim& sim, Direction direction){ - if (sim.state().facing != direction){ - sim_turn_to(sim, direction); - } - sim.tap(direction, STEP_TAP, STEP_TAP_RELEASE); -} - std::string OverworldSimWalker::run(const std::vector& route, const RoutePlanning& planning){ try{ run_route(route, m_sim.state().facing, &planning, calls()); diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSim.h b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSim.h index 2f6c0c83df..62b018d870 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSim.h +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSim.h @@ -250,6 +250,10 @@ enum class SimField{ // The panel of the lift the player stands in (SimScript::lift_floors): // the floor picked, the lift's door now lets out there. LIFT_FLOOR, + // Not A: SELECT, which with the Bicycle registered gets on it where + // running is allowed, or off it, in about + // MovementMechanics::BIKE_SELECT_TIME. (PokemonFRLG_OverworldSimTaps.cpp) + BIKE_SELECT, }; // Simulates overworld movement, encounters and dialogs. @@ -282,13 +286,6 @@ class OverworldSim{ Milliseconds release = MovementMechanics::TURN_SETTLE ); - // SELECT on the overworld: with the Bicycle registered, gets on it - // where running is allowed, or off it, taking about - // MovementMechanics::BIKE_SELECT_TIME. Returns whether it did. - bool press_select(); - // REGISTER on the Bicycle in the bag (SimScript::bike_registered). - void register_bike(){ m_script.bike_registered = true; } - // Watches `watchers` for `duration`, as wait_until(). std::optional watch(const std::vector& watchers, Milliseconds duration); @@ -365,6 +362,7 @@ class OverworldSim{ std::optional next_encounter(); bool rolls_encounter(int rate); bool drops_turn_tap(); + bool press_select(); // Whether the Bicycle tap starting at `start` is dropped, too soon // after the last one. bool drops_bike_tap(Milliseconds start); diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSimField.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSimField.cpp index ac198790ac..3258b390d0 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSimField.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSimField.cpp @@ -33,6 +33,8 @@ bool OverworldSim::use_field(SimField field, size_t floor){ return push_poster_switch(); case SimField::LIFT_FLOOR: return choose_lift_floor(floor); + case SimField::BIKE_SELECT: + return press_select(); } return false; } diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSimTaps.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSimTaps.cpp new file mode 100644 index 0000000000..9cff82e7b3 --- /dev/null +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSimTaps.cpp @@ -0,0 +1,120 @@ +/* Overworld Sim: taps and the Bicycle + * + * From: https://github.com/PokemonAutomation/ + * + * The walker's taps on the sim: turn taps, step taps, and on the Bicycle + * taps dropped when they come too fast, SELECT, and legs counted out a + * tap at a time. + * + */ + +#include +#include "PokemonFRLG_OverworldSim.h" + +namespace PokemonAutomation{ +namespace NintendoSwitch{ +namespace PokemonFRLG{ + +using namespace MovementMechanics; +using namespace OverworldWalkSteps; + + +bool OverworldSim::drops_bike_tap(Milliseconds start){ + const bool fast = m_last_bike_tap && start - *m_last_bike_tap < MovementMechanics::BIKE_TAP_DROP_PERIOD; + m_last_bike_tap = start; + if (!fast || ++m_fast_bike_taps % MovementMechanics::BIKE_FAST_TAP_DROP_EVERY != 0){ + return false; + } + m_state.bike_taps_dropped++; + note(std::format("a Bicycle tap is dropped, {} fast taps in.", m_fast_bike_taps)); + return true; +} + +bool OverworldSim::press_select(){ + const Milliseconds start = m_now; + if (m_state.screen != SimScreen::OVERWORLD || m_frozen || !m_script.bike_registered){ + note(m_script.bike_registered ? "SELECT does nothing off the overworld." : "SELECT does nothing: the Bicycle isn't registered."); + advance_to(start + MovementMechanics::BIKE_SELECT_PRESS); + return false; + } + if (!m_state.on_bike && !map().allow_running){ + note("SELECT: the Bicycle can't be ridden here."); + advance_to(start + MovementMechanics::BIKE_SELECT_TIME); + return false; + } + m_state.on_bike = !m_state.on_bike; + note(m_state.on_bike ? "gets on the Bicycle." : "gets off the Bicycle."); + advance_to(start + MovementMechanics::BIKE_SELECT_TIME); + return true; +} + +BikeTap OverworldSimWalker::bike_tap(const RouteStep& step){ + const MapPosition before = m_sim.state().position; + const std::vector& ints = interrupts(step); + const Milliseconds release = m_rules.bike_tap_period - BIKE_TAP; + const std::optional seen = m_sim.hold(step.direction, BIKE_TAP, release, m_rules.bike_tap_period + BIKE_TAP_SETTLE, watchers(ints)); + if (seen){ + m_log.push_back("Bike: " + ints[seen->watcher].name + " on a tap of " + to_string(step) + "."); + return BikeTap{.moved = false, .interrupt = seen->watcher}; + } + if (!(m_sim.state().position == before)){ + return BikeTap{.moved = true}; + } + return BikeTap{.moved = false, .interrupt = std::nullopt, .cleared_late = clear_late(ints, AFTER_LEG_WATCH, MAX_INTERRUPTIONS_PER_LEG) > 0}; +} + +StepOutcome OverworldSimWalker::walk_bike_taps(const RouteStep& step){ + const std::vector& ints = interrupts(step); + BikeTapCalls calls; + calls.tap = [&]{ return bike_tap(step); }; + calls.clear = [&](size_t index){ clear(ints[index]); }; + calls.log = [&](const std::string& message){ m_log.push_back(message); }; + m_leg_start = m_sim.state().time; + m_leg_dark = m_sim.state().dark; + return count_bike_taps(step, calls); +} + +// walk_and_watch(), getting on the Bicycle first where +// walk_overworld_route_with_recovery() does. +StepOutcome OverworldSimWalker::walk(const RouteStep& step, std::optional facing){ + if (m_rules.get_back_on_bike && gets_on_bike(step, m_rules.speed, m_riding)){ + BikeSelectCalls select; + select.press_select = [&]{ m_sim.use_field(SimField::BIKE_SELECT); }; + select.riding = [&]{ return m_sim.state().on_bike; }; + select.log = [&](const std::string& message){ m_log.push_back(message); }; + if (!select_onto_bike(select)){ + fail("get_on_bike(): not on the Bicycle after SELECT twice. Is it registered?"); + } + m_riding = true; + facing = std::nullopt; + } + m_speed = m_riding || !m_rules.get_back_on_bike ? m_rules.speed : on_foot(m_rules.speed); + const StepOutcome outcome = walk_ridden(step, facing); + if (m_riding && step.warps){ + m_log.push_back("Bike: through the warp to " + step.end.map + ", off the Bicycle."); + m_riding = false; + } + return outcome; +} + +void sim_turn_to(OverworldSim& sim, Direction direction, bool confirm){ + for (size_t tap = 1; tap <= MAX_TURN_TAPS; tap++){ + sim.tap(direction); + const SimState& state = sim.state(); + if (!confirm || state.screen != SimScreen::OVERWORLD || state.facing == direction){ + return; + } + } +} + +void sim_step_once(OverworldSim& sim, Direction direction){ + if (sim.state().facing != direction){ + sim_turn_to(sim, direction); + } + sim.tap(direction, STEP_TAP, STEP_TAP_RELEASE); +} + + +} // namespace PokemonFRLG +} // namespace NintendoSwitch +} // namespace PokemonAutomation diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/ReplayData/frlg-story-sim-trace.json b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/ReplayData/frlg-story-sim-trace.json index da375eaaf3..6f80bbffdc 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/ReplayData/frlg-story-sim-trace.json +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/ReplayData/frlg-story-sim-trace.json @@ -1205,7 +1205,7 @@ "[Event] 00.30/1 from_save: start", "[Event] 00.30/1 from_save: done", "[Event] 00.30/2 register_bike: start", - "00.30/register_bike: ok at -", + "00.30/register_bike: ok at LavenderTown_PokemonCenter_1F (7, 4) facing north (tile)", "[Event] 00.30/2 register_bike: done", "[Event] 00.30/3 east_of_mart_door: start", "00.30/east_of_mart_door: ok at LavenderTown (21, 16) facing east (tile)", diff --git a/SerialPrograms/cmake/SourceFiles.cmake b/SerialPrograms/cmake/SourceFiles.cmake index ec96fcbca3..4654320160 100644 --- a/SerialPrograms/cmake/SourceFiles.cmake +++ b/SerialPrograms/cmake/SourceFiles.cmake @@ -1886,6 +1886,7 @@ file(GLOB LIBRARY_SOURCES Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldRoute_Tests.cpp Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSim.cpp Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSim.h + Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSimTaps.cpp Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSimField.cpp Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldBike_Tests.cpp Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSim_Tests.cpp From 606d4281c5e0184f38eb98b32eaaf7687dabe068 Mon Sep 17 00:00:00 2001 From: dayfine Date: Mon, 9 Nov 2026 23:09:41 -0800 Subject: [PATCH 28/79] FRLG walker: the Bicycle tap API in its own header; linter fixes count_bike_taps() and its types move to PokemonFRLG_OverworldBikeTaps.h/.cpp, BikeSelectCalls loses its log, and the Bicycle tests' expectation is a std::string. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss --- .../PokemonFRLG_OverworldBikeTaps.cpp | 41 +++++++++++++ .../Overworld/PokemonFRLG_OverworldBikeTaps.h | 61 +++++++++++++++++++ .../PokemonFRLG_OverworldBike_Tests.cpp | 3 +- .../PokemonFRLG_OverworldRecovery.cpp | 22 +------ .../Overworld/PokemonFRLG_OverworldRecovery.h | 30 --------- .../PokemonFRLG_OverworldRecoveryWalk.cpp | 1 + .../Overworld/PokemonFRLG_OverworldSim.h | 1 + .../PokemonFRLG_OverworldSimTaps.cpp | 1 - .../Overworld/PokemonFRLG_OverworldWalk.cpp | 6 +- .../Overworld/PokemonFRLG_OverworldWalk.h | 1 - SerialPrograms/cmake/SourceFiles.cmake | 4 +- 11 files changed, 112 insertions(+), 59 deletions(-) create mode 100644 SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldBikeTaps.cpp create mode 100644 SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldBikeTaps.h diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldBikeTaps.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldBikeTaps.cpp new file mode 100644 index 0000000000..fa2871e6d7 --- /dev/null +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldBikeTaps.cpp @@ -0,0 +1,41 @@ +/* Overworld Bicycle Taps + * + * From: https://github.com/PokemonAutomation/ + * + */ + +#include +#include +#include "PokemonFRLG_OverworldBikeTaps.h" + +namespace PokemonAutomation{ +namespace NintendoSwitch{ +namespace PokemonFRLG{ + + +StepOutcome count_bike_taps(const RouteStep& step, const BikeTapCalls& calls){ + int moved = 0; + for (int tap = 1; tap <= step.tiles; tap++){ + const BikeTap result = calls.tap(); + if (result.interrupt || result.cleared_late){ + calls.log(std::format("Bike: tap {} of {}: interrupted after {} tile(s).", tap, step.tiles, moved)); + if (result.interrupt){ + calls.clear(*result.interrupt); + } + const int most = std::min(moved + 1, step.tiles); + return StepOutcome{.end = StepEnd::STOPPED, .walked = WalkedTiles{moved, most}}; + } + if (!result.moved){ + calls.log(std::format("Bike: tap {} of {} didn't move: blocked after {} tile(s).", tap, step.tiles, moved)); + return StepOutcome{.end = StepEnd::STOPPED, .walked = WalkedTiles{moved, moved + BLOCKED_TAP_SLACK}, .blocked = true}; + } + moved++; + } + return StepOutcome{}; +} + + + +} // namespace PokemonFRLG +} // namespace NintendoSwitch +} // namespace PokemonAutomation diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldBikeTaps.h b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldBikeTaps.h new file mode 100644 index 0000000000..c1018ce17f --- /dev/null +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldBikeTaps.h @@ -0,0 +1,61 @@ +/* Overworld Bicycle Taps + * + * From: https://github.com/PokemonAutomation/ + * + * An open leg on the Bicycle counted out a tap at a time, each a tile, + * with the console side passed in (BikeTapCalls), so the walker and the + * sim share it. + * + */ + +#ifndef PokemonAutomation_PokemonFRLG_OverworldBikeTaps_H +#define PokemonAutomation_PokemonFRLG_OverworldBikeTaps_H + +#include +#include +#include +#include +#include "PokemonFRLG_OverworldRecovery.h" +#include "PokemonFRLG_OverworldRoute.h" + +namespace PokemonAutomation{ +namespace NintendoSwitch{ +namespace PokemonFRLG{ + + +// One tap of an open leg on the Bicycle, counted out a tile a tap: whether +// the screen moved, and which of the leg's interrupts showed, if one did. +struct BikeTap{ + bool moved = false; + std::optional interrupt; + // The tap didn't move, and then an interrupt showed, which the tap + // cleared already: a trainer who saw the player, a battle seen late. + bool cleared_late = false; +}; +// The console side of count_bike_taps(): `tap` taps once and judges it; +// `clear` clears interrupt i. +struct BikeTapCalls{ + std::function tap; + std::function clear; + std::function log; +}; +// How far a sure start may be off before a blocked tap finds the player: +// three runs of 00.30 stood 3 tiles off (console B, 2026-11-09). +constexpr int BLOCKED_TAP_SLACK = 3; + +// Walks the open leg `step` a tap at a time: on the Bicycle each tap is +// exactly a tile (MovementMechanics::BIKE_TAP). A tap that doesn't move +// the player ends the leg there, blocked, and one with an interrupt ends +// it once that is cleared. DONE once all of the leg's taps moved; else +// STOPPED, with the tiles walked: blocked, the taps that moved, and up +// to BLOCKED_TAP_SLACK more for a start that was off (run_route() keeps +// the tiles with a blocked one ahead); interrupted, the taps that moved +// and one more, which may have moved before its battle showed. +StepOutcome count_bike_taps(const RouteStep& step, const BikeTapCalls& calls); + + + +} // namespace PokemonFRLG +} // namespace NintendoSwitch +} // namespace PokemonAutomation +#endif diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldBike_Tests.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldBike_Tests.cpp index 13c094c7d0..ce660ee05b 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldBike_Tests.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldBike_Tests.cpp @@ -34,7 +34,7 @@ struct BikeInput{ UnitTestResult (*body)(); }; struct BikeExpectation{ - const char* description; + std::string description; }; struct BikeCase{ BikeInput input; @@ -180,7 +180,6 @@ UnitTestResult test_select_onto_bike(){ int presses = 0; calls.press_select = [&]{ presses++; sim.use_field(SimField::BIKE_SELECT); }; calls.riding = [&]{ return sim.state().on_bike; }; - calls.log = [](const std::string&){}; const bool riding = OverworldWalkSteps::select_onto_bike(calls); if (riding != registered || presses != (registered ? 1 : 2)){ return std::format( diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldRecovery.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldRecovery.cpp index 08492373f2..8cec6277b7 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldRecovery.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldRecovery.cpp @@ -7,6 +7,7 @@ #include #include #include "Pokemon/Navigation/Pokemon_RouteLog.h" +#include "PokemonFRLG_OverworldBikeTaps.h" #include "PokemonFRLG_OverworldReanchor.h" #include "PokemonFRLG_OverworldRecovery.h" @@ -577,27 +578,6 @@ std::optional trainer_crossing( return crossing; } -StepOutcome count_bike_taps(const RouteStep& step, const BikeTapCalls& calls){ - int moved = 0; - for (int tap = 1; tap <= step.tiles; tap++){ - const BikeTap result = calls.tap(); - if (result.interrupt || result.cleared_late){ - calls.log(std::format("Bike: tap {} of {}: interrupted after {} tile(s).", tap, step.tiles, moved)); - if (result.interrupt){ - calls.clear(*result.interrupt); - } - const int most = std::min(moved + 1, step.tiles); - return StepOutcome{.end = StepEnd::STOPPED, .walked = WalkedTiles{moved, most}}; - } - if (!result.moved){ - calls.log(std::format("Bike: tap {} of {} didn't move: blocked after {} tile(s).", tap, step.tiles, moved)); - return StepOutcome{.end = StepEnd::STOPPED, .walked = WalkedTiles{moved, moved + BLOCKED_TAP_SLACK}, .blocked = true}; - } - moved++; - } - return StepOutcome{}; -} - void run_route( const std::vector& route, std::optional facing, const RoutePlanning* planning, const RouteCalls& calls diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldRecovery.h b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldRecovery.h index 8744c0089f..88e18a679b 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldRecovery.h +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldRecovery.h @@ -74,36 +74,6 @@ struct StepOutcome{ }; -// One tap of an open leg on the Bicycle, counted out a tile a tap: whether -// the screen moved, and which of the leg's interrupts showed, if one did. -struct BikeTap{ - bool moved = false; - std::optional interrupt; - // The tap didn't move, and then an interrupt showed, which the tap - // cleared already: a trainer who saw the player, a battle seen late. - bool cleared_late = false; -}; -// The console side of count_bike_taps(): `tap` taps once and judges it; -// `clear` clears interrupt i. -struct BikeTapCalls{ - std::function tap; - std::function clear; - std::function log; -}; -// How far a sure start may be off before a blocked tap finds the player: -// three runs of 00.30 stood 3 tiles off (console B, 2026-11-09). -constexpr int BLOCKED_TAP_SLACK = 3; - -// Walks the open leg `step` a tap at a time: on the Bicycle each tap is -// exactly a tile (MovementMechanics::BIKE_TAP). A tap that doesn't move -// the player ends the leg there, blocked, and one with an interrupt ends -// it once that is cleared. DONE once all of the leg's taps moved; else -// STOPPED, with the tiles walked: blocked, the taps that moved, and up -// to BLOCKED_TAP_SLACK more for a start that was off (run_route() keeps -// the tiles with a blocked one ahead); interrupted, the taps that moved -// and one more, which may have moved before its battle showed. -StepOutcome count_bike_taps(const RouteStep& step, const BikeTapCalls& calls); - // Whether, after each leg to a wall, the walker taps once more toward the // wall and logs whether the player moved (see RouteCalls). enum class WallCheck{ diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldRecoveryWalk.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldRecoveryWalk.cpp index 8038545d93..26ede29f78 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldRecoveryWalk.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldRecoveryWalk.cpp @@ -18,6 +18,7 @@ #include "NintendoSwitch/Commands/NintendoSwitch_Commands_PushButtons.h" #include "VideoGames/PokemonFRLG/Inference/Dialogs/PokemonFRLG_DialogDetector.h" #include "VideoGames/PokemonFRLG/PokemonFRLG_Settings.h" +#include "PokemonFRLG_OverworldBikeTaps.h" #include "PokemonFRLG_OverworldLateBattle.h" #include "PokemonFRLG_OverworldRecoveryWalk.h" diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSim.h b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSim.h index 62b018d870..c9a1b59e1e 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSim.h +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSim.h @@ -42,6 +42,7 @@ #include "Common/Cpp/TestRunners/UnitTestDatabase.h" #include "Pokemon/AutoStory/Pokemon_ScreenEvents.h" #include "PokemonFRLG_MovementMechanics.h" +#include "PokemonFRLG_OverworldBikeTaps.h" #include "PokemonFRLG_OverworldRecovery.h" #include "PokemonFRLG_OverworldRoute.h" #include "PokemonFRLG_OverworldWalk.h" diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSimTaps.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSimTaps.cpp index 9cff82e7b3..03bde06519 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSimTaps.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSimTaps.cpp @@ -81,7 +81,6 @@ StepOutcome OverworldSimWalker::walk(const RouteStep& step, std::optional press_select; std::function riding; - std::function log; }; // Gets on the registered Bicycle with SELECT, checks the player rides, // and presses again once if not. Returns whether they ride. diff --git a/SerialPrograms/cmake/SourceFiles.cmake b/SerialPrograms/cmake/SourceFiles.cmake index 4654320160..b54cf6fb45 100644 --- a/SerialPrograms/cmake/SourceFiles.cmake +++ b/SerialPrograms/cmake/SourceFiles.cmake @@ -1864,6 +1864,9 @@ file(GLOB LIBRARY_SOURCES Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_CodedRooms.cpp Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_CodedRooms.h Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_MovementMechanics.h + Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldBikeTaps.cpp + Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldBikeTaps.h + Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldBike_Tests.cpp Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldLateBattle.cpp Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldLateBattle.h Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldLateBattle_Tests.cpp @@ -1888,7 +1891,6 @@ file(GLOB LIBRARY_SOURCES Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSim.h Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSimTaps.cpp Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSimField.cpp - Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldBike_Tests.cpp Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSim_Tests.cpp Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSpin_Tests.cpp Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldWalk.cpp From b062392cbd32105127126a49fba154e45274ad5e Mon Sep 17 00:00:00 2001 From: dayfine Date: Mon, 9 Nov 2026 23:12:12 -0800 Subject: [PATCH 29/79] FRLG AutoStory: red sim test, a capture started on the Bicycle drifts out of Route 7's grass Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss --- .../PokemonFRLG_AutoStoryPaceSim_Tests.cpp | 82 +++++++++++++++++++ 1 file changed, 82 insertions(+) diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryPaceSim_Tests.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryPaceSim_Tests.cpp index 6a76612aaa..9f614cfd93 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryPaceSim_Tests.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryPaceSim_Tests.cpp @@ -111,6 +111,79 @@ UnitTestResult test_capture_paced_in_trainer_sight(){ } +// A capture on the sim as ConsoleCaptureActions paces it: each search for +// a battle with its own PatchSteps, east and back, `species` read in turn. +class SimConsoleCapture : public CaptureActions{ +public: + SimConsoleCapture(Logger& logger, OverworldSim& sim, std::vector species) + : m_logger(logger), m_sim(sim), m_species(std::move(species)) + {} + virtual bool find_encounter(Direction) override{ + SimPatch pacing(m_sim, Direction::EAST, Direction::WEST); + return pace_until_battle(m_logger, pacing, PACE_MAX_STEPS); + } + virtual EncounterSeen read_encounter() override{ + const std::string species = m_read < m_species.size() ? m_species[m_read] : m_species.back(); + m_read++; + return EncounterSeen{.species = species}; + } + virtual bool flee() override{ + const bool ended = m_sim.handle_battle(SimBattleChoice::RUN) == SimBattleEnd::ENDED; + tiles.push_back(m_sim.state().position); + return ended; + } + virtual FoeHp read_foe_hp() override{ return FoeHp::UNKNOWN; } + virtual TurnEnd attack(size_t) override{ return TurnEnd::FAILED; } + virtual ThrowEnd throw_ball() override{ return ThrowEnd::CAUGHT; } + virtual bool finish_catch(CatchDestination) override{ + return m_sim.handle_battle(SimBattleChoice::FIGHT) == SimBattleEnd::ENDED; + } + // Where each battle run from left the player. + std::vector tiles; +private: + Logger& m_logger; + OverworldSim& m_sim; + std::vector m_species; + size_t m_read = 0; +}; + +// Console B, 2026-11-09 (00.30 run 5): catch_pidgey started on Route 7's +// (14, 6) on the Bicycle, ran from 4 wild battles and then paced 4 minutes +// on the flowers east of the grass (11..18, 2..6). On the Bicycle a tap +// facing another way steps too, so each turn of the pace took a tile, and +// each search began its pace afresh from where the last battle left the +// player. On the sim, from (14, 6) on the Bicycle, 6 battles, the Pidgey +// last: every battle starts on (14, 6) or (15, 6), on foot. +UnitTestResult test_capture_paced_on_bike_stays_in_grass(){ + const MapPosition patch{"Route7", {14, 6}}; + const CapturePlan plan{.species = "pidgey", .max_encounters = 30, .pace = Direction::EAST}; + SimScript script; + script.on_bike = true; + script.bike_registered = true; + for (int grass_step : {2, 5, 6, 9, 12, 13}){ + script.encounters.push_back(SimEncounter{.grass_step = grass_step}); + } + OverworldSim sim(story_maps(), patch, Direction::EAST, script); + LinesLogger logger; + SimConsoleCapture actions(logger, sim, {"rattata", "spearow", "rattata", "oddish", "meowth", "pidgey"}); + const CaptureResult result = run_capture(logger, actions, plan, 5); + if (result.end != CaptureEnd::CAUGHT || result.encounters != 6){ + return capture_message(plan, result) + joined(logger.lines) + joined(sim.state().log); + } + const MapPosition east{"Route7", {15, 6}}; + for (size_t c = 0; c < actions.tiles.size(); c++){ + if (!(actions.tiles[c] == patch) && !(actions.tiles[c] == east)){ + return std::format("Battle {} left the player on {}, off the pace's tiles.", c + 1, to_string(actions.tiles[c])) + + joined(sim.state().log); + } + } + if (sim.state().on_bike){ + return "Paced on the Bicycle." + joined(sim.state().log); + } + return true; +} + + struct AutoStoryPaceSimInput{ std::string name; std::function body; @@ -153,6 +226,15 @@ const AutoStoryPaceSimTestCase AUTO_STORY_PACE_SIM_CASES[] = { .description = "handles trainer encounter while pacing and resumes capture sequence", }, }, + { + .input = { + .name = "a capture started on the Bicycle paces on foot in the grass", + .body = test_capture_paced_on_bike_stays_in_grass, + }, + .expectation = { + .description = "every battle starts on one of the pace's two tiles, off the Bicycle", + }, + }, }; } // namespace From d2504ddaee0e079a4863aa35b5ad340566b14daa Mon Sep 17 00:00:00 2001 From: dayfine Date: Mon, 9 Nov 2026 23:14:16 -0800 Subject: [PATCH 30/79] FRLG AutoStory: pace for a capture or grind on foot, from where the last battle left the player Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss --- .../PokemonFRLG_AutoStoryCapture.cpp | 35 +++++++++++++++++-- .../AutoStory/PokemonFRLG_AutoStoryCapture.h | 20 +++++++++++ .../AutoStory/PokemonFRLG_AutoStoryGrind.cpp | 2 +- .../PokemonFRLG_AutoStoryPaceSim_Tests.cpp | 17 +++++---- 4 files changed, 64 insertions(+), 10 deletions(-) diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryCapture.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryCapture.cpp index 877265def1..3d824b4a38 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryCapture.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryCapture.cpp @@ -437,6 +437,36 @@ bool pace_until_battle(Logger& logger, PatchSteps& steps, size_t max_steps){ } +bool select_off_bike(const BikeSelectCalls& calls){ + for (size_t c = 0; c < 2 && calls.riding(); c++){ + calls.press_select(); + } + return !calls.riding(); +} + +bool find_paced_encounter(Logger& logger, const BikeSelectCalls& bike, PatchSteps& steps){ + if (!select_off_bike(bike)){ + logger.log("Pacing: still on the Bicycle after SELECT twice; not pacing on it.", COLOR_RED); + return false; + } + return pace_until_battle(logger, steps, PACE_MAX_STEPS); +} + +BikeSelectCalls console_bike_select(ConsoleHandle& console, ProControllerContext& context){ + BikeSelectCalls calls; + calls.press_select = [&console, &context]{ + console.log("Pacing: SELECT (MINUS) off the Bicycle."); + pbf_press_button(context, BUTTON_MINUS, MovementMechanics::BIKE_SELECT_PRESS, MovementMechanics::BIKE_SELECT_SETTLE); + }; + calls.riding = [&console, &context]{ + context.wait_for_all_requests(); + VideoSnapshot screen = console.video().snapshot(); + return screen && screen_shows_riding(*screen.frame); + }; + return calls; +} + + ConsolePatchSteps::ConsolePatchSteps( ConsoleHandle& console, ProControllerContext& context, Direction pace, PaceSpot& spot, const PaceTrainerBattle& trainer_battle @@ -502,9 +532,8 @@ ConsoleCaptureActions::ConsoleCaptureActions( {} bool ConsoleCaptureActions::find_encounter(Direction pace){ - PaceSpot spot; - ConsolePatchSteps steps(m_console, m_context, pace, spot, m_trainer_battle); - return pace_until_battle(m_console.logger(), steps, PACE_MAX_STEPS); + ConsolePatchSteps steps(m_console, m_context, pace, m_spot, m_trainer_battle); + return find_paced_encounter(m_console.logger(), console_bike_select(m_console, m_context), steps); } EncounterSeen ConsoleCaptureActions::read_encounter(){ diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryCapture.h b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryCapture.h index b273878c59..6b21cba411 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryCapture.h +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryCapture.h @@ -38,6 +38,7 @@ #include "Pokemon/AutoStory/Pokemon_StoryEvents.h" #include "Pokemon/AutoStory/Pokemon_StorySteps.h" #include "Pokemon/Navigation/Pokemon_Grid.h" +#include "VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldWalk.h" #include "PokemonFRLG_AutoStoryPcStorage.h" namespace PokemonAutomation{ @@ -249,6 +250,23 @@ class PatchSteps{ // meanwhile is fought (PatchSteps::fight_trainer()) and pacing goes on; // their battle isn't a wild one. bool pace_until_battle(Logger& logger, PatchSteps& steps, size_t max_steps); +// Before pacing: gets the player off the Bicycle with SELECT, checked, +// and once more if they still ride. On the Bicycle a tap facing another +// way steps as well as turns, so pacing's turns walk it off the patch +// (console B, 2026-11-09, 00.30 run 5: Route 7's grass). Returns whether +// the player is on foot. +bool select_off_bike(const BikeSelectCalls& calls); + +// One search for a wild battle, as a capture or a grind paces: off the +// Bicycle (select_off_bike()), then pace_until_battle(). `steps` keeps +// the tile pacing left the player on from one search to the next, so the +// pace never starts a tile out. False if no battle came, or the player +// rides on. +bool find_paced_encounter(Logger& logger, const BikeSelectCalls& bike, PatchSteps& steps); + +// select_off_bike()'s calls on the console: SELECT is the Switch's MINUS, +// and the player rides while no standing sprite shows (screen_shows_riding()). +BikeSelectCalls console_bike_select(ConsoleHandle& console, ProControllerContext& context); // Steps in a patch before pacing gives up: about 10 % of steps in grass // start a battle at Route 4's rates. @@ -318,6 +336,8 @@ class ConsoleCaptureActions : public CaptureActions{ ProControllerContext& m_context; Language m_language; PaceTrainerBattle m_trainer_battle; + // Where pacing left the player, kept from one battle to the next. + PaceSpot m_spot; }; diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryGrind.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryGrind.cpp index 670a4dbe47..5af2285722 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryGrind.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryGrind.cpp @@ -349,7 +349,7 @@ bool ConsoleGrindActions::find_encounter(Direction pace){ // As ConsoleCaptureActions::find_encounter(), keeping track of the // tile: a battle starts on the tile just stepped onto. ConsolePatchSteps steps(m_console, m_context, pace, m_spot, m_trainer_battle); - return pace_until_battle(m_console.logger(), steps, PACE_MAX_STEPS); + return find_paced_encounter(m_console.logger(), console_bike_select(m_console, m_context), steps); } EncounterSeen ConsoleGrindActions::read_encounter(){ diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryPaceSim_Tests.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryPaceSim_Tests.cpp index 9f614cfd93..34a8fb8c4e 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryPaceSim_Tests.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryPaceSim_Tests.cpp @@ -111,16 +111,19 @@ UnitTestResult test_capture_paced_in_trainer_sight(){ } -// A capture on the sim as ConsoleCaptureActions paces it: each search for -// a battle with its own PatchSteps, east and back, `species` read in turn. +// A capture on the sim as ConsoleCaptureActions paces it, east and back: +// find_paced_encounter() with one PatchSteps kept from battle to battle, +// `species` read in turn. class SimConsoleCapture : public CaptureActions{ public: SimConsoleCapture(Logger& logger, OverworldSim& sim, std::vector species) - : m_logger(logger), m_sim(sim), m_species(std::move(species)) - {} + : m_logger(logger), m_sim(sim), m_pacing(sim, Direction::EAST, Direction::WEST), m_species(std::move(species)) + { + m_bike.press_select = [this]{ m_sim.use_field(SimField::BIKE_SELECT); }; + m_bike.riding = [this]{ return m_sim.state().on_bike; }; + } virtual bool find_encounter(Direction) override{ - SimPatch pacing(m_sim, Direction::EAST, Direction::WEST); - return pace_until_battle(m_logger, pacing, PACE_MAX_STEPS); + return find_paced_encounter(m_logger, m_bike, m_pacing); } virtual EncounterSeen read_encounter() override{ const std::string species = m_read < m_species.size() ? m_species[m_read] : m_species.back(); @@ -143,6 +146,8 @@ class SimConsoleCapture : public CaptureActions{ private: Logger& m_logger; OverworldSim& m_sim; + SimPatch m_pacing; + BikeSelectCalls m_bike; std::vector m_species; size_t m_read = 0; }; From cbf3354299372a97d8c06a302166e197046e684a Mon Sep 17 00:00:00 2001 From: dayfine Date: Mon, 9 Nov 2026 23:14:41 -0800 Subject: [PATCH 31/79] FRLG AutoStory: qualify OverworldWalkSteps::BikeSelectCalls in pacing Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss --- .../AutoStory/PokemonFRLG_AutoStoryCapture.cpp | 10 +++++----- .../Programs/AutoStory/PokemonFRLG_AutoStoryCapture.h | 8 ++++---- .../AutoStory/PokemonFRLG_AutoStoryPaceSim_Tests.cpp | 2 +- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryCapture.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryCapture.cpp index 3d824b4a38..8e95418a29 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryCapture.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryCapture.cpp @@ -437,14 +437,14 @@ bool pace_until_battle(Logger& logger, PatchSteps& steps, size_t max_steps){ } -bool select_off_bike(const BikeSelectCalls& calls){ +bool select_off_bike(const OverworldWalkSteps::BikeSelectCalls& calls){ for (size_t c = 0; c < 2 && calls.riding(); c++){ calls.press_select(); } return !calls.riding(); } -bool find_paced_encounter(Logger& logger, const BikeSelectCalls& bike, PatchSteps& steps){ +bool find_paced_encounter(Logger& logger, const OverworldWalkSteps::BikeSelectCalls& bike, PatchSteps& steps){ if (!select_off_bike(bike)){ logger.log("Pacing: still on the Bicycle after SELECT twice; not pacing on it.", COLOR_RED); return false; @@ -452,8 +452,8 @@ bool find_paced_encounter(Logger& logger, const BikeSelectCalls& bike, PatchStep return pace_until_battle(logger, steps, PACE_MAX_STEPS); } -BikeSelectCalls console_bike_select(ConsoleHandle& console, ProControllerContext& context){ - BikeSelectCalls calls; +OverworldWalkSteps::BikeSelectCalls console_bike_select(ConsoleHandle& console, ProControllerContext& context){ + OverworldWalkSteps::BikeSelectCalls calls; calls.press_select = [&console, &context]{ console.log("Pacing: SELECT (MINUS) off the Bicycle."); pbf_press_button(context, BUTTON_MINUS, MovementMechanics::BIKE_SELECT_PRESS, MovementMechanics::BIKE_SELECT_SETTLE); @@ -461,7 +461,7 @@ BikeSelectCalls console_bike_select(ConsoleHandle& console, ProControllerContext calls.riding = [&console, &context]{ context.wait_for_all_requests(); VideoSnapshot screen = console.video().snapshot(); - return screen && screen_shows_riding(*screen.frame); + return screen && OverworldWalkSteps::screen_shows_riding(*screen.frame); }; return calls; } diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryCapture.h b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryCapture.h index 6b21cba411..3c8745ae34 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryCapture.h +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryCapture.h @@ -255,18 +255,18 @@ bool pace_until_battle(Logger& logger, PatchSteps& steps, size_t max_steps); // way steps as well as turns, so pacing's turns walk it off the patch // (console B, 2026-11-09, 00.30 run 5: Route 7's grass). Returns whether // the player is on foot. -bool select_off_bike(const BikeSelectCalls& calls); +bool select_off_bike(const OverworldWalkSteps::BikeSelectCalls& calls); // One search for a wild battle, as a capture or a grind paces: off the // Bicycle (select_off_bike()), then pace_until_battle(). `steps` keeps // the tile pacing left the player on from one search to the next, so the // pace never starts a tile out. False if no battle came, or the player // rides on. -bool find_paced_encounter(Logger& logger, const BikeSelectCalls& bike, PatchSteps& steps); +bool find_paced_encounter(Logger& logger, const OverworldWalkSteps::BikeSelectCalls& bike, PatchSteps& steps); // select_off_bike()'s calls on the console: SELECT is the Switch's MINUS, -// and the player rides while no standing sprite shows (screen_shows_riding()). -BikeSelectCalls console_bike_select(ConsoleHandle& console, ProControllerContext& context); +// and the player rides while no standing sprite shows (OverworldWalkSteps::screen_shows_riding()). +OverworldWalkSteps::BikeSelectCalls console_bike_select(ConsoleHandle& console, ProControllerContext& context); // Steps in a patch before pacing gives up: about 10 % of steps in grass // start a battle at Route 4's rates. diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryPaceSim_Tests.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryPaceSim_Tests.cpp index 34a8fb8c4e..e08083594a 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryPaceSim_Tests.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryPaceSim_Tests.cpp @@ -147,7 +147,7 @@ class SimConsoleCapture : public CaptureActions{ Logger& m_logger; OverworldSim& m_sim; SimPatch m_pacing; - BikeSelectCalls m_bike; + OverworldWalkSteps::BikeSelectCalls m_bike; std::vector m_species; size_t m_read = 0; }; From 6c658e926814e379c68d20d812a63a4511fab000 Mon Sep 17 00:00:00 2001 From: dayfine Date: Mon, 9 Nov 2026 23:17:29 -0800 Subject: [PATCH 32/79] FRLG AutoStory: the pacing search in its own header, AutoStoryPacing.h Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss --- .../PokemonFRLG_AutoStoryCapture.cpp | 31 +---------- .../AutoStory/PokemonFRLG_AutoStoryCapture.h | 18 ------- .../AutoStory/PokemonFRLG_AutoStoryGrind.cpp | 1 + .../PokemonFRLG_AutoStoryPaceSim_Tests.cpp | 1 + .../AutoStory/PokemonFRLG_AutoStoryPacing.cpp | 52 +++++++++++++++++++ .../AutoStory/PokemonFRLG_AutoStoryPacing.h | 46 ++++++++++++++++ SerialPrograms/cmake/SourceFiles.cmake | 2 + 7 files changed, 103 insertions(+), 48 deletions(-) create mode 100644 SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryPacing.cpp create mode 100644 SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryPacing.h diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryCapture.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryCapture.cpp index 8e95418a29..5d6582a1b6 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryCapture.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryCapture.cpp @@ -22,6 +22,7 @@ #include "VideoGames/PokemonFRLG/Programs/PokemonFRLG_BattleMenuNavigation.h" #include "PokemonFRLG_AutoStoryActions.h" #include "PokemonFRLG_AutoStoryCapture.h" +#include "PokemonFRLG_AutoStoryPacing.h" #include "PokemonFRLG_AutoStoryVariantWords.h" namespace PokemonAutomation{ @@ -437,36 +438,6 @@ bool pace_until_battle(Logger& logger, PatchSteps& steps, size_t max_steps){ } -bool select_off_bike(const OverworldWalkSteps::BikeSelectCalls& calls){ - for (size_t c = 0; c < 2 && calls.riding(); c++){ - calls.press_select(); - } - return !calls.riding(); -} - -bool find_paced_encounter(Logger& logger, const OverworldWalkSteps::BikeSelectCalls& bike, PatchSteps& steps){ - if (!select_off_bike(bike)){ - logger.log("Pacing: still on the Bicycle after SELECT twice; not pacing on it.", COLOR_RED); - return false; - } - return pace_until_battle(logger, steps, PACE_MAX_STEPS); -} - -OverworldWalkSteps::BikeSelectCalls console_bike_select(ConsoleHandle& console, ProControllerContext& context){ - OverworldWalkSteps::BikeSelectCalls calls; - calls.press_select = [&console, &context]{ - console.log("Pacing: SELECT (MINUS) off the Bicycle."); - pbf_press_button(context, BUTTON_MINUS, MovementMechanics::BIKE_SELECT_PRESS, MovementMechanics::BIKE_SELECT_SETTLE); - }; - calls.riding = [&console, &context]{ - context.wait_for_all_requests(); - VideoSnapshot screen = console.video().snapshot(); - return screen && OverworldWalkSteps::screen_shows_riding(*screen.frame); - }; - return calls; -} - - ConsolePatchSteps::ConsolePatchSteps( ConsoleHandle& console, ProControllerContext& context, Direction pace, PaceSpot& spot, const PaceTrainerBattle& trainer_battle diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryCapture.h b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryCapture.h index 3c8745ae34..7b692d4a67 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryCapture.h +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryCapture.h @@ -38,7 +38,6 @@ #include "Pokemon/AutoStory/Pokemon_StoryEvents.h" #include "Pokemon/AutoStory/Pokemon_StorySteps.h" #include "Pokemon/Navigation/Pokemon_Grid.h" -#include "VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldWalk.h" #include "PokemonFRLG_AutoStoryPcStorage.h" namespace PokemonAutomation{ @@ -250,23 +249,6 @@ class PatchSteps{ // meanwhile is fought (PatchSteps::fight_trainer()) and pacing goes on; // their battle isn't a wild one. bool pace_until_battle(Logger& logger, PatchSteps& steps, size_t max_steps); -// Before pacing: gets the player off the Bicycle with SELECT, checked, -// and once more if they still ride. On the Bicycle a tap facing another -// way steps as well as turns, so pacing's turns walk it off the patch -// (console B, 2026-11-09, 00.30 run 5: Route 7's grass). Returns whether -// the player is on foot. -bool select_off_bike(const OverworldWalkSteps::BikeSelectCalls& calls); - -// One search for a wild battle, as a capture or a grind paces: off the -// Bicycle (select_off_bike()), then pace_until_battle(). `steps` keeps -// the tile pacing left the player on from one search to the next, so the -// pace never starts a tile out. False if no battle came, or the player -// rides on. -bool find_paced_encounter(Logger& logger, const OverworldWalkSteps::BikeSelectCalls& bike, PatchSteps& steps); - -// select_off_bike()'s calls on the console: SELECT is the Switch's MINUS, -// and the player rides while no standing sprite shows (OverworldWalkSteps::screen_shows_riding()). -OverworldWalkSteps::BikeSelectCalls console_bike_select(ConsoleHandle& console, ProControllerContext& context); // Steps in a patch before pacing gives up: about 10 % of steps in grass // start a battle at Route 4's rates. diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryGrind.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryGrind.cpp index 5af2285722..57c103090d 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryGrind.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryGrind.cpp @@ -10,6 +10,7 @@ #include "CommonFramework/Exceptions/OperationFailedException.h" #include "PokemonFRLG_AutoStoryActions.h" #include "PokemonFRLG_AutoStoryGrind.h" +#include "PokemonFRLG_AutoStoryPacing.h" #include "PokemonFRLG_AutoStoryVariantWords.h" namespace PokemonAutomation{ diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryPaceSim_Tests.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryPaceSim_Tests.cpp index e08083594a..1f4d740bc8 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryPaceSim_Tests.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryPaceSim_Tests.cpp @@ -18,6 +18,7 @@ #include "VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldRoute.h" #include "PokemonFRLG_AutoStoryEvents.h" #include "PokemonFRLG_AutoStoryPaceSim.h" +#include "PokemonFRLG_AutoStoryPacing.h" namespace PokemonAutomation{ namespace NintendoSwitch{ diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryPacing.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryPacing.cpp new file mode 100644 index 0000000000..40aca3b218 --- /dev/null +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryPacing.cpp @@ -0,0 +1,52 @@ +/* AutoStory Pacing + * + * From: https://github.com/PokemonAutomation/ + * + */ + +#include "CommonFramework/VideoPipeline/VideoFeed.h" +#include "NintendoSwitch/Commands/NintendoSwitch_Commands_PushButtons.h" +#include "VideoGames/PokemonFRLG/Overworld/PokemonFRLG_MovementMechanics.h" +#include "PokemonFRLG_AutoStoryPacing.h" + +namespace PokemonAutomation{ +namespace NintendoSwitch{ +namespace PokemonFRLG{ + +using OverworldWalkSteps::BikeSelectCalls; + + +bool select_off_bike(const BikeSelectCalls& calls){ + for (size_t c = 0; c < 2 && calls.riding(); c++){ + calls.press_select(); + } + return !calls.riding(); +} + +bool find_paced_encounter(Logger& logger, const BikeSelectCalls& bike, PatchSteps& steps){ + if (!select_off_bike(bike)){ + logger.log("Pacing: still on the Bicycle after SELECT twice; not pacing on it.", COLOR_RED); + return false; + } + return pace_until_battle(logger, steps, PACE_MAX_STEPS); +} + +BikeSelectCalls console_bike_select(ConsoleHandle& console, ProControllerContext& context){ + BikeSelectCalls calls; + calls.press_select = [&console, &context]{ + console.log("Pacing: SELECT (MINUS) off the Bicycle."); + pbf_press_button(context, BUTTON_MINUS, MovementMechanics::BIKE_SELECT_PRESS, MovementMechanics::BIKE_SELECT_SETTLE); + }; + calls.riding = [&console, &context]{ + context.wait_for_all_requests(); + VideoSnapshot screen = console.video().snapshot(); + return screen && OverworldWalkSteps::screen_shows_riding(*screen.frame); + }; + return calls; +} + + + +} // namespace PokemonFRLG +} // namespace NintendoSwitch +} // namespace PokemonAutomation diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryPacing.h b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryPacing.h new file mode 100644 index 0000000000..c8cf49e2e2 --- /dev/null +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryPacing.h @@ -0,0 +1,46 @@ +/* AutoStory Pacing + * + * From: https://github.com/PokemonAutomation/ + * + * A capture's or grind's search for a wild battle: off the Bicycle, then + * pacing in the patch from where the last battle left the player. + * + */ + +#ifndef PokemonAutomation_PokemonFRLG_AutoStoryPacing_H +#define PokemonAutomation_PokemonFRLG_AutoStoryPacing_H + +#include "Common/Cpp/Logging/AbstractLogger.h" +#include "NintendoSwitch/Controllers/Procon/NintendoSwitch_ProController.h" +#include "NintendoSwitch/NintendoSwitch_ConsoleHandle.h" +#include "VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldWalk.h" +#include "PokemonFRLG_AutoStoryCapture.h" + +namespace PokemonAutomation{ +namespace NintendoSwitch{ +namespace PokemonFRLG{ + +// Before pacing: gets the player off the Bicycle with SELECT, checked, +// and once more if they still ride. On the Bicycle a tap facing another +// way steps as well as turns, so pacing's turns walk it off the patch +// (console B, 2026-11-09, 00.30 run 5: Route 7's grass). Returns whether +// the player is on foot. +bool select_off_bike(const OverworldWalkSteps::BikeSelectCalls& calls); + +// One search for a wild battle, as a capture or a grind paces: off the +// Bicycle (select_off_bike()), then pace_until_battle(). `steps` keeps +// the tile pacing left the player on from one search to the next, so the +// pace never starts a tile out. False if no battle came, or the player +// rides on. +bool find_paced_encounter(Logger& logger, const OverworldWalkSteps::BikeSelectCalls& bike, PatchSteps& steps); + +// select_off_bike()'s calls on the console: SELECT is the Switch's MINUS, +// and the player rides while no standing sprite shows (OverworldWalkSteps::screen_shows_riding()). +OverworldWalkSteps::BikeSelectCalls console_bike_select(ConsoleHandle& console, ProControllerContext& context); + + + +} // namespace PokemonFRLG +} // namespace NintendoSwitch +} // namespace PokemonAutomation +#endif diff --git a/SerialPrograms/cmake/SourceFiles.cmake b/SerialPrograms/cmake/SourceFiles.cmake index b54cf6fb45..3f8d707db9 100644 --- a/SerialPrograms/cmake/SourceFiles.cmake +++ b/SerialPrograms/cmake/SourceFiles.cmake @@ -1958,6 +1958,8 @@ file(GLOB LIBRARY_SOURCES Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryPaceSim.cpp Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryPaceSim.h Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryPaceSim_Tests.cpp + Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryPacing.cpp + Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryPacing.h Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryParty.cpp Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryParty.h Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryParty_Tests.cpp From acc74a77e2cbcad87d1f1f55478c8c5eb302daad Mon Sep 17 00:00:00 2001 From: dayfine Date: Mon, 9 Nov 2026 23:33:22 -0800 Subject: [PATCH 33/79] PokemonFRLG: Split over-limit headers, drop char* for code health The newer code-health rules (header symbol counts, no char* / char[]) failed 41 times against frlg/story-json. Declarations move unchanged into headers by concern (Pokemon Center room, hideout lift room, bike and spinner mechanics and presses, overworld spin, sim field, overworld bike, bag, bag use, room legs, field steps, hideout lift); char* constants and parameters become std::string_view or std::string. No behavior change. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss --- .../Overworld/PokemonFRLG_BikeSpinMechanics.h | 68 ++++++++++++++++ .../Overworld/PokemonFRLG_BikeSpinPresses.h | 55 +++++++++++++ .../Overworld/PokemonFRLG_CodedRooms.cpp | 10 ++- .../Overworld/PokemonFRLG_CodedRooms.h | 42 ---------- .../Overworld/PokemonFRLG_HideoutLiftRoom.h | 43 ++++++++++ .../Overworld/PokemonFRLG_MovementMechanics.h | 54 ------------- .../Overworld/PokemonFRLG_OverworldBike.h | 76 +++++++++++++++++ .../PokemonFRLG_OverworldBike_Tests.cpp | 4 + .../Overworld/PokemonFRLG_OverworldMap.cpp | 19 ++--- .../Overworld/PokemonFRLG_OverworldMap.h | 39 +-------- .../PokemonFRLG_OverworldRecoveryWalk.cpp | 2 + .../Overworld/PokemonFRLG_OverworldRoute.cpp | 1 + .../PokemonFRLG_OverworldRoute_Tests.cpp | 12 +-- .../Overworld/PokemonFRLG_OverworldSim.cpp | 2 +- .../Overworld/PokemonFRLG_OverworldSim.h | 30 +------ .../PokemonFRLG_OverworldSimField.cpp | 3 + .../Overworld/PokemonFRLG_OverworldSimField.h | 48 +++++++++++ .../PokemonFRLG_OverworldSimTaps.cpp | 4 + .../PokemonFRLG_OverworldSim_Tests.cpp | 2 + .../Overworld/PokemonFRLG_OverworldSpin.h | 62 ++++++++++++++ .../PokemonFRLG_OverworldSpin_Tests.cpp | 8 +- .../Overworld/PokemonFRLG_OverworldWalk.cpp | 3 + .../Overworld/PokemonFRLG_OverworldWalk.h | 41 ---------- .../PokemonFRLG_OverworldWalk_Tests.cpp | 1 + .../Overworld/PokemonFRLG_PokemonCenterRoom.h | 52 ++++++++++++ .../AutoStory/PokemonFRLG_AutoStoryBag.h | 78 ++++++++++++++++++ .../AutoStory/PokemonFRLG_AutoStoryBagUse.h | 59 ++++++++++++++ .../PokemonFRLG_AutoStoryBattleData_Tests.cpp | 4 +- .../AutoStory/PokemonFRLG_AutoStoryEvents.h | 21 ++--- .../PokemonFRLG_AutoStoryFieldSteps.h | 54 +++++++++++++ .../PokemonFRLG_AutoStoryHideout.cpp | 5 ++ .../AutoStory/PokemonFRLG_AutoStoryHideout.h | 29 ------- .../PokemonFRLG_AutoStoryHideoutLift.h | 64 +++++++++++++++ .../PokemonFRLG_AutoStoryHideout_Tests.cpp | 6 +- .../PokemonFRLG_AutoStoryItemUse.cpp | 4 +- .../AutoStory/PokemonFRLG_AutoStoryItemUse.h | 81 +------------------ .../PokemonFRLG_AutoStoryItemUse_Tests.cpp | 5 +- .../PokemonFRLG_AutoStoryPaceSim_Tests.cpp | 2 + .../AutoStory/PokemonFRLG_AutoStoryPacing.cpp | 2 + .../AutoStory/PokemonFRLG_AutoStoryPacing.h | 1 + .../AutoStory/PokemonFRLG_AutoStoryRoomLegs.h | 44 ++++++++++ .../AutoStory/PokemonFRLG_AutoStoryRooms.cpp | 1 + .../AutoStory/PokemonFRLG_AutoStoryRooms.h | 14 ---- .../PokemonFRLG_AutoStoryRooms_Tests.cpp | 4 +- .../AutoStory/PokemonFRLG_AutoStoryRowSim.cpp | 3 + .../PokemonFRLG_AutoStoryTableSteps.cpp | 8 +- .../PokemonFRLG_AutoStoryTableSteps.h | 19 ----- ...okemonFRLG_AutoStoryVermilionGym_Tests.cpp | 1 + SerialPrograms/cmake/SourceFiles.cmake | 12 +++ 49 files changed, 818 insertions(+), 384 deletions(-) create mode 100644 SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_BikeSpinMechanics.h create mode 100644 SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_BikeSpinPresses.h create mode 100644 SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_HideoutLiftRoom.h create mode 100644 SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldBike.h create mode 100644 SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSimField.h create mode 100644 SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSpin.h create mode 100644 SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_PokemonCenterRoom.h create mode 100644 SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryBag.h create mode 100644 SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryBagUse.h create mode 100644 SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryFieldSteps.h create mode 100644 SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryHideoutLift.h create mode 100644 SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRoomLegs.h diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_BikeSpinMechanics.h b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_BikeSpinMechanics.h new file mode 100644 index 0000000000..ae9283b104 --- /dev/null +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_BikeSpinMechanics.h @@ -0,0 +1,68 @@ +/* Bicycle and Spinner Mechanics + * + * From: https://github.com/PokemonAutomation/ + * + * How FireRed and LeafGreen move the player on the Bicycle and on spinner + * tiles, as measured on the console (PokemonFRLG_MovementMechanics.h has + * walking and running). + * + */ + +#ifndef PokemonAutomation_PokemonFRLG_BikeSpinMechanics_H +#define PokemonAutomation_PokemonFRLG_BikeSpinMechanics_H + +#include "Common/Cpp/Time.h" + +namespace PokemonAutomation{ +namespace NintendoSwitch{ +namespace PokemonFRLG{ +namespace MovementMechanics{ + + +// Riding the Bicycle, measured on console B (2026-11-09, Lavender Town, +// east from the rock west of the Center, from rest, counted back with +// one-tile taps): holds of 450, 500, 650, 700, 900, 950, 1100, 1250, +// 1300, 1450 and 1500ms moved 5, 5, 7, 7, 9, 10, 11, 13, 13, 15 and 15 +// tiles, the same each time: a tile per 100ms, so an open leg's hold of +// (n - 1) tiles and a half moves n. 112ms a tile (a wall-to-wall time +// of the motion on screen) held "west 16 (open)" for 17 or 18 tiles on +// Route 8 (00.30 run 2). Not the decompilation's 4 frames a tile (67ms): +// the bike speeds up from rest. +inline constexpr Milliseconds BIKE_TILE_TIME(100); + +// On the Bicycle a tap never only turns the player: from rest, a 40ms tap +// moved a tile facing either way, and holds of 112, 150, 200, 250, 300, +// 336 and 400ms moved 1, 2, 2, 3, 3, 4 and 4 tiles (console B, +// 2026-11-09, Route 12's north pier). So a bike leg has no turn tap: its +// hold turns the player too, and loses no tile for it. +inline constexpr bool BIKE_TAP_ONLY_TURNS = false; + +// Chains of 40ms taps on the Bicycle (console B, 2026-11-09): one tap per +// 100ms (60ms release) moved exactly a tile each. +inline constexpr Milliseconds BIKE_TAP_PERIOD_WORKED(100); + +// At one tap per 60ms, one tap in 12 was dropped. Somewhere between that +// and BIKE_TAP_PERIOD_WORKED the game starts dropping taps; the sim drops +// taps that start sooner than this after the last one. +inline constexpr Milliseconds BIKE_TAP_DROP_PERIOD(80); + +// Of the taps that come sooner than BIKE_TAP_DROP_PERIOD, the sim drops +// one in this many. +inline constexpr int BIKE_FAST_TAP_DROP_EVERY = 12; + +// With the Bicycle registered (Key Items, BICYCLE, REGISTER), SELECT gets +// on and off in about 1s (console B, 2026-11-09). Going through a door +// takes the player off (not measured); a battle leaves them on. +inline constexpr Milliseconds BIKE_SELECT_TIME(1000); + +// A spinner tile (Rocket Hideout, Viridian Gym) slides the player a tile +// per 8 frames (pokefirered PlayerGoSpin(): MOVE_SPEED_FAST_1). Not +// measured on the console. +inline constexpr Milliseconds SPIN_TILE_TIME(133); + + +} // namespace MovementMechanics +} // namespace PokemonFRLG +} // namespace NintendoSwitch +} // namespace PokemonAutomation +#endif diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_BikeSpinPresses.h b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_BikeSpinPresses.h new file mode 100644 index 0000000000..e58d996e90 --- /dev/null +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_BikeSpinPresses.h @@ -0,0 +1,55 @@ +/* Bicycle and Spinner Presses + * + * From: https://github.com/PokemonAutomation/ + * + * The presses the walker sends on the Bicycle and after a slide, from + * PokemonFRLG_BikeSpinMechanics.h. + * + */ + +#ifndef PokemonAutomation_PokemonFRLG_BikeSpinPresses_H +#define PokemonAutomation_PokemonFRLG_BikeSpinPresses_H + +#include "Common/Cpp/Time.h" +#include "PokemonFRLG_BikeSpinMechanics.h" +#include "PokemonFRLG_MovementMechanics.h" + +namespace PokemonAutomation{ +namespace NintendoSwitch{ +namespace PokemonFRLG{ +namespace MovementMechanics{ + + +// An open leg on the Bicycle is counted out in taps, each a tile: a 40ms +// press each. +inline constexpr Milliseconds BIKE_TAP(40); + +// The taps' period, start to start, slower than the chains that worked, +// so none is dropped. +inline constexpr Milliseconds BIKE_TAP_PERIOD(120); + +// After a tap, how long until the screen shows whether it moved: the +// tile's 100ms and video lag. The Command File Runner's tap check judged +// its first tap too early, as unmoved. Not measured: a guess. +inline constexpr Milliseconds BIKE_TAP_SETTLE(250); + +// SELECT, pressed to get on the registered Bicycle. +inline constexpr Milliseconds BIKE_SELECT_PRESS(160); + +// The wait after SELECT for the player to be up on the Bicycle. +inline constexpr Milliseconds BIKE_SELECT_SETTLE(1200); + +// The wait after a slide's last tile before the next press: the spin's +// last frames and the facing it leaves. Not measured. +inline constexpr Milliseconds SPIN_STOP_SETTLE(300); + +static_assert(BIKE_TAP_PERIOD > BIKE_TAP_PERIOD_WORKED && BIKE_TAP_PERIOD_WORKED > BIKE_TAP_DROP_PERIOD); +static_assert(BIKE_TAP < BIKE_TILE_TIME && BIKE_TAP <= LONGEST_TAP); +static_assert(BIKE_SELECT_SETTLE > BIKE_SELECT_TIME); + + +} // namespace MovementMechanics +} // namespace PokemonFRLG +} // namespace NintendoSwitch +} // namespace PokemonAutomation +#endif diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_CodedRooms.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_CodedRooms.cpp index 64a103cf0a..d9a0957b8c 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_CodedRooms.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_CodedRooms.cpp @@ -7,6 +7,8 @@ #include #include #include "PokemonFRLG_CodedRooms.h" +#include "PokemonFRLG_HideoutLiftRoom.h" +#include "PokemonFRLG_PokemonCenterRoom.h" #include "PokemonFRLG_OverworldMaps.h" namespace PokemonAutomation{ @@ -88,7 +90,7 @@ MapObject object(std::string name, Pokemon::ObjectKind kind, const TilePos& tile // *_PokemonCenter_1F.json) all have them. The mat's warps: (6..8, 8), // the middle one MB_SOUTH_ARROW_WARP-like ("walk_south"); the stairs to // 2F at (1, 6), which isn't loaded. -const char CENTER_ROOM_JSON[] = R"({ +constexpr std::string_view CENTER_ROOM_JSON = R"({ "name": "PokemonCenter_1F", "source": {"decomp_file": "data/layouts/PokemonCenter_1F/map.bin", "revision": "ce6406d8c2eaf46d543c8a2606de0c3cb1951982", "date": "2026-11-09"}, "allow_running": false, @@ -108,7 +110,7 @@ const char CENTER_ROOM_JSON[] = R"({ // walls, 3 to 5 floor), the panel's bg event at (0, 2), and warp 1 at // (2, 5), the one MB_SOUTH_ARROW_WARP tile (warp 0 at (1, 5) has no // behaviour, so never fires). -const char LIFT_ROOM_JSON[] = R"({ +constexpr std::string_view LIFT_ROOM_JSON = R"({ "name": "RocketHideout_Elevator", "source": {"decomp_file": "data/layouts/RocketHideout_Elevator/map.bin", "revision": "ce6406d8c2eaf46d543c8a2606de0c3cb1951982", "date": "2026-11-09"}, "tiles": ["#####", "#####", "S####", ".....", ".....", ".....", "#####"], @@ -165,7 +167,7 @@ bool is_pokemon_center(std::string_view map){ } MapData pokemon_center_room(const std::string& name, const Pokemon::WarpDestination& outside){ - MapData room = parse_map(CENTER_ROOM_JSON, name); + MapData room = parse_map(std::string(CENTER_ROOM_JSON), name); room.name = name; for (MapWarp& warp : room.warps){ if (warp.y == CENTER_MAT.y){ @@ -192,7 +194,7 @@ std::optional add_pokemon_center_room(std::vector& maps, s MapData rocket_hideout_lift_room(){ - return parse_map(LIFT_ROOM_JSON, std::string(LIFT_MAP)); + return parse_map(std::string(LIFT_ROOM_JSON), std::string(LIFT_MAP)); } const std::vector& rocket_hideout_lift_doors(){ diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_CodedRooms.h b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_CodedRooms.h index 348aba0492..8b8b548730 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_CodedRooms.h +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_CodedRooms.h @@ -47,48 +47,6 @@ inline constexpr TilePos GAME_CORNER_POSTER{11, 1}; void add_coded_objects(MapData& map); -// A Pokemon Center's ground floor. pokefirered gives all of Kanto's and -// the Sevii Islands' but the Indigo Plateau's and One Island's the one -// layout, LAYOUT_POKEMON_CENTER_1F; the seven in the map lock have the -// same tiles and differ only in who stands where, none of them on the -// nurse's column. -// The mat inside the door: the player arrives on it and leaves from it, -// walking south. -inline constexpr TilePos CENTER_MAT{7, 8}; -// Below the nurse's counter, facing her (the nurse at (7, 2)). -inline constexpr TilePos CENTER_NURSE_FRONT{7, 4}; -// Whether `map` names a Pokemon Center's ground floor. -bool is_pokemon_center(std::string_view map); -// The ground floor of the Center named `name`, whose mat lets out on -// `outside` (the door tile of the town's map): its tiles, the nurse, and -// the mat's warps. No person but the nurse: who stands where differs, and -// the script keeps to the nurse's column. -MapData pokemon_center_room(const std::string& name, const Pokemon::WarpDestination& outside); -// For a sim: adds the coded room of the Center whose door is on -// `maps[town]` to `maps`, and returns its name; nothing if the town has -// no Center door. The town gets a point "
_door" on its door tile -// for the room's mat to let out on. -std::optional add_pokemon_center_room(std::vector& maps, size_t town); - - -// The Rocket Hideout's lift (pokefirered LAYOUT_ROCKET_HIDEOUT_ELEVATOR, -// 5 by 7 tiles, rows 3 to 5 walkable). -inline constexpr std::string_view LIFT_MAP = "RocketHideout_Elevator"; -// Where the floors' lift doors put the player (warp 1, an -// MB_SOUTH_ARROW_WARP tile): south from it leaves the lift. -inline constexpr TilePos LIFT_ARRIVAL{2, 5}; -// Below the panel (a bg event at (0, 2), RocketHideout_Elevator_ -// EventScript_FloorSelect), facing north. -inline constexpr TilePos LIFT_PANEL_FRONT{0, 3}; -// The lift's room. Its door is a dynamic warp: the sim takes it to the -// floor picked (SimScript::lift_floors with rocket_hideout_lift_doors()). -MapData rocket_hideout_lift_room(); -// Where the lift lets out for each floor on its panel, top first -// (setdynamicwarp in RocketHideout_Elevator's scripts): B1F (24, 25), -// B2F (28, 16), B4F (20, 23), each its floor's lift door. -const std::vector& rocket_hideout_lift_doors(); - - } // namespace PokemonFRLG } // namespace NintendoSwitch diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_HideoutLiftRoom.h b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_HideoutLiftRoom.h new file mode 100644 index 0000000000..30b8e80671 --- /dev/null +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_HideoutLiftRoom.h @@ -0,0 +1,43 @@ +/* Hideout Lift Room + * + * From: https://github.com/PokemonAutomation/ + * + * The Rocket Hideout's lift, coded rather than mapped + * (PokemonFRLG_CodedRooms.h). + * + */ + +#ifndef PokemonAutomation_PokemonFRLG_HideoutLiftRoom_H +#define PokemonAutomation_PokemonFRLG_HideoutLiftRoom_H + +#include +#include "PokemonFRLG_OverworldMap.h" +#include "PokemonFRLG_OverworldRoute.h" + +namespace PokemonAutomation{ +namespace NintendoSwitch{ +namespace PokemonFRLG{ + + +// The Rocket Hideout's lift (pokefirered LAYOUT_ROCKET_HIDEOUT_ELEVATOR, +// 5 by 7 tiles, rows 3 to 5 walkable). +inline constexpr std::string_view LIFT_MAP = "RocketHideout_Elevator"; +// Where the floors' lift doors put the player (warp 1, an +// MB_SOUTH_ARROW_WARP tile): south from it leaves the lift. +inline constexpr TilePos LIFT_ARRIVAL{2, 5}; +// Below the panel (a bg event at (0, 2), RocketHideout_Elevator_ +// EventScript_FloorSelect), facing north. +inline constexpr TilePos LIFT_PANEL_FRONT{0, 3}; +// The lift's room. Its door is a dynamic warp: the sim takes it to the +// floor picked (SimScript::lift_floors with rocket_hideout_lift_doors()). +MapData rocket_hideout_lift_room(); +// Where the lift lets out for each floor on its panel, top first +// (setdynamicwarp in RocketHideout_Elevator's scripts): B1F (24, 25), +// B2F (28, 16), B4F (20, 23), each its floor's lift door. +const std::vector& rocket_hideout_lift_doors(); + + +} // namespace PokemonFRLG +} // namespace NintendoSwitch +} // namespace PokemonAutomation +#endif diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_MovementMechanics.h b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_MovementMechanics.h index 1b29078224..461c103777 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_MovementMechanics.h +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_MovementMechanics.h @@ -48,36 +48,6 @@ inline constexpr Milliseconds TILE_TIME(267); inline constexpr Milliseconds RUN_TILE_TIME(133); // Surfing: a tile per 8 frames. inline constexpr Milliseconds SURF_TILE_TIME(133); -// Riding the Bicycle, measured on console B (2026-11-09, Lavender Town, -// east from the rock west of the Center, from rest, counted back with -// one-tile taps): holds of 450, 500, 650, 700, 900, 950, 1100, 1250, -// 1300, 1450 and 1500ms moved 5, 5, 7, 7, 9, 10, 11, 13, 13, 15 and 15 -// tiles, the same each time: a tile per 100ms, so an open leg's hold of -// (n - 1) tiles and a half moves n. 112ms a tile (a wall-to-wall time -// of the motion on screen) held "west 16 (open)" for 17 or 18 tiles on -// Route 8 (00.30 run 2). Not the decompilation's 4 frames a tile (67ms): -// the bike speeds up from rest. -inline constexpr Milliseconds BIKE_TILE_TIME(100); -// On the Bicycle a tap never only turns the player: from rest, a 40ms tap -// moved a tile facing either way, and holds of 112, 150, 200, 250, 300, -// 336 and 400ms moved 1, 2, 2, 3, 3, 4 and 4 tiles (console B, -// 2026-11-09, Route 12's north pier). So a bike leg has no turn tap: its -// hold turns the player too, and loses no tile for it. -inline constexpr bool BIKE_TAP_ONLY_TURNS = false; -// Chains of 40ms taps on the Bicycle (console B, 2026-11-09): one tap per -// 100ms (60ms release) moved exactly a tile each. -inline constexpr Milliseconds BIKE_TAP_PERIOD_WORKED(100); -// At one tap per 60ms, one tap in 12 was dropped. Somewhere between that -// and BIKE_TAP_PERIOD_WORKED the game starts dropping taps; the sim drops -// taps that start sooner than this after the last one. -inline constexpr Milliseconds BIKE_TAP_DROP_PERIOD(80); -// Of the taps that come sooner than BIKE_TAP_DROP_PERIOD, the sim drops -// one in this many. -inline constexpr int BIKE_FAST_TAP_DROP_EVERY = 12; -// With the Bicycle registered (Key Items, BICYCLE, REGISTER), SELECT gets -// on and off in about 1s (console B, 2026-11-09). Going through a door -// takes the player off (not measured); a battle leaves them on. -inline constexpr Milliseconds BIKE_SELECT_TIME(1000); // The longest tap measured to only turn a player facing another way, and // to take exactly one step for one facing its way. inline constexpr Milliseconds LONGEST_TAP(133); @@ -92,10 +62,6 @@ inline constexpr Milliseconds STEP_TAP_SPACING_WORKED(666); // the D-pad this long. Not measured: pokefirered's fade from black is 16 // frames, then the field takes input; a tap sent at once was lost. inline constexpr Milliseconds BATTLE_EXIT_LOCKOUT(500); -// A spinner tile (Rocket Hideout, Viridian Gym) slides the player a tile -// per 8 frames (pokefirered PlayerGoSpin(): MOVE_SPEED_FAST_1). Not -// measured on the console. -inline constexpr Milliseconds SPIN_TILE_TIME(133); // The walker's presses. @@ -118,35 +84,15 @@ inline constexpr Milliseconds STEP_TAP(66); // STEP_TAP_RELEASE after it, past the lockout. inline constexpr Milliseconds STEP_TAP_RELEASE(700); -// An open leg on the Bicycle is counted out in taps, each a tile: a 40ms -// press each. -inline constexpr Milliseconds BIKE_TAP(40); -// The taps' period, start to start, slower than the chains that worked, -// so none is dropped. -inline constexpr Milliseconds BIKE_TAP_PERIOD(120); -// After a tap, how long until the screen shows whether it moved: the -// tile's 100ms and video lag. The Command File Runner's tap check judged -// its first tap too early, as unmoved. Not measured: a guess. -inline constexpr Milliseconds BIKE_TAP_SETTLE(250); -// SELECT, pressed to get on the registered Bicycle. -inline constexpr Milliseconds BIKE_SELECT_PRESS(160); -// The wait after SELECT for the player to be up on the Bicycle. -inline constexpr Milliseconds BIKE_SELECT_SETTLE(1200); // How long the overworld must show nothing (no box, fade or battle) after // a battle before the next tap: twice the lockout. inline constexpr Milliseconds AFTER_BATTLE_QUIET(1000); -// The wait after a slide's last tile before the next press: the spin's -// last frames and the facing it leaves. Not measured. -inline constexpr Milliseconds SPIN_STOP_SETTLE(300); static_assert(TURN_TAP <= LONGEST_TAP && FACE_HOLD <= LONGEST_TAP && STEP_TAP <= LONGEST_TAP); static_assert(STEP_TAP + STEP_TAP_RELEASE > STEP_TAP_SPACING_WORKED); static_assert(STEP_TAP_SPACING_WORKED > STEP_TAP_LOCKOUT); static_assert(AFTER_BATTLE_QUIET > BATTLE_EXIT_LOCKOUT); -static_assert(BIKE_TAP_PERIOD > BIKE_TAP_PERIOD_WORKED && BIKE_TAP_PERIOD_WORKED > BIKE_TAP_DROP_PERIOD); -static_assert(BIKE_TAP < BIKE_TILE_TIME && BIKE_TAP <= LONGEST_TAP); -static_assert(BIKE_SELECT_SETTLE > BIKE_SELECT_TIME); } // namespace MovementMechanics diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldBike.h b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldBike.h new file mode 100644 index 0000000000..ca42c358a7 --- /dev/null +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldBike.h @@ -0,0 +1,76 @@ +/* Overworld Bicycle + * + * From: https://github.com/PokemonAutomation/ + * + * How the overworld walker rides the Bicycle: which legs it taps out, + * and getting on with SELECT. + * + */ + +#ifndef PokemonAutomation_PokemonFRLG_OverworldBike_H +#define PokemonAutomation_PokemonFRLG_OverworldBike_H + +#include +#include +#include "CommonFramework/ImageTypes/ImageViewRGB32.h" +#include "NintendoSwitch/Controllers/Procon/NintendoSwitch_ProController.h" +#include "NintendoSwitch/NintendoSwitch_ConsoleHandle.h" +#include "PokemonFRLG_OverworldWalk.h" + +namespace PokemonAutomation{ +namespace NintendoSwitch{ +namespace PokemonFRLG{ + + +// The speed walked at instead of `speed` while off the Bicycle (a door +// took the player off): a run. +MoveSpeed on_foot(MoveSpeed speed); + +namespace OverworldWalkSteps{ + +// Whether a WALK `step` at `speed` starts with a turn tap, for a player +// facing `facing`: on foot facing another way (or an unknown way), so the +// hold starts facing the right way. Never on the Bicycle, where a tap +// takes a step (MovementMechanics::BIKE_TAP_ONLY_TURNS). +bool turns_first(const RouteStep& step, MoveSpeed speed, std::optional facing); + +// Whether `step` at `speed` is walked a tap at a time, each a tile +// (count_bike_taps()): an open leg on the Bicycle, outdoors, not onto a +// warp or a spinner, and not over a map connection, where the game holds +// the player up a tile (a tap there isn't measured). Legs to a wall are +// held: the wall ends them. +bool counts_bike_taps(const RouteStep& step, MoveSpeed speed); + +// Whether, walking a route at `speed` and riding the Bicycle or not +// (`riding`), the player gets on with SELECT before `step`: a WALK where +// the Bicycle may be ridden, after a door took them off. +bool gets_on_bike(const RouteStep& step, MoveSpeed speed, bool riding); + +// The console side of select_onto_bike(): presses SELECT and waits it +// out; reads whether the player rides. +struct BikeSelectCalls{ + std::function press_select; + std::function riding; +}; + +// Gets on the registered Bicycle with SELECT, checks the player rides, +// and presses again once if not. Returns whether they ride. +bool select_onto_bike(const BikeSelectCalls& calls); + +// Whether the player rides the Bicycle, from the screen: the overworld +// is up, and no standing player's sprite shows where the player stands +// (read_player_facing()). False under a message or a menu. +bool screen_shows_riding(const ImageViewRGB32& screen); + +// select_onto_bike() on the console: SELECT is the Switch's MINUS. +// Throws OperationFailedException if the player doesn't ride after two +// presses. +void get_on_bike(ConsoleHandle& console, ProControllerContext& context); + +} // namespace OverworldWalkSteps + + +} // namespace PokemonFRLG +} // namespace NintendoSwitch +} // namespace PokemonAutomation +#endif diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldBike_Tests.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldBike_Tests.cpp index ce660ee05b..eca8adf9da 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldBike_Tests.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldBike_Tests.cpp @@ -14,10 +14,14 @@ #include "Common/Cpp/Exceptions.h" #include "Common/Cpp/TestRunners/UnitTest.h" #include "PokemonFRLG_MovementMechanics.h" +#include "PokemonFRLG_BikeSpinPresses.h" +#include "PokemonFRLG_BikeSpinMechanics.h" #include "PokemonFRLG_OverworldMaps.h" #include "PokemonFRLG_OverworldRecovery.h" #include "PokemonFRLG_OverworldRoute.h" #include "PokemonFRLG_OverworldSim.h" +#include "PokemonFRLG_OverworldSimField.h" +#include "PokemonFRLG_OverworldBike.h" namespace PokemonAutomation{ namespace NintendoSwitch{ diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldMap.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldMap.cpp index 41a578fdde..997c6b4609 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldMap.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldMap.cpp @@ -8,6 +8,7 @@ #include "Common/Cpp/Exceptions.h" #include "PokemonFRLG_CodedRooms.h" #include "PokemonFRLG_OverworldMap.h" +#include "PokemonFRLG_OverworldSpin.h" namespace PokemonAutomation{ namespace NintendoSwitch{ @@ -231,16 +232,16 @@ StepKind classify_step_onto( return StepKind::WALK; } -const char SPIN_NORTH_REGION[] = "spin_north"; -const char SPIN_SOUTH_REGION[] = "spin_south"; -const char SPIN_WEST_REGION[] = "spin_west"; -const char SPIN_EAST_REGION[] = "spin_east"; -const char SPIN_STOP_REGION[] = "spin_stop"; - namespace{ -bool in_region(const MapData& map, const char* region, const TilePos& point){ - const auto tiles = map.regions.find(region); +// The regions a map may list spinner tiles in (PokemonFRLG_OverworldSpin.h). +constexpr std::string_view SPIN_NORTH_REGION = "spin_north"; +constexpr std::string_view SPIN_SOUTH_REGION = "spin_south"; +constexpr std::string_view SPIN_WEST_REGION = "spin_west"; +constexpr std::string_view SPIN_EAST_REGION = "spin_east"; +constexpr std::string_view SPIN_STOP_REGION = "spin_stop"; +bool in_region(const MapData& map, std::string_view region, const TilePos& point){ + const auto tiles = map.regions.find(std::string(region)); return tiles != map.regions.end() && std::find(tiles->second.begin(), tiles->second.end(), point) != tiles->second.end(); } @@ -250,7 +251,7 @@ std::optional spin_direction(const MapData& map, const TilePos& point if (const std::optional coded = coded_spin_direction(map.name, point)){ return coded; } - static const std::pair ARROWS[] = { + static const std::pair ARROWS[] = { {SPIN_NORTH_REGION, Direction::NORTH}, {SPIN_SOUTH_REGION, Direction::SOUTH}, {SPIN_WEST_REGION, Direction::WEST}, diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldMap.h b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldMap.h index aecc3af3c0..469f17efa7 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldMap.h +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldMap.h @@ -19,6 +19,7 @@ #include #include #include +#include #include "Pokemon/Navigation/Pokemon_Grid.h" #include "Pokemon/Navigation/Pokemon_MapData.h" @@ -160,44 +161,6 @@ PlayerState after_step_onto( ); -// Spinner tiles (Rocket Hideout B2F and B3F, Viridian Gym): pokefirered's -// MB_SPIN_UP, MB_SPIN_DOWN, MB_SPIN_LEFT, MB_SPIN_RIGHT and -// MB_STOP_SPINNING. The tile glyphs can't say so: the hideout's floors -// have them coded (coded_spin_direction(), PokemonFRLG_CodedRooms.h); -// another map may list them in these regions, as it does WILD_REGION. -// "spin_north": MB_SPIN_UP. -extern const char SPIN_NORTH_REGION[]; -// "spin_south": MB_SPIN_DOWN. -extern const char SPIN_SOUTH_REGION[]; -// "spin_west": MB_SPIN_LEFT. -extern const char SPIN_WEST_REGION[]; -// "spin_east": MB_SPIN_RIGHT. -extern const char SPIN_EAST_REGION[]; -// "spin_stop": MB_STOP_SPINNING. -extern const char SPIN_STOP_REGION[]; -// The way the arrow on this tile slides the player, if it is a spinner. -std::optional spin_direction(const MapData& map, const TilePos& point); -// Whether this tile ends a slide (MB_STOP_SPINNING). -bool stops_spinning(const MapData& map, const TilePos& point); - -// Where a slide leaves the player, the way it last moved them, and how -// many tiles it took. -struct SpinSlide{ - PlayerState end; - Direction facing = Direction::NORTH; - int tiles = 0; -}; -// The slide of a player who has just stepped onto the spinner `state` -// stands on (pokefirered TryUpdatePlayerSpinDirection()): a tile at a -// time the last arrow's way, turned by each arrow on the way, until a stop -// tile, or a step the step rules refuse (a wall, a person: the game's -// collision ends the forced movement there). Nothing if `state` isn't on a -// spinner, if the arrows turn the player round in a loop, or if the slide -// crosses a warp, which isn't modelled. -std::optional spin_slide(const MapData& map, const PlayerState& state); - - - } // namespace PokemonFRLG } // namespace NintendoSwitch } // namespace PokemonAutomation diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldRecoveryWalk.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldRecoveryWalk.cpp index 26ede29f78..e7fbd0e42a 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldRecoveryWalk.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldRecoveryWalk.cpp @@ -21,6 +21,8 @@ #include "PokemonFRLG_OverworldBikeTaps.h" #include "PokemonFRLG_OverworldLateBattle.h" #include "PokemonFRLG_OverworldRecoveryWalk.h" +#include "PokemonFRLG_BikeSpinPresses.h" +#include "PokemonFRLG_OverworldBike.h" namespace PokemonAutomation{ namespace NintendoSwitch{ diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldRoute.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldRoute.cpp index d16f0ca592..2e1c573abf 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldRoute.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldRoute.cpp @@ -14,6 +14,7 @@ #include "Pokemon/Navigation/Pokemon_LegPlanner.h" #include "PokemonFRLG_OverworldMaps.h" #include "PokemonFRLG_OverworldRoute.h" +#include "PokemonFRLG_OverworldSpin.h" namespace PokemonAutomation{ namespace NintendoSwitch{ diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldRoute_Tests.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldRoute_Tests.cpp index 0f9fcb753a..3058352ad3 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldRoute_Tests.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldRoute_Tests.cpp @@ -28,7 +28,7 @@ struct RouteTestInput{ UnitTestResult (*body)(); }; struct RouteTestExpectation{ - const char* description; + std::string description; }; struct RouteTestCase{ RouteTestInput input; @@ -232,7 +232,7 @@ UnitTestResult test_mewtwo_tile_unreachable(){ UnitTestResult test_story_maps(){ const std::vector maps = overworld_maps(); - for (const char* name : { + for (const std::string name : { "PalletTown_PlayersHouse_2F", "PalletTown_ProfessorOaksLab", "Route1", "ViridianCity_Mart", "Route22", "Route2", "ViridianForest", "PewterCity", "PewterCity_Museum_1F", "PewterCity_Gym", }){ @@ -289,7 +289,7 @@ UnitTestResult test_viridian_mart_to_pewter_gym(){ } // A room with a sign on its north wall, above the third column. -const char* const TEST_SIGN_ROOM_JSON = R"({ +const std::string TEST_SIGN_ROOM_JSON = R"({ "name": "SignRoom", "source": {"decomp_file": "", "revision": "test", "date": "2026-10-31"}, "tiles": ["##S##", "#...#", "#...#", "#...#", "#####"], "elevation": ["33333", "33333", "33333", "33333", "33333"] @@ -321,7 +321,7 @@ UnitTestResult test_no_hold_into_sign(){ } // A yard with a row of ledges across it. -const char* const TEST_LEDGE_YARD_JSON = R"({ +const std::string TEST_LEDGE_YARD_JSON = R"({ "name": "LedgeYard", "source": {"decomp_file": "", "revision": "test", "date": "2026-10-31"}, "tiles": ["#####", "#...#", "#...#", "#vvv#", "#...#", "#####"], "elevation": ["33333", "33333", "33333", "33333", "33333", "33333"] @@ -409,14 +409,14 @@ UnitTestResult test_wild_steps(){ return true; } -const char* const TEST_ROOM_JSON = R"({ +const std::string TEST_ROOM_JSON = R"({ "name": "Room", "source": {"decomp_file": "", "revision": "test", "date": "2026-10-31"}, "tiles": ["#####", "#...#", "#...#", "##.##"], "elevation": ["33333", "33333", "33333", "33333"], "points": {"warp_0": [2, 3]}, "warps": [{"x": 2, "y": 3, "enter": "walk_south", "to_map": "Yard", "to_point": "warp_0"}] })"; -const char* const TEST_YARD_JSON = R"({ +const std::string TEST_YARD_JSON = R"({ "name": "Yard", "source": {"decomp_file": "", "revision": "test", "date": "2026-10-31"}, "tiles": ["#####", "##D##", "#...#", "#####"], "elevation": ["33333", "33333", "33333", "33333"], diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSim.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSim.cpp index fc523332db..14129e9086 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSim.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSim.cpp @@ -13,6 +13,7 @@ #include "PokemonFRLG_OverworldLateBattle.h" #include "PokemonFRLG_OverworldReanchor.h" #include "PokemonFRLG_OverworldWalk.h" +#include "PokemonFRLG_OverworldBike.h" #include "PokemonFRLG_OverworldSim.h" namespace PokemonAutomation{ @@ -672,7 +673,6 @@ bool OverworldSim::close_message(){ - // // OverworldSimWalker // diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSim.h b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSim.h index c9a1b59e1e..3b847ecc70 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSim.h +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSim.h @@ -42,10 +42,14 @@ #include "Common/Cpp/TestRunners/UnitTestDatabase.h" #include "Pokemon/AutoStory/Pokemon_ScreenEvents.h" #include "PokemonFRLG_MovementMechanics.h" +#include "PokemonFRLG_BikeSpinPresses.h" +#include "PokemonFRLG_BikeSpinMechanics.h" #include "PokemonFRLG_OverworldBikeTaps.h" #include "PokemonFRLG_OverworldRecovery.h" #include "PokemonFRLG_OverworldRoute.h" +#include "PokemonFRLG_OverworldSimField.h" #include "PokemonFRLG_OverworldWalk.h" +#include "PokemonFRLG_OverworldSpin.h" namespace PokemonAutomation{ namespace NintendoSwitch{ @@ -236,26 +240,6 @@ enum class SimBattleEnd{ NO_BATTLE, // there was none, on screen or about to show }; -// What A does on the overworld, facing something (OverworldSim::use_field()). -enum class SimField{ - // Cuts the tree the player faces (an object named "cut_tree") with - // YES to the game's question: it is gone until the player next warps, - // as its hide flag is a FLAG_TEMP. - CUT_TREE, - // The poster the player faces (an object named "poster"): the switch - // behind it opens the stairs, which takes away the objects named - // "poster_stairs" for good (pokefirered - // CeladonCity_GameCorner_EventScript_Poster's setmetatile). The sim - // adds both to the Game Corner from code (add_coded_objects()). - POSTER_SWITCH, - // The panel of the lift the player stands in (SimScript::lift_floors): - // the floor picked, the lift's door now lets out there. - LIFT_FLOOR, - // Not A: SELECT, which with the Bicycle registered gets on it where - // running is allowed, or off it, in about - // MovementMechanics::BIKE_SELECT_TIME. (PokemonFRLG_OverworldSimTaps.cpp) - BIKE_SELECT, -}; // Simulates overworld movement, encounters and dialogs. class OverworldSim{ @@ -617,12 +601,6 @@ class OverworldSimWalker{ void add_tests_OverworldSim(UnitTestDatabase& database); // Register the tests of a warp's fade over before the hold onto it ends. void add_tests_OverworldWarpFade(UnitTestDatabase& database); -// Register the tests of spinner tiles, the lift's panel and the poster -// switch on made-up maps. -void add_tests_OverworldSpin(UnitTestDatabase& database); -// Register the tests of the Bicycle's taps and SELECT on a made-up map. -void add_tests_OverworldBike(UnitTestDatabase& database); - } // namespace PokemonFRLG diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSimField.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSimField.cpp index 3258b390d0..dfdc41651b 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSimField.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSimField.cpp @@ -11,6 +11,9 @@ #include #include "PokemonFRLG_CodedRooms.h" #include "PokemonFRLG_OverworldSim.h" +#include "PokemonFRLG_OverworldSimField.h" +#include "PokemonFRLG_BikeSpinMechanics.h" +#include "PokemonFRLG_OverworldSpin.h" namespace PokemonAutomation{ namespace NintendoSwitch{ diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSimField.h b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSimField.h new file mode 100644 index 0000000000..4dd405a0f6 --- /dev/null +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSimField.h @@ -0,0 +1,48 @@ +/* Overworld Sim Field Actions + * + * From: https://github.com/PokemonAutomation/ + * + * What the overworld sim does for A (or SELECT) on the field, and the + * tests of the Bicycle's taps and SELECT in the sim. + * + */ + +#ifndef PokemonAutomation_PokemonFRLG_OverworldSimField_H +#define PokemonAutomation_PokemonFRLG_OverworldSimField_H + +#include "Common/Cpp/TestRunners/UnitTestDatabase.h" + +namespace PokemonAutomation{ +namespace NintendoSwitch{ +namespace PokemonFRLG{ + + +// What A does on the overworld, facing something (OverworldSim::use_field()). +enum class SimField{ + // Cuts the tree the player faces (an object named "cut_tree") with + // YES to the game's question: it is gone until the player next warps, + // as its hide flag is a FLAG_TEMP. + CUT_TREE, + // The poster the player faces (an object named "poster"): the switch + // behind it opens the stairs, which takes away the objects named + // "poster_stairs" for good (pokefirered + // CeladonCity_GameCorner_EventScript_Poster's setmetatile). The sim + // adds both to the Game Corner from code (add_coded_objects()). + POSTER_SWITCH, + // The panel of the lift the player stands in (SimScript::lift_floors): + // the floor picked, the lift's door now lets out there. + LIFT_FLOOR, + // Not A: SELECT, which with the Bicycle registered gets on it where + // running is allowed, or off it, in about + // MovementMechanics::BIKE_SELECT_TIME. (PokemonFRLG_OverworldSimTaps.cpp) + BIKE_SELECT, +}; + +// Register the tests of the Bicycle's taps and SELECT on a made-up map. +void add_tests_OverworldBike(UnitTestDatabase& database); + + +} // namespace PokemonFRLG +} // namespace NintendoSwitch +} // namespace PokemonAutomation +#endif diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSimTaps.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSimTaps.cpp index 03bde06519..197d4d7355 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSimTaps.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSimTaps.cpp @@ -10,6 +10,10 @@ #include #include "PokemonFRLG_OverworldSim.h" +#include "PokemonFRLG_OverworldSimField.h" +#include "PokemonFRLG_BikeSpinMechanics.h" +#include "PokemonFRLG_BikeSpinPresses.h" +#include "PokemonFRLG_OverworldBike.h" namespace PokemonAutomation{ namespace NintendoSwitch{ diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSim_Tests.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSim_Tests.cpp index cfa1e6b021..25d6f4bfc4 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSim_Tests.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSim_Tests.cpp @@ -24,6 +24,8 @@ #include "PokemonFRLG_OverworldLateBattle.h" #include "PokemonFRLG_OverworldMaps.h" #include "PokemonFRLG_OverworldSim.h" +#include "PokemonFRLG_OverworldSimField.h" +#include "PokemonFRLG_OverworldSpin.h" namespace PokemonAutomation{ namespace NintendoSwitch{ diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSpin.h b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSpin.h new file mode 100644 index 0000000000..6a4a5a9730 --- /dev/null +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSpin.h @@ -0,0 +1,62 @@ +/* Overworld Spinner Tiles + * + * From: https://github.com/PokemonAutomation/ + * + * Spinner tiles: which way their arrows slide the player, and where a + * slide ends. + * + */ + +#ifndef PokemonAutomation_PokemonFRLG_OverworldSpin_H +#define PokemonAutomation_PokemonFRLG_OverworldSpin_H + +#include +#include "Common/Cpp/TestRunners/UnitTestDatabase.h" +#include "PokemonFRLG_OverworldMap.h" + +namespace PokemonAutomation{ +namespace NintendoSwitch{ +namespace PokemonFRLG{ + + +// Spinner tiles (Rocket Hideout B2F and B3F, Viridian Gym): pokefirered's +// MB_SPIN_UP, MB_SPIN_DOWN, MB_SPIN_LEFT, MB_SPIN_RIGHT and +// MB_STOP_SPINNING. The tile glyphs can't say so: the hideout's floors +// have them coded (coded_spin_direction(), PokemonFRLG_CodedRooms.h); +// another map may list them in these regions, as it does WILD_REGION. +// "spin_north": MB_SPIN_UP. +// "spin_south": MB_SPIN_DOWN. +// "spin_west": MB_SPIN_LEFT. +// "spin_east": MB_SPIN_RIGHT. +// "spin_stop": MB_STOP_SPINNING. +// +// The way the arrow on this tile slides the player, if it is a spinner. +std::optional spin_direction(const MapData& map, const TilePos& point); +// Whether this tile ends a slide (MB_STOP_SPINNING). +bool stops_spinning(const MapData& map, const TilePos& point); + +// Where a slide leaves the player, the way it last moved them, and how +// many tiles it took. +struct SpinSlide{ + PlayerState end; + Direction facing = Direction::NORTH; + int tiles = 0; +}; +// The slide of a player who has just stepped onto the spinner `state` +// stands on (pokefirered TryUpdatePlayerSpinDirection()): a tile at a +// time the last arrow's way, turned by each arrow on the way, until a stop +// tile, or a step the step rules refuse (a wall, a person: the game's +// collision ends the forced movement there). Nothing if `state` isn't on a +// spinner, if the arrows turn the player round in a loop, or if the slide +// crosses a warp, which isn't modelled. +std::optional spin_slide(const MapData& map, const PlayerState& state); + +// Register the tests of spinner tiles, the lift's panel and the poster +// switch on made-up maps. +void add_tests_OverworldSpin(UnitTestDatabase& database); + + +} // namespace PokemonFRLG +} // namespace NintendoSwitch +} // namespace PokemonAutomation +#endif diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSpin_Tests.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSpin_Tests.cpp index afe24a3f8b..e17a69bda4 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSpin_Tests.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSpin_Tests.cpp @@ -19,6 +19,8 @@ #include "PokemonFRLG_OverworldRecovery.h" #include "PokemonFRLG_OverworldRoute.h" #include "PokemonFRLG_OverworldSim.h" +#include "PokemonFRLG_OverworldSimField.h" +#include "PokemonFRLG_OverworldSpin.h" namespace PokemonAutomation{ namespace NintendoSwitch{ @@ -32,7 +34,7 @@ struct SpinInput{ UnitTestResult (*body)(); }; struct SpinExpectation{ - const char* description; + std::string description; }; struct SpinCase{ SpinInput input; @@ -193,7 +195,7 @@ UnitTestResult test_sim_walker_walks_slide(){ // A lift whose door, the exit mat (1, 2), lets out on the floor picked. std::vector lift_maps(){ - const char* FLOOR = R"({ + const std::string FLOOR = R"({ "name": "%s", "source": {"decomp_file": "", "revision": "test", "date": "2026-11-09"}, "tiles": ["###", "#.#", "###"] })"; @@ -203,7 +205,7 @@ std::vector lift_maps(){ "tiles": ["###", "#.#", "#.#", "###"], "warps": [{"x": 1, "y": 2, "enter": "walk_south"}] })", "Lift")); - for (const char* name : {"FloorA", "FloorB"}){ + for (const std::string name : {"FloorA", "FloorB"}){ std::string json = FLOOR; json.replace(json.find("%s"), 2, name); maps.push_back(parse_map(json, name)); diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldWalk.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldWalk.cpp index 2ce0c18407..104d07542f 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldWalk.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldWalk.cpp @@ -23,6 +23,9 @@ #include "VideoGames/PokemonFRLG/PokemonFRLG_Settings.h" #include "PokemonFRLG_PlayerFacingReader.h" #include "PokemonFRLG_OverworldWalk.h" +#include "PokemonFRLG_OverworldBike.h" +#include "PokemonFRLG_BikeSpinMechanics.h" +#include "PokemonFRLG_BikeSpinPresses.h" namespace PokemonAutomation{ namespace NintendoSwitch{ diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldWalk.h b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldWalk.h index 0ccb3b1bee..5666f54367 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldWalk.h +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldWalk.h @@ -82,9 +82,6 @@ enum class MoveSpeed{ }; // Name of a movement speed. const char* move_speed_name(MoveSpeed speed); -// The speed walked at instead of `speed` while off the Bicycle (a door -// took the player off): a run. -MoveSpeed on_foot(MoveSpeed speed); // Walks `route` from where it was planned, at `speed`. The player must be @@ -157,43 +154,6 @@ MoveSpeed step_speed(const RouteStep& step, MoveSpeed speed); // pace whatever the speed; where running isn't allowed, the walking pace. Milliseconds tile_time(const RouteStep& step, MoveSpeed speed); -// Whether a WALK `step` at `speed` starts with a turn tap, for a player -// facing `facing`: on foot facing another way (or an unknown way), so the -// hold starts facing the right way. Never on the Bicycle, where a tap -// takes a step (MovementMechanics::BIKE_TAP_ONLY_TURNS). -bool turns_first(const RouteStep& step, MoveSpeed speed, std::optional facing); - -// Whether `step` at `speed` is walked a tap at a time, each a tile -// (count_bike_taps()): an open leg on the Bicycle, outdoors, not onto a -// warp or a spinner, and not over a map connection, where the game holds -// the player up a tile (a tap there isn't measured). Legs to a wall are -// held: the wall ends them. -bool counts_bike_taps(const RouteStep& step, MoveSpeed speed); - -// Whether, walking a route at `speed` and riding the Bicycle or not -// (`riding`), the player gets on with SELECT before `step`: a WALK where -// the Bicycle may be ridden, after a door took them off. -bool gets_on_bike(const RouteStep& step, MoveSpeed speed, bool riding); - -// The console side of select_onto_bike(): presses SELECT and waits it -// out; reads whether the player rides. -struct BikeSelectCalls{ - std::function press_select; - std::function riding; -}; -// Gets on the registered Bicycle with SELECT, checks the player rides, -// and presses again once if not. Returns whether they ride. -bool select_onto_bike(const BikeSelectCalls& calls); - -// Whether the player rides the Bicycle, from the screen: the overworld -// is up, and no standing player's sprite shows where the player stands -// (read_player_facing()). False under a message or a menu. -bool screen_shows_riding(const ImageViewRGB32& screen); - -// select_onto_bike() on the console: SELECT is the Switch's MINUS. -// Throws OperationFailedException if the player doesn't ride after two -// presses. -void get_on_bike(ConsoleHandle& console, ProControllerContext& context); // The mover for `step` at `speed`: hold_dpad_running() for a run on foot // where the map allows it, hold_dpad() otherwise (B does nothing on the @@ -299,7 +259,6 @@ void start_surf(ConsoleHandle& console, ProControllerContext& context, Direction void add_tests_OverworldWalk(UnitTestDatabase& database); - } // namespace PokemonFRLG } // namespace NintendoSwitch } // namespace PokemonAutomation diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldWalk_Tests.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldWalk_Tests.cpp index aa659b6101..a0f8605ca0 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldWalk_Tests.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldWalk_Tests.cpp @@ -13,6 +13,7 @@ #include "PokemonFRLG_OverworldMaps.h" #include "PokemonFRLG_OverworldSim.h" #include "PokemonFRLG_OverworldWalk.h" +#include "PokemonFRLG_BikeSpinMechanics.h" namespace PokemonAutomation{ namespace NintendoSwitch{ diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_PokemonCenterRoom.h b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_PokemonCenterRoom.h new file mode 100644 index 0000000000..9578c86200 --- /dev/null +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_PokemonCenterRoom.h @@ -0,0 +1,52 @@ +/* Pokemon Center Room + * + * From: https://github.com/PokemonAutomation/ + * + * A Pokemon Center's ground floor, coded rather than mapped + * (PokemonFRLG_CodedRooms.h). + * + */ + +#ifndef PokemonAutomation_PokemonFRLG_PokemonCenterRoom_H +#define PokemonAutomation_PokemonFRLG_PokemonCenterRoom_H + +#include +#include +#include +#include +#include "PokemonFRLG_OverworldMap.h" +#include "PokemonFRLG_OverworldRoute.h" + +namespace PokemonAutomation{ +namespace NintendoSwitch{ +namespace PokemonFRLG{ + + +// A Pokemon Center's ground floor. pokefirered gives all of Kanto's and +// the Sevii Islands' but the Indigo Plateau's and One Island's the one +// layout, LAYOUT_POKEMON_CENTER_1F; the seven in the map lock have the +// same tiles and differ only in who stands where, none of them on the +// nurse's column. +// The mat inside the door: the player arrives on it and leaves from it, +// walking south. +inline constexpr TilePos CENTER_MAT{7, 8}; +// Below the nurse's counter, facing her (the nurse at (7, 2)). +inline constexpr TilePos CENTER_NURSE_FRONT{7, 4}; +// Whether `map` names a Pokemon Center's ground floor. +bool is_pokemon_center(std::string_view map); +// The ground floor of the Center named `name`, whose mat lets out on +// `outside` (the door tile of the town's map): its tiles, the nurse, and +// the mat's warps. No person but the nurse: who stands where differs, and +// the script keeps to the nurse's column. +MapData pokemon_center_room(const std::string& name, const Pokemon::WarpDestination& outside); +// For a sim: adds the coded room of the Center whose door is on +// `maps[town]` to `maps`, and returns its name; nothing if the town has +// no Center door. The town gets a point "
_door" on its door tile +// for the room's mat to let out on. +std::optional add_pokemon_center_room(std::vector& maps, size_t town); + + +} // namespace PokemonFRLG +} // namespace NintendoSwitch +} // namespace PokemonAutomation +#endif diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryBag.h b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryBag.h new file mode 100644 index 0000000000..9bd80334fb --- /dev/null +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryBag.h @@ -0,0 +1,78 @@ +/* AutoStory Bag + * + * From: https://github.com/PokemonAutomation/ + * + * The bag as the story's item steps drive it: its pockets, the rows of + * items, and the actions on it, the console's or a test's. + * + */ + +#ifndef PokemonAutomation_PokemonFRLG_AutoStoryBag_H +#define PokemonAutomation_PokemonFRLG_AutoStoryBag_H + +#include +#include +#include +#include +#include +#include "VideoGames/PokemonFRLG/Inference/Menus/PokemonFRLG_ItemListReader.h" + +namespace PokemonAutomation{ +namespace NintendoSwitch{ +namespace PokemonFRLG{ + + +// The bag's pockets, in the order LEFT and RIGHT go through them. +enum class BagPocket{ + ITEMS, + KEY_ITEMS, + POKE_BALLS, +}; + +// The pocket of an item the story uses from the bag: repel, super-repel, +// max-repel, escape-rope (Items) or bicycle (Key Items); nothing for +// another. +std::optional usable_item_pocket(std::string_view item); + +// Whether `item` is a Repel of any kind. +bool is_repel(std::string_view item); + +// The row of `item` in `rows` (read_bag_pocket()'s, from the top), if it +// has one left: a count of -1 (unread) counts as some. +std::optional bag_row_of(const std::vector& rows, std::string_view item); + +// The bag, as use_item_from_bag() drives it: the console's, or a test's. +class ItemUseActions{ +public: + virtual ~ItemUseActions() = default; + // From the overworld, opens the bag on `pocket`, scrolled to its top. + virtual bool open_pocket(BagPocket pocket) = 0; + // The open pocket's rows, from the top. + virtual std::vector read_pocket() = 0; + // Moves to row `row`, USE, and through what the item says. + virtual void use_row(size_t row) = 0; + // Moves to row `row` and REGISTERs it for SELECT. + virtual void register_row(size_t row) = 0; + // Back to the overworld (nothing to do if the item closed the bag). + virtual void close_bag() = 0; +}; + +// How use_item_from_bag() ended. +enum class ItemUseEnd{ + USED, + // The pocket has none left (or the name isn't read). + NONE_LEFT, + // The bag didn't open. + NO_BAG, + // Not an item the story uses from the bag. + UNKNOWN_ITEM, +}; + +// "used", "none_left": the end's name in logs and failures. +std::string item_use_end_name(ItemUseEnd end); + + +} // namespace PokemonFRLG +} // namespace NintendoSwitch +} // namespace PokemonAutomation +#endif diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryBagUse.h b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryBagUse.h new file mode 100644 index 0000000000..802f5c0724 --- /dev/null +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryBagUse.h @@ -0,0 +1,59 @@ +/* AutoStory Bag Use + * + * From: https://github.com/PokemonAutomation/ + * + * Using and registering items from the bag, and renewing a Repel, on + * the console or a test's bag. + * + */ + +#ifndef PokemonAutomation_PokemonFRLG_AutoStoryBagUse_H +#define PokemonAutomation_PokemonFRLG_AutoStoryBagUse_H + +#include +#include +#include "Common/Cpp/Logging/AbstractLogger.h" +#include "CommonFramework/Language.h" +#include "NintendoSwitch/Controllers/Procon/NintendoSwitch_ProController.h" +#include "NintendoSwitch/NintendoSwitch_ConsoleHandle.h" +#include "PokemonFRLG_AutoStoryBag.h" + +namespace PokemonAutomation{ +namespace NintendoSwitch{ +namespace PokemonFRLG{ + + +// Opens the item's pocket, finds it and uses it, then back to the +// overworld. +ItemUseEnd use_item_from_bag(Logger& logger, ItemUseActions& actions, std::string_view item); + +// The same, REGISTERing it for SELECT (the Bicycle) instead of USE. +ItemUseEnd register_item_in_bag(Logger& logger, ItemUseActions& actions, std::string_view item); + +// After "REPEL's effect wore off..." has closed: FRLG asks nothing, so +// another of the same Repel is used if the bag has one. NONE_LEFT is no +// failure: the walk goes on without. +ItemUseEnd renew_repel(Logger& logger, ItemUseActions& actions, std::string_view item); + +// The console's bag. +class ConsoleItemUseActions : public ItemUseActions{ +public: + ConsoleItemUseActions(ConsoleHandle& console, ProControllerContext& context, Language language); + + virtual bool open_pocket(BagPocket pocket) override; + virtual std::vector read_pocket() override; + virtual void use_row(size_t row) override; + virtual void register_row(size_t row) override; + virtual void close_bag() override; + +private: + ConsoleHandle& m_console; + ProControllerContext& m_context; + Language m_language; +}; + + +} // namespace PokemonFRLG +} // namespace NintendoSwitch +} // namespace PokemonAutomation +#endif diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryBattleData_Tests.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryBattleData_Tests.cpp index f9e53a5779..4b4a442605 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryBattleData_Tests.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryBattleData_Tests.cpp @@ -145,8 +145,8 @@ UnitTestResult test_story_trainers(){ // party. UnitTestResult test_hideout_trainers(){ struct Expected{ - const char* map; - const char* battle; + std::string map; + std::string battle; std::vector party; }; const Expected EXPECTED[] = { diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryEvents.h b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryEvents.h index 4ecbd72ab7..ee7cb5dced 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryEvents.h +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryEvents.h @@ -44,11 +44,11 @@ namespace NintendoSwitch{ namespace PokemonFRLG{ -// Story leg definition imported from Pokemon AutoStory. +// Story leg definition imported from Pokemon AutoStory. using Pokemon::StoryLeg; -// Story step definition imported from Pokemon AutoStory. +// Story step definition imported from Pokemon AutoStory. using Pokemon::StoryStep; -// Story step kind classification imported from Pokemon AutoStory. +// Story step kind classification imported from Pokemon AutoStory. using Pokemon::StoryStepKind; // Where the player stands and faces: the one-tile poses of FRLG's table @@ -63,17 +63,13 @@ struct StoryPose{ // The variant of a ROUTE or LEGS step that runs, with B held: the player // has the Running Shoes (00.10 on). inline const std::string RUN_VARIANT = "run"; -// The variant of a ROUTE or LEGS step ridden on the Bicycle, mounted by a -// RIDE_BIKE_VARIANT step before it (PokemonFRLG_AutoStoryItemUse.h). -// Indoors, where the game doesn't let the player ride, it walks. -inline const std::string BIKE_VARIANT = "bike"; // The variant of a STEP into a trainer's line: a tile at a time, at most // TRAINER_LINE_TILES, until the trainer sees the player // (step_until_seen()). The battle after it starts on the trainer's row // whether the walk before ended on its tile or a tile short. inline const std::string TRAINER_LINE_VARIANT = "trainer_line"; -// Maximum tiles to step into a trainer's line of sight. +// Maximum tiles to step into a trainer's line of sight. inline constexpr int TRAINER_LINE_TILES = 3; // The variant of a STEP into the line of a trainer who looks around @@ -181,7 +177,7 @@ const std::vector& story_maps(); // City's harbor). const RouteCosts& story_route_costs(); -// Converts a StoryPose to a general navigation Pose. +// Converts a StoryPose to a general navigation Pose. Pokemon::Pose to_pose(const StoryPose& pose); // `pose` as a StoryPose: nothing unless it is on one tile. std::optional story_pose(const Pokemon::Pose& pose); @@ -349,8 +345,7 @@ Pokemon::Checkpoint build_checkpoint(const StoryCheckpoint& data, StoryExecutor& Pokemon::Segment make_story_segment(const std::vector& checkpoints, StoryExecutor& executor); - -} // namespace PokemonFRLG -} // namespace NintendoSwitch -} // namespace PokemonAutomation +} // namespace PokemonFRLG +} // namespace NintendoSwitch +} // namespace PokemonAutomation #endif diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryFieldSteps.h b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryFieldSteps.h new file mode 100644 index 0000000000..7712e128e1 --- /dev/null +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryFieldSteps.h @@ -0,0 +1,54 @@ +/* AutoStory Field Steps + * + * From: https://github.com/PokemonAutomation/ + * + * Table constructors for the GAME steps on the field: the hideout's + * switch and lift, Pokemon Centers, and items from the bag. + * + */ + +#ifndef PokemonAutomation_PokemonFRLG_AutoStoryFieldSteps_H +#define PokemonAutomation_PokemonFRLG_AutoStoryFieldSteps_H + +#include +#include +#include +#include "PokemonFRLG_AutoStoryTableSteps.h" + +namespace PokemonAutomation{ +namespace NintendoSwitch{ +namespace PokemonFRLG{ +namespace StoryTable{ + + +// Pushes the switch behind the Game Corner's poster the player faces +// (POSTER_SWITCH_VARIANT). +StoryStep poster_switch(std::string name, std::string why); + +// Rides the Rocket Hideout's lift from the floor it stands at to `to` +// (LIFT_FLOOR_VARIANT): "B1F", "B2F", "B4F". The player starts below +// `from`'s lift door, facing north, and ends on `to`'s, facing south. +StoryStep lift_floor(std::string name, std::string_view from, std::string_view to, std::string why); + +// Into the Pokemon Center `center` (a map name) from below its door, +// facing north, to below the nurse's counter (CENTER_ENTER_VARIANT): the +// same script in every Center, with no map of its rooms. +StoryStep center_enter(std::string name, const std::string& center, std::string why); + +// Out of the Center from below the nurse's counter (CENTER_EXIT_VARIANT) +// to `below_door`, the tile below its door outside, facing south. +StoryStep center_exit(std::string name, Pokemon::Pose below_door, std::string why); + +// Uses `item` from the bag on the overworld (USE_ITEM_VARIANT): a +// Repel, or an Escape Rope, which leaves the player on `pose_after`. +StoryStep use_item(std::string name, std::string_view item, std::string why, std::optional pose_after = std::nullopt); + +// Gets on the Bicycle (RIDE_BIKE_VARIANT). +StoryStep ride_bike(std::string name, std::string why); + + +} // namespace StoryTable +} // namespace PokemonFRLG +} // namespace NintendoSwitch +} // namespace PokemonAutomation +#endif diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryHideout.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryHideout.cpp index 77d1aac88c..7c648a746c 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryHideout.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryHideout.cpp @@ -7,10 +7,15 @@ #include #include "NintendoSwitch/Commands/NintendoSwitch_Commands_PushButtons.h" #include "VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldWalk.h" +#include "VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldBike.h" #include "PokemonFRLG_AutoStoryActions.h" #include "PokemonFRLG_AutoStoryHideout.h" +#include "PokemonFRLG_AutoStoryHideoutLift.h" #include "PokemonFRLG_AutoStoryItemUse.h" +#include "PokemonFRLG_AutoStoryBagUse.h" +#include "PokemonFRLG_AutoStoryBag.h" #include "PokemonFRLG_AutoStoryRooms.h" +#include "PokemonFRLG_AutoStoryRoomLegs.h" #include "PokemonFRLG_AutoStoryVariantWords.h" namespace PokemonAutomation{ diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryHideout.h b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryHideout.h index 475c5cc9cd..f343157956 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryHideout.h +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryHideout.h @@ -50,38 +50,10 @@ inline constexpr Pokemon::StoryArgSpec LIFT_FLOOR_ARGS[] = { {"to", Pokemon::StoryArgType::TEXT, true}, }; -// The lift panel's menu, top first (pokefirered -// sMultichoiceList_RocketHideoutElevator): B1F, B2F, B4F, EXIT. -const std::vector& rocket_hideout_lift_menu(); - -// A ride: the menu rows the cursor starts on and is moved to. -struct LiftRide{ - size_t from = 0; - size_t to = 0; -}; -// The ride a lift_floor step names, or nothing if it is not one, or names -// a floor the panel hasn't. -std::optional parse_lift_floor_step(const Pokemon::StoryStep& step); - -// Presses of the D-pad on a menu: which way, how many. -struct MenuPresses{ - Pokemon::Direction direction = Pokemon::Direction::SOUTH; - size_t presses = 0; -}; -// The fewest presses that move the cursor from `ride.from` to `ride.to` -// on a menu of `entries` rows. A multichoice of more than three rows -// wraps round (pokefirered DrawVerticalMultichoiceMenu()). -MenuPresses lift_menu_presses(const LiftRide& ride, size_t entries); // Whether `step` is one of this file's steps. bool is_hideout_step(const Pokemon::StoryStep& step); -// On the console: A on the panel, the floor picked, the ride waited out -// back to the overworld, the player still in the lift. -void pick_lift_floor(ConsoleHandle& console, ProControllerContext& context, const LiftRide& ride); -// On the console, the whole ride: into the lift from below the door, -// the floor picked, out onto the floor's lift door. -void ride_lift(ConsoleHandle& console, ProControllerContext& context, const LiftRide& ride); // On the console: A on the poster, its message closed back to the // overworld. void push_poster_switch(ConsoleHandle& console, ProControllerContext& context); @@ -99,7 +71,6 @@ std::optional run_field_game_step( void add_tests_AutoStoryHideout(UnitTestDatabase& database); - } // namespace PokemonFRLG } // namespace NintendoSwitch } // namespace PokemonAutomation diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryHideoutLift.h b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryHideoutLift.h new file mode 100644 index 0000000000..0f782cae71 --- /dev/null +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryHideoutLift.h @@ -0,0 +1,64 @@ +/* AutoStory Hideout Lift + * + * From: https://github.com/PokemonAutomation/ + * + * Riding the Rocket Hideout's lift: its panel's menu, the presses that + * pick a floor, and the ride on the console. + * + */ + +#ifndef PokemonAutomation_PokemonFRLG_AutoStoryHideoutLift_H +#define PokemonAutomation_PokemonFRLG_AutoStoryHideoutLift_H + +#include +#include +#include +#include +#include "NintendoSwitch/Controllers/Procon/NintendoSwitch_ProController.h" +#include "NintendoSwitch/NintendoSwitch_ConsoleHandle.h" +#include "Pokemon/AutoStory/Pokemon_StorySteps.h" +#include "Pokemon/Navigation/Pokemon_Grid.h" + +namespace PokemonAutomation{ +namespace NintendoSwitch{ +namespace PokemonFRLG{ + + +// The lift panel's menu, top first (pokefirered +// sMultichoiceList_RocketHideoutElevator): B1F, B2F, B4F, EXIT. +const std::vector& rocket_hideout_lift_menu(); + +// A ride: the menu rows the cursor starts on and is moved to. +struct LiftRide{ + size_t from = 0; + size_t to = 0; +}; + +// The ride a lift_floor step names, or nothing if it is not one, or names +// a floor the panel hasn't. +std::optional parse_lift_floor_step(const Pokemon::StoryStep& step); + +// Presses of the D-pad on a menu: which way, how many. +struct MenuPresses{ + Pokemon::Direction direction = Pokemon::Direction::SOUTH; + size_t presses = 0; +}; + +// The fewest presses that move the cursor from `ride.from` to `ride.to` +// on a menu of `entries` rows. A multichoice of more than three rows +// wraps round (pokefirered DrawVerticalMultichoiceMenu()). +MenuPresses lift_menu_presses(const LiftRide& ride, size_t entries); + +// On the console: A on the panel, the floor picked, the ride waited out +// back to the overworld, the player still in the lift. +void pick_lift_floor(ConsoleHandle& console, ProControllerContext& context, const LiftRide& ride); + +// On the console, the whole ride: into the lift from below the door, +// the floor picked, out onto the floor's lift door. +void ride_lift(ConsoleHandle& console, ProControllerContext& context, const LiftRide& ride); + + +} // namespace PokemonFRLG +} // namespace NintendoSwitch +} // namespace PokemonAutomation +#endif diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryHideout_Tests.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryHideout_Tests.cpp index 0df832e8fb..e84ba87ea8 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryHideout_Tests.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryHideout_Tests.cpp @@ -9,13 +9,17 @@ #include #include "Common/Cpp/TestRunners/UnitTest.h" #include "VideoGames/PokemonFRLG/Overworld/PokemonFRLG_CodedRooms.h" +#include "VideoGames/PokemonFRLG/Overworld/PokemonFRLG_HideoutLiftRoom.h" #include "VideoGames/PokemonFRLG/Overworld/PokemonFRLG_MovementMechanics.h" #include "VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldMaps.h" #include "VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSim.h" #include "PokemonFRLG_AutoStoryHideout.h" +#include "PokemonFRLG_AutoStoryHideoutLift.h" #include "PokemonFRLG_AutoStoryRowSim.h" #include "PokemonFRLG_AutoStoryTableSteps.h" +#include "PokemonFRLG_AutoStoryFieldSteps.h" #include "PokemonFRLG_AutoStoryVariantWords.h" +#include "VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSpin.h" namespace PokemonAutomation{ namespace NintendoSwitch{ @@ -213,7 +217,7 @@ struct AutoStoryHideoutBodyInput{ UnitTestResult (*body)(); }; struct AutoStoryHideoutBodyExpectation{ - const char* description; + std::string description; }; struct AutoStoryHideoutBodyCase{ AutoStoryHideoutBodyInput input; diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryItemUse.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryItemUse.cpp index 5f8ecc77aa..d1b7ecb16d 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryItemUse.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryItemUse.cpp @@ -10,6 +10,8 @@ #include "PokemonFRLG_AutoStoryActions.h" #include "PokemonFRLG_AutoStoryEvents.h" #include "PokemonFRLG_AutoStoryItemUse.h" +#include "PokemonFRLG_AutoStoryBagUse.h" +#include "PokemonFRLG_AutoStoryBag.h" #include "PokemonFRLG_AutoStoryVariantWords.h" namespace PokemonAutomation{ @@ -65,7 +67,7 @@ std::optional bag_row_of(const std::vector& rows, std::string_vi return std::nullopt; } -const char* item_use_end_name(ItemUseEnd end){ +std::string item_use_end_name(ItemUseEnd end){ switch (end){ case ItemUseEnd::USED: return "used"; diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryItemUse.h b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryItemUse.h index 780a5ce463..f19b161c35 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryItemUse.h +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryItemUse.h @@ -45,25 +45,16 @@ inline constexpr Pokemon::StoryArgSpec USE_ITEM_ARGS[] = { // (OverworldWalkSteps::get_on_bike()). The ROUTE steps after it ride // (BIKE_VARIANT). inline const std::string RIDE_BIKE_VARIANT = "ride_bike"; +// The variant of a ROUTE or LEGS step ridden on the Bicycle, mounted by a +// RIDE_BIKE_VARIANT step before it. +// Indoors, where the game doesn't let the player ride, it walks. +inline const std::string BIKE_VARIANT = "bike"; // The GAME step that registers the Bicycle for SELECT: the Key Items // pocket's BICYCLE, REGISTER, its menu's second option. Once a save: // the registration is saved with the game, and a save made before it // doesn't have it. inline const std::string REGISTER_BIKE_VARIANT = "register_bike"; -// The bag's pockets, in the order LEFT and RIGHT go through them. -enum class BagPocket{ - ITEMS, - KEY_ITEMS, - POKE_BALLS, -}; - -// The pocket of an item the story uses from the bag: repel, super-repel, -// max-repel, escape-rope (Items) or bicycle (Key Items); nothing for -// another. -std::optional usable_item_pocket(std::string_view item); -// Whether `item` is a Repel of any kind. -bool is_repel(std::string_view item); // The item a use_item step uses, or nothing if it isn't one, the item // isn't one the story uses from the bag, or it names a slot. @@ -71,75 +62,11 @@ std::optional parse_use_item_step(const Pokemon::StoryStep& step); // Whether `step` is one of this file's steps. bool is_item_use_step(const Pokemon::StoryStep& step); -// The row of `item` in `rows` (read_bag_pocket()'s, from the top), if it -// has one left: a count of -1 (unread) counts as some. -std::optional bag_row_of(const std::vector& rows, std::string_view item); - - -// The bag, as use_item_from_bag() drives it: the console's, or a test's. -class ItemUseActions{ -public: - virtual ~ItemUseActions() = default; - // From the overworld, opens the bag on `pocket`, scrolled to its top. - virtual bool open_pocket(BagPocket pocket) = 0; - // The open pocket's rows, from the top. - virtual std::vector read_pocket() = 0; - // Moves to row `row`, USE, and through what the item says. - virtual void use_row(size_t row) = 0; - // Moves to row `row` and REGISTERs it for SELECT. - virtual void register_row(size_t row) = 0; - // Back to the overworld (nothing to do if the item closed the bag). - virtual void close_bag() = 0; -}; - -// How use_item_from_bag() ended. -enum class ItemUseEnd{ - USED, - // The pocket has none left (or the name isn't read). - NONE_LEFT, - // The bag didn't open. - NO_BAG, - // Not an item the story uses from the bag. - UNKNOWN_ITEM, -}; -// "used", "none_left": the end's name in logs and failures. -const char* item_use_end_name(ItemUseEnd end); - -// Opens the item's pocket, finds it and uses it, then back to the -// overworld. -ItemUseEnd use_item_from_bag(Logger& logger, ItemUseActions& actions, std::string_view item); -// The same, REGISTERing it for SELECT (the Bicycle) instead of USE. -ItemUseEnd register_item_in_bag(Logger& logger, ItemUseActions& actions, std::string_view item); - -// After "REPEL's effect wore off..." has closed: FRLG asks nothing, so -// another of the same Repel is used if the bag has one. NONE_LEFT is no -// failure: the walk goes on without. -ItemUseEnd renew_repel(Logger& logger, ItemUseActions& actions, std::string_view item); - - -// The console's bag. -class ConsoleItemUseActions : public ItemUseActions{ -public: - ConsoleItemUseActions(ConsoleHandle& console, ProControllerContext& context, Language language); - - virtual bool open_pocket(BagPocket pocket) override; - virtual std::vector read_pocket() override; - virtual void use_row(size_t row) override; - virtual void register_row(size_t row) override; - virtual void close_bag() override; - -private: - ConsoleHandle& m_console; - ProControllerContext& m_context; - Language m_language; -}; - // Registers the item use tests. void add_tests_AutoStoryItemUse(UnitTestDatabase& database); - } // namespace PokemonFRLG } // namespace NintendoSwitch } // namespace PokemonAutomation diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryItemUse_Tests.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryItemUse_Tests.cpp index 66c2f36a92..82900c7f7a 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryItemUse_Tests.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryItemUse_Tests.cpp @@ -14,9 +14,12 @@ #include "Common/Cpp/Logging/AbstractLogger.h" #include "Common/Cpp/TestRunners/UnitTest.h" #include "VideoGames/PokemonFRLG/Overworld/PokemonFRLG_MovementMechanics.h" +#include "VideoGames/PokemonFRLG/Overworld/PokemonFRLG_BikeSpinMechanics.h" #include "VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldWalk.h" #include "PokemonFRLG_AutoStoryEvents.h" #include "PokemonFRLG_AutoStoryItemUse.h" +#include "PokemonFRLG_AutoStoryBagUse.h" +#include "PokemonFRLG_AutoStoryBag.h" #include "PokemonFRLG_AutoStoryVariantWords.h" namespace PokemonAutomation{ @@ -216,7 +219,7 @@ struct AutoStoryItemUseBodyInput{ UnitTestResult (*body)(); }; struct AutoStoryItemUseBodyExpectation{ - const char* description; + std::string description; }; struct AutoStoryItemUseBodyCase{ AutoStoryItemUseBodyInput input; diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryPaceSim_Tests.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryPaceSim_Tests.cpp index 1f4d740bc8..a796111168 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryPaceSim_Tests.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryPaceSim_Tests.cpp @@ -19,6 +19,8 @@ #include "PokemonFRLG_AutoStoryEvents.h" #include "PokemonFRLG_AutoStoryPaceSim.h" #include "PokemonFRLG_AutoStoryPacing.h" +#include "VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSimField.h" +#include "VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldBike.h" namespace PokemonAutomation{ namespace NintendoSwitch{ diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryPacing.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryPacing.cpp index 40aca3b218..fff4f60541 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryPacing.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryPacing.cpp @@ -7,7 +7,9 @@ #include "CommonFramework/VideoPipeline/VideoFeed.h" #include "NintendoSwitch/Commands/NintendoSwitch_Commands_PushButtons.h" #include "VideoGames/PokemonFRLG/Overworld/PokemonFRLG_MovementMechanics.h" +#include "VideoGames/PokemonFRLG/Overworld/PokemonFRLG_BikeSpinPresses.h" #include "PokemonFRLG_AutoStoryPacing.h" +#include "VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldBike.h" namespace PokemonAutomation{ namespace NintendoSwitch{ diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryPacing.h b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryPacing.h index c8cf49e2e2..7c36a7674a 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryPacing.h +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryPacing.h @@ -14,6 +14,7 @@ #include "NintendoSwitch/Controllers/Procon/NintendoSwitch_ProController.h" #include "NintendoSwitch/NintendoSwitch_ConsoleHandle.h" #include "VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldWalk.h" +#include "VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldBike.h" #include "PokemonFRLG_AutoStoryCapture.h" namespace PokemonAutomation{ diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRoomLegs.h b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRoomLegs.h new file mode 100644 index 0000000000..aa8fc199a9 --- /dev/null +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRoomLegs.h @@ -0,0 +1,44 @@ +/* AutoStory Room Legs + * + * From: https://github.com/PokemonAutomation/ + * + * The scripted legs through a Pokemon Center and the Rocket Hideout's + * lift. + * + */ + +#ifndef PokemonAutomation_PokemonFRLG_AutoStoryRoomLegs_H +#define PokemonAutomation_PokemonFRLG_AutoStoryRoomLegs_H + +#include +#include +#include "PokemonFRLG_AutoStoryRooms.h" + +namespace PokemonAutomation{ +namespace NintendoSwitch{ +namespace PokemonFRLG{ + + +// Into a Center: north through the door, north 4 to the nurse. +const std::vector& center_enter_legs(); + +// Out of a Center: south 4 to the mat, south through the door. +const std::vector& center_exit_legs(); + +// Into the hideout's lift, from below a floor's lift door facing north: +// north through the door onto LIFT_ARRIVAL, north 2, west 2 to below the +// panel (LIFT_PANEL_FRONT), facing it. +const std::vector& lift_in_legs(); + +// Out of the lift, from below the panel: east 2, south 2 onto the arrow +// warp, south through it, onto the floor picked's lift door. +const std::vector& lift_out_legs(); + +// The legs of the Center's step `variant`; empty if it isn't one. +const std::vector& center_legs(std::string_view variant); + + +} // namespace PokemonFRLG +} // namespace NintendoSwitch +} // namespace PokemonAutomation +#endif diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRooms.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRooms.cpp index 52de05543b..e6dbf9cb22 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRooms.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRooms.cpp @@ -7,6 +7,7 @@ #include "VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldWalk.h" #include "PokemonFRLG_AutoStoryActions.h" #include "PokemonFRLG_AutoStoryRooms.h" +#include "PokemonFRLG_AutoStoryRoomLegs.h" namespace PokemonAutomation{ namespace NintendoSwitch{ diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRooms.h b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRooms.h index ee5b3d9f91..3cb36443b0 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRooms.h +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRooms.h @@ -47,19 +47,6 @@ struct RoomLeg{ int tiles = 0; bool warps = false; }; -// Into a Center: north through the door, north 4 to the nurse. -const std::vector& center_enter_legs(); -// Out of a Center: south 4 to the mat, south through the door. -const std::vector& center_exit_legs(); -// Into the hideout's lift, from below a floor's lift door facing north: -// north through the door onto LIFT_ARRIVAL, north 2, west 2 to below the -// panel (LIFT_PANEL_FRONT), facing it. -const std::vector& lift_in_legs(); -// Out of the lift, from below the panel: east 2, south 2 onto the arrow -// warp, south through it, onto the floor picked's lift door. -const std::vector& lift_out_legs(); -// The legs of the Center's step `variant`; empty if it isn't one. -const std::vector& center_legs(std::string_view variant); // On the console: the legs, a step tap a tile (step_once()), each warp's // fade waited out. `facing` is the way the player faces at the start, if @@ -74,7 +61,6 @@ void walk_room_legs( void add_tests_AutoStoryRooms(UnitTestDatabase& database); - } // namespace PokemonFRLG } // namespace NintendoSwitch } // namespace PokemonAutomation diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRooms_Tests.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRooms_Tests.cpp index 00884dc0b3..a314f95df8 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRooms_Tests.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRooms_Tests.cpp @@ -8,11 +8,13 @@ #include #include "Common/Cpp/TestRunners/UnitTest.h" #include "VideoGames/PokemonFRLG/Overworld/PokemonFRLG_CodedRooms.h" +#include "VideoGames/PokemonFRLG/Overworld/PokemonFRLG_PokemonCenterRoom.h" #include "VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldMaps.h" #include "VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSim.h" #include "PokemonFRLG_AutoStoryRooms.h" #include "PokemonFRLG_AutoStoryRowSim.h" #include "PokemonFRLG_AutoStoryTableSteps.h" +#include "PokemonFRLG_AutoStoryFieldSteps.h" namespace PokemonAutomation{ namespace NintendoSwitch{ @@ -62,7 +64,7 @@ std::string in_and_out(const std::string& town, const std::string& center){ const MapPosition below_door{town, door.next(Direction::SOUTH)}; OverworldSim sim(maps, below_door, Direction::NORTH); StoryPose at{town, below_door.point, Direction::NORTH}; - std::string failure = row_step_on_sim(sim, at, StoryTable::center_enter("to_nurse", center.c_str(), "test"), "test"); + std::string failure = row_step_on_sim(sim, at, StoryTable::center_enter("to_nurse", center, "test"), "test"); if (!failure.empty()){ return failure; } diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRowSim.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRowSim.cpp index e8e33c6b4a..91ce25068e 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRowSim.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRowSim.cpp @@ -18,8 +18,11 @@ #include "VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldMaps.h" #include "VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldWalk.h" #include "PokemonFRLG_AutoStoryHideout.h" +#include "PokemonFRLG_AutoStoryHideoutLift.h" #include "PokemonFRLG_AutoStoryRooms.h" +#include "PokemonFRLG_AutoStoryRoomLegs.h" #include "PokemonFRLG_AutoStoryRowSim.h" +#include "VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSimField.h" namespace PokemonAutomation{ namespace NintendoSwitch{ diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryTableSteps.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryTableSteps.cpp index d9815af8dc..28daae9c8f 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryTableSteps.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryTableSteps.cpp @@ -5,10 +5,14 @@ */ #include "VideoGames/PokemonFRLG/Overworld/PokemonFRLG_CodedRooms.h" +#include "VideoGames/PokemonFRLG/Overworld/PokemonFRLG_HideoutLiftRoom.h" +#include "VideoGames/PokemonFRLG/Overworld/PokemonFRLG_PokemonCenterRoom.h" #include "PokemonFRLG_AutoStoryHideout.h" +#include "PokemonFRLG_AutoStoryHideoutLift.h" #include "PokemonFRLG_AutoStoryItemUse.h" #include "PokemonFRLG_AutoStoryRooms.h" #include "PokemonFRLG_AutoStoryTableSteps.h" +#include "PokemonFRLG_AutoStoryFieldSteps.h" namespace PokemonAutomation{ namespace NintendoSwitch{ @@ -175,10 +179,10 @@ StoryStep lift_floor(std::string name, std::string_view from, std::string_view t return step; } -StoryStep center_enter(std::string name, const char* center, std::string why){ +StoryStep center_enter(std::string name, const std::string& center, std::string why){ StoryStep step = make(StoryStepKind::GAME, std::move(name), std::move(why)); step.variant = CENTER_ENTER_VARIANT; - step.pose_after = at(center, CENTER_NURSE_FRONT.x, CENTER_NURSE_FRONT.y, Direction::NORTH); + step.pose_after = at(center.c_str(), CENTER_NURSE_FRONT.x, CENTER_NURSE_FRONT.y, Direction::NORTH); return step; } diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryTableSteps.h b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryTableSteps.h index f562000d58..00d2012393 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryTableSteps.h +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryTableSteps.h @@ -183,25 +183,6 @@ StoryStep options_step(); // Cuts the tree the player faces (CUT_TREE_VARIANT) and steps onto its // tile, `tree`, facing the way the step goes. StoryStep cut_tree(std::string name, Pokemon::Pose tree, std::string why); -// Pushes the switch behind the Game Corner's poster the player faces -// (POSTER_SWITCH_VARIANT). -StoryStep poster_switch(std::string name, std::string why); -// Rides the Rocket Hideout's lift from the floor it stands at to `to` -// (LIFT_FLOOR_VARIANT): "B1F", "B2F", "B4F". The player starts below -// `from`'s lift door, facing north, and ends on `to`'s, facing south. -StoryStep lift_floor(std::string name, std::string_view from, std::string_view to, std::string why); -// Into the Pokemon Center `center` (a map name) from below its door, -// facing north, to below the nurse's counter (CENTER_ENTER_VARIANT): the -// same script in every Center, with no map of its rooms. -StoryStep center_enter(std::string name, const char* center, std::string why); -// Out of the Center from below the nurse's counter (CENTER_EXIT_VARIANT) -// to `below_door`, the tile below its door outside, facing south. -StoryStep center_exit(std::string name, Pokemon::Pose below_door, std::string why); -// Uses `item` from the bag on the overworld (USE_ITEM_VARIANT): a -// Repel, or an Escape Rope, which leaves the player on `pose_after`. -StoryStep use_item(std::string name, std::string_view item, std::string why, std::optional pose_after = std::nullopt); -// Gets on the Bicycle (RIDE_BIKE_VARIANT). -StoryStep ride_bike(std::string name, std::string why); } // namespace StoryTable diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryVermilionGym_Tests.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryVermilionGym_Tests.cpp index 2f70ad11b1..17a9b016b8 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryVermilionGym_Tests.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryVermilionGym_Tests.cpp @@ -25,6 +25,7 @@ #include "VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldMaps.h" #include "VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldRoute.h" #include "VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSim.h" +#include "VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSimField.h" #include "PokemonFRLG_AutoStoryDamage.h" #include "PokemonFRLG_AutoStoryEvents.h" #include "PokemonFRLG_AutoStoryGrind.h" diff --git a/SerialPrograms/cmake/SourceFiles.cmake b/SerialPrograms/cmake/SourceFiles.cmake index 3f8d707db9..25b636266e 100644 --- a/SerialPrograms/cmake/SourceFiles.cmake +++ b/SerialPrograms/cmake/SourceFiles.cmake @@ -1861,9 +1861,13 @@ file(GLOB LIBRARY_SOURCES Source/VideoGames/PokemonFRLG/Inference/Sounds/PokemonFRLG_CatchFanfareDetector.h Source/VideoGames/PokemonFRLG/Inference/Sounds/PokemonFRLG_ShinySoundDetector.cpp Source/VideoGames/PokemonFRLG/Inference/Sounds/PokemonFRLG_ShinySoundDetector.h + Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_BikeSpinMechanics.h + Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_BikeSpinPresses.h Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_CodedRooms.cpp Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_CodedRooms.h + Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_HideoutLiftRoom.h Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_MovementMechanics.h + Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldBike.h Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldBikeTaps.cpp Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldBikeTaps.h Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldBike_Tests.cpp @@ -1889,9 +1893,11 @@ file(GLOB LIBRARY_SOURCES Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldRoute_Tests.cpp Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSim.cpp Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSim.h + Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSimField.h Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSimTaps.cpp Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSimField.cpp Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSim_Tests.cpp + Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSpin.h Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSpin_Tests.cpp Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldWalk.cpp Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldWalk.h @@ -1899,6 +1905,7 @@ file(GLOB LIBRARY_SOURCES Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldWarpFade_Tests.cpp Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_PlayerFacingReader.cpp Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_PlayerFacingReader.h + Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_PokemonCenterRoom.h Source/VideoGames/PokemonFRLG/PokemonFRLG_Navigation.cpp Source/VideoGames/PokemonFRLG/PokemonFRLG_Navigation.h Source/VideoGames/PokemonFRLG/PokemonFRLG_Panels.cpp @@ -1914,6 +1921,8 @@ file(GLOB LIBRARY_SOURCES Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryAbilities_Tests.cpp Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryActions.cpp Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryActions.h + Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryBag.h + Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryBagUse.h Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryBattle.cpp Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryBattle.h Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryBattleData.cpp @@ -1935,6 +1944,7 @@ file(GLOB LIBRARY_SOURCES Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryDamage.h Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryEvents.cpp Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryEvents.h + Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryFieldSteps.h Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryFoeTracker.cpp Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryFoeTracker.h Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryGrind.cpp @@ -1943,6 +1953,7 @@ file(GLOB LIBRARY_SOURCES Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryHideout.cpp Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryHideout.h Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryHideout_Tests.cpp + Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryHideoutLift.h Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryItemUse.cpp Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryItemUse.h Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryItemUse_Tests.cpp @@ -1974,6 +1985,7 @@ file(GLOB LIBRARY_SOURCES Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRngLoop_Tests.cpp Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRngOptions.cpp Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRngOptions.h + Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRoomLegs.h Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRooms.cpp Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRooms.h Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRooms_Tests.cpp From 1d619d9347ee1279150a8aa872d2ac3c30c3d925 Mon Sep 17 00:00:00 2001 From: dayfine Date: Tue, 10 Nov 2026 00:07:12 -0800 Subject: [PATCH 34/79] FRLG AutoStory 00.31: Celadon Game Corner to the Rocket Hideout's LIFT KEY as an authored plan From Celadon's Pokemon Center: the Game Corner's poster Grunt, the poster switch, the hideout down to B4F's Lift Key Grunt, the LIFT KEY, and back up to B3F below its Rare Candy. Celadon's Center has no map file, so its coded ground floor is added to the story maps and the plan walks out of it as 00.30 walks out of Lavender's. A step north onto the Grunt's tile after his battle (he is removed by the script); B2F goes round east of the turning Grunt (20, 6) and up column 21 to the stairs. The fault sweep and the row test hide a talk-started battle's trainer once the script removes them (talk_battle_hide_flag()). The story-wide tests count 00.31; the sim trace golden gains its lines only. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss --- .../Overworld/PokemonFRLG_OverworldMaps.cpp | 28 +++++++++ .../PokemonFRLG_AutoStoryFaultSweep_Tests.cpp | 30 +++++++++- .../PokemonFRLG_AutoStoryFaultSweep_Tests.h | 8 +++ .../PokemonFRLG_AutoStoryLavender_Tests.cpp | 43 +++++++++++++ .../PokemonFRLG_AutoStoryRunPlan_Tests.cpp | 8 +-- .../AutoStory/PokemonFRLG_AutoStory_Tests.cpp | 10 ++-- .../ReplayData/frlg-story-sim-trace.json | 60 +++++++++++++++++-- .../AutoStory/StoryData/Draft/README.md | 2 +- .../{Draft => }/frlg-00.31.plan.json | 36 +++++++---- 9 files changed, 197 insertions(+), 28 deletions(-) rename SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/{Draft => }/frlg-00.31.plan.json (67%) diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldMaps.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldMaps.cpp index 69ac64c188..4c9eeb3f6c 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldMaps.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldMaps.cpp @@ -8,6 +8,7 @@ #include "Common/Cpp/Exceptions.h" #include "Common/Cpp/Json/JsonValue.h" #include "PokemonFRLG_OverworldMaps.h" +#include "PokemonFRLG_PokemonCenterRoom.h" namespace PokemonAutomation{ namespace NintendoSwitch{ @@ -92,18 +93,45 @@ const char* const MAP_NAMES[] = { "UndergroundPath_WestEntrance", "Route7", "CeladonCity", + // The Game Corner's poster and the Rocket Hideout down to B4F. + "CeladonCity_GameCorner", + "RocketHideout_B1F", + "RocketHideout_B2F", + "RocketHideout_B3F", + "RocketHideout_B4F", "CeruleanCave_1F", "CeruleanCave_2F", "CeruleanCave_B1F", }; +// Whether `maps` has a map named `name`. +bool has_map(const std::vector& maps, const std::string& name){ + return std::any_of(maps.begin(), maps.end(), [&](const MapData& map){ return map.name == name; }); +} + +// The coded room (pokemon_center_room()) of each Pokemon Center whose +// door is on one of `maps` but which has no map file of its own: +// Celadon City's. +void add_unmapped_centers(std::vector& maps){ + const size_t towns = maps.size(); + for (size_t town = 0; town < towns; town++){ + for (const MapWarp& warp : maps[town].warps){ + if (warp.to && is_pokemon_center(warp.to->map) && !has_map(maps, warp.to->map)){ + add_pokemon_center_room(maps, town); + break; + } + } + } +} + const std::vector& all_maps(){ static const std::vector MAPS = []{ std::vector maps; for (const char* name : MAP_NAMES){ maps.push_back(load_map(name)); } + add_unmapped_centers(maps); return maps; }(); return MAPS; diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryFaultSweep_Tests.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryFaultSweep_Tests.cpp index 61a208d570..4292dcbf93 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryFaultSweep_Tests.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryFaultSweep_Tests.cpp @@ -174,6 +174,12 @@ bool walks_after(const StoryCheckpoint& row, size_t c){ }); } +// By the battle's map and name. The Game Corner's Grunt walks off once +// beaten (CeladonCity_GameCorner_Text_DefeatedGrunt: removeobject). +const std::map, std::string> TALK_BATTLE_HIDE_FLAGS{ + {{"CeladonCity_GameCorner", "rocket_grunt"}, "FLAG_HIDE_GAME_CORNER_ROCKET"}, +}; + // Whether `failure` is a script the sim does not have: a scene's trigger // stepped onto (no trainer sees the player there) or a leader's battle // after a talk (no trainer's message up). @@ -195,7 +201,8 @@ RowRun run_row( RowRun out; std::optional off_maps; StoryPose at = *story_pose(*row.start); - auto sim = std::make_unique(sweep_maps(), MapPosition{at.map, at.tile}, at.facing.value_or(Direction::SOUTH), script); + std::vector maps = sweep_maps(); + auto sim = std::make_unique(maps, MapPosition{at.map, at.tile}, at.facing.value_or(Direction::SOUTH), script); const auto add = [&out](const SimState& state){ out.time += state.time; out.steps += state.steps; @@ -216,6 +223,12 @@ RowRun run_row( continue; } at = *story_pose(*step.pose_after); + const std::optional hidden = talk_battle_hide_flag(step); + if (let_pass && hidden){ + for (MapData& map : maps){ + hide_objects(map, {*hidden}); + } + } const auto landing = landings.find(c); const MapPosition land{at.map, landing == landings.end() ? at.tile : landing->second}; if (!map_loaded(land.map)){ @@ -224,9 +237,9 @@ RowRun run_row( out.failure = walks_after(row, c) ? std::format("{}/{}: ends on {}, which has no map, with a walk after it.", row.id, step.name, land.map) : ""; break; } - if (!(sim->state().position == land)){ + if (!(sim->state().position == land) || (let_pass && hidden)){ add(sim->state()); - sim = std::make_unique(sweep_maps(), land, at.facing.value_or(sim->state().facing), script); + sim = std::make_unique(maps, land, at.facing.value_or(sim->state().facing), script); } } if (out.failure.empty() && !sim->state().violations.empty()){ @@ -545,6 +558,17 @@ const FaultSweepCase FAULT_SWEEP_CASES[] = { {.input = {.fault = FaultClass::LOST_TAP}, .expectation = {}}, }; +std::optional talk_battle_hide_flag(const StoryStep& step){ + if (step.kind != StoryStepKind::BATTLE || !step.pose_after){ + return std::nullopt; + } + const auto found = TALK_BATTLE_HIDE_FLAGS.find({step.pose_after->map, step.name}); + if (found == TALK_BATTLE_HIDE_FLAGS.end()){ + return std::nullopt; + } + return found->second; +} + void add_tests_AutoStoryFaultSweep(UnitTestDatabase& database){ for (const FaultSweepCase& item : FAULT_SWEEP_CASES){ for (const StoryCheckpoint& row : story_checkpoints()){ diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryFaultSweep_Tests.h b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryFaultSweep_Tests.h index cda979a2f3..32f3fd1951 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryFaultSweep_Tests.h +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryFaultSweep_Tests.h @@ -7,13 +7,21 @@ #ifndef PokemonAutomation_PokemonFRLG_AutoStoryFaultSweep_Tests_H #define PokemonAutomation_PokemonFRLG_AutoStoryFaultSweep_Tests_H +#include +#include #include "Common/Cpp/TestRunners/UnitTestDatabase.h" +#include "Pokemon/AutoStory/Pokemon_StorySteps.h" namespace PokemonAutomation{ namespace NintendoSwitch{ namespace PokemonFRLG{ +// The hide flag the script of `step`, a battle a talk starts, sets when +// the trainer leaves after it: the sim, which plays no such battle, must +// hide them for the row to go on. +std::optional talk_battle_hide_flag(const Pokemon::StoryStep& step); + // Each class of console failure injected at every row of the story on the // overworld sim; the rows the program still fails are known failing // (PokemonFRLG_AutoStoryFaultSweep_Tests.cpp). diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryLavender_Tests.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryLavender_Tests.cpp index 3b4c0f3fc6..8c3bb9795f 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryLavender_Tests.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryLavender_Tests.cpp @@ -15,6 +15,7 @@ #include #include #include +#include #include #include #include @@ -709,6 +710,47 @@ UnitTestResult test_celadon_save_place(Logger&){ return true; } +// 00.31 on the sim: out of Celadon's Center, the Game Corner's poster +// Grunt, the switch, the Rocket Hideout down to B4F's Lift Key Grunt, the +// LIFT KEY, and back up to B3F below its Rare Candy. +// A battle a talk starts (the poster Grunt's) is the sim's to skip: it +// leaves the player where the plan says, and the trainer walks off +// (talk_battle_hide_flag()). +UnitTestResult test_hideout_row(Logger&){ + const StoryCheckpoint& row = checkpoint("00.31"); + StoryPose at = *story_pose(*row.start); + std::vector maps = maps_after_route10(); + auto sim = std::make_unique(maps, MapPosition{at.map, at.tile}, *at.facing); + std::vector fought; + for (const StoryStep& step : row.steps){ + const std::optional hidden = talk_battle_hide_flag(step); + if (!hidden){ + if (const std::string failure = row_step_on_sim(*sim, at, step, row.id); !failure.empty()){ + return "00.31: ended on " + to_string(sim->state().position) + "; " + failure; + } + continue; + } + at = *story_pose(*step.pose_after); + for (MapData& map : maps){ + hide_objects(map, {*hidden}); + } + fought = sim->state().trainers_beaten; + sim = std::make_unique(maps, MapPosition{at.map, at.tile}, *at.facing); + } + fought.insert(fought.end(), sim->state().trainers_beaten.begin(), sim->state().trainers_beaten.end()); + if (fought != std::vector{"rocket_m"}){ + return std::format("00.31: fought {} trainers on the sim, not the Lift Key Grunt alone.", fought.size()); + } + if (!sim->state().violations.empty()){ + return "00.31: a violation on the way: " + sim->state().violations.back(); + } + const MapPosition end{"RocketHideout_B3F", {12, 13}}; + if (!(sim->state().position == end)){ + return "00.31: ended on " + to_string(sim->state().position) + ", not " + to_string(end) + "."; + } + return true; +} + } // namespace @@ -731,6 +773,7 @@ const AutoStoryLavenderCase AUTO_STORY_LAVENDER_CASES[] = { {.input = {"00.30 a wild battle on the step into Route 7's grass", test_route7_grass_battles}, .expectation = {}}, {.input = {"00.30 Route 8 west from a start up to 3 tiles off", test_route8_west_off_start}, .expectation = {}}, {.input = {"00.30 saves in Celadon City's Pokemon Center", test_celadon_save_place}, .expectation = {}}, + {.input = {"00.31 the Game Corner's poster, the Rocket Hideout to B4F's LIFT KEY and B3F's Rare Candy", test_hideout_row}, .expectation = {}}, }; void add_tests_AutoStoryLavender(UnitTestDatabase& database){ diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRunPlan_Tests.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRunPlan_Tests.cpp index 430c754d9e..a5d02a435d 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRunPlan_Tests.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRunPlan_Tests.cpp @@ -138,7 +138,7 @@ class Test_RunPlan : public UnitTest{ const RunPlanScenario m_scenario; }; -const std::string TODAY = "00.01 00.02 00.03 00.04 00.05 00.06 00.07 00.08 00.09 00.10 00.11 00.12 00.12c 00.13 00.14 00.14b 00.14c 00.15 00.15b 00.16 00.17 00.18 00.19 00.20 00.21 00.22 00.23 00.24 00.25 00.26 00.27 00.28 00.29 00.30"; +const std::string TODAY = "00.01 00.02 00.03 00.04 00.05 00.06 00.07 00.08 00.09 00.10 00.11 00.12 00.12c 00.13 00.14 00.14b 00.14c 00.15 00.15b 00.16 00.17 00.18 00.19 00.20 00.21 00.22 00.23 00.24 00.25 00.26 00.27 00.28 00.29 00.30 00.31"; const RunPlanScenario RUN_PLAN_CASES[] = { { @@ -229,11 +229,11 @@ const RunPlanScenario RUN_PLAN_CASES[] = { }, { .input = {.name = "Gift RNG off: 00.12b is passed over", .first = "00.11"}, - .expectation = {.expected_ids = "00.11 00.12 00.12c 00.13 00.14 00.14b 00.14c 00.15 00.15b 00.16 00.17 00.18 00.19 00.20 00.21 00.22 00.23 00.24 00.25 00.26 00.27 00.28 00.29 00.30"}, + .expectation = {.expected_ids = "00.11 00.12 00.12c 00.13 00.14 00.14b 00.14c 00.15 00.15b 00.16 00.17 00.18 00.19 00.20 00.21 00.22 00.23 00.24 00.25 00.26 00.27 00.28 00.29 00.30 00.31"}, }, { .input = {.name = "Gift RNG off: 00.12b runs when started at", .first = "00.12b"}, - .expectation = {.expected_ids = "00.12b 00.12c 00.13 00.14 00.14b 00.14c 00.15 00.15b 00.16 00.17 00.18 00.19 00.20 00.21 00.22 00.23 00.24 00.25 00.26 00.27 00.28 00.29 00.30"}, + .expectation = {.expected_ids = "00.12b 00.12c 00.13 00.14 00.14b 00.14c 00.15 00.15b 00.16 00.17 00.18 00.19 00.20 00.21 00.22 00.23 00.24 00.25 00.26 00.27 00.28 00.29 00.30 00.31"}, }, { .input = { .name = "Gift RNG: started at 00.12b, from the save beside the salesman", @@ -258,7 +258,7 @@ const RunPlanScenario RUN_PLAN_CASES[] = { }, { .input = {.name = "Starter RNG alone: 00.12b runs when started at", .first = "00.12b", .handoffs = {.starter_rng = true}}, - .expectation = {.expected_ids = "00.12b 00.12c 00.13 00.14 00.14b 00.14c 00.15 00.15b 00.16 00.17 00.18 00.19 00.20 00.21 00.22 00.23 00.24 00.25 00.26 00.27 00.28 00.29 00.30"}, + .expectation = {.expected_ids = "00.12b 00.12c 00.13 00.14 00.14b 00.14c 00.15 00.15b 00.16 00.17 00.18 00.19 00.20 00.21 00.22 00.23 00.24 00.25 00.26 00.27 00.28 00.29 00.30 00.31"}, }, { .input = { .name = "Starter RNG first, with both on", diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStory_Tests.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStory_Tests.cpp index 174473bdc1..d81c8fe481 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStory_Tests.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStory_Tests.cpp @@ -230,8 +230,8 @@ UnitTestResult check_checkpoint(const StoryCheckpoint& checkpoint, StoryPose& po UnitTestResult test_routes_and_chain(){ const std::vector& checkpoints = story_checkpoints(); - if (checkpoints.size() != 37 || checkpoints[0].start){ - return "Expected 37 checkpoints, the first from a new game."; + if (checkpoints.size() != 38 || checkpoints[0].start){ + return "Expected 38 checkpoints, the first from a new game."; } StoryPose pose; for (size_t c = 0; c < checkpoints.size(); c++){ @@ -603,7 +603,7 @@ UnitTestResult check_lines(const StoryCheckpoint& checkpoint, std::set Date: Tue, 10 Nov 2026 00:07:38 -0800 Subject: [PATCH 35/79] FRLG AutoStory: the fault sweep's trainer hiding in its own function, for code health Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss --- .../PokemonFRLG_AutoStoryFaultSweep_Tests.cpp | 22 +++++++++++++------ 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryFaultSweep_Tests.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryFaultSweep_Tests.cpp index 4292dcbf93..288a6c4fb7 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryFaultSweep_Tests.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryFaultSweep_Tests.cpp @@ -188,6 +188,19 @@ bool unscripted(const std::string& failure){ || failure.find(": no_battle.") != std::string::npos; } +// Hides from `maps` the trainer who leaves after `step`, a battle a talk +// starts (talk_battle_hide_flag()). Returns whether there was one. +bool hide_talk_battle_trainer(std::vector& maps, const StoryStep& step){ + const std::optional hidden = talk_battle_hide_flag(step); + if (!hidden){ + return false; + } + for (MapData& map : maps){ + hide_objects(map, {*hidden}); + } + return true; +} + // Row `row` on the sim with `script`, from its start. After a step the sim // does not play, the player is put on its pose_after, or on `landings`' // tile for it, the program going on from the pose_after either way. A @@ -223,12 +236,7 @@ RowRun run_row( continue; } at = *story_pose(*step.pose_after); - const std::optional hidden = talk_battle_hide_flag(step); - if (let_pass && hidden){ - for (MapData& map : maps){ - hide_objects(map, {*hidden}); - } - } + const bool hidden = let_pass && hide_talk_battle_trainer(maps, step); const auto landing = landings.find(c); const MapPosition land{at.map, landing == landings.end() ? at.tile : landing->second}; if (!map_loaded(land.map)){ @@ -237,7 +245,7 @@ RowRun run_row( out.failure = walks_after(row, c) ? std::format("{}/{}: ends on {}, which has no map, with a walk after it.", row.id, step.name, land.map) : ""; break; } - if (!(sim->state().position == land) || (let_pass && hidden)){ + if (!(sim->state().position == land) || hidden){ add(sim->state()); sim = std::make_unique(maps, land, at.facing.value_or(sim->state().facing), script); } From 3ed6b4cb3bbcbc234c4e65b684435833db2633ba Mon Sep 17 00:00:00 2001 From: dayfine Date: Tue, 10 Nov 2026 00:25:15 -0800 Subject: [PATCH 36/79] FRLG Overworld: red sim test, a short first leg off the Rocket Hideout B3F stairs Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss --- .../PokemonFRLG_OverworldSim_Tests.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSim_Tests.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSim_Tests.cpp index 25d6f4bfc4..c8fd3a9d07 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSim_Tests.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSim_Tests.cpp @@ -488,6 +488,23 @@ UnitTestResult test_short_leg_unseen(){ return true; } +// 00.31 r1 (console B, 2026-11-10), Rocket Hideout B3F: off the stairs from +// B2F, the open leg west along the top corridor ended short, so the hold +// south to the wall stayed in the corridor, and the legs through the +// spinners after it all ran there: the walk ended a few tiles west of the +// stairs it came down, with no warp to B4F. +UnitTestResult test_short_leg_off_hideout_stairs(){ + SimCase c{.start = at("RocketHideout_B3F", 18, 2), .facing = Direction::EAST, .goal = arrival("RocketHideout_B4F", "warp_0")}; + for (const int short_by : {1, 2}){ + c.script.short_holds = {{1, short_by}}; + const SimRun now = run_case(c); + if (!arrived(now, c.goal)){ + return std::format("Expected B4F reached with the first leg {} tile(s) short:", short_by) + describe(now); + } + } + return true; +} + // r18 (console B, 2026-11-01), Pewter Gym: after Brock, Camper Liam sees // the player on the walk south to the door, walks up and battles. The // route holds on south to the door's mat; finding the player again at @@ -963,6 +980,7 @@ const OverworldSimCase OVERWORLD_SIM_CASES[] = { {.input = {"no hold over a ledge", test_no_hold_over_ledge}, .expectation = {},}, {.input = {"a short leg, then a sign", test_short_leg_then_sign}, .expectation = {},}, {.input = {"a short leg, nothing seen", test_short_leg_unseen}, .expectation = {},}, + {.input = {"a short leg off the hideout's stairs", test_short_leg_off_hideout_stairs}, .expectation = {},}, {.input = {"a trainer on the way out of Pewter Gym", test_trainer_on_way_out}, .expectation = {},}, {.input = {"out of Viridian Mart from the clerk's scene", test_mart_exit}, .expectation = {},}, {.input = {"Mt. Moon: down the ladders to B2F", test_mt_moon_ladders}, .expectation = {},}, From 9da5d77e560bc587b3efaa92e75933c680627f3c Mon Sep 17 00:00:00 2001 From: dayfine Date: Tue, 10 Nov 2026 00:28:41 -0800 Subject: [PATCH 37/79] FRLG Overworld: check open legs whose wall holds and way back walk up to 3 tiles per tile Rocket Hideout B3F's west 7 off the stairs from B2F ended short on console B (00.31 r1); the check skipped it since the hold to the west wall and back walks 18, over 2 per tile. The red sim test now passes. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss --- .../Overworld/PokemonFRLG_OverworldRecovery.cpp | 6 +++--- .../PokemonFRLG/Overworld/PokemonFRLG_OverworldRecovery.h | 7 +++++++ 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldRecovery.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldRecovery.cpp index 8cec6277b7..9ef2a168a9 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldRecovery.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldRecovery.cpp @@ -417,7 +417,7 @@ class RouteRun{ // with nothing to show it (r16), unless it ends on its tile from // wherever the leg left the player. If it doesn't, finds the player at // walls first; without such holds, or if they and the way back walk - // farther than the leg there and back, trusts the leg. Only there, and + // farther than OPEN_LEG_CHECK_TILES_PER_TILE times the leg, trusts the leg. Only there, and // only that far, to keep the check cheap: in Viridian Forest (r16) it // walks 10 tiles after "west 6", while after Route 1's "west 4" the // only holds walk 30. An open leg after a short one walks on off the @@ -434,8 +434,8 @@ class RouteRun{ return; } const std::optional anchor = plan_reanchor(*maps(), candidates, step, m_planning->costs); - if (!anchor || anchor->holds.empty() || reanchor_tiles(*anchor) > 2 * step.tiles){ - m_calls.log("Route: no holds to walls within " + std::to_string(2 * step.tiles) + " tiles find the player if " + to_string(step) + " ended short; taken as walked."); + if (!anchor || anchor->holds.empty() || reanchor_tiles(*anchor) > OPEN_LEG_CHECK_TILES_PER_TILE * step.tiles){ + m_calls.log("Route: no holds to walls within " + std::to_string(OPEN_LEG_CHECK_TILES_PER_TILE * step.tiles) + " tiles find the player if " + to_string(step) + " ended short; taken as walked."); return; } m_calls.log(std::format( diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldRecovery.h b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldRecovery.h index 88e18a679b..a26d9e9332 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldRecovery.h +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldRecovery.h @@ -87,6 +87,13 @@ enum class WallCheck{ // known (the forest drift), so this is what was seen, not a bound. constexpr int OPEN_LEG_SHORTFALL = 2; +// How far the holds that find the player after an open leg, and the way +// back, may walk, per tile of the leg. 2 left Rocket Hideout B3F's "west +// 7" off the stairs unchecked: the hold to its west wall and back walk up +// to 18, and the leg ended short (00.31 r1, console B, 2026-11-10). Route +// 1's "west 4", whose holds walk 30, stays unchecked. +constexpr int OPEN_LEG_CHECK_TILES_PER_TILE = 3; + // Where a leg onto a warp stopped when its fade was a wild battle's: the // battle's wipe passes for the fade (console B, 2026-11-03, Mt. Moon 1F), // so the stop isn't timed. The battle started on one of the leg's steps From e81230c92294b8ad223a4dbf317a4532abb21c84 Mon Sep 17 00:00:00 2001 From: dayfine Date: Tue, 10 Nov 2026 00:30:31 -0800 Subject: [PATCH 38/79] FRLG Overworld: the B3F short-leg sim test in the spinner tests, keeping the sim tests under 1000 lines Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss --- .../PokemonFRLG_OverworldSim_Tests.cpp | 18 ---------- .../PokemonFRLG_OverworldSpin_Tests.cpp | 35 +++++++++++++++++++ 2 files changed, 35 insertions(+), 18 deletions(-) diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSim_Tests.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSim_Tests.cpp index c8fd3a9d07..25d6f4bfc4 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSim_Tests.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSim_Tests.cpp @@ -488,23 +488,6 @@ UnitTestResult test_short_leg_unseen(){ return true; } -// 00.31 r1 (console B, 2026-11-10), Rocket Hideout B3F: off the stairs from -// B2F, the open leg west along the top corridor ended short, so the hold -// south to the wall stayed in the corridor, and the legs through the -// spinners after it all ran there: the walk ended a few tiles west of the -// stairs it came down, with no warp to B4F. -UnitTestResult test_short_leg_off_hideout_stairs(){ - SimCase c{.start = at("RocketHideout_B3F", 18, 2), .facing = Direction::EAST, .goal = arrival("RocketHideout_B4F", "warp_0")}; - for (const int short_by : {1, 2}){ - c.script.short_holds = {{1, short_by}}; - const SimRun now = run_case(c); - if (!arrived(now, c.goal)){ - return std::format("Expected B4F reached with the first leg {} tile(s) short:", short_by) + describe(now); - } - } - return true; -} - // r18 (console B, 2026-11-01), Pewter Gym: after Brock, Camper Liam sees // the player on the walk south to the door, walks up and battles. The // route holds on south to the door's mat; finding the player again at @@ -980,7 +963,6 @@ const OverworldSimCase OVERWORLD_SIM_CASES[] = { {.input = {"no hold over a ledge", test_no_hold_over_ledge}, .expectation = {},}, {.input = {"a short leg, then a sign", test_short_leg_then_sign}, .expectation = {},}, {.input = {"a short leg, nothing seen", test_short_leg_unseen}, .expectation = {},}, - {.input = {"a short leg off the hideout's stairs", test_short_leg_off_hideout_stairs}, .expectation = {},}, {.input = {"a trainer on the way out of Pewter Gym", test_trainer_on_way_out}, .expectation = {},}, {.input = {"out of Viridian Mart from the clerk's scene", test_mart_exit}, .expectation = {},}, {.input = {"Mt. Moon: down the ladders to B2F", test_mt_moon_ladders}, .expectation = {},}, diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSpin_Tests.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSpin_Tests.cpp index e17a69bda4..0a52517442 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSpin_Tests.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSpin_Tests.cpp @@ -193,6 +193,37 @@ UnitTestResult test_sim_walker_walks_slide(){ } +// 00.31 r1 (console B, 2026-11-10), Rocket Hideout B3F: off the stairs from +// B2F, the open leg west along the top corridor ended short, so the hold +// south to the wall stayed in the corridor, and the legs through the +// spinners after it all ran there: the walk ended a few tiles west of the +// stairs it came down, with no warp to B4F. +UnitTestResult test_short_leg_off_hideout_stairs(){ + static const std::vector maps = overworld_maps(); + const MapPosition start{"RocketHideout_B3F", {18, 2}}; + const MapPosition goal{"RocketHideout_B4F", map_point(maps, "RocketHideout_B4F", "warp_0")}; + const auto route = plan_overworld_route(maps, start, RouteGoal{goal, std::nullopt}, default_route_costs(), Direction::EAST); + if (!route){ + return std::string("No route from B3F's stairs to B4F."); + } + for (const int short_by : {1, 2}){ + SimScript script; + script.short_holds = {{1, short_by}}; + OverworldSim sim(maps, start, Direction::EAST, script); + OverworldSimWalker walker(sim); + const RoutePlanning planning{.maps = &maps, .costs = default_route_costs(), .start = start, .label = "Sim"}; + const std::string failure = walker.run(*route, planning); + if (!failure.empty() || !(sim.state().position == goal)){ + return std::format( + "With the first leg {} tile(s) short, walked to {}, failure \"{}\".", + short_by, to_string(sim.state().position), failure + ); + } + } + return true; +} + + // A lift whose door, the exit mat (1, 2), lets out on the floor picked. std::vector lift_maps(){ const std::string FLOOR = R"({ @@ -304,6 +335,10 @@ const SpinCase SPIN_CASES[] = { .input = {.name = "sim walker walks a slide", .body = test_sim_walker_walks_slide}, .expectation = {.description = "sim walker walks a slide"}, }, + { + .input = {.name = "a short leg off the hideout's stairs", .body = test_short_leg_off_hideout_stairs}, + .expectation = {.description = "B4F reached after a short first leg on B3F"}, + }, { .input = {.name = "lift lets out on the floor picked", .body = test_lift_floor}, .expectation = {.description = "lift lets out on the floor picked"}, From 95626157c314030eab2804775209650f470a613b Mon Sep 17 00:00:00 2001 From: dayfine Date: Tue, 10 Nov 2026 00:32:23 -0800 Subject: [PATCH 39/79] FRLG Overworld: the open-leg check's tiles-per-tile limit in the .cpp, off the header's symbol count Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss --- .../Overworld/PokemonFRLG_OverworldRecovery.cpp | 7 +++++++ .../PokemonFRLG/Overworld/PokemonFRLG_OverworldRecovery.h | 7 ------- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldRecovery.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldRecovery.cpp index 9ef2a168a9..20b343f9c1 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldRecovery.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldRecovery.cpp @@ -59,6 +59,13 @@ int sight_onto(const std::vector& maps, const MapPosition& tile){ return sight; } +// How far the holds that find the player after an open leg, and the way +// back, may walk, per tile of the leg. 2 left Rocket Hideout B3F's "west +// 7" off the stairs unchecked: the hold to its west wall and back walk up +// to 18, and the leg ended short (00.31 r1, console B, 2026-11-10). Route +// 1's "west 4", whose holds walk 30, stays unchecked. +constexpr int OPEN_LEG_CHECK_TILES_PER_TILE = 3; + // The tiles an open `step` from `start` may have ended on with nothing // seen: its end, and up to OPEN_LEG_SHORTFALL tiles before it. std::vector short_candidates(const std::vector& maps, const MapPosition& start, const RouteStep& step){ diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldRecovery.h b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldRecovery.h index a26d9e9332..88e18a679b 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldRecovery.h +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldRecovery.h @@ -87,13 +87,6 @@ enum class WallCheck{ // known (the forest drift), so this is what was seen, not a bound. constexpr int OPEN_LEG_SHORTFALL = 2; -// How far the holds that find the player after an open leg, and the way -// back, may walk, per tile of the leg. 2 left Rocket Hideout B3F's "west -// 7" off the stairs unchecked: the hold to its west wall and back walk up -// to 18, and the leg ended short (00.31 r1, console B, 2026-11-10). Route -// 1's "west 4", whose holds walk 30, stays unchecked. -constexpr int OPEN_LEG_CHECK_TILES_PER_TILE = 3; - // Where a leg onto a warp stopped when its fade was a wild battle's: the // battle's wipe passes for the fade (console B, 2026-11-03, Mt. Moon 1F), // so the stop isn't timed. The battle started on one of the leg's steps From 3484975e513566374dded6219a1a1206295fa851 Mon Sep 17 00:00:00 2001 From: dayfine Date: Tue, 10 Nov 2026 00:52:48 -0800 Subject: [PATCH 40/79] FRLG Overworld: check an open leg before a step onto a spinner 00.31 r1 run 3 (console B): on Rocket Hideout B3F, "south 2" from (1, 14) ended a tile short; "east 2" onto the arrow (3, 16) walked into the wall instead, the next position check mistook that wall for the one at (7, 20), and the later legs slid the player to the stop tile (10, 13). An open leg followed by a slide is now checked like one followed by a wall hold. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss --- .../PokemonFRLG_OverworldRecovery.cpp | 13 ++++++- .../Overworld/PokemonFRLG_OverworldRecovery.h | 3 +- .../PokemonFRLG_OverworldSpin_Tests.cpp | 38 +++++++++++++++++++ 3 files changed, 51 insertions(+), 3 deletions(-) diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldRecovery.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldRecovery.cpp index 20b343f9c1..c9f6dfc447 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldRecovery.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldRecovery.cpp @@ -82,6 +82,15 @@ bool is_wall_hold(const RouteStep& next){ return next.action == RouteAction::WALK && next.to_wall && !next.warps; } +// Whether `next` steps onto a spinner. From a tile short of its start it +// misses the arrow, or walks onto another, and ends elsewhere in the maze: +// "south 2" before Rocket Hideout B3F's "east 2" onto the arrow (3, 16) +// ended a tile short, the east leg walked into a wall, and the walk after +// it slid up to (10, 13) (00.31 r1 run 3, console B, 2026-11-10). +bool is_slide(const RouteStep& next){ + return next.action == RouteAction::WALK && next.spin_tiles && !next.warps; +} + // Whether `next`, a hold to a wall, ends on its planned tile from each of // `candidates`: then it finds the player itself. bool hold_finds(const std::vector& maps, const std::vector& candidates, const RouteStep& next){ @@ -432,12 +441,12 @@ class RouteRun{ void check_open_leg(const RouteStep& step, const std::optional& start){ if (maps() == nullptr || m_planning->open_leg_check != OpenLegCheck::REANCHOR || !start || step.action != RouteAction::WALK || step.to_wall || step.warps - || m_next >= m_plan.size() || !is_wall_hold(m_plan[m_next]) + || m_next >= m_plan.size() || !(is_wall_hold(m_plan[m_next]) || is_slide(m_plan[m_next])) ){ return; } const std::vector candidates = short_candidates(*maps(), *start, step); - if (candidates.size() < 2 || hold_finds(*maps(), candidates, m_plan[m_next])){ + if (candidates.size() < 2 || (is_wall_hold(m_plan[m_next]) && hold_finds(*maps(), candidates, m_plan[m_next]))){ return; } const std::optional anchor = plan_reanchor(*maps(), candidates, step, m_planning->costs); diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldRecovery.h b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldRecovery.h index 88e18a679b..52cbb9e1d1 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldRecovery.h +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldRecovery.h @@ -22,7 +22,8 @@ * (walked_before_warp()), and the way back goes on through the warp; * - an open leg that ended with nothing seen may still have ended up to * OPEN_LEG_SHORTFALL tiles short. When the next step is a hold to a - * wall that doesn't end on its tile from each of those, the player is + * wall that doesn't end on its tile from each of those, or a step onto + * a spinner (which a short start misses), the player is * found at walls the same way and walked back to the leg's end first. * When no holds find them, the leg is taken as walked, as before. * diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSpin_Tests.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSpin_Tests.cpp index 0a52517442..433eb39443 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSpin_Tests.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSpin_Tests.cpp @@ -224,6 +224,40 @@ UnitTestResult test_short_leg_off_hideout_stairs(){ } +// 00.31 r1 run 3 (console B, 2026-11-10), Rocket Hideout B3F: "south 2" +// from (1, 14), at the wall, ended a tile short at (1, 15) with nothing +// seen. "east 2", meant to step onto the arrow (3, 16), walked into the +// wall east of (1, 15); the position check after the next leg took that +// wall for the one east of the stop tile (7, 20) and found the player +// there. From column 1 the hold "east 11" stepped onto the arrow (2, 17), +// which slid them up round (6, 17) and (6, 13) to the stop tile (10, 13); +// the hold west onto the warp slid them back there round (6, 13) (frame: +// the player on (10, 13), the north arrow (10, 14) below). +UnitTestResult test_short_leg_before_hideout_arrows(){ + static const std::vector maps = overworld_maps(); + const MapPosition start{"RocketHideout_B3F", {1, 14}}; + const MapPosition goal{"RocketHideout_B4F", map_point(maps, "RocketHideout_B4F", "warp_0")}; + const auto route = plan_overworld_route(maps, start, RouteGoal{goal, std::nullopt}, default_route_costs(), Direction::WEST); + if (!route){ + return std::string("No route from B3F's west wall to B4F."); + } + for (const int short_by : {1, 2}){ + SimScript script; + script.short_holds = {{1, short_by}}; + OverworldSim sim(maps, start, Direction::WEST, script); + OverworldSimWalker walker(sim); + const RoutePlanning planning{.maps = &maps, .costs = default_route_costs(), .start = start, .label = "Sim"}; + const std::string failure = walker.run(*route, planning); + if (!failure.empty() || !(sim.state().position == goal)){ + return std::format( + "With the first leg {} tile(s) short, walked to {}, failure \"{}\":{}", + short_by, to_string(sim.state().position), failure, describe(*route) + ); + } + } + return true; +} + // A lift whose door, the exit mat (1, 2), lets out on the floor picked. std::vector lift_maps(){ const std::string FLOOR = R"({ @@ -339,6 +373,10 @@ const SpinCase SPIN_CASES[] = { .input = {.name = "a short leg off the hideout's stairs", .body = test_short_leg_off_hideout_stairs}, .expectation = {.description = "B4F reached after a short first leg on B3F"}, }, + { + .input = {.name = "a short leg before the hideout's arrows", .body = test_short_leg_before_hideout_arrows}, + .expectation = {.description = "B4F reached after a short leg to the arrow row on B3F"}, + }, { .input = {.name = "lift lets out on the floor picked", .body = test_lift_floor}, .expectation = {.description = "lift lets out on the floor picked"}, From f23905dd024addcd87ad14226f0239329b47bd89 Mon Sep 17 00:00:00 2001 From: dayfine Date: Tue, 10 Nov 2026 01:11:29 -0800 Subject: [PATCH 41/79] FRLG AutoStory 00.31: B3F's arrow floor as pokeguy's legs, a checked tap a tile Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss --- .../PokemonFRLG_OverworldBikeTaps.cpp | 20 +++++- .../Overworld/PokemonFRLG_OverworldBikeTaps.h | 21 ++++++- .../PokemonFRLG_OverworldRecoveryWalk.cpp | 61 +++++++++++++++---- .../Overworld/PokemonFRLG_OverworldRoute.h | 5 ++ .../Overworld/PokemonFRLG_OverworldSim.cpp | 4 +- .../Overworld/PokemonFRLG_OverworldSim.h | 3 + .../PokemonFRLG_OverworldSimTaps.cpp | 24 +++++++- .../AutoStory/PokemonFRLG_AutoStoryEvents.cpp | 31 +++++++++- .../AutoStory/PokemonFRLG_AutoStoryEvents.h | 5 ++ .../PokemonFRLG_AutoStoryHideout_Tests.cpp | 42 +++++++++++++ .../AutoStory/StoryData/frlg-00.31.plan.json | 32 +++++++++- 11 files changed, 226 insertions(+), 22 deletions(-) diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldBikeTaps.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldBikeTaps.cpp index fa2871e6d7..18663df9f2 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldBikeTaps.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldBikeTaps.cpp @@ -6,6 +6,7 @@ #include #include +#include "PokemonFRLG_BikeSpinPresses.h" #include "PokemonFRLG_OverworldBikeTaps.h" namespace PokemonAutomation{ @@ -16,7 +17,11 @@ namespace PokemonFRLG{ StepOutcome count_bike_taps(const RouteStep& step, const BikeTapCalls& calls){ int moved = 0; for (int tap = 1; tap <= step.tiles; tap++){ - const BikeTap result = calls.tap(); + BikeTap result = calls.tap(tap); + for (int retry = 1; retry < calls.tries && !result.moved && !result.interrupt && !result.cleared_late; retry++){ + calls.log(std::format("Taps: tap {} of {} didn't move: tapping again, it may only have turned the player.", tap, step.tiles)); + result = calls.tap(tap); + } if (result.interrupt || result.cleared_late){ calls.log(std::format("Bike: tap {} of {}: interrupted after {} tile(s).", tap, step.tiles, moved)); if (result.interrupt){ @@ -34,6 +39,19 @@ StepOutcome count_bike_taps(const RouteStep& step, const BikeTapCalls& calls){ return StepOutcome{}; } +bool counts_step_taps(const RouteStep& step){ + return step.tapped && step.action == RouteAction::WALK && step.tiles > 0 + && !step.surfing && !step.warps && step.connection_steps.empty(); +} + +Milliseconds step_tap_settle(const RouteStep& step, int tap){ + using namespace MovementMechanics; + if (tap != step.tiles || !step.spin_tiles){ + return 0ms; + } + return SPIN_TILE_TIME * *step.spin_tiles + SPIN_STOP_SETTLE; +} + } // namespace PokemonFRLG diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldBikeTaps.h b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldBikeTaps.h index c1018ce17f..12a3e8694d 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldBikeTaps.h +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldBikeTaps.h @@ -32,13 +32,20 @@ struct BikeTap{ // cleared already: a trainer who saw the player, a battle seen late. bool cleared_late = false; }; -// The console side of count_bike_taps(): `tap` taps once and judges it; +// The console side of count_bike_taps(): `tap` taps once, for the leg's +// `tap`th tile (from 1), and judges it; // `clear` clears interrupt i. struct BikeTapCalls{ - std::function tap; + std::function tap; std::function clear; std::function log; + // Taps per tile before one that doesn't move counts as blocked: on + // foot a tap facing another way only turns the player + // (STEP_TAP_TRIES). + int tries = 1; }; +// Taps per tile on foot: the first tap of a leg may only turn. +constexpr int STEP_TAP_TRIES = 2; // How far a sure start may be off before a blocked tap finds the player: // three runs of 00.30 stood 3 tiles off (console B, 2026-11-09). constexpr int BLOCKED_TAP_SLACK = 3; @@ -53,6 +60,16 @@ constexpr int BLOCKED_TAP_SLACK = 3; // and one more, which may have moved before its battle showed. StepOutcome count_bike_taps(const RouteStep& step, const BikeTapCalls& calls); +// Whether `step` is walked on foot a tap at a time (RouteStep::tapped), +// each a tile, by count_bike_taps() with STEP_TAP_TRIES: an open leg or +// one to a wall or onto a spinner, not onto a warp or over a connection. +bool counts_step_taps(const RouteStep& step); + +// How long after a step tap of `step`, the `tap`th (from 1), the screen +// is still: the step, and on the last tap of a leg onto a spinner the +// slide (RouteStep::spin_tiles) and its settle. +Milliseconds step_tap_settle(const RouteStep& step, int tap); + } // namespace PokemonFRLG diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldRecoveryWalk.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldRecoveryWalk.cpp index e7fbd0e42a..18b365317f 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldRecoveryWalk.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldRecoveryWalk.cpp @@ -76,14 +76,23 @@ double top_band_change(const ImageViewRGB32& before, const ImageViewRGB32& after return ImageMatch::pixel_RMSD(extract_box_reference(before, band), extract_box_reference(after, band)); } -// One tap of a leg counted out on the Bicycle (count_bike_taps()): a -// BIKE_TAP press released to a BIKE_TAP_PERIOD period, then -// BIKE_TAP_SETTLE for the screen to show the step, watching `interrupts` -// throughout. A tap that didn't scroll the screen is watched on for a -// late interrupt, which is cleared. +// A counted tap's press, its release and the wait after it for the +// screen to show the step. +struct TapTiming{ + Milliseconds press; + Milliseconds release; + Milliseconds settle; +}; +// On the Bicycle: a BIKE_TAP press released to a BIKE_TAP_PERIOD period, +// then BIKE_TAP_SETTLE. +constexpr TapTiming BIKE_TAP_TIMING{BIKE_TAP, BIKE_TAP_PERIOD - BIKE_TAP, BIKE_TAP_SETTLE}; + +// One tap of a leg counted out (count_bike_taps()), timed by `timing`, +// watching `interrupts` throughout. A tap that didn't scroll the screen +// is watched on for a late interrupt, which is cleared. BikeTap console_bike_tap( ConsoleHandle& console, ProControllerContext& context, - const RouteStep& step, const OverworldInterrupts& interrupts + const RouteStep& step, const OverworldInterrupts& interrupts, const TapTiming& timing ){ context.wait_for_all_requests(); const VideoSnapshot before = console.video().snapshot(); @@ -96,8 +105,8 @@ BikeTap console_bike_tap( const int ret = run_until( console, context, [&](ProControllerContext& context){ - pbf_press_dpad(context, dpad(step.direction), BIKE_TAP, BIKE_TAP_PERIOD - BIKE_TAP); - pbf_wait(context, BIKE_TAP_SETTLE); + pbf_press_dpad(context, dpad(step.direction), timing.press, timing.release); + pbf_wait(context, timing.settle); context.wait_for_all_requests(); }, callbacks @@ -122,9 +131,32 @@ StepWalk walk_bike_taps( StepWalk out{std::nullopt, current_time(), false, false}; const OverworldInterrupts& watched = step.wild ? interrupts.wild : interrupts.other; BikeTapCalls calls; - calls.tap = [&]{ return console_bike_tap(console, context, step, watched); }; + calls.tap = [&](int){ return console_bike_tap(console, context, step, watched, BIKE_TAP_TIMING); }; + calls.clear = [&](size_t index){ watched[index]->clear(console, context); }; + calls.log = [&](const std::string& message){ console.log(message, COLOR_ORANGE); }; + const StepOutcome outcome = count_bike_taps(step, calls); + out.stopped = outcome.walked; + out.blocked = outcome.blocked; + return out; +} + +// A leg on foot, a step tap at a time (counts_step_taps()): STEP_TAP +// pressed and STEP_TAP_RELEASE let go, past the step's lockout, then the +// slide off a spinner waited out (step_tap_settle()). +StepWalk walk_step_taps( + ConsoleHandle& console, ProControllerContext& context, + const RouteStep& step, const OverworldInterruptSet& interrupts +){ + StepWalk out{std::nullopt, current_time(), false, false}; + const OverworldInterrupts& watched = step.wild ? interrupts.wild : interrupts.other; + BikeTapCalls calls; + calls.tap = [&](int tap){ + const TapTiming timing{STEP_TAP, STEP_TAP_RELEASE, step_tap_settle(step, tap)}; + return console_bike_tap(console, context, step, watched, timing); + }; calls.clear = [&](size_t index){ watched[index]->clear(console, context); }; calls.log = [&](const std::string& message){ console.log(message, COLOR_ORANGE); }; + calls.tries = STEP_TAP_TRIES; const StepOutcome outcome = count_bike_taps(step, calls); out.stopped = outcome.walked; out.blocked = outcome.blocked; @@ -264,9 +296,14 @@ StepOutcome walk_and_watch( clear_open_message(console, context, step.wild ? interrupts.wild : interrupts.other, step); check_overworld(console, context, step); const LegRecorder recorder(console, context, interrupts, step); - const StepWalk walked = counts_bike_taps(step, speed) - ? walk_bike_taps(console, context, step, interrupts) - : walk_step(console, context, step, facing, interrupts, speed); + StepWalk walked; + if (counts_step_taps(step)){ + walked = walk_step_taps(console, context, step, interrupts); + }else if (counts_bike_taps(step, speed)){ + walked = walk_bike_taps(console, context, step, interrupts); + }else{ + walked = walk_step(console, context, step, facing, interrupts, speed); + } if (walked.stopped){ return StepOutcome{.end = StepEnd::STOPPED, .walked = walked.stopped, .blocked = walked.blocked}; } diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldRoute.h b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldRoute.h index 2d5f45f8e4..8841226edd 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldRoute.h +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldRoute.h @@ -80,6 +80,11 @@ struct RouteStep{ // tiles on, to `end` (spin_slide()). The hold must end on the spinner: // held on, the player walks on after the slide. std::optional spin_tiles; + // WALK on foot: walked a tap at a time, each a tile, and each checked + // to have moved (count_step_taps()), as through the hideout's arrow + // floors, where a hold that ends a tile off slides the player + // elsewhere (console B, 2026-11-10, 00.31 r1). + bool tapped = false; // WALK, SURF: a wild Pokemon can appear on the way: the step crosses // tall grass or water. Elsewhere (indoors, streets) no wild battle can // start, so the walker doesn't watch for one. diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSim.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSim.cpp index 14129e9086..938dab9efc 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSim.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSim.cpp @@ -880,8 +880,8 @@ StepOutcome OverworldSimWalker::walk_ridden(const RouteStep& step, std::optional clear_late(interrupts(step), OPEN_MESSAGE_WATCH, 1); } check_overworld(step); - if (m_rules.count_bike_taps && counts_bike_taps(step, m_speed)){ - const StepOutcome outcome = walk_bike_taps(step); + if (counts_step_taps(step) || (m_rules.count_bike_taps && counts_bike_taps(step, m_speed))){ + const StepOutcome outcome = counts_step_taps(step) ? walk_step_taps(step) : walk_bike_taps(step); if (outcome.end != StepEnd::DONE){ return outcome; } diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSim.h b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSim.h index 3b847ecc70..70b4f088e5 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSim.h +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSim.h @@ -553,6 +553,9 @@ class OverworldSimWalker{ // count_bike_taps() on the sim. StepOutcome walk_bike_taps(const RouteStep& step); BikeTap bike_tap(const RouteStep& step); + // count_bike_taps() on foot (counts_step_taps()). + StepOutcome walk_step_taps(const RouteStep& step); + BikeTap step_tap(const RouteStep& step, int tap); std::optional late_stop(const RouteStep& step); // stop_tiles(); without SimWalkerRules::whole_leg_in_dark, the dark // screen places the stop at the hold's start. diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSimTaps.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSimTaps.cpp index 197d4d7355..65ff730b5c 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSimTaps.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSimTaps.cpp @@ -70,7 +70,7 @@ BikeTap OverworldSimWalker::bike_tap(const RouteStep& step){ StepOutcome OverworldSimWalker::walk_bike_taps(const RouteStep& step){ const std::vector& ints = interrupts(step); BikeTapCalls calls; - calls.tap = [&]{ return bike_tap(step); }; + calls.tap = [&](int){ return bike_tap(step); }; calls.clear = [&](size_t index){ clear(ints[index]); }; calls.log = [&](const std::string& message){ m_log.push_back(message); }; m_leg_start = m_sim.state().time; @@ -78,6 +78,28 @@ StepOutcome OverworldSimWalker::walk_bike_taps(const RouteStep& step){ return count_bike_taps(step, calls); } +BikeTap OverworldSimWalker::step_tap(const RouteStep& step, int tap){ + const MapPosition before = m_sim.state().position; + m_sim.tap(step.direction, STEP_TAP, STEP_TAP_RELEASE); + m_sim.watch({}, step_tap_settle(step, tap)); + if (!(m_sim.state().position == before)){ + return BikeTap{.moved = true}; + } + return BikeTap{.moved = false, .interrupt = std::nullopt, .cleared_late = clear_late(interrupts(step), AFTER_LEG_WATCH, MAX_INTERRUPTIONS_PER_LEG) > 0}; +} + +StepOutcome OverworldSimWalker::walk_step_taps(const RouteStep& step){ + const std::vector& ints = interrupts(step); + BikeTapCalls calls; + calls.tap = [&](int tap){ return step_tap(step, tap); }; + calls.clear = [&](size_t index){ clear(ints[index]); }; + calls.log = [&](const std::string& message){ m_log.push_back(message); }; + calls.tries = STEP_TAP_TRIES; + m_leg_start = m_sim.state().time; + m_leg_dark = m_sim.state().dark; + return count_bike_taps(step, calls); +} + // walk_and_watch(), getting on the Bicycle first where // walk_overworld_route_with_recovery() does. StepOutcome OverworldSimWalker::walk(const RouteStep& step, std::optional facing){ diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryEvents.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryEvents.cpp index b089da5379..e469c828b9 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryEvents.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryEvents.cpp @@ -16,6 +16,7 @@ #include "VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldReanchor.h" #include "VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldRecoveryWalk.h" #include "VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldRoute.h" +#include "VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSpin.h" #include "VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldWalk.h" #include "PokemonFRLG_AutoStoryAbilities.h" #include "PokemonFRLG_AutoStoryBattleData.h" @@ -166,7 +167,12 @@ Outcome walk_legs(StoryEnv& env, RunState& state, const StoryStep& step){ if (!facing){ facing = face_a_wall(env, start); } - const std::optional> route = fixed_route(story_maps(), start, step.legs); + std::optional> route = fixed_route(story_maps(), start, step.legs); + if (route && step.variant == TAPS_VARIANT){ + for (RouteStep& leg : *route){ + leg.tapped = true; + } + } if (!facing || !route || route->empty()){ return Pokemon::outcome_failed("bad_legs", to_string(start)); } @@ -439,6 +445,24 @@ void add_start_pose_check( add_start_check(checkpoint, start, std::move(reader), std::move(log)); } +namespace{ + +// A leg's step onto a spinner: only its last (`last`), which slides +// `player` on to where the slide ends, facing its way (spin_slide()). +// False mid-leg, or for a slide that loops or leaves through a warp. +bool land_on_spinner(const MapData& map, PlayerState& player, bool last, RouteStep& step){ + const std::optional slide = spin_slide(map, player); + if (!last || !slide){ + return false; + } + player = slide->end; + step.spin_tiles = slide->tiles; + step.facing_after = slide->facing; + return true; +} + +} + std::optional> fixed_route( const std::vector& maps, const MapPosition& start, const std::vector& legs ){ @@ -467,8 +491,11 @@ std::optional> fixed_route( } step.wild |= is_tall_grass(*map, next); player = after_step(*map, player, leg.direction, kind); + if (spin_direction(*map, player.position) && !land_on_spinner(*map, player, c + 1 == leg.tiles, step)){ + return std::nullopt; + } } - step.to_wall = classify_step(*map, player, leg.direction) == StepKind::BLOCKED; + step.to_wall = !step.spin_tiles && classify_step(*map, player, leg.direction) == StepKind::BLOCKED; step.end = MapPosition{map->name, player.position}; route.push_back(step); } diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryEvents.h b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryEvents.h index ee7cb5dced..45a707d4d5 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryEvents.h +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryEvents.h @@ -64,6 +64,11 @@ struct StoryPose{ // has the Running Shoes (00.10 on). inline const std::string RUN_VARIANT = "run"; +// The variant of LEGS walked on foot a tap at a time, each tap checked to +// have moved the player a tile (RouteStep::tapped): the Rocket Hideout's +// arrow floors, where a hold a tile off slides the player elsewhere. +inline const std::string TAPS_VARIANT = "taps"; + // The variant of a STEP into a trainer's line: a tile at a time, at most // TRAINER_LINE_TILES, until the trainer sees the player // (step_until_seen()). The battle after it starts on the trainer's row diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryHideout_Tests.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryHideout_Tests.cpp index e84ba87ea8..5688c4d7e7 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryHideout_Tests.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryHideout_Tests.cpp @@ -212,6 +212,44 @@ UnitTestResult test_coded_spinners(){ return true; } +// 00.31's taps through B3F's arrow floor (frlg-00.31.plan.json's +// b3f_arrow_maze, pokeguy's way) on the sim, from the stairs (18, 2) +// to below the stairs to B4F (15, 19): as planned, and with each of the +// turns the taps make dropped in turn (a tap facing another way only +// turns the player, and a dropped one doesn't even turn them). +UnitTestResult test_b3f_maze_taps(){ + using Pokemon::StoryLeg; + const std::vector legs{ + {Direction::WEST, 6}, {Direction::SOUTH, 5}, {Direction::WEST, 7}, {Direction::SOUTH, 2}, {Direction::WEST, 1}, + {Direction::SOUTH, 2}, {Direction::WEST, 2}, {Direction::SOUTH, 3}, {Direction::WEST, 3}, {Direction::SOUTH, 2}, + {Direction::EAST, 2}, {Direction::WEST, 2}, {Direction::SOUTH, 5}, {Direction::EAST, 10}, {Direction::NORTH, 6}, + }; + const std::vector& maps = story_maps(); + const MapPosition start{"RocketHideout_B3F", {18, 2}}; + const MapPosition goal{"RocketHideout_B3F", {15, 19}}; + std::optional> route = fixed_route(maps, start, legs); + if (!route || !(route->back().end == goal)){ + return std::string("The legs don't end below B3F's stairs to B4F."); + } + for (RouteStep& step : *route){ + step.tapped = true; + } + for (int dropped = 0; dropped <= (int)legs.size(); dropped++){ + SimScript script; + if (dropped > 0){ + script.dropped_turn_taps = {dropped}; + } + OverworldSim sim(maps, start, Direction::EAST, script); + OverworldSimWalker walker(sim); + const RoutePlanning planning{.maps = &maps, .costs = default_route_costs(), .start = start, .label = "Sim"}; + const std::string failure = walker.run(*route, planning); + if (!failure.empty() || !(sim.state().position == goal)){ + return std::format("With turn tap {} dropped, walked to {}, failure \"{}\".", dropped, to_string(sim.state().position), failure); + } + } + return true; +} + struct AutoStoryHideoutBodyInput{ std::string name; UnitTestResult (*body)(); @@ -251,6 +289,10 @@ const AutoStoryHideoutBodyCase HIDEOUT_BODY_CASES[] = { .input = {.name = "coded spinners", .body = test_coded_spinners}, .expectation = {.description = "B2F's and B3F's arrows come from code, not the map"}, }, + { + .input = {.name = "B3F's arrow floor a tap at a time", .body = test_b3f_maze_taps}, + .expectation = {.description = "below the stairs to B4F, with any one turn dropped"}, + }, }; const LiftCase LIFT_CASES[] = { diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.31.plan.json b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.31.plan.json index 23a3cb24d4..1787f57fab 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.31.plan.json +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.31.plan.json @@ -58,12 +58,26 @@ "legs": [{"direction": "west", "tiles": 2}, {"direction": "north", "tiles": 2}], "why": "west to (21, 4), a tile short of the Grunt's north line (20, 4..5), and up column 21 to the wall, onto the stairs (21, 2), whose warp is a step east" }, + { + "id": "b3f_off_stairs", + "kind": "route", + "target": {"certainty": "tile", "map": "RocketHideout_B3F", "where": {"facing": "east", "kind": "tiles", "tiles": [[18, 2]]}}, + "variant": "run", + "why": "east off the stairs (21, 2) to B3F, onto its stairs (18, 2)" + }, + { + "id": "b3f_arrow_maze", + "kind": "legs", + "variant": "taps", + "legs": [{"direction": "west", "tiles": 6}, {"direction": "south", "tiles": 5}, {"direction": "west", "tiles": 7}, {"direction": "south", "tiles": 2}, {"direction": "west", "tiles": 1}, {"direction": "south", "tiles": 2}, {"direction": "west", "tiles": 2}, {"direction": "south", "tiles": 3}, {"direction": "west", "tiles": 3}, {"direction": "south", "tiles": 2}, {"direction": "east", "tiles": 2}, {"direction": "west", "tiles": 2}, {"direction": "south", "tiles": 5}, {"direction": "east", "tiles": 10}, {"direction": "north", "tiles": 6}], + "why": "pokeguy's way through the arrow floor (video 56:39-56:50), a tap a tile: west along the top corridor and down column 12 to row 7, west to (5, 7), down to (5, 9) between the arrows; west onto (4, 9), which slides to the stop (2, 9); south onto (2, 11), which slides east to the stop (6, 11); west to (4, 11), down column 4 to (4, 14), west to the wall (1, 14), down to (1, 16); east onto (3, 16), which slides east and, turned by (7, 16), south to the stop (7, 20); west to (5, 20), down column 5 to row 25, east to column 15 and up to (15, 19), below the stairs to B4F (15, 18). He detours to the BLACKGLASSES on the way down column 5; we don't." + }, { "id": "hideout_b4f_west", "kind": "route", "target": {"certainty": "tile", "map": "RocketHideout_B4F", "where": {"facing": "west", "kind": "tiles", "tiles": [[5, 3]]}}, "variant": "run", - "why": "east off the stairs to B3F, B3F to B4F (15, 18), round to (5, 3), east of the tile below the Grunt (4, 2)" + "why": "up onto the stairs (15, 18) to B4F (11, 15), round to (5, 3), east of the tile below the Grunt (4, 2)" }, { "id": "key_grunt_line", @@ -90,12 +104,26 @@ "kind": "talk", "why": "pick up the LIFT KEY (pokeguy 57:33)" }, + { + "id": "b3f_from_b4f", + "kind": "route", + "target": {"certainty": "tile", "map": "RocketHideout_B3F", "where": {"facing": "west", "kind": "tiles", "tiles": [[15, 18]]}}, + "variant": "run", + "why": "back to B4F's stairs (11, 15) and up them to B3F's (15, 18)" + }, + { + "id": "b3f_back_to_candy_row", + "kind": "legs", + "variant": "taps", + "legs": [{"direction": "south", "tiles": 2}, {"direction": "west", "tiles": 5}, {"direction": "north", "tiles": 6}], + "why": "pokeguy's way back (video 57:39-57:42), a tap a tile: down to row 20, west to column 10, up it onto the arrow (10, 14), which slides a tile north to the stop (10, 13)" + }, { "id": "beside_b3f_rare_candy", "kind": "route", "target": {"certainty": "tile", "map": "RocketHideout_B3F", "where": {"facing": "north", "kind": "tiles", "tiles": [[12, 13]]}}, "variant": "run", - "why": "back up the stairs to B3F, below the Rare Candy (12, 12) beside the arrow tiles" + "why": "east along row 13 to the wall, below the Rare Candy (12, 12)" }, { "id": "b3f_rare_candy", From 6f3974e7589f1942bc01ce0ff1047e13941e00ef Mon Sep 17 00:00:00 2001 From: dayfine Date: Tue, 10 Nov 2026 01:11:48 -0800 Subject: [PATCH 42/79] fixup: no ms literal --- .../PokemonFRLG/Overworld/PokemonFRLG_OverworldBikeTaps.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldBikeTaps.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldBikeTaps.cpp index 18663df9f2..4dad679747 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldBikeTaps.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldBikeTaps.cpp @@ -47,7 +47,7 @@ bool counts_step_taps(const RouteStep& step){ Milliseconds step_tap_settle(const RouteStep& step, int tap){ using namespace MovementMechanics; if (tap != step.tiles || !step.spin_tiles){ - return 0ms; + return Milliseconds(0); } return SPIN_TILE_TIME * *step.spin_tiles + SPIN_STOP_SETTLE; } From 9cb0488b22da4bccbec117513e49cbf44f843a0c Mon Sep 17 00:00:00 2001 From: dayfine Date: Tue, 10 Nov 2026 01:13:20 -0800 Subject: [PATCH 43/79] FRLG AutoStory: LEGS take the taps variant --- .../PokemonFRLG/Programs/AutoStory/Data/JsonParser.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/Data/JsonParser.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/Data/JsonParser.cpp index efc9dfe566..3f2925510e 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/Data/JsonParser.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/Data/JsonParser.cpp @@ -236,8 +236,9 @@ bool known_game_step(const StoryStep& step){ bool known_variant(const StoryStep& step){ switch (step.kind){ case StoryStepKind::ROUTE: - case StoryStepKind::LEGS: return step.variant.empty() || step.variant == RUN_VARIANT || step.variant == BIKE_VARIANT; + case StoryStepKind::LEGS: + return step.variant.empty() || step.variant == RUN_VARIANT || step.variant == BIKE_VARIANT || step.variant == TAPS_VARIANT; case StoryStepKind::STEP: return step.variant.empty() || step.variant == TRAINER_LINE_VARIANT || step.variant == TRAINER_WAIT_VARIANT; case StoryStepKind::GAME: From 515782a0462d4fc11565f6908e8763338cae1a2a Mon Sep 17 00:00:00 2001 From: dayfine Date: Tue, 10 Nov 2026 01:15:05 -0800 Subject: [PATCH 44/79] FRLG AutoStory: three step taps per tile, the run check skips taps legs --- .../PokemonFRLG/Overworld/PokemonFRLG_OverworldBikeTaps.h | 5 +++-- .../Programs/AutoStory/PokemonFRLG_AutoStory_Tests.cpp | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldBikeTaps.h b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldBikeTaps.h index 12a3e8694d..fb5bb67188 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldBikeTaps.h +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldBikeTaps.h @@ -44,8 +44,9 @@ struct BikeTapCalls{ // (STEP_TAP_TRIES). int tries = 1; }; -// Taps per tile on foot: the first tap of a leg may only turn. -constexpr int STEP_TAP_TRIES = 2; +// Taps per tile on foot: the first tap of a leg may only turn, and the +// game may miss a turn tap (MovementMechanics::MAX_TURN_TAPS). +constexpr int STEP_TAP_TRIES = 3; // How far a sure start may be off before a blocked tap finds the player: // three runs of 00.30 stood 3 tiles off (console B, 2026-11-09). constexpr int BLOCKED_TAP_SLACK = 3; diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStory_Tests.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStory_Tests.cpp index d81c8fe481..e28aef7676 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStory_Tests.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStory_Tests.cpp @@ -359,7 +359,8 @@ UnitTestResult test_runs_after_shoes(){ size_t runs = 0; for (const StoryCheckpoint& checkpoint : story_checkpoints()){ for (const StoryStep& step : checkpoint.steps){ - if (step.kind != StoryStepKind::ROUTE && step.kind != StoryStepKind::LEGS){ + // Taps walk a tile a tap at any speed. + if ((step.kind != StoryStepKind::ROUTE && step.kind != StoryStepKind::LEGS) || step.variant == TAPS_VARIANT){ continue; } const MoveSpeed expected = has_shoes ? MoveSpeed::RUN : MoveSpeed::WALK; From ada1353b85a531926c168ece302315ac6a5e093d Mon Sep 17 00:00:00 2001 From: dayfine Date: Tue, 10 Nov 2026 01:17:22 -0800 Subject: [PATCH 45/79] FRLG AutoStory 00.31: the golden trace with the taps legs; the B3F taps and short-hold sweep test --- .../PokemonFRLG_AutoStoryHideout_Tests.cpp | 78 ++++++++++++++---- .../ReplayData/frlg-story-sim-trace.json | 80 +++++++++++++++---- 2 files changed, 125 insertions(+), 33 deletions(-) diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryHideout_Tests.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryHideout_Tests.cpp index 5688c4d7e7..5a041601d7 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryHideout_Tests.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryHideout_Tests.cpp @@ -5,6 +5,7 @@ */ #include +#include #include #include #include "Common/Cpp/TestRunners/UnitTest.h" @@ -212,24 +213,15 @@ UnitTestResult test_coded_spinners(){ return true; } -// 00.31's taps through B3F's arrow floor (frlg-00.31.plan.json's -// b3f_arrow_maze, pokeguy's way) on the sim, from the stairs (18, 2) -// to below the stairs to B4F (15, 19): as planned, and with each of the -// turns the taps make dropped in turn (a tap facing another way only -// turns the player, and a dropped one doesn't even turn them). -UnitTestResult test_b3f_maze_taps(){ - using Pokemon::StoryLeg; - const std::vector legs{ - {Direction::WEST, 6}, {Direction::SOUTH, 5}, {Direction::WEST, 7}, {Direction::SOUTH, 2}, {Direction::WEST, 1}, - {Direction::SOUTH, 2}, {Direction::WEST, 2}, {Direction::SOUTH, 3}, {Direction::WEST, 3}, {Direction::SOUTH, 2}, - {Direction::EAST, 2}, {Direction::WEST, 2}, {Direction::SOUTH, 5}, {Direction::EAST, 10}, {Direction::NORTH, 6}, - }; +// `legs` from `start` tapped out on the sim (RouteStep::tapped), facing +// `facing`: as planned, and with each of the turns the taps make dropped +// in turn (a tap facing another way only turns the player, and a +// dropped one doesn't even turn them). Empty if each run ends on `goal`. +std::string tap_legs_on_sim(const MapPosition& start, Direction facing, const std::vector& legs, const MapPosition& goal){ const std::vector& maps = story_maps(); - const MapPosition start{"RocketHideout_B3F", {18, 2}}; - const MapPosition goal{"RocketHideout_B3F", {15, 19}}; std::optional> route = fixed_route(maps, start, legs); if (!route || !(route->back().end == goal)){ - return std::string("The legs don't end below B3F's stairs to B4F."); + return "The legs from " + to_string(start) + " don't end on " + to_string(goal) + "."; } for (RouteStep& step : *route){ step.tapped = true; @@ -239,7 +231,7 @@ UnitTestResult test_b3f_maze_taps(){ if (dropped > 0){ script.dropped_turn_taps = {dropped}; } - OverworldSim sim(maps, start, Direction::EAST, script); + OverworldSim sim(maps, start, facing, script); OverworldSimWalker walker(sim); const RoutePlanning planning{.maps = &maps, .costs = default_route_costs(), .start = start, .label = "Sim"}; const std::string failure = walker.run(*route, planning); @@ -247,6 +239,60 @@ UnitTestResult test_b3f_maze_taps(){ return std::format("With turn tap {} dropped, walked to {}, failure \"{}\".", dropped, to_string(sim.state().position), failure); } } + return ""; +} + +// The planned route from `start` to `goal` on the sim, with each of its +// holds 1 and 2 tiles short in turn. Empty if each run ends on `goal`. +std::string short_holds_on_sim(const MapPosition& start, Direction facing, const MapPosition& goal){ + const std::vector& maps = story_maps(); + const auto route = plan_overworld_route(maps, start, RouteGoal{goal, std::nullopt}, default_route_costs(), facing); + if (!route){ + return "No route from " + to_string(start) + "."; + } + for (int hold = 1; hold <= (int)route->size(); hold++){ + for (const int short_by : {1, 2}){ + SimScript script; + script.short_holds = {{hold, short_by}}; + OverworldSim sim(maps, start, facing, script); + OverworldSimWalker walker(sim); + const RoutePlanning planning{.maps = &maps, .costs = default_route_costs(), .start = start, .label = "Sim"}; + const std::string failure = walker.run(*route, planning); + if (!failure.empty() || !(sim.state().position == goal)){ + return std::format("Hold {} {} short from {}: walked to {}, failure \"{}\".", hold, short_by, to_string(start), to_string(sim.state().position), failure); + } + } + } + return ""; +} + +// 00.31's taps through B3F's arrow floor (frlg-00.31.plan.json's +// b3f_arrow_maze and b3f_back_to_candy_row, pokeguy's way): down from +// the stairs (18, 2) to below the stairs to B4F (15, 19), and back from +// them (15, 18) to the stop (10, 13). The routes planned after them, +// onto the stairs to B4F and east to below the Rare Candy, have no +// arrow on the way: a short hold there is found again. +UnitTestResult test_b3f_maze_taps(){ + using Pokemon::StoryLeg; + const MapPosition below_stairs{"RocketHideout_B3F", {15, 19}}; + const MapPosition candy_stop{"RocketHideout_B3F", {10, 13}}; + const std::vector failures{ + tap_legs_on_sim({"RocketHideout_B3F", {18, 2}}, Direction::EAST, { + {Direction::WEST, 6}, {Direction::SOUTH, 5}, {Direction::WEST, 7}, {Direction::SOUTH, 2}, {Direction::WEST, 1}, + {Direction::SOUTH, 2}, {Direction::WEST, 2}, {Direction::SOUTH, 3}, {Direction::WEST, 3}, {Direction::SOUTH, 2}, + {Direction::EAST, 2}, {Direction::WEST, 2}, {Direction::SOUTH, 5}, {Direction::EAST, 10}, {Direction::NORTH, 6}, + }, below_stairs), + tap_legs_on_sim({"RocketHideout_B3F", {15, 18}}, Direction::WEST, { + {Direction::SOUTH, 2}, {Direction::WEST, 5}, {Direction::NORTH, 6}, + }, candy_stop), + short_holds_on_sim(below_stairs, Direction::NORTH, {"RocketHideout_B4F", map_point(story_maps(), "RocketHideout_B4F", "warp_0")}), + short_holds_on_sim(candy_stop, Direction::NORTH, {"RocketHideout_B3F", {12, 13}}), + }; + for (const std::string& failure : failures){ + if (!failure.empty()){ + return failure; + } + } return true; } diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/ReplayData/frlg-story-sim-trace.json b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/ReplayData/frlg-story-sim-trace.json index db636bfd22..c98f337e39 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/ReplayData/frlg-story-sim-trace.json +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/ReplayData/frlg-story-sim-trace.json @@ -1277,7 +1277,7 @@ "[Checkpoint] 00.30: done, 24 run, 0 skipped", "[Checkpoint] 00.30: passed on attempt 1 (one-shot)", "begin 00.31", - "[Checkpoint] 00.31: start, 16 events", + "[Checkpoint] 00.31: start, 20 events", "[Event] 00.31/1 from_save: start", "[Event] 00.31/1 from_save: done", "[Event] 00.31/2 celadon_below_game_corner: start", @@ -1304,33 +1304,79 @@ "[Event] 00.31/9 b2f_to_stairs: start", "00.31/b2f_to_stairs: ok at RocketHideout_B2F (21, 2) facing north (tile)", "[Event] 00.31/9 b2f_to_stairs: done", - "[Event] 00.31/10 hideout_b4f_west: start", + "[Event] 00.31/10 b3f_off_stairs: start", + "00.31/b3f_off_stairs: ok at RocketHideout_B3F (18, 2) facing east (tile)", + "[Event] 00.31/10 b3f_off_stairs: done", + "[Event] 00.31/11 b3f_arrow_maze: start", + "00.31/b3f_arrow_maze: ok at RocketHideout_B3F (15, 19) facing north (tile)", + "[Event] 00.31/11 b3f_arrow_maze: done", + "[Event] 00.31/12 hideout_b4f_west: start", "00.31/hideout_b4f_west: ok at RocketHideout_B4F (5, 3) facing west (tile)", - "[Event] 00.31/10 hideout_b4f_west: done", - "[Event] 00.31/11 key_grunt_line: start", + "[Event] 00.31/12 hideout_b4f_west: done", + "[Event] 00.31/13 key_grunt_line: start", "00.31/key_grunt_line: ok at RocketHideout_B4F (4, 3) facing west (tile)", - "[Event] 00.31/11 key_grunt_line: done", - "[Event] 00.31/12 lift_key_grunt: start", + "[Event] 00.31/13 key_grunt_line: done", + "[Event] 00.31/14 lift_key_grunt: start", "00.31/lift_key_grunt: ok at -", - "[Event] 00.31/12 lift_key_grunt: done", - "[Event] 00.31/13 below_lift_key: start", + "[Event] 00.31/14 lift_key_grunt: done", + "[Event] 00.31/15 below_lift_key: start", "00.31/below_lift_key: ok at RocketHideout_B4F (3, 3) facing north (tile)", - "[Event] 00.31/13 below_lift_key: done", - "[Event] 00.31/14 lift_key: start", + "[Event] 00.31/15 below_lift_key: done", + "[Event] 00.31/16 lift_key: start", "00.31/lift_key: ok at -", - "[Event] 00.31/14 lift_key: done", - "[Event] 00.31/15 beside_b3f_rare_candy: start", + "[Event] 00.31/16 lift_key: done", + "[Event] 00.31/17 b3f_from_b4f: start", + "00.31/b3f_from_b4f: ok at RocketHideout_B3F (15, 18) facing west (tile)", + "[Event] 00.31/17 b3f_from_b4f: done", + "[Event] 00.31/18 b3f_back_to_candy_row: start", + "00.31/b3f_back_to_candy_row: ok at RocketHideout_B3F (10, 13) facing north (tile)", + "[Event] 00.31/18 b3f_back_to_candy_row: done", + "[Event] 00.31/19 beside_b3f_rare_candy: start", "00.31/beside_b3f_rare_candy: ok at RocketHideout_B3F (12, 13) facing north (tile)", - "[Event] 00.31/15 beside_b3f_rare_candy: done", - "[Event] 00.31/16 b3f_rare_candy: start", + "[Event] 00.31/19 beside_b3f_rare_candy: done", + "[Event] 00.31/20 b3f_rare_candy: start", "00.31/b3f_rare_candy: ok at -", - "[Event] 00.31/16 b3f_rare_candy: done", + "[Event] 00.31/20 b3f_rare_candy: done", "save at RocketHideout_B3F (12, 13) facing north (tile)", - "[Checkpoint] 00.31: done, 16 run, 0 skipped", + "[Checkpoint] 00.31: done, 20 run, 0 skipped", "[Checkpoint] 00.31: passed on attempt 1 (one-shot)", "[Segment] 00: 35 of 35 checkpoints one-shot", "[Segment] 00: done, 35 checkpoints", "completed", - "00.01: 2 stubbed: intro, options\n00.02: 0 stubbed\n00.03: 1 stubbed: to_the_lab\n00.04: 5 stubbed: squirtle_ball, choose_squirtle, no_nickname, rival_takes_bulbasaur, rival_battle\n00.05: 1 stubbed: parcel_from_clerk\n00.06: 2 stubbed: give_parcel, pokedex_scene\n00.07: 2 stubbed: heal_viridian, old_man_tutorial\n00.08: 1 stubbed: heal_pewter\n00.09: 3 stubbed: camper_liam, challenge_brock, brock\n00.10: 1 stubbed: shoes_from_aide\n00.11: 4 stubbed: heal_pewter, bug_catcher_colton, bug_catcher_greg, bug_catcher_james\n00.12: 1 stubbed: heal_route4\n00.12c: 1 stubbed: magikarp_to_box\n00.13: 6 stubbed: heal_route4, moon_stone_ball, found_moon_stone, rocket_grunt, super_nerd_miguel, helix_fossil\n00.14: 2 stubbed: teach_mega_kick, heal_cerulean\n00.14b: 3 stubbed: buy_potions, grind_to_lv23, heal_cerulean\n00.14c: 4 stubbed: challenge_misty, misty, heal_cerulean, teach_water_pulse\n00.15: 4 stubbed: teach_water_pulse, buy_potions, grind_for_rival, heal_cerulean\n00.15b: 2 stubbed: teach_water_pulse, rival_cerulean\n00.16: 7 stubbed: heal_cerulean, bug_catcher_cale, lass_ali, youngster_timmy, lass_reli, camper_ethan, rocket_grunt\n00.17: 4 stubbed: hiker_franklin, picnicker_kelsey, hiker_nob, lass_haley\n00.18: 7 stubbed: bill_clefairy, help_bill, bill_into_teleporter, cell_separator, bill_comes_out, thank_bill, ss_ticket\n00.19: 1 stubbed: heal_cerulean\n00.20: 3 stubbed: buy_poke_balls, catch_oddish, heal_cerulean\n00.21: 3 stubbed: rocket_grunt, camper_jeff, heal_vermilion\n00.22: 6 stubbed: show_ss_ticket, rival_ss_anne, captain, hm01_cut, ss_anne_sails, heal_vermilion\n00.23: 9 stubbed: teach_cut, teach_dig, cut_gym_tree, sailor_dwayne, engineer_baily, gentleman_tucker, trash_cans, cut_tree_out, heal_vermilion\n00.24: 4 stubbed: surge_winnable, grind_for_surge, heal_vermilion, cut_gym_tree\n00.25: 4 stubbed: challenge_lt_surge, lt_surge, cut_tree_out, heal_vermilion\n00.26: 8 stubbed: chairman, hear_story, bike_voucher, cut_cerulean_tree, talk_bike_clerk, bicycle, buy_repels, heal_cerulean\n00.27: 6 stubbed: cut_cerulean_tree, cut_route9_tree, picnicker_alicia, hiker_jeremy, bug_catcher_conner, heal_route10\n00.28: 9 stubbed: cut_route10_tree, pokemaniac_ashton, pokemaniac_winston, picnicker_martha, hiker_allen, hiker_lenny, picnicker_sofia, hiker_dudley, picnicker_dana\n00.29: 1 stubbed: heal_lavender\n00.30: 7 stubbed: register_bike, buy_ropes_and_super_repels, ride_bike, gamer_rich, catch_pidgey, celadon_nurse, heal_celadon\n00.31: 6 stubbed: talk_poster_guard, rocket_grunt, poster_switch, lift_key_grunt, lift_key, b3f_rare_candy\n" + "00.01: 2 stubbed: intro, options", + "00.02: 0 stubbed", + "00.03: 1 stubbed: to_the_lab", + "00.04: 5 stubbed: squirtle_ball, choose_squirtle, no_nickname, rival_takes_bulbasaur, rival_battle", + "00.05: 1 stubbed: parcel_from_clerk", + "00.06: 2 stubbed: give_parcel, pokedex_scene", + "00.07: 2 stubbed: heal_viridian, old_man_tutorial", + "00.08: 1 stubbed: heal_pewter", + "00.09: 3 stubbed: camper_liam, challenge_brock, brock", + "00.10: 1 stubbed: shoes_from_aide", + "00.11: 4 stubbed: heal_pewter, bug_catcher_colton, bug_catcher_greg, bug_catcher_james", + "00.12: 1 stubbed: heal_route4", + "00.12c: 1 stubbed: magikarp_to_box", + "00.13: 6 stubbed: heal_route4, moon_stone_ball, found_moon_stone, rocket_grunt, super_nerd_miguel, helix_fossil", + "00.14: 2 stubbed: teach_mega_kick, heal_cerulean", + "00.14b: 3 stubbed: buy_potions, grind_to_lv23, heal_cerulean", + "00.14c: 4 stubbed: challenge_misty, misty, heal_cerulean, teach_water_pulse", + "00.15: 4 stubbed: teach_water_pulse, buy_potions, grind_for_rival, heal_cerulean", + "00.15b: 2 stubbed: teach_water_pulse, rival_cerulean", + "00.16: 7 stubbed: heal_cerulean, bug_catcher_cale, lass_ali, youngster_timmy, lass_reli, camper_ethan, rocket_grunt", + "00.17: 4 stubbed: hiker_franklin, picnicker_kelsey, hiker_nob, lass_haley", + "00.18: 7 stubbed: bill_clefairy, help_bill, bill_into_teleporter, cell_separator, bill_comes_out, thank_bill, ss_ticket", + "00.19: 1 stubbed: heal_cerulean", + "00.20: 3 stubbed: buy_poke_balls, catch_oddish, heal_cerulean", + "00.21: 3 stubbed: rocket_grunt, camper_jeff, heal_vermilion", + "00.22: 6 stubbed: show_ss_ticket, rival_ss_anne, captain, hm01_cut, ss_anne_sails, heal_vermilion", + "00.23: 9 stubbed: teach_cut, teach_dig, cut_gym_tree, sailor_dwayne, engineer_baily, gentleman_tucker, trash_cans, cut_tree_out, heal_vermilion", + "00.24: 4 stubbed: surge_winnable, grind_for_surge, heal_vermilion, cut_gym_tree", + "00.25: 4 stubbed: challenge_lt_surge, lt_surge, cut_tree_out, heal_vermilion", + "00.26: 8 stubbed: chairman, hear_story, bike_voucher, cut_cerulean_tree, talk_bike_clerk, bicycle, buy_repels, heal_cerulean", + "00.27: 6 stubbed: cut_cerulean_tree, cut_route9_tree, picnicker_alicia, hiker_jeremy, bug_catcher_conner, heal_route10", + "00.28: 9 stubbed: cut_route10_tree, pokemaniac_ashton, pokemaniac_winston, picnicker_martha, hiker_allen, hiker_lenny, picnicker_sofia, hiker_dudley, picnicker_dana", + "00.29: 1 stubbed: heal_lavender", + "00.30: 7 stubbed: register_bike, buy_ropes_and_super_repels, ride_bike, gamer_rich, catch_pidgey, celadon_nurse, heal_celadon", + "00.31: 6 stubbed: talk_poster_guard, rocket_grunt, poster_switch, lift_key_grunt, lift_key, b3f_rare_candy" ] } From fcde135d2940ed42e684d3dcfacf010e48f6732c Mon Sep 17 00:00:00 2001 From: dayfine Date: Tue, 10 Nov 2026 01:18:47 -0800 Subject: [PATCH 46/79] FRLG AutoStory 00.31: golden trace from the old one, only 00.31 changed; CRLF include --- .../PokemonFRLG_AutoStoryHideout_Tests.cpp | 2 +- .../ReplayData/frlg-story-sim-trace.json | 36 +------------------ 2 files changed, 2 insertions(+), 36 deletions(-) diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryHideout_Tests.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryHideout_Tests.cpp index 5a041601d7..5c046ef92e 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryHideout_Tests.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryHideout_Tests.cpp @@ -5,7 +5,7 @@ */ #include -#include +#include #include #include #include "Common/Cpp/TestRunners/UnitTest.h" diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/ReplayData/frlg-story-sim-trace.json b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/ReplayData/frlg-story-sim-trace.json index c98f337e39..e3cc1c3a99 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/ReplayData/frlg-story-sim-trace.json +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/ReplayData/frlg-story-sim-trace.json @@ -1343,40 +1343,6 @@ "[Segment] 00: 35 of 35 checkpoints one-shot", "[Segment] 00: done, 35 checkpoints", "completed", - "00.01: 2 stubbed: intro, options", - "00.02: 0 stubbed", - "00.03: 1 stubbed: to_the_lab", - "00.04: 5 stubbed: squirtle_ball, choose_squirtle, no_nickname, rival_takes_bulbasaur, rival_battle", - "00.05: 1 stubbed: parcel_from_clerk", - "00.06: 2 stubbed: give_parcel, pokedex_scene", - "00.07: 2 stubbed: heal_viridian, old_man_tutorial", - "00.08: 1 stubbed: heal_pewter", - "00.09: 3 stubbed: camper_liam, challenge_brock, brock", - "00.10: 1 stubbed: shoes_from_aide", - "00.11: 4 stubbed: heal_pewter, bug_catcher_colton, bug_catcher_greg, bug_catcher_james", - "00.12: 1 stubbed: heal_route4", - "00.12c: 1 stubbed: magikarp_to_box", - "00.13: 6 stubbed: heal_route4, moon_stone_ball, found_moon_stone, rocket_grunt, super_nerd_miguel, helix_fossil", - "00.14: 2 stubbed: teach_mega_kick, heal_cerulean", - "00.14b: 3 stubbed: buy_potions, grind_to_lv23, heal_cerulean", - "00.14c: 4 stubbed: challenge_misty, misty, heal_cerulean, teach_water_pulse", - "00.15: 4 stubbed: teach_water_pulse, buy_potions, grind_for_rival, heal_cerulean", - "00.15b: 2 stubbed: teach_water_pulse, rival_cerulean", - "00.16: 7 stubbed: heal_cerulean, bug_catcher_cale, lass_ali, youngster_timmy, lass_reli, camper_ethan, rocket_grunt", - "00.17: 4 stubbed: hiker_franklin, picnicker_kelsey, hiker_nob, lass_haley", - "00.18: 7 stubbed: bill_clefairy, help_bill, bill_into_teleporter, cell_separator, bill_comes_out, thank_bill, ss_ticket", - "00.19: 1 stubbed: heal_cerulean", - "00.20: 3 stubbed: buy_poke_balls, catch_oddish, heal_cerulean", - "00.21: 3 stubbed: rocket_grunt, camper_jeff, heal_vermilion", - "00.22: 6 stubbed: show_ss_ticket, rival_ss_anne, captain, hm01_cut, ss_anne_sails, heal_vermilion", - "00.23: 9 stubbed: teach_cut, teach_dig, cut_gym_tree, sailor_dwayne, engineer_baily, gentleman_tucker, trash_cans, cut_tree_out, heal_vermilion", - "00.24: 4 stubbed: surge_winnable, grind_for_surge, heal_vermilion, cut_gym_tree", - "00.25: 4 stubbed: challenge_lt_surge, lt_surge, cut_tree_out, heal_vermilion", - "00.26: 8 stubbed: chairman, hear_story, bike_voucher, cut_cerulean_tree, talk_bike_clerk, bicycle, buy_repels, heal_cerulean", - "00.27: 6 stubbed: cut_cerulean_tree, cut_route9_tree, picnicker_alicia, hiker_jeremy, bug_catcher_conner, heal_route10", - "00.28: 9 stubbed: cut_route10_tree, pokemaniac_ashton, pokemaniac_winston, picnicker_martha, hiker_allen, hiker_lenny, picnicker_sofia, hiker_dudley, picnicker_dana", - "00.29: 1 stubbed: heal_lavender", - "00.30: 7 stubbed: register_bike, buy_ropes_and_super_repels, ride_bike, gamer_rich, catch_pidgey, celadon_nurse, heal_celadon", - "00.31: 6 stubbed: talk_poster_guard, rocket_grunt, poster_switch, lift_key_grunt, lift_key, b3f_rare_candy" + "00.01: 2 stubbed: intro, options\n00.02: 0 stubbed\n00.03: 1 stubbed: to_the_lab\n00.04: 5 stubbed: squirtle_ball, choose_squirtle, no_nickname, rival_takes_bulbasaur, rival_battle\n00.05: 1 stubbed: parcel_from_clerk\n00.06: 2 stubbed: give_parcel, pokedex_scene\n00.07: 2 stubbed: heal_viridian, old_man_tutorial\n00.08: 1 stubbed: heal_pewter\n00.09: 3 stubbed: camper_liam, challenge_brock, brock\n00.10: 1 stubbed: shoes_from_aide\n00.11: 4 stubbed: heal_pewter, bug_catcher_colton, bug_catcher_greg, bug_catcher_james\n00.12: 1 stubbed: heal_route4\n00.12c: 1 stubbed: magikarp_to_box\n00.13: 6 stubbed: heal_route4, moon_stone_ball, found_moon_stone, rocket_grunt, super_nerd_miguel, helix_fossil\n00.14: 2 stubbed: teach_mega_kick, heal_cerulean\n00.14b: 3 stubbed: buy_potions, grind_to_lv23, heal_cerulean\n00.14c: 4 stubbed: challenge_misty, misty, heal_cerulean, teach_water_pulse\n00.15: 4 stubbed: teach_water_pulse, buy_potions, grind_for_rival, heal_cerulean\n00.15b: 2 stubbed: teach_water_pulse, rival_cerulean\n00.16: 7 stubbed: heal_cerulean, bug_catcher_cale, lass_ali, youngster_timmy, lass_reli, camper_ethan, rocket_grunt\n00.17: 4 stubbed: hiker_franklin, picnicker_kelsey, hiker_nob, lass_haley\n00.18: 7 stubbed: bill_clefairy, help_bill, bill_into_teleporter, cell_separator, bill_comes_out, thank_bill, ss_ticket\n00.19: 1 stubbed: heal_cerulean\n00.20: 3 stubbed: buy_poke_balls, catch_oddish, heal_cerulean\n00.21: 3 stubbed: rocket_grunt, camper_jeff, heal_vermilion\n00.22: 6 stubbed: show_ss_ticket, rival_ss_anne, captain, hm01_cut, ss_anne_sails, heal_vermilion\n00.23: 9 stubbed: teach_cut, teach_dig, cut_gym_tree, sailor_dwayne, engineer_baily, gentleman_tucker, trash_cans, cut_tree_out, heal_vermilion\n00.24: 4 stubbed: surge_winnable, grind_for_surge, heal_vermilion, cut_gym_tree\n00.25: 4 stubbed: challenge_lt_surge, lt_surge, cut_tree_out, heal_vermilion\n00.26: 8 stubbed: chairman, hear_story, bike_voucher, cut_cerulean_tree, talk_bike_clerk, bicycle, buy_repels, heal_cerulean\n00.27: 6 stubbed: cut_cerulean_tree, cut_route9_tree, picnicker_alicia, hiker_jeremy, bug_catcher_conner, heal_route10\n00.28: 9 stubbed: cut_route10_tree, pokemaniac_ashton, pokemaniac_winston, picnicker_martha, hiker_allen, hiker_lenny, picnicker_sofia, hiker_dudley, picnicker_dana\n00.29: 1 stubbed: heal_lavender\n00.30: 7 stubbed: register_bike, buy_ropes_and_super_repels, ride_bike, gamer_rich, catch_pidgey, celadon_nurse, heal_celadon\n00.31: 6 stubbed: talk_poster_guard, rocket_grunt, poster_switch, lift_key_grunt, lift_key, b3f_rare_candy\n" ] } From ab60d971008cf39cadd15bda8c130b478e331268 Mon Sep 17 00:00:00 2001 From: dayfine Date: Tue, 10 Nov 2026 01:20:32 -0800 Subject: [PATCH 47/79] FRLG AutoStory: fixed_route in its own file, AutoStoryLegs.cpp, keeping AutoStoryEvents.cpp under 1000 lines --- .../AutoStory/PokemonFRLG_AutoStoryEvents.cpp | 58 -------------- .../AutoStory/PokemonFRLG_AutoStoryLegs.cpp | 76 +++++++++++++++++++ SerialPrograms/cmake/SourceFiles.cmake | 1 + 3 files changed, 77 insertions(+), 58 deletions(-) create mode 100644 SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryLegs.cpp diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryEvents.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryEvents.cpp index e469c828b9..344aaaeccb 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryEvents.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryEvents.cpp @@ -16,7 +16,6 @@ #include "VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldReanchor.h" #include "VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldRecoveryWalk.h" #include "VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldRoute.h" -#include "VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSpin.h" #include "VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldWalk.h" #include "PokemonFRLG_AutoStoryAbilities.h" #include "PokemonFRLG_AutoStoryBattleData.h" @@ -445,63 +444,6 @@ void add_start_pose_check( add_start_check(checkpoint, start, std::move(reader), std::move(log)); } -namespace{ - -// A leg's step onto a spinner: only its last (`last`), which slides -// `player` on to where the slide ends, facing its way (spin_slide()). -// False mid-leg, or for a slide that loops or leaves through a warp. -bool land_on_spinner(const MapData& map, PlayerState& player, bool last, RouteStep& step){ - const std::optional slide = spin_slide(map, player); - if (!last || !slide){ - return false; - } - player = slide->end; - step.spin_tiles = slide->tiles; - step.facing_after = slide->facing; - return true; -} - -} - -std::optional> fixed_route( - const std::vector& maps, const MapPosition& start, const std::vector& legs -){ - const MapData* map = nullptr; - for (const MapData& candidate : maps){ - if (candidate.name == start.map){ - map = &candidate; - } - } - if (map == nullptr || !in_bounds(*map, start.point)){ - return std::nullopt; - } - std::vector route; - PlayerState player{start.point, elevation_at(*map, start.point), false}; - for (const StoryLeg& leg : legs){ - RouteStep step; - step.direction = leg.direction; - step.tiles = leg.tiles; - step.facing_after = leg.direction; - step.walk_only = !map->allow_running; - for (int c = 0; c < leg.tiles; c++){ - const StepKind kind = classify_step(*map, player, leg.direction); - const TilePos next = player.position.next(leg.direction); - if (kind != StepKind::WALK || !in_bounds(*map, next) || warps_on_step(*map, next)){ - return std::nullopt; - } - step.wild |= is_tall_grass(*map, next); - player = after_step(*map, player, leg.direction, kind); - if (spin_direction(*map, player.position) && !land_on_spinner(*map, player, c + 1 == leg.tiles, step)){ - return std::nullopt; - } - } - step.to_wall = !step.spin_tiles && classify_step(*map, player, leg.direction) == StepKind::BLOCKED; - step.end = MapPosition{map->name, player.position}; - route.push_back(step); - } - return route; -} - Pokemon::Pose paced_pose(const Pokemon::Pose& patch, const StoryStep& step){ std::optional pace; if (const std::optional grind = parse_grind_step(step)){ diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryLegs.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryLegs.cpp new file mode 100644 index 0000000000..8423c21844 --- /dev/null +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryLegs.cpp @@ -0,0 +1,76 @@ +/* AutoStory Legs + * + * From: https://github.com/PokemonAutomation/ + * + */ + +#include "VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldMap.h" +#include "VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSpin.h" +#include "PokemonFRLG_AutoStoryEvents.h" + +namespace PokemonAutomation{ +namespace NintendoSwitch{ +namespace PokemonFRLG{ + + +namespace{ + +// A leg's step onto a spinner: only its last (`last`), which slides +// `player` on to where the slide ends, facing its way (spin_slide()). +// False mid-leg, or for a slide that loops or leaves through a warp. +bool land_on_spinner(const MapData& map, PlayerState& player, bool last, RouteStep& step){ + const std::optional slide = spin_slide(map, player); + if (!last || !slide){ + return false; + } + player = slide->end; + step.spin_tiles = slide->tiles; + step.facing_after = slide->facing; + return true; +} + +} // namespace + +std::optional> fixed_route( + const std::vector& maps, const MapPosition& start, const std::vector& legs +){ + const MapData* map = nullptr; + for (const MapData& candidate : maps){ + if (candidate.name == start.map){ + map = &candidate; + } + } + if (map == nullptr || !in_bounds(*map, start.point)){ + return std::nullopt; + } + std::vector route; + PlayerState player{start.point, elevation_at(*map, start.point), false}; + for (const StoryLeg& leg : legs){ + RouteStep step; + step.direction = leg.direction; + step.tiles = leg.tiles; + step.facing_after = leg.direction; + step.walk_only = !map->allow_running; + for (int c = 0; c < leg.tiles; c++){ + const StepKind kind = classify_step(*map, player, leg.direction); + const TilePos next = player.position.next(leg.direction); + if (kind != StepKind::WALK || !in_bounds(*map, next) || warps_on_step(*map, next)){ + return std::nullopt; + } + step.wild |= is_tall_grass(*map, next); + player = after_step(*map, player, leg.direction, kind); + if (spin_direction(*map, player.position) && !land_on_spinner(*map, player, c + 1 == leg.tiles, step)){ + return std::nullopt; + } + } + step.to_wall = !step.spin_tiles && classify_step(*map, player, leg.direction) == StepKind::BLOCKED; + step.end = MapPosition{map->name, player.position}; + route.push_back(step); + } + return route; +} + + +} // namespace PokemonFRLG +} // namespace NintendoSwitch +} // namespace PokemonAutomation diff --git a/SerialPrograms/cmake/SourceFiles.cmake b/SerialPrograms/cmake/SourceFiles.cmake index 25b636266e..3d71d4e3a3 100644 --- a/SerialPrograms/cmake/SourceFiles.cmake +++ b/SerialPrograms/cmake/SourceFiles.cmake @@ -1944,6 +1944,7 @@ file(GLOB LIBRARY_SOURCES Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryDamage.h Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryEvents.cpp Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryEvents.h + Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryLegs.cpp Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryFieldSteps.h Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryFoeTracker.cpp Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryFoeTracker.h From 421a651ca41630b425be8382506ab1829ee57cf3 Mon Sep 17 00:00:00 2001 From: dayfine Date: Tue, 10 Nov 2026 01:22:38 -0800 Subject: [PATCH 48/79] FRLG AutoStory: TAPS_VARIANT and fixed_route() in AutoStoryLegs.h, off AutoStoryEvents.h's symbol count --- .../AutoStory/PokemonFRLG_AutoStoryEvents.cpp | 1 + .../AutoStory/PokemonFRLG_AutoStoryEvents.h | 12 ------ .../PokemonFRLG_AutoStoryHideout_Tests.cpp | 1 + .../AutoStory/PokemonFRLG_AutoStoryLegs.cpp | 1 + .../AutoStory/PokemonFRLG_AutoStoryLegs.h | 39 +++++++++++++++++++ .../AutoStory/PokemonFRLG_AutoStoryRowSim.cpp | 1 + .../AutoStory/PokemonFRLG_AutoStory_Tests.cpp | 1 + SerialPrograms/cmake/SourceFiles.cmake | 1 + 8 files changed, 45 insertions(+), 12 deletions(-) create mode 100644 SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryLegs.h diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryEvents.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryEvents.cpp index 344aaaeccb..1563e3e99c 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryEvents.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryEvents.cpp @@ -23,6 +23,7 @@ #include "PokemonFRLG_AutoStoryEvents.h" #include "PokemonFRLG_AutoStoryGrind.h" #include "PokemonFRLG_AutoStoryHideout.h" +#include "PokemonFRLG_AutoStoryLegs.h" #include "PokemonFRLG_AutoStoryScreenEvents.h" #include "PokemonFRLG_AutoStorySummary.h" #include "PokemonFRLG_AutoStoryTable.h" diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryEvents.h b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryEvents.h index 45a707d4d5..74631b27cf 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryEvents.h +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryEvents.h @@ -64,11 +64,6 @@ struct StoryPose{ // has the Running Shoes (00.10 on). inline const std::string RUN_VARIANT = "run"; -// The variant of LEGS walked on foot a tap at a time, each tap checked to -// have moved the player a tile (RouteStep::tapped): the Rocket Hideout's -// arrow floors, where a hold a tile off slides the player elsewhere. -inline const std::string TAPS_VARIANT = "taps"; - // The variant of a STEP into a trainer's line: a tile at a time, at most // TRAINER_LINE_TILES, until the trainer sees the player // (step_until_seen()). The battle after it starts on the trainer's row @@ -217,13 +212,6 @@ void add_start_pose_check( Pokemon::Checkpoint& checkpoint, const std::optional& start, SavePoseReader read, StoryLog log ); -// `legs` from `start` as route steps for the walker, each checked against -// the map: nothing if a step is blocked or leaves the map. A leg ends "to -// wall" if the next step its way is blocked. -std::optional> fixed_route( - const std::vector& maps, const MapPosition& start, const std::vector& legs -); - // Where a GRIND or capture `step` that paces (pace = ...) leaves the // player who started it on `patch`: the patch's tile or the one its pace // leads to, as the last battle came, facing unknown. `patch` for any diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryHideout_Tests.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryHideout_Tests.cpp index 5c046ef92e..eb424124d6 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryHideout_Tests.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryHideout_Tests.cpp @@ -16,6 +16,7 @@ #include "VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSim.h" #include "PokemonFRLG_AutoStoryHideout.h" #include "PokemonFRLG_AutoStoryHideoutLift.h" +#include "PokemonFRLG_AutoStoryLegs.h" #include "PokemonFRLG_AutoStoryRowSim.h" #include "PokemonFRLG_AutoStoryTableSteps.h" #include "PokemonFRLG_AutoStoryFieldSteps.h" diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryLegs.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryLegs.cpp index 8423c21844..420268e05a 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryLegs.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryLegs.cpp @@ -6,6 +6,7 @@ #include "VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldMap.h" #include "VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSpin.h" +#include "PokemonFRLG_AutoStoryLegs.h" #include "PokemonFRLG_AutoStoryEvents.h" namespace PokemonAutomation{ diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryLegs.h b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryLegs.h new file mode 100644 index 0000000000..d19c8fd42f --- /dev/null +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryLegs.h @@ -0,0 +1,39 @@ +/* AutoStory Legs + * + * From: https://github.com/PokemonAutomation/ + * + * LEGS steps: a fixed list of legs, as the walker's route steps. + * + */ + +#ifndef PokemonAutomation_PokemonFRLG_AutoStoryLegs_H +#define PokemonAutomation_PokemonFRLG_AutoStoryLegs_H + +#include +#include +#include +#include "Pokemon/AutoStory/Types/Pokemon_StoryStep.h" +#include "VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldRoute.h" + +namespace PokemonAutomation{ +namespace NintendoSwitch{ +namespace PokemonFRLG{ + +// The variant of LEGS walked on foot a tap at a time, each tap checked to +// have moved the player a tile (RouteStep::tapped): the Rocket Hideout's +// arrow floors, where a hold a tile off slides the player elsewhere. +inline const std::string TAPS_VARIANT = "taps"; + +// `legs` from `start` as route steps for the walker, each checked against +// the map: nothing if a step is blocked or leaves the map. A leg ends "to +// wall" if the next step its way is blocked. +std::optional> fixed_route( + const std::vector& maps, const MapPosition& start, const std::vector& legs +); + + + +} // namespace PokemonFRLG +} // namespace NintendoSwitch +} // namespace PokemonAutomation +#endif diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRowSim.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRowSim.cpp index 91ce25068e..a3fbdc9155 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRowSim.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRowSim.cpp @@ -13,6 +13,7 @@ #include #include "Common/Cpp/Exceptions.h" #include "Pokemon/AutoStory/Pokemon_TilePose.h" +#include "PokemonFRLG_AutoStoryLegs.h" #include "PokemonFRLG_AutoStoryActions.h" #include "PokemonFRLG_AutoStoryBattleDecisions.h" #include "VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldMaps.h" diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStory_Tests.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStory_Tests.cpp index e28aef7676..bd8b7080f0 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStory_Tests.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStory_Tests.cpp @@ -22,6 +22,7 @@ #include "VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldMaps.h" #include "VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldRecovery.h" #include "VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldRoute.h" +#include "PokemonFRLG_AutoStoryLegs.h" #include "PokemonFRLG_AutoStoryActions.h" #include "PokemonFRLG_AutoStoryCapture.h" #include "PokemonFRLG_AutoStoryGrind.h" diff --git a/SerialPrograms/cmake/SourceFiles.cmake b/SerialPrograms/cmake/SourceFiles.cmake index 3d71d4e3a3..38199837a9 100644 --- a/SerialPrograms/cmake/SourceFiles.cmake +++ b/SerialPrograms/cmake/SourceFiles.cmake @@ -1945,6 +1945,7 @@ file(GLOB LIBRARY_SOURCES Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryEvents.cpp Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryEvents.h Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryLegs.cpp + Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryLegs.h Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryFieldSteps.h Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryFoeTracker.cpp Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryFoeTracker.h From 5ba4c269350cffb2dc0c940ec8d18e0b902bbd13 Mon Sep 17 00:00:00 2001 From: dayfine Date: Tue, 10 Nov 2026 01:23:36 -0800 Subject: [PATCH 49/79] FRLG AutoStory: JsonParser includes AutoStoryLegs.h; AutoStory_Tests under 1000 lines --- .../PokemonFRLG/Programs/AutoStory/Data/JsonParser.cpp | 1 + .../Programs/AutoStory/PokemonFRLG_AutoStory_Tests.cpp | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/Data/JsonParser.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/Data/JsonParser.cpp index 3f2925510e..a7e08d42ca 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/Data/JsonParser.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/Data/JsonParser.cpp @@ -22,6 +22,7 @@ #include "VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryParty.h" #include "VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryPcStorage.h" #include "VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRooms.h" +#include "VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryLegs.h #include "VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryTeach.h" #include "VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryTrashCans.h" #include "LegacyJsonFormat.h" diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStory_Tests.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStory_Tests.cpp index bd8b7080f0..48a3e724dc 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStory_Tests.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStory_Tests.cpp @@ -360,7 +360,6 @@ UnitTestResult test_runs_after_shoes(){ size_t runs = 0; for (const StoryCheckpoint& checkpoint : story_checkpoints()){ for (const StoryStep& step : checkpoint.steps){ - // Taps walk a tile a tap at any speed. if ((step.kind != StoryStepKind::ROUTE && step.kind != StoryStepKind::LEGS) || step.variant == TAPS_VARIANT){ continue; } From 62e1cedfbfdc4bb7e09c0a978555f4cc5dfd8e30 Mon Sep 17 00:00:00 2001 From: dayfine Date: Tue, 10 Nov 2026 01:24:20 -0800 Subject: [PATCH 50/79] FRLG AutoStory: close JsonParser's AutoStoryLegs.h include --- .../PokemonFRLG/Programs/AutoStory/Data/JsonParser.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/Data/JsonParser.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/Data/JsonParser.cpp index a7e08d42ca..f0a4649081 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/Data/JsonParser.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/Data/JsonParser.cpp @@ -22,7 +22,7 @@ #include "VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryParty.h" #include "VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryPcStorage.h" #include "VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRooms.h" -#include "VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryLegs.h +#include "VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryLegs.h" #include "VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryTeach.h" #include "VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryTrashCans.h" #include "LegacyJsonFormat.h" From bd86cf734726917f2d1060bed7e8886c5730f787 Mon Sep 17 00:00:00 2001 From: dayfine Date: Tue, 10 Nov 2026 01:25:17 -0800 Subject: [PATCH 51/79] FRLG AutoStory: Lavender tests include AutoStoryLegs.h --- .../Programs/AutoStory/PokemonFRLG_AutoStoryLavender_Tests.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryLavender_Tests.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryLavender_Tests.cpp index 8c3bb9795f..b90d21a91b 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryLavender_Tests.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryLavender_Tests.cpp @@ -29,6 +29,7 @@ #include "VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldMap.h" #include "VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldMaps.h" #include "VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSim.h" +#include "PokemonFRLG_AutoStoryLegs.h" #include "PokemonFRLG_AutoStoryEvents.h" #include "PokemonFRLG_AutoStoryFaultSweep_Tests.h" #include "PokemonFRLG_AutoStoryResources.h" From 953bb8c092639a0c87ed6894f4da5b19824b48ad Mon Sep 17 00:00:00 2001 From: dayfine Date: Tue, 10 Nov 2026 01:51:44 -0800 Subject: [PATCH 52/79] FRLG AutoStory 00.32: the Rocket Hideout's lift, door guards, Giovanni and SILPH SCOPE as an authored plan B3F back up by taps to its top corridor, B2F's arrows as taps with each slide ending a leg, the MOON STONE picked up where its ball blocks column 2, the lift to B4F, both door guards, Giovanni, the SILPH SCOPE and an Escape Rope out. The Rare Candies and Blastoise's evolution are left out: no executor uses an item on a party slot yet. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss --- .../PokemonFRLG_AutoStoryLavender_Tests.cpp | 38 ++ .../PokemonFRLG_AutoStoryRunPlan_Tests.cpp | 8 +- .../AutoStory/PokemonFRLG_AutoStory_Tests.cpp | 4 +- .../StoryData/Draft/frlg-00.32.plan.json | 111 ----- .../AutoStory/StoryData/frlg-00.32.plan.json | 404 ++++++++++++++++++ 5 files changed, 448 insertions(+), 117 deletions(-) delete mode 100644 SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/Draft/frlg-00.32.plan.json create mode 100644 SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.32.plan.json diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryLavender_Tests.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryLavender_Tests.cpp index b90d21a91b..96e320cc5a 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryLavender_Tests.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryLavender_Tests.cpp @@ -755,6 +755,43 @@ UnitTestResult test_hideout_row(Logger&){ } // namespace +// 00.32 on the sim: from below B3F's Rare Candy back up to B2F, through +// its arrows (the MOON STONE ball stands in the way and is picked up), +// the lift to B4F, the two door guards, Giovanni, and beside the SILPH +// SCOPE. The talk-started battles are the sim's to skip; the MOON +// STONE's pickup hides its ball, as the game does. +UnitTestResult test_hideout_giovanni_row(Logger&){ + const StoryCheckpoint& row = checkpoint("00.32"); + StoryPose at = *story_pose(*row.start); + std::vector maps = maps_after_route10(); + auto sim = std::make_unique(maps, MapPosition{at.map, at.tile}, *at.facing); + for (const StoryStep& step : row.steps){ + if (step.name == "escape_rope_hideout"){ + break; + } + if (const std::string failure = row_step_on_sim(*sim, at, step, row.id); !failure.empty()){ + return "00.32: ended on " + to_string(sim->state().position) + "; " + failure; + } + if (step.name == "moon_stone"){ + for (MapData& map : maps){ + hide_objects(map, {"FLAG_HIDE_ROCKET_HIDEOUT_B2F_MOON_STONE"}); + } + sim = std::make_unique(maps, sim->state().position, sim->state().facing); + } + } + if (!sim->state().trainers_beaten.empty()){ + return std::format("00.32: walked into {} trainers' lines on the sim.", sim->state().trainers_beaten.size()); + } + if (!sim->state().violations.empty()){ + return "00.32: a violation on the way: " + sim->state().violations.back(); + } + const MapPosition end{"RocketHideout_B4F", {21, 5}}; + if (!(sim->state().position == end)){ + return "00.32: ended on " + to_string(sim->state().position) + ", not " + to_string(end) + "."; + } + return true; +} + const AutoStoryLavenderCase AUTO_STORY_LAVENDER_CASES[] = { {.input = {"00.28 the tree, Rock Tunnel's nine trainers, out of its south mouth", test_rock_tunnel_row}, .expectation = {}}, {.input = {"00.28 a wild battle mid-leg in the tunnel", test_rock_tunnel_wild_battles}, .expectation = {}}, @@ -775,6 +812,7 @@ const AutoStoryLavenderCase AUTO_STORY_LAVENDER_CASES[] = { {.input = {"00.30 Route 8 west from a start up to 3 tiles off", test_route8_west_off_start}, .expectation = {}}, {.input = {"00.30 saves in Celadon City's Pokemon Center", test_celadon_save_place}, .expectation = {}}, {.input = {"00.31 the Game Corner's poster, the Rocket Hideout to B4F's LIFT KEY and B3F's Rare Candy", test_hideout_row}, .expectation = {}}, + {.input = {"00.32 B2F's arrows, the lift, the door guards, Giovanni and the SILPH SCOPE", test_hideout_giovanni_row}, .expectation = {}}, }; void add_tests_AutoStoryLavender(UnitTestDatabase& database){ diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRunPlan_Tests.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRunPlan_Tests.cpp index a5d02a435d..f02be1c314 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRunPlan_Tests.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRunPlan_Tests.cpp @@ -138,7 +138,7 @@ class Test_RunPlan : public UnitTest{ const RunPlanScenario m_scenario; }; -const std::string TODAY = "00.01 00.02 00.03 00.04 00.05 00.06 00.07 00.08 00.09 00.10 00.11 00.12 00.12c 00.13 00.14 00.14b 00.14c 00.15 00.15b 00.16 00.17 00.18 00.19 00.20 00.21 00.22 00.23 00.24 00.25 00.26 00.27 00.28 00.29 00.30 00.31"; +const std::string TODAY = "00.01 00.02 00.03 00.04 00.05 00.06 00.07 00.08 00.09 00.10 00.11 00.12 00.12c 00.13 00.14 00.14b 00.14c 00.15 00.15b 00.16 00.17 00.18 00.19 00.20 00.21 00.22 00.23 00.24 00.25 00.26 00.27 00.28 00.29 00.30 00.31 00.32"; const RunPlanScenario RUN_PLAN_CASES[] = { { @@ -229,11 +229,11 @@ const RunPlanScenario RUN_PLAN_CASES[] = { }, { .input = {.name = "Gift RNG off: 00.12b is passed over", .first = "00.11"}, - .expectation = {.expected_ids = "00.11 00.12 00.12c 00.13 00.14 00.14b 00.14c 00.15 00.15b 00.16 00.17 00.18 00.19 00.20 00.21 00.22 00.23 00.24 00.25 00.26 00.27 00.28 00.29 00.30 00.31"}, + .expectation = {.expected_ids = "00.11 00.12 00.12c 00.13 00.14 00.14b 00.14c 00.15 00.15b 00.16 00.17 00.18 00.19 00.20 00.21 00.22 00.23 00.24 00.25 00.26 00.27 00.28 00.29 00.30 00.31 00.32"}, }, { .input = {.name = "Gift RNG off: 00.12b runs when started at", .first = "00.12b"}, - .expectation = {.expected_ids = "00.12b 00.12c 00.13 00.14 00.14b 00.14c 00.15 00.15b 00.16 00.17 00.18 00.19 00.20 00.21 00.22 00.23 00.24 00.25 00.26 00.27 00.28 00.29 00.30 00.31"}, + .expectation = {.expected_ids = "00.12b 00.12c 00.13 00.14 00.14b 00.14c 00.15 00.15b 00.16 00.17 00.18 00.19 00.20 00.21 00.22 00.23 00.24 00.25 00.26 00.27 00.28 00.29 00.30 00.31 00.32"}, }, { .input = { .name = "Gift RNG: started at 00.12b, from the save beside the salesman", @@ -258,7 +258,7 @@ const RunPlanScenario RUN_PLAN_CASES[] = { }, { .input = {.name = "Starter RNG alone: 00.12b runs when started at", .first = "00.12b", .handoffs = {.starter_rng = true}}, - .expectation = {.expected_ids = "00.12b 00.12c 00.13 00.14 00.14b 00.14c 00.15 00.15b 00.16 00.17 00.18 00.19 00.20 00.21 00.22 00.23 00.24 00.25 00.26 00.27 00.28 00.29 00.30 00.31"}, + .expectation = {.expected_ids = "00.12b 00.12c 00.13 00.14 00.14b 00.14c 00.15 00.15b 00.16 00.17 00.18 00.19 00.20 00.21 00.22 00.23 00.24 00.25 00.26 00.27 00.28 00.29 00.30 00.31 00.32"}, }, { .input = { .name = "Starter RNG first, with both on", diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStory_Tests.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStory_Tests.cpp index 48a3e724dc..9cfe7926b6 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStory_Tests.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStory_Tests.cpp @@ -231,8 +231,8 @@ UnitTestResult check_checkpoint(const StoryCheckpoint& checkpoint, StoryPose& po UnitTestResult test_routes_and_chain(){ const std::vector& checkpoints = story_checkpoints(); - if (checkpoints.size() != 38 || checkpoints[0].start){ - return "Expected 38 checkpoints, the first from a new game."; + if (checkpoints.size() != 39 || checkpoints[0].start){ + return "Expected 39 checkpoints, the first from a new game."; } StoryPose pose; for (size_t c = 0; c < checkpoints.size(); c++){ diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/Draft/frlg-00.32.plan.json b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/Draft/frlg-00.32.plan.json deleted file mode 100644 index fcb107b1f7..0000000000 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/Draft/frlg-00.32.plan.json +++ /dev/null @@ -1,111 +0,0 @@ -{ - "format": "pokesim-authored-checkpoint/1", - "game": "frlg", - "checkpoint": { - "id": "00.32", - "title": "Rocket Hideout: the lift to B4F, the two door guards, two Rare Candies, Blastoise, Giovanni and the SILPH SCOPE", - "start": {"certainty": "tile", "map": "RocketHideout_B3F", "where": {"facing": "north", "kind": "tiles", "tiles": [[12, 13]]}}, - "events": [ - { - "id": "b2f_lift", - "kind": "route", - "target": {"certainty": "tile", "map": "RocketHideout_B2F", "where": {"facing": "north", "kind": "tiles", "tiles": [[28, 17]]}}, - "variant": "run", - "why": "up to B2F, along the arrow tiles to the lift (28..29, 16)" - }, - { - "id": "lift_to_b4f", - "kind": "game_action", - "declared_after": {"certainty": "tile", "map": "RocketHideout_B4F", "where": {"facing": "south", "kind": "tiles", "tiles": [[20, 23]]}}, - "variant": "lift_floor", - "args": {"from": "B2F", "to": "B4F"}, - "why": "the lift script: in through the door (28, 16), to the panel, B4F with the LIFT KEY, out onto B4F's lift door; no map of the lift" - }, - { - "id": "b4f_below_guards", - "kind": "route", - "target": {"certainty": "tile", "map": "RocketHideout_B4F", "where": {"facing": "north", "kind": "tiles", "tiles": [[17, 16]]}}, - "variant": "run", - "why": "from the lift door to below the two Grunts (16, 14) and (19, 14)" - }, - { - "id": "talk_left_guard", - "kind": "talk", - "why": "the left door guard" - }, - { - "id": "hideout-left-guard", - "kind": "battle", - "declared_after": {"certainty": "tile", "map": "RocketHideout_B4F", "where": {"facing": "north", "kind": "tiles", "tiles": [[17, 16]]}}, - "why": "Rocket Grunt (TRAINER_TEAM_ROCKET_GRUNT_16): Sandshrew, Sandslash, Ekans Lv23" - }, - { - "id": "talk_right_guard", - "kind": "talk", - "why": "the right door guard" - }, - { - "id": "hideout-right-guard", - "kind": "battle", - "declared_after": {"certainty": "tile", "map": "RocketHideout_B4F", "where": {"facing": "north", "kind": "tiles", "tiles": [[17, 16]]}}, - "why": "Rocket Grunt (TRAINER_TEAM_ROCKET_GRUNT_17): Ekans, Sandshrew, Arbok Lv23; the door opens" - }, - { - "id": "rare_candy_1", - "kind": "game_action", - "variant": "use_item", - "args": {"item": "rare-candy", "slot": 1}, - "why": "Rare Candy: Lv35 (pokeguy 1:00:25)" - }, - { - "id": "rare_candy_2", - "kind": "game_action", - "variant": "use_item", - "args": {"item": "rare-candy", "slot": 1}, - "why": "Rare Candy: Lv36, Wartortle evolves" - }, - { - "id": "evolve_blastoise", - "kind": "scene", - "why": "Wartortle evolves into Blastoise; do not press B" - }, - { - "id": "below_giovanni", - "kind": "route", - "target": {"certainty": "tile", "map": "RocketHideout_B4F", "where": {"facing": "north", "kind": "tiles", "tiles": [[19, 5]]}}, - "why": "through the door to below Giovanni (19, 4)" - }, - { - "id": "talk_giovanni", - "kind": "talk", - "why": "Giovanni" - }, - { - "id": "hideout-giovanni", - "kind": "battle", - "declared_after": {"certainty": "tile", "map": "RocketHideout_B4F", "where": {"facing": "north", "kind": "tiles", "tiles": [[19, 5]]}}, - "why": "Giovanni (TRAINER_BOSS_GIOVANNI): Onix, Rhyhorn, Kangaskhan" - }, - { - "id": "beside_silph_scope", - "kind": "route", - "target": {"certainty": "tile", "map": "RocketHideout_B4F", "where": {"facing": "west", "kind": "tiles", "tiles": [[21, 5]]}}, - "why": "round to east of the SILPH SCOPE (20, 5)" - }, - { - "id": "silph_scope", - "kind": "talk", - "why": "pick up the SILPH SCOPE" - }, - { - "id": "escape_rope_hideout", - "kind": "game_action", - "declared_after": {"certainty": "tile", "map": "CeladonCity", "where": {"facing": "south", "kind": "tiles", "tiles": [[34, 22]]}}, - "variant": "use_item", - "args": {"item": "escape-rope"}, - "why": "out to the Game Corner's door (pokeguy 1:02:10)" - } - ] - }, - "execution": {"menu": "full"} -} diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.32.plan.json b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.32.plan.json new file mode 100644 index 0000000000..231d908613 --- /dev/null +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.32.plan.json @@ -0,0 +1,404 @@ +{ + "format": "pokesim-authored-checkpoint/1", + "game": "frlg", + "checkpoint": { + "id": "00.32", + "title": "Rocket Hideout: B2F's arrows and the MOON STONE, the lift to B4F, the two door guards, Giovanni, the SILPH SCOPE and an Escape Rope out", + "start": { + "certainty": "tile", + "map": "RocketHideout_B3F", + "where": { + "facing": "north", + "kind": "tiles", + "tiles": [ + [ + 12, + 13 + ] + ] + } + }, + "events": [ + { + "id": "b3f_to_top_corridor", + "kind": "legs", + "variant": "taps", + "legs": [ + { + "direction": "west", + "tiles": 4 + }, + { + "direction": "north", + "tiles": 2 + }, + { + "direction": "east", + "tiles": 4 + }, + { + "direction": "north", + "tiles": 7 + } + ], + "why": "a tap a tile from below the Rare Candy (12, 12): west along row 13 to (8, 13), north onto the arrow (8, 11), which slides to the stop (8, 9), east to (12, 9) and up column 12 to the wall at (12, 2)" + }, + { + "id": "b2f_from_b3f", + "kind": "route", + "target": { + "certainty": "tile", + "map": "RocketHideout_B2F", + "where": { + "facing": "east", + "kind": "tiles", + "tiles": [ + [ + 21, + 2 + ] + ] + } + }, + "variant": "run", + "why": "east along row 2 onto the stairs (18, 2), up to B2F's (21, 2); no arrow on the way" + }, + { + "id": "b2f_arrows_to_moon_stone", + "kind": "legs", + "variant": "taps", + "legs": [ + { + "direction": "south", + "tiles": 1 + }, + { + "direction": "west", + "tiles": 2 + }, + { + "direction": "south", + "tiles": 2 + }, + { + "direction": "west", + "tiles": 2 + }, + { + "direction": "south", + "tiles": 1 + }, + { + "direction": "west", + "tiles": 1 + } + ], + "why": "a tap a tile, west of the turning Grunt (20, 6) and out of his lines (sight 2): down to (21, 3), west to (19, 3), down to (19, 5), west to (17, 5), down to (17, 6), west onto the arrow (16, 6), which slides west and, turned at (11, 6) and (11, 4), on to the stop (1, 4)" + }, + { + "id": "above_moon_stone", + "kind": "route", + "target": { + "certainty": "tile", + "map": "RocketHideout_B2F", + "where": { + "facing": "south", + "kind": "tiles", + "tiles": [ + [ + 2, + 4 + ] + ] + } + }, + "variant": "run", + "why": "a step east, above the MOON STONE (2, 5), which stands in the only way on (pokeguy 57:52)" + }, + { + "id": "moon_stone", + "kind": "talk", + "why": "pick up the MOON STONE: the ball blocks column 2" + }, + { + "id": "b2f_arrows_to_lift_room", + "kind": "legs", + "variant": "taps", + "legs": [ + { + "direction": "south", + "tiles": 4 + }, + { + "direction": "east", + "tiles": 1 + }, + { + "direction": "south", + "tiles": 1 + }, + { + "direction": "east", + "tiles": 1 + }, + { + "direction": "east", + "tiles": 2 + }, + { + "direction": "west", + "tiles": 2 + }, + { + "direction": "east", + "tiles": 3 + }, + { + "direction": "south", + "tiles": 2 + }, + { + "direction": "west", + "tiles": 1 + }, + { + "direction": "east", + "tiles": 1 + }, + { + "direction": "south", + "tiles": 1 + } + ], + "why": "a tap a tile through B2F's arrows, each slide the end of a leg: down column 2 to (2, 8), east and down to (3, 9), east onto (4, 9), which slides to the stop (8, 11); east twice, the second onto a slide to the stop (14, 13); west twice onto a slide to the stop (10, 15); east to (13, 15), down to (13, 17), west onto a slide to the stop (8, 19), east to (9, 19) and down onto (9, 20), which slides east to the stop (13, 20)" + }, + { + "id": "below_lift", + "kind": "route", + "target": { + "certainty": "tile", + "map": "RocketHideout_B2F", + "where": { + "facing": "north", + "kind": "tiles", + "tiles": [ + [ + 28, + 17 + ] + ] + } + }, + "variant": "run", + "why": "east to (15, 20), up column 15 to row 17 and east along it to below the lift door (28, 16); no arrow on the way" + }, + { + "id": "lift_to_b4f", + "kind": "game_action", + "declared_after": { + "certainty": "tile", + "map": "RocketHideout_B4F", + "where": { + "facing": "south", + "kind": "tiles", + "tiles": [ + [ + 20, + 23 + ] + ] + } + }, + "variant": "lift_floor", + "args": { + "from": "B2F", + "to": "B4F" + }, + "why": "the lift script: in through the door (28, 16), to the panel, B4F with the LIFT KEY, out onto B4F's lift door; no map of the lift" + }, + { + "id": "below_left_guard", + "kind": "route", + "target": { + "certainty": "tile", + "map": "RocketHideout_B4F", + "where": { + "facing": "north", + "kind": "tiles", + "tiles": [ + [ + 16, + 15 + ] + ] + } + }, + "variant": "run", + "why": "from the lift door up to below the left door Grunt (16, 14)" + }, + { + "id": "talk_left_guard", + "kind": "talk", + "why": "the left door guard" + }, + { + "id": "left_guard", + "kind": "battle", + "declared_after": { + "certainty": "tile", + "map": "RocketHideout_B4F", + "where": { + "facing": "north", + "kind": "tiles", + "tiles": [ + [ + 16, + 15 + ] + ] + } + }, + "why": "Rocket Grunt (TRAINER_TEAM_ROCKET_GRUNT_16): Sandshrew, Sandslash, Ekans Lv23" + }, + { + "id": "below_right_guard", + "kind": "route", + "target": { + "certainty": "tile", + "map": "RocketHideout_B4F", + "where": { + "facing": "north", + "kind": "tiles", + "tiles": [ + [ + 19, + 15 + ] + ] + } + }, + "variant": "run", + "why": "east along row 15 to below the right door Grunt (19, 14)" + }, + { + "id": "talk_right_guard", + "kind": "talk", + "why": "the right door guard" + }, + { + "id": "right_guard", + "kind": "battle", + "declared_after": { + "certainty": "tile", + "map": "RocketHideout_B4F", + "where": { + "facing": "north", + "kind": "tiles", + "tiles": [ + [ + 19, + 15 + ] + ] + } + }, + "why": "Rocket Grunt (TRAINER_TEAM_ROCKET_GRUNT_17): Ekans, Sandshrew, Arbok Lv23 (Arbok's Glare paralysed pokeguy's Wartortle, 59:44)" + }, + { + "id": "below_giovanni", + "kind": "route", + "target": { + "certainty": "tile", + "map": "RocketHideout_B4F", + "where": { + "facing": "north", + "kind": "tiles", + "tiles": [ + [ + 19, + 5 + ] + ] + } + }, + "variant": "run", + "why": "between the guards (17..18, 12..13) and up to below Giovanni (19, 4)" + }, + { + "id": "talk_giovanni", + "kind": "talk", + "why": "Giovanni" + }, + { + "id": "giovanni", + "kind": "battle", + "declared_after": { + "certainty": "tile", + "map": "RocketHideout_B4F", + "where": { + "facing": "north", + "kind": "tiles", + "tiles": [ + [ + 19, + 5 + ] + ] + } + }, + "why": "Giovanni (TRAINER_BOSS_GIOVANNI): Onix, Rhyhorn, Kangaskhan" + }, + { + "id": "beside_silph_scope", + "kind": "route", + "target": { + "certainty": "tile", + "map": "RocketHideout_B4F", + "where": { + "facing": "west", + "kind": "tiles", + "tiles": [ + [ + 21, + 5 + ] + ] + } + }, + "variant": "run", + "why": "round by row 7 to east of the SILPH SCOPE (20, 5)" + }, + { + "id": "silph_scope", + "kind": "talk", + "why": "pick up the SILPH SCOPE (pokeguy 1:02:10)" + }, + { + "id": "escape_rope_hideout", + "kind": "game_action", + "declared_after": { + "certainty": "tile", + "map": "CeladonCity", + "where": { + "facing": "south", + "kind": "tiles", + "tiles": [ + [ + 34, + 22 + ] + ] + } + }, + "variant": "use_item", + "args": { + "item": "escape-rope" + }, + "why": "out to the Game Corner's door (pokeguy 1:02:17)" + } + ] + }, + "execution": { + "menu": "full" + } +} From d285f9317770a3ec0833bedceac2bee6913660a6 Mon Sep 17 00:00:00 2001 From: dayfine Date: Tue, 10 Nov 2026 01:54:14 -0800 Subject: [PATCH 53/79] FRLG AutoStory 00.32: the story maps without B2F's MOON STONE ball; the Rocket Hideout's save card place Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss --- .../Inference/Menus/PokemonFRLG_SaveCardReader.cpp | 1 + .../Programs/AutoStory/PokemonFRLG_AutoStoryEvents.cpp | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Inference/Menus/PokemonFRLG_SaveCardReader.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Inference/Menus/PokemonFRLG_SaveCardReader.cpp index 6401dd7cc9..0a4f626940 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Inference/Menus/PokemonFRLG_SaveCardReader.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Inference/Menus/PokemonFRLG_SaveCardReader.cpp @@ -77,6 +77,7 @@ class PlaceNameMatcher : public OCR::SmallDictionaryMatcher{ {"lavender-town", "Lavender Town"}, {"vermilion-city", "Vermilion City"}, {"celadon-city", "Celadon City"}, + {"rocket-hideout", "Rocket Hideout"}, }){ JsonArray names; names.push_back(name); diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryEvents.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryEvents.cpp index 1563e3e99c..74e6ddb01a 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryEvents.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryEvents.cpp @@ -366,6 +366,9 @@ const std::vector& story_maps(){ const std::vector all = overworld_maps(); std::set flags = map_flag_set(all, "after_hall_of_fame"); flags.merge(map_flag_set(all, "new_game")); + // The one ball the story picks up in its way: B2F's MOON STONE + // blocks column 2 of the arrow floor (00.32's moon_stone). + flags.insert("FLAG_HIDE_ROCKET_HIDEOUT_B2F_MOON_STONE"); return overworld_maps(flags); }(); return maps; @@ -400,6 +403,7 @@ std::string save_card_place(const std::string& map){ {"Route10", "route-10"}, {"LavenderTown", "lavender-town"}, {"CeladonCity", "celadon-city"}, + {"RocketHideout", "rocket-hideout"}, }; for (const auto& [prefix, place] : PLACES){ if (map == prefix || map.rfind(prefix + "_", 0) == 0){ From cccd2fa056781c9776d4e0f87466a3cc762f881e Mon Sep 17 00:00:00 2001 From: dayfine Date: Tue, 10 Nov 2026 01:59:06 -0800 Subject: [PATCH 54/79] FRLG AutoStory 00.32: the row on the sim, the golden trace's 00.32 lines, and B2F's taps and short-hold sweep Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss --- .../PokemonFRLG_AutoStoryHideout_Tests.cpp | 36 +++++++++ .../PokemonFRLG_AutoStoryLavender_Tests.cpp | 14 +++- .../ReplayData/frlg-story-sim-trace.json | 75 ++++++++++++++++++- 3 files changed, 119 insertions(+), 6 deletions(-) diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryHideout_Tests.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryHideout_Tests.cpp index eb424124d6..98c660e552 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryHideout_Tests.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryHideout_Tests.cpp @@ -297,6 +297,38 @@ UnitTestResult test_b3f_maze_taps(){ return true; } +// 00.32's taps (frlg-00.32.plan.json): B3F from below its Rare Candy up +// to the top corridor, and B2F's arrows to the MOON STONE's stop and on +// to the lift room's stop (13, 20), with any one turn dropped; the routes +// between them, with no arrow on the way, with any hold short. +UnitTestResult test_b2f_maze_taps(){ + using Pokemon::StoryLeg; + const MapPosition b2f_stairs{"RocketHideout_B2F", {21, 2}}; + const MapPosition lift_stop{"RocketHideout_B2F", {13, 20}}; + const std::vector failures{ + tap_legs_on_sim({"RocketHideout_B3F", {12, 13}}, Direction::NORTH, { + {Direction::WEST, 4}, {Direction::NORTH, 2}, {Direction::EAST, 4}, {Direction::NORTH, 7}, + }, {"RocketHideout_B3F", {12, 2}}), + tap_legs_on_sim(b2f_stairs, Direction::EAST, { + {Direction::SOUTH, 1}, {Direction::WEST, 2}, {Direction::SOUTH, 2}, {Direction::WEST, 2}, {Direction::SOUTH, 1}, {Direction::WEST, 1}, + }, {"RocketHideout_B2F", {1, 4}}), + tap_legs_on_sim({"RocketHideout_B2F", {2, 4}}, Direction::SOUTH, { + {Direction::SOUTH, 4}, {Direction::EAST, 1}, {Direction::SOUTH, 1}, {Direction::EAST, 1}, {Direction::EAST, 2}, {Direction::WEST, 2}, + {Direction::EAST, 3}, {Direction::SOUTH, 2}, {Direction::WEST, 1}, {Direction::EAST, 1}, {Direction::SOUTH, 1}, + }, lift_stop), + short_holds_on_sim({"RocketHideout_B3F", {12, 2}}, Direction::NORTH, b2f_stairs), + short_holds_on_sim(lift_stop, Direction::EAST, {"RocketHideout_B2F", {28, 17}}), + short_holds_on_sim({"RocketHideout_B4F", {20, 24}}, Direction::SOUTH, {"RocketHideout_B4F", {16, 15}}), + short_holds_on_sim({"RocketHideout_B4F", {19, 15}}, Direction::NORTH, {"RocketHideout_B4F", {19, 5}}), + }; + for (const std::string& failure : failures){ + if (!failure.empty()){ + return failure; + } + } + return true; +} + struct AutoStoryHideoutBodyInput{ std::string name; UnitTestResult (*body)(); @@ -340,6 +372,10 @@ const AutoStoryHideoutBodyCase HIDEOUT_BODY_CASES[] = { .input = {.name = "B3F's arrow floor a tap at a time", .body = test_b3f_maze_taps}, .expectation = {.description = "below the stairs to B4F, with any one turn dropped"}, }, + { + .input = {.name = "B2F's arrow floor to the lift a tap at a time", .body = test_b2f_maze_taps}, + .expectation = {.description = "00.32's taps and the routes between them, any turn dropped or hold short"}, + }, }; const LiftCase LIFT_CASES[] = { diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryLavender_Tests.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryLavender_Tests.cpp index 96e320cc5a..0909dd3e37 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryLavender_Tests.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryLavender_Tests.cpp @@ -26,6 +26,7 @@ #include #include "Common/Cpp/Exceptions.h" #include "Common/Cpp/TestRunners/UnitTest.h" +#include "VideoGames/PokemonFRLG/Overworld/PokemonFRLG_HideoutLiftRoom.h" #include "VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldMap.h" #include "VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldMaps.h" #include "VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSim.h" @@ -764,11 +765,20 @@ UnitTestResult test_hideout_giovanni_row(Logger&){ const StoryCheckpoint& row = checkpoint("00.32"); StoryPose at = *story_pose(*row.start); std::vector maps = maps_after_route10(); - auto sim = std::make_unique(maps, MapPosition{at.map, at.tile}, *at.facing); + if (std::none_of(maps.begin(), maps.end(), [](const MapData& map){ return map.name == LIFT_MAP; })){ + maps.push_back(rocket_hideout_lift_room()); + } + SimScript script; + script.lift_floors[std::string(LIFT_MAP)] = rocket_hideout_lift_doors(); + auto sim = std::make_unique(maps, MapPosition{at.map, at.tile}, *at.facing, script); for (const StoryStep& step : row.steps){ if (step.name == "escape_rope_hideout"){ break; } + if (step.kind == StoryStepKind::BATTLE){ + at = *story_pose(*step.pose_after); + continue; + } if (const std::string failure = row_step_on_sim(*sim, at, step, row.id); !failure.empty()){ return "00.32: ended on " + to_string(sim->state().position) + "; " + failure; } @@ -776,7 +786,7 @@ UnitTestResult test_hideout_giovanni_row(Logger&){ for (MapData& map : maps){ hide_objects(map, {"FLAG_HIDE_ROCKET_HIDEOUT_B2F_MOON_STONE"}); } - sim = std::make_unique(maps, sim->state().position, sim->state().facing); + sim = std::make_unique(maps, sim->state().position, sim->state().facing, script); } } if (!sim->state().trainers_beaten.empty()){ diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/ReplayData/frlg-story-sim-trace.json b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/ReplayData/frlg-story-sim-trace.json index e3cc1c3a99..0c08026fd1 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/ReplayData/frlg-story-sim-trace.json +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/ReplayData/frlg-story-sim-trace.json @@ -1,7 +1,7 @@ { "about": "story_sim_trace() of the FRLG story table (Data/AuthoredStory_Tests.h), taken from the C++ rows before they moved to StoryData; from 00.30 on, from their plans.", "trace": [ - "[Segment] 00: start, 35 checkpoints", + "[Segment] 00: start, 36 checkpoints", "begin 00.01", "[Checkpoint] 00.01: start, 2 events", "[Event] 00.01/1 intro: start", @@ -1340,9 +1340,76 @@ "save at RocketHideout_B3F (12, 13) facing north (tile)", "[Checkpoint] 00.31: done, 20 run, 0 skipped", "[Checkpoint] 00.31: passed on attempt 1 (one-shot)", - "[Segment] 00: 35 of 35 checkpoints one-shot", - "[Segment] 00: done, 35 checkpoints", + "begin 00.32", + "[Checkpoint] 00.32: start, 21 events", + "[Event] 00.32/1 from_save: start", + "[Event] 00.32/1 from_save: done", + "[Event] 00.32/2 b3f_to_top_corridor: start", + "00.32/b3f_to_top_corridor: ok at RocketHideout_B3F (12, 2) facing north (tile)", + "[Event] 00.32/2 b3f_to_top_corridor: done", + "[Event] 00.32/3 b2f_from_b3f: start", + "00.32/b2f_from_b3f: ok at RocketHideout_B2F (21, 2) facing east (tile)", + "[Event] 00.32/3 b2f_from_b3f: done", + "[Event] 00.32/4 b2f_arrows_to_moon_stone: start", + "00.32/b2f_arrows_to_moon_stone: ok at RocketHideout_B2F (1, 4) facing west (tile)", + "[Event] 00.32/4 b2f_arrows_to_moon_stone: done", + "[Event] 00.32/5 above_moon_stone: start", + "00.32/above_moon_stone: ok at RocketHideout_B2F (2, 4) facing south (tile)", + "[Event] 00.32/5 above_moon_stone: done", + "[Event] 00.32/6 moon_stone: start", + "00.32/moon_stone: ok at -", + "[Event] 00.32/6 moon_stone: done", + "[Event] 00.32/7 b2f_arrows_to_lift_room: start", + "00.32/b2f_arrows_to_lift_room: ok at RocketHideout_B2F (13, 20) facing east (tile)", + "[Event] 00.32/7 b2f_arrows_to_lift_room: done", + "[Event] 00.32/8 below_lift: start", + "00.32/below_lift: ok at RocketHideout_B2F (28, 17) facing north (tile)", + "[Event] 00.32/8 below_lift: done", + "[Event] 00.32/9 lift_to_b4f: start", + "00.32/lift_to_b4f: ok at RocketHideout_B2F (28, 17) facing north (tile)", + "[Event] 00.32/9 lift_to_b4f: done", + "[Event] 00.32/10 below_left_guard: start", + "00.32/below_left_guard: ok at RocketHideout_B4F (16, 15) facing north (tile)", + "[Event] 00.32/10 below_left_guard: done", + "[Event] 00.32/11 talk_left_guard: start", + "00.32/talk_left_guard: ok at -", + "[Event] 00.32/11 talk_left_guard: done", + "[Event] 00.32/12 left_guard: start", + "00.32/left_guard: ok at -", + "[Event] 00.32/12 left_guard: done", + "[Event] 00.32/13 below_right_guard: start", + "00.32/below_right_guard: ok at RocketHideout_B4F (19, 15) facing north (tile)", + "[Event] 00.32/13 below_right_guard: done", + "[Event] 00.32/14 talk_right_guard: start", + "00.32/talk_right_guard: ok at -", + "[Event] 00.32/14 talk_right_guard: done", + "[Event] 00.32/15 right_guard: start", + "00.32/right_guard: ok at -", + "[Event] 00.32/15 right_guard: done", + "[Event] 00.32/16 below_giovanni: start", + "00.32/below_giovanni: ok at RocketHideout_B4F (19, 5) facing north (tile)", + "[Event] 00.32/16 below_giovanni: done", + "[Event] 00.32/17 talk_giovanni: start", + "00.32/talk_giovanni: ok at -", + "[Event] 00.32/17 talk_giovanni: done", + "[Event] 00.32/18 giovanni: start", + "00.32/giovanni: ok at -", + "[Event] 00.32/18 giovanni: done", + "[Event] 00.32/19 beside_silph_scope: start", + "00.32/beside_silph_scope: ok at RocketHideout_B4F (21, 5) facing west (tile)", + "[Event] 00.32/19 beside_silph_scope: done", + "[Event] 00.32/20 silph_scope: start", + "00.32/silph_scope: ok at -", + "[Event] 00.32/20 silph_scope: done", + "[Event] 00.32/21 escape_rope_hideout: start", + "00.32/escape_rope_hideout: ok at RocketHideout_B4F (21, 5) facing west (tile)", + "[Event] 00.32/21 escape_rope_hideout: done", + "save at CeladonCity (34, 22) facing south (tile)", + "[Checkpoint] 00.32: done, 21 run, 0 skipped", + "[Checkpoint] 00.32: passed on attempt 1 (one-shot)", + "[Segment] 00: 36 of 36 checkpoints one-shot", + "[Segment] 00: done, 36 checkpoints", "completed", - "00.01: 2 stubbed: intro, options\n00.02: 0 stubbed\n00.03: 1 stubbed: to_the_lab\n00.04: 5 stubbed: squirtle_ball, choose_squirtle, no_nickname, rival_takes_bulbasaur, rival_battle\n00.05: 1 stubbed: parcel_from_clerk\n00.06: 2 stubbed: give_parcel, pokedex_scene\n00.07: 2 stubbed: heal_viridian, old_man_tutorial\n00.08: 1 stubbed: heal_pewter\n00.09: 3 stubbed: camper_liam, challenge_brock, brock\n00.10: 1 stubbed: shoes_from_aide\n00.11: 4 stubbed: heal_pewter, bug_catcher_colton, bug_catcher_greg, bug_catcher_james\n00.12: 1 stubbed: heal_route4\n00.12c: 1 stubbed: magikarp_to_box\n00.13: 6 stubbed: heal_route4, moon_stone_ball, found_moon_stone, rocket_grunt, super_nerd_miguel, helix_fossil\n00.14: 2 stubbed: teach_mega_kick, heal_cerulean\n00.14b: 3 stubbed: buy_potions, grind_to_lv23, heal_cerulean\n00.14c: 4 stubbed: challenge_misty, misty, heal_cerulean, teach_water_pulse\n00.15: 4 stubbed: teach_water_pulse, buy_potions, grind_for_rival, heal_cerulean\n00.15b: 2 stubbed: teach_water_pulse, rival_cerulean\n00.16: 7 stubbed: heal_cerulean, bug_catcher_cale, lass_ali, youngster_timmy, lass_reli, camper_ethan, rocket_grunt\n00.17: 4 stubbed: hiker_franklin, picnicker_kelsey, hiker_nob, lass_haley\n00.18: 7 stubbed: bill_clefairy, help_bill, bill_into_teleporter, cell_separator, bill_comes_out, thank_bill, ss_ticket\n00.19: 1 stubbed: heal_cerulean\n00.20: 3 stubbed: buy_poke_balls, catch_oddish, heal_cerulean\n00.21: 3 stubbed: rocket_grunt, camper_jeff, heal_vermilion\n00.22: 6 stubbed: show_ss_ticket, rival_ss_anne, captain, hm01_cut, ss_anne_sails, heal_vermilion\n00.23: 9 stubbed: teach_cut, teach_dig, cut_gym_tree, sailor_dwayne, engineer_baily, gentleman_tucker, trash_cans, cut_tree_out, heal_vermilion\n00.24: 4 stubbed: surge_winnable, grind_for_surge, heal_vermilion, cut_gym_tree\n00.25: 4 stubbed: challenge_lt_surge, lt_surge, cut_tree_out, heal_vermilion\n00.26: 8 stubbed: chairman, hear_story, bike_voucher, cut_cerulean_tree, talk_bike_clerk, bicycle, buy_repels, heal_cerulean\n00.27: 6 stubbed: cut_cerulean_tree, cut_route9_tree, picnicker_alicia, hiker_jeremy, bug_catcher_conner, heal_route10\n00.28: 9 stubbed: cut_route10_tree, pokemaniac_ashton, pokemaniac_winston, picnicker_martha, hiker_allen, hiker_lenny, picnicker_sofia, hiker_dudley, picnicker_dana\n00.29: 1 stubbed: heal_lavender\n00.30: 7 stubbed: register_bike, buy_ropes_and_super_repels, ride_bike, gamer_rich, catch_pidgey, celadon_nurse, heal_celadon\n00.31: 6 stubbed: talk_poster_guard, rocket_grunt, poster_switch, lift_key_grunt, lift_key, b3f_rare_candy\n" + "00.01: 2 stubbed: intro, options\n00.02: 0 stubbed\n00.03: 1 stubbed: to_the_lab\n00.04: 5 stubbed: squirtle_ball, choose_squirtle, no_nickname, rival_takes_bulbasaur, rival_battle\n00.05: 1 stubbed: parcel_from_clerk\n00.06: 2 stubbed: give_parcel, pokedex_scene\n00.07: 2 stubbed: heal_viridian, old_man_tutorial\n00.08: 1 stubbed: heal_pewter\n00.09: 3 stubbed: camper_liam, challenge_brock, brock\n00.10: 1 stubbed: shoes_from_aide\n00.11: 4 stubbed: heal_pewter, bug_catcher_colton, bug_catcher_greg, bug_catcher_james\n00.12: 1 stubbed: heal_route4\n00.12c: 1 stubbed: magikarp_to_box\n00.13: 6 stubbed: heal_route4, moon_stone_ball, found_moon_stone, rocket_grunt, super_nerd_miguel, helix_fossil\n00.14: 2 stubbed: teach_mega_kick, heal_cerulean\n00.14b: 3 stubbed: buy_potions, grind_to_lv23, heal_cerulean\n00.14c: 4 stubbed: challenge_misty, misty, heal_cerulean, teach_water_pulse\n00.15: 4 stubbed: teach_water_pulse, buy_potions, grind_for_rival, heal_cerulean\n00.15b: 2 stubbed: teach_water_pulse, rival_cerulean\n00.16: 7 stubbed: heal_cerulean, bug_catcher_cale, lass_ali, youngster_timmy, lass_reli, camper_ethan, rocket_grunt\n00.17: 4 stubbed: hiker_franklin, picnicker_kelsey, hiker_nob, lass_haley\n00.18: 7 stubbed: bill_clefairy, help_bill, bill_into_teleporter, cell_separator, bill_comes_out, thank_bill, ss_ticket\n00.19: 1 stubbed: heal_cerulean\n00.20: 3 stubbed: buy_poke_balls, catch_oddish, heal_cerulean\n00.21: 3 stubbed: rocket_grunt, camper_jeff, heal_vermilion\n00.22: 6 stubbed: show_ss_ticket, rival_ss_anne, captain, hm01_cut, ss_anne_sails, heal_vermilion\n00.23: 9 stubbed: teach_cut, teach_dig, cut_gym_tree, sailor_dwayne, engineer_baily, gentleman_tucker, trash_cans, cut_tree_out, heal_vermilion\n00.24: 4 stubbed: surge_winnable, grind_for_surge, heal_vermilion, cut_gym_tree\n00.25: 4 stubbed: challenge_lt_surge, lt_surge, cut_tree_out, heal_vermilion\n00.26: 8 stubbed: chairman, hear_story, bike_voucher, cut_cerulean_tree, talk_bike_clerk, bicycle, buy_repels, heal_cerulean\n00.27: 6 stubbed: cut_cerulean_tree, cut_route9_tree, picnicker_alicia, hiker_jeremy, bug_catcher_conner, heal_route10\n00.28: 9 stubbed: cut_route10_tree, pokemaniac_ashton, pokemaniac_winston, picnicker_martha, hiker_allen, hiker_lenny, picnicker_sofia, hiker_dudley, picnicker_dana\n00.29: 1 stubbed: heal_lavender\n00.30: 7 stubbed: register_bike, buy_ropes_and_super_repels, ride_bike, gamer_rich, catch_pidgey, celadon_nurse, heal_celadon\n00.31: 6 stubbed: talk_poster_guard, rocket_grunt, poster_switch, lift_key_grunt, lift_key, b3f_rare_candy\n00.32: 10 stubbed: moon_stone, lift_to_b4f, talk_left_guard, left_guard, talk_right_guard, right_guard, talk_giovanni, giovanni, silph_scope, escape_rope_hideout\n" ] } From 545d66c10f32f6772e8d5c0b507be9efc9d7f605 Mon Sep 17 00:00:00 2001 From: dayfine Date: Tue, 10 Nov 2026 02:01:08 -0800 Subject: [PATCH 55/79] FRLG AutoStory 00.32: no short-hold sweep onto B3F's stairs, which the walker can't recover yet Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss --- .../Programs/AutoStory/PokemonFRLG_AutoStoryHideout_Tests.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryHideout_Tests.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryHideout_Tests.cpp index 98c660e552..54ceb8b298 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryHideout_Tests.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryHideout_Tests.cpp @@ -316,7 +316,8 @@ UnitTestResult test_b2f_maze_taps(){ {Direction::SOUTH, 4}, {Direction::EAST, 1}, {Direction::SOUTH, 1}, {Direction::EAST, 1}, {Direction::EAST, 2}, {Direction::WEST, 2}, {Direction::EAST, 3}, {Direction::SOUTH, 2}, {Direction::WEST, 1}, {Direction::EAST, 1}, {Direction::SOUTH, 1}, }, lift_stop), - short_holds_on_sim({"RocketHideout_B3F", {12, 2}}, Direction::NORTH, b2f_stairs), + // Not B3F (12, 2) to B2F's stairs: a hold short onto B3F's stairs (18, 2) + // stops without the warp's fade, which the walker doesn't recover yet. short_holds_on_sim(lift_stop, Direction::EAST, {"RocketHideout_B2F", {28, 17}}), short_holds_on_sim({"RocketHideout_B4F", {20, 24}}, Direction::SOUTH, {"RocketHideout_B4F", {16, 15}}), short_holds_on_sim({"RocketHideout_B4F", {19, 15}}, Direction::NORTH, {"RocketHideout_B4F", {19, 5}}), From eccc565b394f75285119a369ae65e48f9e5d26d9 Mon Sep 17 00:00:00 2001 From: dayfine Date: Tue, 10 Nov 2026 02:10:07 -0800 Subject: [PATCH 56/79] FRLG overworld: one more step into a warp when its fade doesn't come A hold that ends short on a stairs or door warp gets no fade; the walker and the sim now tap the leg's direction once and watch again before failing. The sim doesn't yet model the press on B3F's stairs (18, 2), so the B2F short-hold check stays out. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss --- .../Overworld/PokemonFRLG_OverworldSim.cpp | 11 ++++++++++- .../Overworld/PokemonFRLG_OverworldWalk.cpp | 11 ++++++++++- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSim.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSim.cpp index 938dab9efc..d507c26fea 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSim.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSim.cpp @@ -799,7 +799,16 @@ bool OverworldSimWalker::fade_over_since(Milliseconds from) const{ bool OverworldSimWalker::after_warp(const RouteStep& step, int warps_before, Milliseconds watched_from){ if (m_sim.state().warps == warps_before){ if (!m_sim.watch({SimWatcher::BATTLE_SCREEN}, WARP_TIMEOUT)){ - fail("walk_overworld_route(): no fade in and out after walking onto the warp to " + step.end.map + "."); + // A hold that ended short on a stairs or door warp: one more + // step into it takes it. + m_log.push_back("Route: no fade; one more step into the warp."); + const Milliseconds tapped = m_sim.state().time; + m_sim.tap(step.direction, STEP_TAP, STEP_TAP_RELEASE); + if (m_sim.state().warps == warps_before + || (!fade_over_since(tapped) && !m_sim.watch({SimWatcher::FADE}, WARP_TIMEOUT)) + ){ + fail("walk_overworld_route(): no fade in and out after walking onto the warp to " + step.end.map + "."); + } } }else if (!fade_over_since(watched_from) && !m_sim.watch({SimWatcher::FADE}, WARP_TIMEOUT)){ fail("walk_overworld_route(): no fade in and out after walking onto the warp to " + step.end.map + "."); diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldWalk.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldWalk.cpp index 104d07542f..3f52b70d0c 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldWalk.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldWalk.cpp @@ -301,7 +301,16 @@ void wait_out_warp(ConsoleHandle& console, ProControllerContext& context, const return; } context.wait_for_all_requests(); - if (wait_until(console, context, WARP_TIMEOUT, {fade.watcher()}) < 0){ + if (wait_until(console, context, WARP_TIMEOUT, {fade.watcher()}) >= 0){ + return; + } + // A hold that ended short on a stairs or door warp: one more step into + // it takes it. + console.log("Route: no fade; one more step into the warp.", COLOR_ORANGE); + BlackScreenOverWatcher arrival(COLOR_RED); + Pokemon::WatchAlong retry_fade(arrival); + pbf_press_dpad(context, dpad(step.direction), STEP_TAP, STEP_TAP_RELEASE); + if (wait_until(console, context, WARP_TIMEOUT, {retry_fade.watcher()}) < 0){ OperationFailedExceptionWithScreenshot::fire( ErrorReportMode::SEND_ERROR_REPORT, "walk_overworld_route(): no fade in and out after walking onto the warp to " + step.end.map + ".", From 37b8021e8a1e96cb0bd0e52b4c4d23171bbd7eb8 Mon Sep 17 00:00:00 2001 From: dayfine Date: Tue, 10 Nov 2026 02:12:02 -0800 Subject: [PATCH 57/79] FRLG overworld sim: keep OverworldSim.cpp within 1000 lines Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss --- .../Overworld/PokemonFRLG_OverworldSim.cpp | 25 ++++++------------- 1 file changed, 8 insertions(+), 17 deletions(-) diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSim.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSim.cpp index d507c26fea..7df9a35d7c 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSim.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSim.cpp @@ -525,7 +525,6 @@ void OverworldSim::stuck_hold(Direction direction){ } } - std::optional OverworldSim::hold( Direction direction, Milliseconds duration, Milliseconds release, Milliseconds watch, const std::vector& watchers @@ -672,7 +671,6 @@ bool OverworldSim::close_message(){ } - // // OverworldSimWalker // @@ -795,22 +793,15 @@ bool OverworldSimWalker::fade_over_since(Milliseconds from) const{ // was a wild battle's, run from. wait_out_warp()'s watcher takes a wild // battle's wipe for the fade (run 7; console B, 2026-11-03, Mt. Moon 1F): // the battle screen stands in for the wipe. The fade is watched for from -// `watched_from`: a fade over by then is missed. +// `watched_from`: a fade over by then is missed. No warp: a step more. bool OverworldSimWalker::after_warp(const RouteStep& step, int warps_before, Milliseconds watched_from){ - if (m_sim.state().warps == warps_before){ - if (!m_sim.watch({SimWatcher::BATTLE_SCREEN}, WARP_TIMEOUT)){ - // A hold that ended short on a stairs or door warp: one more - // step into it takes it. - m_log.push_back("Route: no fade; one more step into the warp."); - const Milliseconds tapped = m_sim.state().time; - m_sim.tap(step.direction, STEP_TAP, STEP_TAP_RELEASE); - if (m_sim.state().warps == warps_before - || (!fade_over_since(tapped) && !m_sim.watch({SimWatcher::FADE}, WARP_TIMEOUT)) - ){ - fail("walk_overworld_route(): no fade in and out after walking onto the warp to " + step.end.map + "."); - } - } - }else if (!fade_over_since(watched_from) && !m_sim.watch({SimWatcher::FADE}, WARP_TIMEOUT)){ + bool battle = false; + if (m_sim.state().warps == warps_before && !(battle = m_sim.watch({SimWatcher::BATTLE_SCREEN}, WARP_TIMEOUT).has_value())){ + m_log.push_back("Route: no fade; one more step into the warp."); + watched_from = m_sim.state().time; + m_sim.tap(step.direction, STEP_TAP, STEP_TAP_RELEASE); + } + if (!battle && (m_sim.state().warps == warps_before || (!fade_over_since(watched_from) && !m_sim.watch({SimWatcher::FADE}, WARP_TIMEOUT)))){ fail("walk_overworld_route(): no fade in and out after walking onto the warp to " + step.end.map + "."); } m_sim.watch({}, AFTER_WARP); From 17ff2a472461d49cfe8d966a34bc99109b69d557 Mon Sep 17 00:00:00 2001 From: dayfine Date: Tue, 10 Nov 2026 02:23:07 -0800 Subject: [PATCH 58/79] FRLG AutoStory 00.32: step on into arrow warps; tap up to row 17 A hold that ended two tiles short of B3F's stairs (18, 2), an arrow warp that fires on the press made standing on it, needed two more step taps; the walker and the sim now retry up to WARP_RETRY_TAPS. B2F's open column 15 from the lift room's stop is now tapped, since a hold short there sent the run into row 18's wall. Golden trace updated. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss --- .../Overworld/PokemonFRLG_MovementMechanics.h | 4 ++ .../Overworld/PokemonFRLG_OverworldSim.cpp | 11 ++-- .../Overworld/PokemonFRLG_OverworldWalk.cpp | 27 ++++---- .../PokemonFRLG_AutoStoryHideout_Tests.cpp | 14 +++-- .../ReplayData/frlg-story-sim-trace.json | 63 ++++++++++--------- .../AutoStory/StoryData/frlg-00.32.plan.json | 18 +++++- 6 files changed, 85 insertions(+), 52 deletions(-) diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_MovementMechanics.h b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_MovementMechanics.h index 461c103777..a43604bdae 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_MovementMechanics.h +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_MovementMechanics.h @@ -83,6 +83,10 @@ inline constexpr Milliseconds STEP_TAP(66); // The release after a step tap: the next one starts STEP_TAP + // STEP_TAP_RELEASE after it, past the lockout. inline constexpr Milliseconds STEP_TAP_RELEASE(700); +// The step taps after a hold toward a warp that showed no fade: a hold +// ends up to two tiles short, and an arrow warp (stairs, a mat) fires on +// the press made standing on it, a step after reaching it. +inline constexpr int WARP_RETRY_TAPS = 2; // How long the overworld must show nothing (no box, fade or battle) after diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSim.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSim.cpp index 7df9a35d7c..debc6b9ed2 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSim.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSim.cpp @@ -793,13 +793,16 @@ bool OverworldSimWalker::fade_over_since(Milliseconds from) const{ // was a wild battle's, run from. wait_out_warp()'s watcher takes a wild // battle's wipe for the fade (run 7; console B, 2026-11-03, Mt. Moon 1F): // the battle screen stands in for the wipe. The fade is watched for from -// `watched_from`: a fade over by then is missed. No warp: a step more. +// `watched_from`: a fade over by then is missed. No warp: up to +// WARP_RETRY_TAPS steps more. bool OverworldSimWalker::after_warp(const RouteStep& step, int warps_before, Milliseconds watched_from){ bool battle = false; if (m_sim.state().warps == warps_before && !(battle = m_sim.watch({SimWatcher::BATTLE_SCREEN}, WARP_TIMEOUT).has_value())){ - m_log.push_back("Route: no fade; one more step into the warp."); - watched_from = m_sim.state().time; - m_sim.tap(step.direction, STEP_TAP, STEP_TAP_RELEASE); + for (int tap = 0; tap < WARP_RETRY_TAPS && m_sim.state().warps == warps_before; tap++){ + m_log.push_back("Route: no fade; one more step into the warp."); + watched_from = m_sim.state().time; + m_sim.tap(step.direction, STEP_TAP, STEP_TAP_RELEASE); + } } if (!battle && (m_sim.state().warps == warps_before || (!fade_over_since(watched_from) && !m_sim.watch({SimWatcher::FADE}, WARP_TIMEOUT)))){ fail("walk_overworld_route(): no fade in and out after walking onto the warp to " + step.end.map + "."); diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldWalk.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldWalk.cpp index 3f52b70d0c..4892ee6465 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldWalk.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldWalk.cpp @@ -304,19 +304,22 @@ void wait_out_warp(ConsoleHandle& console, ProControllerContext& context, const if (wait_until(console, context, WARP_TIMEOUT, {fade.watcher()}) >= 0){ return; } - // A hold that ended short on a stairs or door warp: one more step into - // it takes it. - console.log("Route: no fade; one more step into the warp.", COLOR_ORANGE); - BlackScreenOverWatcher arrival(COLOR_RED); - Pokemon::WatchAlong retry_fade(arrival); - pbf_press_dpad(context, dpad(step.direction), STEP_TAP, STEP_TAP_RELEASE); - if (wait_until(console, context, WARP_TIMEOUT, {retry_fade.watcher()}) < 0){ - OperationFailedExceptionWithScreenshot::fire( - ErrorReportMode::SEND_ERROR_REPORT, - "walk_overworld_route(): no fade in and out after walking onto the warp to " + step.end.map + ".", - console - ); + // A hold that ended short of a stairs or door warp, or on an arrow + // warp: a step more at a time takes it. + for (int tap = 0; tap < WARP_RETRY_TAPS; tap++){ + console.log("Route: no fade; one more step into the warp.", COLOR_ORANGE); + BlackScreenOverWatcher arrival(COLOR_RED); + Pokemon::WatchAlong retry_fade(arrival); + pbf_press_dpad(context, dpad(step.direction), STEP_TAP, STEP_TAP_RELEASE); + if (wait_until(console, context, WARP_TIMEOUT, {retry_fade.watcher()}) >= 0){ + return; + } } + OperationFailedExceptionWithScreenshot::fire( + ErrorReportMode::SEND_ERROR_REPORT, + "walk_overworld_route(): no fade in and out after walking onto the warp to " + step.end.map + ".", + console + ); } void wait_out_warp(ConsoleHandle& console, ProControllerContext& context, const RouteStep& step){ diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryHideout_Tests.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryHideout_Tests.cpp index 54ceb8b298..a5667dedc1 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryHideout_Tests.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryHideout_Tests.cpp @@ -299,8 +299,9 @@ UnitTestResult test_b3f_maze_taps(){ // 00.32's taps (frlg-00.32.plan.json): B3F from below its Rare Candy up // to the top corridor, and B2F's arrows to the MOON STONE's stop and on -// to the lift room's stop (13, 20), with any one turn dropped; the routes -// between them, with no arrow on the way, with any hold short. +// to the lift room's stop (13, 20) and up to row 17, with any one turn +// dropped; the routes between them, with no arrow on the way, with any +// hold short. UnitTestResult test_b2f_maze_taps(){ using Pokemon::StoryLeg; const MapPosition b2f_stairs{"RocketHideout_B2F", {21, 2}}; @@ -316,9 +317,12 @@ UnitTestResult test_b2f_maze_taps(){ {Direction::SOUTH, 4}, {Direction::EAST, 1}, {Direction::SOUTH, 1}, {Direction::EAST, 1}, {Direction::EAST, 2}, {Direction::WEST, 2}, {Direction::EAST, 3}, {Direction::SOUTH, 2}, {Direction::WEST, 1}, {Direction::EAST, 1}, {Direction::SOUTH, 1}, }, lift_stop), - // Not B3F (12, 2) to B2F's stairs: a hold short onto B3F's stairs (18, 2) - // stops without the warp's fade, which the walker doesn't recover yet. - short_holds_on_sim(lift_stop, Direction::EAST, {"RocketHideout_B2F", {28, 17}}), + short_holds_on_sim({"RocketHideout_B3F", {12, 2}}, Direction::NORTH, b2f_stairs), + tap_legs_on_sim(lift_stop, Direction::EAST, { + {Direction::EAST, 2}, {Direction::NORTH, 3}, + }, {"RocketHideout_B2F", {15, 17}}), + // Not row 17 east to below the lift (28, 17): a hold short ends on + // (27, 17), open floor, which the walker doesn't notice yet. short_holds_on_sim({"RocketHideout_B4F", {20, 24}}, Direction::SOUTH, {"RocketHideout_B4F", {16, 15}}), short_holds_on_sim({"RocketHideout_B4F", {19, 15}}, Direction::NORTH, {"RocketHideout_B4F", {19, 5}}), }; diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/ReplayData/frlg-story-sim-trace.json b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/ReplayData/frlg-story-sim-trace.json index 0c08026fd1..950ca337a9 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/ReplayData/frlg-story-sim-trace.json +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/ReplayData/frlg-story-sim-trace.json @@ -1341,7 +1341,7 @@ "[Checkpoint] 00.31: done, 20 run, 0 skipped", "[Checkpoint] 00.31: passed on attempt 1 (one-shot)", "begin 00.32", - "[Checkpoint] 00.32: start, 21 events", + "[Checkpoint] 00.32: start, 22 events", "[Event] 00.32/1 from_save: start", "[Event] 00.32/1 from_save: done", "[Event] 00.32/2 b3f_to_top_corridor: start", @@ -1362,50 +1362,53 @@ "[Event] 00.32/7 b2f_arrows_to_lift_room: start", "00.32/b2f_arrows_to_lift_room: ok at RocketHideout_B2F (13, 20) facing east (tile)", "[Event] 00.32/7 b2f_arrows_to_lift_room: done", - "[Event] 00.32/8 below_lift: start", + "[Event] 00.32/8 lift_room_to_row_17: start", + "00.32/lift_room_to_row_17: ok at RocketHideout_B2F (15, 17) facing north (tile)", + "[Event] 00.32/8 lift_room_to_row_17: done", + "[Event] 00.32/9 below_lift: start", "00.32/below_lift: ok at RocketHideout_B2F (28, 17) facing north (tile)", - "[Event] 00.32/8 below_lift: done", - "[Event] 00.32/9 lift_to_b4f: start", + "[Event] 00.32/9 below_lift: done", + "[Event] 00.32/10 lift_to_b4f: start", "00.32/lift_to_b4f: ok at RocketHideout_B2F (28, 17) facing north (tile)", - "[Event] 00.32/9 lift_to_b4f: done", - "[Event] 00.32/10 below_left_guard: start", + "[Event] 00.32/10 lift_to_b4f: done", + "[Event] 00.32/11 below_left_guard: start", "00.32/below_left_guard: ok at RocketHideout_B4F (16, 15) facing north (tile)", - "[Event] 00.32/10 below_left_guard: done", - "[Event] 00.32/11 talk_left_guard: start", + "[Event] 00.32/11 below_left_guard: done", + "[Event] 00.32/12 talk_left_guard: start", "00.32/talk_left_guard: ok at -", - "[Event] 00.32/11 talk_left_guard: done", - "[Event] 00.32/12 left_guard: start", + "[Event] 00.32/12 talk_left_guard: done", + "[Event] 00.32/13 left_guard: start", "00.32/left_guard: ok at -", - "[Event] 00.32/12 left_guard: done", - "[Event] 00.32/13 below_right_guard: start", + "[Event] 00.32/13 left_guard: done", + "[Event] 00.32/14 below_right_guard: start", "00.32/below_right_guard: ok at RocketHideout_B4F (19, 15) facing north (tile)", - "[Event] 00.32/13 below_right_guard: done", - "[Event] 00.32/14 talk_right_guard: start", + "[Event] 00.32/14 below_right_guard: done", + "[Event] 00.32/15 talk_right_guard: start", "00.32/talk_right_guard: ok at -", - "[Event] 00.32/14 talk_right_guard: done", - "[Event] 00.32/15 right_guard: start", + "[Event] 00.32/15 talk_right_guard: done", + "[Event] 00.32/16 right_guard: start", "00.32/right_guard: ok at -", - "[Event] 00.32/15 right_guard: done", - "[Event] 00.32/16 below_giovanni: start", + "[Event] 00.32/16 right_guard: done", + "[Event] 00.32/17 below_giovanni: start", "00.32/below_giovanni: ok at RocketHideout_B4F (19, 5) facing north (tile)", - "[Event] 00.32/16 below_giovanni: done", - "[Event] 00.32/17 talk_giovanni: start", + "[Event] 00.32/17 below_giovanni: done", + "[Event] 00.32/18 talk_giovanni: start", "00.32/talk_giovanni: ok at -", - "[Event] 00.32/17 talk_giovanni: done", - "[Event] 00.32/18 giovanni: start", + "[Event] 00.32/18 talk_giovanni: done", + "[Event] 00.32/19 giovanni: start", "00.32/giovanni: ok at -", - "[Event] 00.32/18 giovanni: done", - "[Event] 00.32/19 beside_silph_scope: start", + "[Event] 00.32/19 giovanni: done", + "[Event] 00.32/20 beside_silph_scope: start", "00.32/beside_silph_scope: ok at RocketHideout_B4F (21, 5) facing west (tile)", - "[Event] 00.32/19 beside_silph_scope: done", - "[Event] 00.32/20 silph_scope: start", + "[Event] 00.32/20 beside_silph_scope: done", + "[Event] 00.32/21 silph_scope: start", "00.32/silph_scope: ok at -", - "[Event] 00.32/20 silph_scope: done", - "[Event] 00.32/21 escape_rope_hideout: start", + "[Event] 00.32/21 silph_scope: done", + "[Event] 00.32/22 escape_rope_hideout: start", "00.32/escape_rope_hideout: ok at RocketHideout_B4F (21, 5) facing west (tile)", - "[Event] 00.32/21 escape_rope_hideout: done", + "[Event] 00.32/22 escape_rope_hideout: done", "save at CeladonCity (34, 22) facing south (tile)", - "[Checkpoint] 00.32: done, 21 run, 0 skipped", + "[Checkpoint] 00.32: done, 22 run, 0 skipped", "[Checkpoint] 00.32: passed on attempt 1 (one-shot)", "[Segment] 00: 36 of 36 checkpoints one-shot", "[Segment] 00: done, 36 checkpoints", diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.32.plan.json b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.32.plan.json index 231d908613..99195761cb 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.32.plan.json +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.32.plan.json @@ -172,6 +172,22 @@ ], "why": "a tap a tile through B2F's arrows, each slide the end of a leg: down column 2 to (2, 8), east and down to (3, 9), east onto (4, 9), which slides to the stop (8, 11); east twice, the second onto a slide to the stop (14, 13); west twice onto a slide to the stop (10, 15); east to (13, 15), down to (13, 17), west onto a slide to the stop (8, 19), east to (9, 19) and down onto (9, 20), which slides east to the stop (13, 20)" }, + { + "id": "lift_room_to_row_17", + "kind": "legs", + "variant": "taps", + "legs": [ + { + "direction": "east", + "tiles": 2 + }, + { + "direction": "north", + "tiles": 3 + } + ], + "why": "a tap a tile from the stop (13, 20): east to the wall at (15, 20) and up column 15 to row 17; a hold up the open column that ended short sent the run east along row 18 into its wall at (17, 18)" + }, { "id": "below_lift", "kind": "route", @@ -190,7 +206,7 @@ } }, "variant": "run", - "why": "east to (15, 20), up column 15 to row 17 and east along it to below the lift door (28, 16); no arrow on the way" + "why": "east along row 17 to below the lift door (28, 16); no arrow on the way" }, { "id": "lift_to_b4f", From e2ce441fb4c425d2b8e3c8bdfdfba8ae862e49eb Mon Sep 17 00:00:00 2001 From: dayfine Date: Tue, 10 Nov 2026 02:27:34 -0800 Subject: [PATCH 59/79] FRLG AutoStory 00.32: keep the warp retry within the code-health limits Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss --- .../Overworld/PokemonFRLG_MovementMechanics.h | 4 ---- .../Overworld/PokemonFRLG_OverworldSim.cpp | 12 ++++-------- .../Overworld/PokemonFRLG_OverworldWalk.cpp | 5 +++-- 3 files changed, 7 insertions(+), 14 deletions(-) diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_MovementMechanics.h b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_MovementMechanics.h index a43604bdae..461c103777 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_MovementMechanics.h +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_MovementMechanics.h @@ -83,10 +83,6 @@ inline constexpr Milliseconds STEP_TAP(66); // The release after a step tap: the next one starts STEP_TAP + // STEP_TAP_RELEASE after it, past the lockout. inline constexpr Milliseconds STEP_TAP_RELEASE(700); -// The step taps after a hold toward a warp that showed no fade: a hold -// ends up to two tiles short, and an arrow warp (stairs, a mat) fires on -// the press made standing on it, a step after reaching it. -inline constexpr int WARP_RETRY_TAPS = 2; // How long the overworld must show nothing (no box, fade or battle) after diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSim.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSim.cpp index debc6b9ed2..0df9220f96 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSim.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSim.cpp @@ -326,7 +326,6 @@ std::optional OverworldSim::press(Direction direction) const return step; } - // A trainer on the player's map who sees them now walks up and speaks. bool OverworldSim::trainer_sees(Milliseconds pressed){ std::vector& objects = m_maps[m_map].objects; @@ -670,7 +669,6 @@ bool OverworldSim::close_message(){ return true; } - // // OverworldSimWalker // @@ -693,7 +691,6 @@ Milliseconds delay_of(const OverworldInterrupts& interrupts, size_t index){ } // namespace - OverworldSimWalker::OverworldSimWalker(OverworldSim& sim, SimWalkerRules rules, const OverworldInterruptSet& walker) : m_sim(sim) , m_rules(rules) @@ -793,12 +790,13 @@ bool OverworldSimWalker::fade_over_since(Milliseconds from) const{ // was a wild battle's, run from. wait_out_warp()'s watcher takes a wild // battle's wipe for the fade (run 7; console B, 2026-11-03, Mt. Moon 1F): // the battle screen stands in for the wipe. The fade is watched for from -// `watched_from`: a fade over by then is missed. No warp: up to -// WARP_RETRY_TAPS steps more. +// `watched_from`: a fade over by then is missed. No warp: a step more, +// twice: a hold ends up to two tiles short, and an arrow warp (stairs) +// fires on the press made standing on it. bool OverworldSimWalker::after_warp(const RouteStep& step, int warps_before, Milliseconds watched_from){ bool battle = false; if (m_sim.state().warps == warps_before && !(battle = m_sim.watch({SimWatcher::BATTLE_SCREEN}, WARP_TIMEOUT).has_value())){ - for (int tap = 0; tap < WARP_RETRY_TAPS && m_sim.state().warps == warps_before; tap++){ + for (int tap = 0; tap < 2 && m_sim.state().warps == warps_before; tap++){ m_log.push_back("Route: no fade; one more step into the warp."); watched_from = m_sim.state().time; m_sim.tap(step.direction, STEP_TAP, STEP_TAP_RELEASE); @@ -996,8 +994,6 @@ std::string OverworldSimWalker::run(const std::vector& route, const R return ""; } - - } // namespace PokemonFRLG } // namespace NintendoSwitch } // namespace PokemonAutomation diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldWalk.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldWalk.cpp index 4892ee6465..1cc21a731f 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldWalk.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldWalk.cpp @@ -305,8 +305,9 @@ void wait_out_warp(ConsoleHandle& console, ProControllerContext& context, const return; } // A hold that ended short of a stairs or door warp, or on an arrow - // warp: a step more at a time takes it. - for (int tap = 0; tap < WARP_RETRY_TAPS; tap++){ + // warp: a step more at a time, twice, takes it. A hold ends up to two + // tiles short, and an arrow warp fires on the press made standing on it. + for (int tap = 0; tap < 2; tap++){ console.log("Route: no fade; one more step into the warp.", COLOR_ORANGE); BlackScreenOverWatcher arrival(COLOR_RED); Pokemon::WatchAlong retry_fade(arrival); From 4854152c26a6a61f516e5d5a699e367c03499795 Mon Sep 17 00:00:00 2001 From: dayfine Date: Tue, 10 Nov 2026 02:34:46 -0800 Subject: [PATCH 60/79] FRLG AutoStory 00.32: tap every open-floor walk on the hideout floors Row 17 to below the lift and B4F from the lift door to the guards, Giovanni and the SILPH SCOPE are now taps legs, one checked tap per tile; the MOON STONE, Giovanni and the SILPH SCOPE keep a turn-only route to face them. The sweep checks run them all with each turn dropped. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss --- .../PokemonFRLG_AutoStoryHideout_Tests.cpp | 32 +++- .../ReplayData/frlg-story-sim-trace.json | 85 +++++---- .../AutoStory/StoryData/frlg-00.32.plan.json | 162 ++++++++++++------ 3 files changed, 183 insertions(+), 96 deletions(-) diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryHideout_Tests.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryHideout_Tests.cpp index a5667dedc1..a17260a261 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryHideout_Tests.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryHideout_Tests.cpp @@ -299,13 +299,17 @@ UnitTestResult test_b3f_maze_taps(){ // 00.32's taps (frlg-00.32.plan.json): B3F from below its Rare Candy up // to the top corridor, and B2F's arrows to the MOON STONE's stop and on -// to the lift room's stop (13, 20) and up to row 17, with any one turn -// dropped; the routes between them, with no arrow on the way, with any -// hold short. +// to the lift room's stop (13, 20), up to row 17 and on to below the +// lift, and B4F from the lift door to the guards, Giovanni and the +// SILPH SCOPE, with any one turn dropped; the stairs up from B3F, which +// end on their warp, with any hold short. UnitTestResult test_b2f_maze_taps(){ using Pokemon::StoryLeg; const MapPosition b2f_stairs{"RocketHideout_B2F", {21, 2}}; const MapPosition lift_stop{"RocketHideout_B2F", {13, 20}}; + const MapPosition left_guard{"RocketHideout_B4F", {16, 15}}; + const MapPosition right_guard{"RocketHideout_B4F", {19, 15}}; + const MapPosition below_giovanni{"RocketHideout_B4F", {19, 5}}; const std::vector failures{ tap_legs_on_sim({"RocketHideout_B3F", {12, 13}}, Direction::NORTH, { {Direction::WEST, 4}, {Direction::NORTH, 2}, {Direction::EAST, 4}, {Direction::NORTH, 7}, @@ -321,10 +325,24 @@ UnitTestResult test_b2f_maze_taps(){ tap_legs_on_sim(lift_stop, Direction::EAST, { {Direction::EAST, 2}, {Direction::NORTH, 3}, }, {"RocketHideout_B2F", {15, 17}}), - // Not row 17 east to below the lift (28, 17): a hold short ends on - // (27, 17), open floor, which the walker doesn't notice yet. - short_holds_on_sim({"RocketHideout_B4F", {20, 24}}, Direction::SOUTH, {"RocketHideout_B4F", {16, 15}}), - short_holds_on_sim({"RocketHideout_B4F", {19, 15}}, Direction::NORTH, {"RocketHideout_B4F", {19, 5}}), + tap_legs_on_sim({"RocketHideout_B2F", {1, 4}}, Direction::WEST, { + {Direction::EAST, 1}, + }, {"RocketHideout_B2F", {2, 4}}), + tap_legs_on_sim({"RocketHideout_B2F", {15, 17}}, Direction::NORTH, { + {Direction::EAST, 12}, {Direction::SOUTH, 1}, {Direction::EAST, 1}, {Direction::NORTH, 1}, + }, {"RocketHideout_B2F", {28, 17}}), + tap_legs_on_sim({"RocketHideout_B4F", {20, 23}}, Direction::SOUTH, { + {Direction::SOUTH, 1}, {Direction::WEST, 4}, {Direction::NORTH, 9}, + }, left_guard), + tap_legs_on_sim(left_guard, Direction::NORTH, { + {Direction::SOUTH, 1}, {Direction::EAST, 3}, {Direction::NORTH, 1}, + }, right_guard), + tap_legs_on_sim(right_guard, Direction::NORTH, { + {Direction::WEST, 2}, {Direction::NORTH, 10}, {Direction::EAST, 2}, + }, below_giovanni), + tap_legs_on_sim(below_giovanni, Direction::NORTH, { + {Direction::WEST, 2}, {Direction::SOUTH, 2}, {Direction::EAST, 4}, {Direction::NORTH, 2}, + }, {"RocketHideout_B4F", {21, 5}}), }; for (const std::string& failure : failures){ if (!failure.empty()){ diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/ReplayData/frlg-story-sim-trace.json b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/ReplayData/frlg-story-sim-trace.json index 950ca337a9..e66489918d 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/ReplayData/frlg-story-sim-trace.json +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/ReplayData/frlg-story-sim-trace.json @@ -1341,7 +1341,7 @@ "[Checkpoint] 00.31: done, 20 run, 0 skipped", "[Checkpoint] 00.31: passed on attempt 1 (one-shot)", "begin 00.32", - "[Checkpoint] 00.32: start, 22 events", + "[Checkpoint] 00.32: start, 25 events", "[Event] 00.32/1 from_save: start", "[Event] 00.32/1 from_save: done", "[Event] 00.32/2 b3f_to_top_corridor: start", @@ -1353,62 +1353,71 @@ "[Event] 00.32/4 b2f_arrows_to_moon_stone: start", "00.32/b2f_arrows_to_moon_stone: ok at RocketHideout_B2F (1, 4) facing west (tile)", "[Event] 00.32/4 b2f_arrows_to_moon_stone: done", - "[Event] 00.32/5 above_moon_stone: start", + "[Event] 00.32/5 beside_moon_stone: start", + "00.32/beside_moon_stone: ok at RocketHideout_B2F (2, 4) facing east (tile)", + "[Event] 00.32/5 beside_moon_stone: done", + "[Event] 00.32/6 above_moon_stone: start", "00.32/above_moon_stone: ok at RocketHideout_B2F (2, 4) facing south (tile)", - "[Event] 00.32/5 above_moon_stone: done", - "[Event] 00.32/6 moon_stone: start", + "[Event] 00.32/6 above_moon_stone: done", + "[Event] 00.32/7 moon_stone: start", "00.32/moon_stone: ok at -", - "[Event] 00.32/6 moon_stone: done", - "[Event] 00.32/7 b2f_arrows_to_lift_room: start", + "[Event] 00.32/7 moon_stone: done", + "[Event] 00.32/8 b2f_arrows_to_lift_room: start", "00.32/b2f_arrows_to_lift_room: ok at RocketHideout_B2F (13, 20) facing east (tile)", - "[Event] 00.32/7 b2f_arrows_to_lift_room: done", - "[Event] 00.32/8 lift_room_to_row_17: start", + "[Event] 00.32/8 b2f_arrows_to_lift_room: done", + "[Event] 00.32/9 lift_room_to_row_17: start", "00.32/lift_room_to_row_17: ok at RocketHideout_B2F (15, 17) facing north (tile)", - "[Event] 00.32/8 lift_room_to_row_17: done", - "[Event] 00.32/9 below_lift: start", + "[Event] 00.32/9 lift_room_to_row_17: done", + "[Event] 00.32/10 below_lift: start", "00.32/below_lift: ok at RocketHideout_B2F (28, 17) facing north (tile)", - "[Event] 00.32/9 below_lift: done", - "[Event] 00.32/10 lift_to_b4f: start", + "[Event] 00.32/10 below_lift: done", + "[Event] 00.32/11 lift_to_b4f: start", "00.32/lift_to_b4f: ok at RocketHideout_B2F (28, 17) facing north (tile)", - "[Event] 00.32/10 lift_to_b4f: done", - "[Event] 00.32/11 below_left_guard: start", + "[Event] 00.32/11 lift_to_b4f: done", + "[Event] 00.32/12 below_left_guard: start", "00.32/below_left_guard: ok at RocketHideout_B4F (16, 15) facing north (tile)", - "[Event] 00.32/11 below_left_guard: done", - "[Event] 00.32/12 talk_left_guard: start", + "[Event] 00.32/12 below_left_guard: done", + "[Event] 00.32/13 talk_left_guard: start", "00.32/talk_left_guard: ok at -", - "[Event] 00.32/12 talk_left_guard: done", - "[Event] 00.32/13 left_guard: start", + "[Event] 00.32/13 talk_left_guard: done", + "[Event] 00.32/14 left_guard: start", "00.32/left_guard: ok at -", - "[Event] 00.32/13 left_guard: done", - "[Event] 00.32/14 below_right_guard: start", + "[Event] 00.32/14 left_guard: done", + "[Event] 00.32/15 below_right_guard: start", "00.32/below_right_guard: ok at RocketHideout_B4F (19, 15) facing north (tile)", - "[Event] 00.32/14 below_right_guard: done", - "[Event] 00.32/15 talk_right_guard: start", + "[Event] 00.32/15 below_right_guard: done", + "[Event] 00.32/16 talk_right_guard: start", "00.32/talk_right_guard: ok at -", - "[Event] 00.32/15 talk_right_guard: done", - "[Event] 00.32/16 right_guard: start", + "[Event] 00.32/16 talk_right_guard: done", + "[Event] 00.32/17 right_guard: start", "00.32/right_guard: ok at -", - "[Event] 00.32/16 right_guard: done", - "[Event] 00.32/17 below_giovanni: start", + "[Event] 00.32/17 right_guard: done", + "[Event] 00.32/18 beside_giovanni: start", + "00.32/beside_giovanni: ok at RocketHideout_B4F (19, 5) facing east (tile)", + "[Event] 00.32/18 beside_giovanni: done", + "[Event] 00.32/19 below_giovanni: start", "00.32/below_giovanni: ok at RocketHideout_B4F (19, 5) facing north (tile)", - "[Event] 00.32/17 below_giovanni: done", - "[Event] 00.32/18 talk_giovanni: start", + "[Event] 00.32/19 below_giovanni: done", + "[Event] 00.32/20 talk_giovanni: start", "00.32/talk_giovanni: ok at -", - "[Event] 00.32/18 talk_giovanni: done", - "[Event] 00.32/19 giovanni: start", + "[Event] 00.32/20 talk_giovanni: done", + "[Event] 00.32/21 giovanni: start", "00.32/giovanni: ok at -", - "[Event] 00.32/19 giovanni: done", - "[Event] 00.32/20 beside_silph_scope: start", + "[Event] 00.32/21 giovanni: done", + "[Event] 00.32/22 east_of_silph_scope: start", + "00.32/east_of_silph_scope: ok at RocketHideout_B4F (21, 5) facing north (tile)", + "[Event] 00.32/22 east_of_silph_scope: done", + "[Event] 00.32/23 beside_silph_scope: start", "00.32/beside_silph_scope: ok at RocketHideout_B4F (21, 5) facing west (tile)", - "[Event] 00.32/20 beside_silph_scope: done", - "[Event] 00.32/21 silph_scope: start", + "[Event] 00.32/23 beside_silph_scope: done", + "[Event] 00.32/24 silph_scope: start", "00.32/silph_scope: ok at -", - "[Event] 00.32/21 silph_scope: done", - "[Event] 00.32/22 escape_rope_hideout: start", + "[Event] 00.32/24 silph_scope: done", + "[Event] 00.32/25 escape_rope_hideout: start", "00.32/escape_rope_hideout: ok at RocketHideout_B4F (21, 5) facing west (tile)", - "[Event] 00.32/22 escape_rope_hideout: done", + "[Event] 00.32/25 escape_rope_hideout: done", "save at CeladonCity (34, 22) facing south (tile)", - "[Checkpoint] 00.32: done, 22 run, 0 skipped", + "[Checkpoint] 00.32: done, 25 run, 0 skipped", "[Checkpoint] 00.32: passed on attempt 1 (one-shot)", "[Segment] 00: 36 of 36 checkpoints one-shot", "[Segment] 00: done, 36 checkpoints", diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.32.plan.json b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.32.plan.json index 99195761cb..8b706af9b0 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.32.plan.json +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.32.plan.json @@ -95,6 +95,18 @@ ], "why": "a tap a tile, west of the turning Grunt (20, 6) and out of his lines (sight 2): down to (21, 3), west to (19, 3), down to (19, 5), west to (17, 5), down to (17, 6), west onto the arrow (16, 6), which slides west and, turned at (11, 6) and (11, 4), on to the stop (1, 4)" }, + { + "id": "beside_moon_stone", + "kind": "legs", + "variant": "taps", + "legs": [ + { + "direction": "east", + "tiles": 1 + } + ], + "why": "a tap east from the stop (1, 4) to above the MOON STONE (2, 5), which stands in the only way on (pokeguy 57:52)" + }, { "id": "above_moon_stone", "kind": "route", @@ -113,7 +125,7 @@ } }, "variant": "run", - "why": "a step east, above the MOON STONE (2, 5), which stands in the only way on (pokeguy 57:52)" + "why": "turn to face the MOON STONE (2, 5): no tile to walk" }, { "id": "moon_stone", @@ -190,23 +202,27 @@ }, { "id": "below_lift", - "kind": "route", - "target": { - "certainty": "tile", - "map": "RocketHideout_B2F", - "where": { - "facing": "north", - "kind": "tiles", - "tiles": [ - [ - 28, - 17 - ] - ] + "kind": "legs", + "variant": "taps", + "legs": [ + { + "direction": "east", + "tiles": 12 + }, + { + "direction": "south", + "tiles": 1 + }, + { + "direction": "east", + "tiles": 1 + }, + { + "direction": "north", + "tiles": 1 } - }, - "variant": "run", - "why": "east along row 17 to below the lift door (28, 16); no arrow on the way" + ], + "why": "a tap a tile along row 17 to (27, 17), down to row 18 and east to (28, 18), and up to below the lift door (28, 16), facing it" }, { "id": "lift_to_b4f", @@ -234,23 +250,23 @@ }, { "id": "below_left_guard", - "kind": "route", - "target": { - "certainty": "tile", - "map": "RocketHideout_B4F", - "where": { - "facing": "north", - "kind": "tiles", - "tiles": [ - [ - 16, - 15 - ] - ] + "kind": "legs", + "variant": "taps", + "legs": [ + { + "direction": "south", + "tiles": 1 + }, + { + "direction": "west", + "tiles": 4 + }, + { + "direction": "north", + "tiles": 9 } - }, - "variant": "run", - "why": "from the lift door up to below the left door Grunt (16, 14)" + ], + "why": "a tap a tile off the lift door (20, 23): down to (20, 24), west to (16, 24) and up column 16 to below the left door Grunt (16, 14)" }, { "id": "talk_left_guard", @@ -278,23 +294,23 @@ }, { "id": "below_right_guard", - "kind": "route", - "target": { - "certainty": "tile", - "map": "RocketHideout_B4F", - "where": { - "facing": "north", - "kind": "tiles", - "tiles": [ - [ - 19, - 15 - ] - ] + "kind": "legs", + "variant": "taps", + "legs": [ + { + "direction": "south", + "tiles": 1 + }, + { + "direction": "east", + "tiles": 3 + }, + { + "direction": "north", + "tiles": 1 } - }, - "variant": "run", - "why": "east along row 15 to below the right door Grunt (19, 14)" + ], + "why": "a tap a tile: down to (16, 16), east along row 16 to (19, 16) and up to below the right door Grunt (19, 14)" }, { "id": "talk_right_guard", @@ -320,6 +336,26 @@ }, "why": "Rocket Grunt (TRAINER_TEAM_ROCKET_GRUNT_17): Ekans, Sandshrew, Arbok Lv23 (Arbok's Glare paralysed pokeguy's Wartortle, 59:44)" }, + { + "id": "beside_giovanni", + "kind": "legs", + "variant": "taps", + "legs": [ + { + "direction": "west", + "tiles": 2 + }, + { + "direction": "north", + "tiles": 10 + }, + { + "direction": "east", + "tiles": 2 + } + ], + "why": "a tap a tile: west to (17, 15), up column 17 between the guards (17..18, 12..13) to the wall at (17, 5), and east to below Giovanni (19, 4)" + }, { "id": "below_giovanni", "kind": "route", @@ -338,7 +374,7 @@ } }, "variant": "run", - "why": "between the guards (17..18, 12..13) and up to below Giovanni (19, 4)" + "why": "turn to face Giovanni (19, 4): no tile to walk" }, { "id": "talk_giovanni", @@ -364,6 +400,30 @@ }, "why": "Giovanni (TRAINER_BOSS_GIOVANNI): Onix, Rhyhorn, Kangaskhan" }, + { + "id": "east_of_silph_scope", + "kind": "legs", + "variant": "taps", + "legs": [ + { + "direction": "west", + "tiles": 2 + }, + { + "direction": "south", + "tiles": 2 + }, + { + "direction": "east", + "tiles": 4 + }, + { + "direction": "north", + "tiles": 2 + } + ], + "why": "a tap a tile round by row 7: west to (17, 5), down to (17, 7), east to the wall at (21, 7) and up to the wall at (21, 5), east of the SILPH SCOPE (20, 5)" + }, { "id": "beside_silph_scope", "kind": "route", @@ -382,7 +442,7 @@ } }, "variant": "run", - "why": "round by row 7 to east of the SILPH SCOPE (20, 5)" + "why": "turn to face the SILPH SCOPE (20, 5): no tile to walk" }, { "id": "silph_scope", From 212a1ebccfcf1be0901b81115475ccabcb2b0ecf Mon Sep 17 00:00:00 2001 From: dayfine Date: Tue, 10 Nov 2026 02:41:52 -0800 Subject: [PATCH 61/79] FRLG AutoStory 00.32: judge a tap's step on all four edge bands The tap judge compared only the top quarter of the screen. On Rocket Hideout B3F the floor repeats every tile, so a one-tile scroll left the band nearly unchanged: real steps read as turns, the retries overshot, and the route ended off its path (00.32 run 1). Take the largest change over the top, bottom, left and right quarters instead, all clear of the player. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss --- .../PokemonFRLG_OverworldBike_Tests.cpp | 42 +++++++++++++++++++ .../PokemonFRLG_OverworldRecoveryWalk.cpp | 36 +++++++++------- .../PokemonFRLG_OverworldRecoveryWalk.h | 17 ++++++++ 3 files changed, 80 insertions(+), 15 deletions(-) diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldBike_Tests.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldBike_Tests.cpp index eca8adf9da..8fc91a73c5 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldBike_Tests.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldBike_Tests.cpp @@ -17,7 +17,9 @@ #include "PokemonFRLG_BikeSpinPresses.h" #include "PokemonFRLG_BikeSpinMechanics.h" #include "PokemonFRLG_OverworldMaps.h" +#include "CommonFramework/ImageTypes/ImageRGB32.h" #include "PokemonFRLG_OverworldRecovery.h" +#include "PokemonFRLG_OverworldRecoveryWalk.h" #include "PokemonFRLG_OverworldRoute.h" #include "PokemonFRLG_OverworldSim.h" #include "PokemonFRLG_OverworldSimField.h" @@ -215,7 +217,47 @@ UnitTestResult test_speed_after_door(){ return true; } +// A floor that repeats every 16-pixel tile, with a pillar on the bottom +// row, seen from `scroll` pixels east. +ImageRGB32 periodic_floor(size_t scroll){ + ImageRGB32 image(160, 160); + for (size_t y = 0; y < 160; y++){ + for (size_t x = 0; x < 160; x++){ + const size_t floor_x = x + scroll; + uint32_t pixel = (floor_x % 16 < 8) ^ (y % 16 < 8) ? 0xff808040 : 0xffa0a060; + if (y >= 130 && floor_x >= 100 && floor_x < 120){ + pixel = 0xff000000; + } + image.pixel(x, y) = pixel; + } + } + return image; +} + +// Rocket Hideout B3F (00.32 run 1): a tap east over a floor that repeats +// every tile left the top band the same, so the tap read as a turn. +UnitTestResult test_scroll_over_periodic_floor(){ + const ImageFloatBox game(0, 0, 1, 1); + const ImageRGB32 before = periodic_floor(0); + const double stepped = tap_scroll_change(before, periodic_floor(16), game); + if (stepped <= WALL_TAP_MOVED_RMSD){ + return std::format("Expected a one-tile scroll to read as a step: change {}.", stepped); + } + ImageRGB32 turned = periodic_floor(0); + for (size_t y = 64; y < 96; y++){ + for (size_t x = 64; x < 96; x++){ + turned.pixel(x, y) = 0xffff0000; + } + } + const double bumped = tap_scroll_change(before, turned, game); + if (bumped > WALL_TAP_MOVED_RMSD){ + return std::format("Expected the player turning in the middle not to read as a step: change {}.", bumped); + } + return true; +} + const BikeCase OVERWORLD_BIKE_CASES[] = { + {.input = {"a tap over a floor that repeats every tile", test_scroll_over_periodic_floor}, .expectation = {"scroll seen at the bottom edge; a turn is not"}}, {.input = {"taps a tile each, one in 12 dropped 60ms apart", test_tap_chains}, .expectation = {"23 of 25 tiles at 60ms; 25 at 100 and 120ms"}}, {.input = {"an open leg of 11 from a start 2 off, counted in taps", test_counted_leg_off_start}, .expectation = {"found against the rock and walked back"}}, {.input = {"SELECT onto the registered Bicycle", test_select_onto_bike}, .expectation = {"one press registered; two and off unregistered"}}, diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldRecoveryWalk.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldRecoveryWalk.cpp index 18b365317f..a2787d36ca 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldRecoveryWalk.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldRecoveryWalk.cpp @@ -4,6 +4,7 @@ * */ +#include #include #include #include @@ -61,21 +62,26 @@ struct StepWalk{ bool blocked = false; }; -// TODO(forest drift, 2026-11-01): the threshold is a diagnostic's guess. -// How much the game screen's top quarter, clear of the player in the -// middle, may change when a tap toward a wall only bumps the player (the -// player's own animation, an animated tile). A step scrolls the whole map -// by a tile. Not yet measured on the console: a guess on the safe side. -constexpr double WALL_TAP_MOVED_RMSD = 20.0; - -// How much the top quarter of the game screen changed from `before` to -// `after`: a step scrolls it by a tile. -double top_band_change(const ImageViewRGB32& before, const ImageViewRGB32& after){ - const ImageFloatBox game = GameSettings::instance().GAME_BOX; - const ImageFloatBox band(game.x, game.y, game.width, game.height * 0.25); - return ImageMatch::pixel_RMSD(extract_box_reference(before, band), extract_box_reference(after, band)); +} // namespace + +double tap_scroll_change(const ImageViewRGB32& before, const ImageViewRGB32& after, const ImageFloatBox& game){ + const double w = game.width * 0.25; + const double h = game.height * 0.25; + const ImageFloatBox bands[] = { + {game.x, game.y, game.width, h}, + {game.x, game.y + game.height - h, game.width, h}, + {game.x, game.y, w, game.height}, + {game.x + game.width - w, game.y, w, game.height}, + }; + double most = 0; + for (const ImageFloatBox& band : bands){ + most = std::max(most, ImageMatch::pixel_RMSD(extract_box_reference(before, band), extract_box_reference(after, band))); + } + return most; } +namespace{ + // A counted tap's press, its release and the wait after it for the // screen to show the step. struct TapTiming{ @@ -116,7 +122,7 @@ BikeTap console_bike_tap( return BikeTap{.moved = false, .interrupt = (size_t)ret}; } const VideoSnapshot after = console.video().snapshot(); - if (before && after && top_band_change(before, after) > WALL_TAP_MOVED_RMSD){ + if (before && after && tap_scroll_change(before, after, GameSettings::instance().GAME_BOX) > WALL_TAP_MOVED_RMSD){ return BikeTap{.moved = true}; } const bool late = Pokemon::clear_late_interrupts(console, context, interrupts, AFTER_LEG_WATCH, MAX_INTERRUPTIONS_PER_LEG) > 0; @@ -411,7 +417,7 @@ bool moved_past_wall(ConsoleHandle& console, ProControllerContext& context, cons if (!before || !after){ return false; } - const double change = top_band_change(before, after); + const double change = tap_scroll_change(before, after, GameSettings::instance().GAME_BOX); console.log(std::format("Position check: a tap toward the wall of {} changed the screen by {:.1f}.", to_string(step), change)); return change > WALL_TAP_MOVED_RMSD; } diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldRecoveryWalk.h b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldRecoveryWalk.h index 51cd54ac1a..a65eca8c20 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldRecoveryWalk.h +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldRecoveryWalk.h @@ -15,6 +15,8 @@ #include #include +#include "CommonFramework/ImageTools/ImageBoxes.h" +#include "CommonFramework/ImageTypes/ImageViewRGB32.h" #include "NintendoSwitch/Controllers/Procon/NintendoSwitch_ProController.h" #include "NintendoSwitch/NintendoSwitch_ConsoleHandle.h" #include "PokemonFRLG_OverworldRecovery.h" @@ -26,6 +28,21 @@ namespace NintendoSwitch{ namespace PokemonFRLG{ +// TODO(forest drift, 2026-11-01): the threshold is a diagnostic's guess. +// How much each edge quarter of the game screen, clear of the player in the +// middle, may change when a tap toward a wall only bumps the player (the +// player's own animation, an animated tile). A step scrolls the whole map +// by a tile. Not yet measured on the console: a guess on the safe side. +constexpr double WALL_TAP_MOVED_RMSD = 20.0; + +// How much a counted tap scrolled the map: the largest RMSD between `before` +// and `after` over the four edge quarters (top, bottom, left, right) of +// `game`, all clear of the player in the middle. One band alone misses a +// step over a floor that repeats every tile (Rocket Hideout B3F, 00.32): a +// one-tile scroll leaves the band nearly the same. +double tap_scroll_change(const ImageViewRGB32& before, const ImageViewRGB32& after, const ImageFloatBox& game); + + // Walks `route`, planned with `planning`, at `speed`, as // walk_overworld_route() does, from the same start: standing still on the // overworld, not on the bike, facing `facing` (read from the screen if not From 55ff73bf56be3a9e4bc1ebed141cf040e4ff55e8 Mon Sep 17 00:00:00 2001 From: dayfine Date: Tue, 10 Nov 2026 02:49:56 -0800 Subject: [PATCH 62/79] FRLG AutoStory 00.31: a talk fails unless A opens a message Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss --- .../AutoStory/PokemonFRLG_AutoStoryActions.cpp | 15 +++++++++++++++ .../AutoStory/PokemonFRLG_AutoStoryActions.h | 2 ++ .../AutoStory/PokemonFRLG_AutoStoryEvents.cpp | 5 ++++- 3 files changed, 21 insertions(+), 1 deletion(-) diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryActions.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryActions.cpp index 94a86456c2..391a1817ed 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryActions.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryActions.cpp @@ -555,6 +555,21 @@ void answer_yes_no(ConsoleHandle& console, ProControllerContext& context, bool y ); } +// A talk to a person or an item ball opens a message; an A that opens +// none faced nothing (00.31 b3f_rare_candy, console B, 2026-11-10: one A, +// "done", on the wrong floor). The message is left open for the next step. +bool talk_opens_message(ConsoleHandle& console, ProControllerContext& context){ + WhiteDialogWatcher opened(COLOR_RED); + const int shown = run_until( + console, context, + [](ProControllerContext& context){ + pbf_press_button(context, BUTTON_A, 160ms, 2000ms); + }, + {opened} + ); + return shown >= 0; +} + std::optional talk_and_count_pages(ConsoleHandle& console, ProControllerContext& context){ WhiteDialogWatcher opened(COLOR_RED); const int shown = run_until( diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryActions.h b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryActions.h index 07e37e35c9..bdf5be0d80 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryActions.h +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryActions.h @@ -117,6 +117,8 @@ void answer_yes_no(ConsoleHandle& console, ProControllerContext& context, bool y // has, one or two, then on to the overworld. Language-free: one A after // the first page has printed either closes the message or shows its // second page. Nothing if no message showed. +// Presses A; true once a message box is up. +bool talk_opens_message(ConsoleHandle& console, ProControllerContext& context); std::optional talk_and_count_pages(ConsoleHandle& console, ProControllerContext& context); // From the overworld: one step `direction`, onto a trigger or into a door. diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryEvents.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryEvents.cpp index 1563e3e99c..52de5db764 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryEvents.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryEvents.cpp @@ -17,6 +17,7 @@ #include "VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldRecoveryWalk.h" #include "VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldRoute.h" #include "VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldWalk.h" +#include "PokemonFRLG_AutoStoryActions.h" #include "PokemonFRLG_AutoStoryAbilities.h" #include "PokemonFRLG_AutoStoryBattleData.h" #include "PokemonFRLG_AutoStoryCapture.h" @@ -719,7 +720,9 @@ ConsoleAction console_action_of(StoryActionId id){ return take_step; case StoryActionId::TALK: return [](StoryEnv& env, RunState&, const StoryStep&){ - pbf_press_button(env.context, BUTTON_A, 160ms, 800ms); + if (!talk_opens_message(env.console, env.context)){ + return Pokemon::outcome_failed("no_message", "talk: A opened no message; nothing to talk to or pick up here."); + } return Pokemon::outcome_ok(); }; case StoryActionId::ANSWER: From 3f53ca1e9b986eb567babbd23699128d11051dc3 Mon Sep 17 00:00:00 2001 From: dayfine Date: Tue, 10 Nov 2026 02:50:27 -0800 Subject: [PATCH 63/79] FRLG AutoStory 00.31: keep the talk check beside its step Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss --- .../PokemonFRLG_AutoStoryActions.cpp | 15 --------------- .../AutoStory/PokemonFRLG_AutoStoryActions.h | 2 -- .../AutoStory/PokemonFRLG_AutoStoryEvents.cpp | 19 ++++++++++++++++++- 3 files changed, 18 insertions(+), 18 deletions(-) diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryActions.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryActions.cpp index 391a1817ed..94a86456c2 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryActions.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryActions.cpp @@ -555,21 +555,6 @@ void answer_yes_no(ConsoleHandle& console, ProControllerContext& context, bool y ); } -// A talk to a person or an item ball opens a message; an A that opens -// none faced nothing (00.31 b3f_rare_candy, console B, 2026-11-10: one A, -// "done", on the wrong floor). The message is left open for the next step. -bool talk_opens_message(ConsoleHandle& console, ProControllerContext& context){ - WhiteDialogWatcher opened(COLOR_RED); - const int shown = run_until( - console, context, - [](ProControllerContext& context){ - pbf_press_button(context, BUTTON_A, 160ms, 2000ms); - }, - {opened} - ); - return shown >= 0; -} - std::optional talk_and_count_pages(ConsoleHandle& console, ProControllerContext& context){ WhiteDialogWatcher opened(COLOR_RED); const int shown = run_until( diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryActions.h b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryActions.h index bdf5be0d80..07e37e35c9 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryActions.h +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryActions.h @@ -117,8 +117,6 @@ void answer_yes_no(ConsoleHandle& console, ProControllerContext& context, bool y // has, one or two, then on to the overworld. Language-free: one A after // the first page has printed either closes the message or shows its // second page. Nothing if no message showed. -// Presses A; true once a message box is up. -bool talk_opens_message(ConsoleHandle& console, ProControllerContext& context); std::optional talk_and_count_pages(ConsoleHandle& console, ProControllerContext& context); // From the overworld: one step `direction`, onto a trigger or into a door. diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryEvents.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryEvents.cpp index 52de5db764..be8410780d 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryEvents.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryEvents.cpp @@ -9,15 +9,16 @@ #include #include "Common/Cpp/Exceptions.h" #include "CommonFramework/Exceptions/OperationFailedException.h" +#include "CommonTools/Async/InferenceRoutines.h" #include "NintendoSwitch/Commands/NintendoSwitch_Commands_PushButtons.h" #include "Pokemon/AutoStory/Pokemon_TilePose.h" #include "Pokemon/Navigation/Pokemon_RouteLog.h" +#include "VideoGames/PokemonFRLG/Inference/Dialogs/PokemonFRLG_DialogDetector.h" #include "VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldMaps.h" #include "VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldReanchor.h" #include "VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldRecoveryWalk.h" #include "VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldRoute.h" #include "VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldWalk.h" -#include "PokemonFRLG_AutoStoryActions.h" #include "PokemonFRLG_AutoStoryAbilities.h" #include "PokemonFRLG_AutoStoryBattleData.h" #include "PokemonFRLG_AutoStoryCapture.h" @@ -495,6 +496,22 @@ std::optional wall_beside(const MapData& map, const TilePos& tile){ namespace{ +// A talk to a person or an item ball opens a message; an A that opens +// none faced nothing (00.31 b3f_rare_candy, console B, 2026-11-10: one A, +// "done", on the wrong floor). The message is left open for the next step. +bool talk_opens_message(ConsoleHandle& console, ProControllerContext& context){ + WhiteDialogWatcher opened(COLOR_RED); + const int shown = run_until( + console, context, + [](ProControllerContext& context){ + pbf_press_button(context, BUTTON_A, 160ms, 2000ms); + }, + {opened} + ); + return shown >= 0; +} + + bool walked(StoryEnv& env, RunState& state, const StoryStep& step){ const Outcome outcome = walk_route(env, state, step); if (outcome.succeeded() && outcome.pose){ From 5fb00548c8aad9dfdc07ec18a2ee56bc38f0883c Mon Sep 17 00:00:00 2001 From: dayfine Date: Tue, 10 Nov 2026 03:41:33 -0800 Subject: [PATCH 64/79] FRLG AutoStory 00.31: tap B4F's open floor after the LIFT KEY From the Grunt's line to below the LIFT KEY and on to B4F's stairs (11, 15) are now taps legs, one checked tap per tile; below_lift_key keeps a turn-only route to face the key and b3f_from_b4f only climbs the stairs. The sweep checks run them with each turn dropped and the stairs with any hold short. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss --- .../PokemonFRLG_AutoStoryHideout_Tests.cpp | 29 ++++++++++++++-- .../ReplayData/frlg-story-sim-trace.json | 34 +++++++++++-------- .../AutoStory/StoryData/frlg-00.31.plan.json | 18 ++++++++-- 3 files changed, 62 insertions(+), 19 deletions(-) diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryHideout_Tests.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryHideout_Tests.cpp index eb424124d6..6e678803fa 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryHideout_Tests.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryHideout_Tests.cpp @@ -218,8 +218,10 @@ UnitTestResult test_coded_spinners(){ // `facing`: as planned, and with each of the turns the taps make dropped // in turn (a tap facing another way only turns the player, and a // dropped one doesn't even turn them). Empty if each run ends on `goal`. -std::string tap_legs_on_sim(const MapPosition& start, Direction facing, const std::vector& legs, const MapPosition& goal){ - const std::vector& maps = story_maps(); +std::string tap_legs_on_sim( + const MapPosition& start, Direction facing, const std::vector& legs, const MapPosition& goal, + const std::vector& maps = story_maps() +){ std::optional> route = fixed_route(maps, start, legs); if (!route || !(route->back().end == goal)){ return "The legs from " + to_string(start) + " don't end on " + to_string(goal) + "."; @@ -272,11 +274,25 @@ std::string short_holds_on_sim(const MapPosition& start, Direction facing, const // the stairs (18, 2) to below the stairs to B4F (15, 19), and back from // them (15, 18) to the stop (10, 13). The routes planned after them, // onto the stairs to B4F and east to below the Rare Candy, have no -// arrow on the way: a short hold there is found again. +// arrow on the way: a short hold there is found again. B4F after the +// LIFT KEY, a tap a tile from the Grunt's line to below the key and on +// to the stairs (11, 15) with any one turn dropped, and the stairs up. UnitTestResult test_b3f_maze_taps(){ using Pokemon::StoryLeg; const MapPosition below_stairs{"RocketHideout_B3F", {15, 19}}; const MapPosition candy_stop{"RocketHideout_B3F", {10, 13}}; + const MapPosition b4f_below_key{"RocketHideout_B4F", {3, 3}}; + const MapPosition b4f_stairs{"RocketHideout_B4F", {11, 15}}; + // The Lift Key Grunt (4, 2) is beaten by then: (4, 3), in his line, is + // open floor. + std::vector key_grunt_beaten = story_maps(); + for (MapData& map : key_grunt_beaten){ + for (MapObject& object : map.objects){ + if (map.name == "RocketHideout_B4F" && object.x == 4 && object.y == 2){ + object.trainer.reset(); + } + } + } const std::vector failures{ tap_legs_on_sim({"RocketHideout_B3F", {18, 2}}, Direction::EAST, { {Direction::WEST, 6}, {Direction::SOUTH, 5}, {Direction::WEST, 7}, {Direction::SOUTH, 2}, {Direction::WEST, 1}, @@ -288,6 +304,13 @@ UnitTestResult test_b3f_maze_taps(){ }, candy_stop), short_holds_on_sim(below_stairs, Direction::NORTH, {"RocketHideout_B4F", map_point(story_maps(), "RocketHideout_B4F", "warp_0")}), short_holds_on_sim(candy_stop, Direction::NORTH, {"RocketHideout_B3F", {12, 13}}), + tap_legs_on_sim({"RocketHideout_B4F", {4, 3}}, Direction::WEST, { + {Direction::WEST, 1}, + }, b4f_below_key), + tap_legs_on_sim(b4f_below_key, Direction::NORTH, { + {Direction::EAST, 3}, {Direction::SOUTH, 4}, {Direction::EAST, 5}, {Direction::SOUTH, 8}, + }, b4f_stairs, key_grunt_beaten), + short_holds_on_sim(b4f_stairs, Direction::SOUTH, {"RocketHideout_B3F", {15, 18}}), }; for (const std::string& failure : failures){ if (!failure.empty()){ diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/ReplayData/frlg-story-sim-trace.json b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/ReplayData/frlg-story-sim-trace.json index e3cc1c3a99..77e203aee2 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/ReplayData/frlg-story-sim-trace.json +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/ReplayData/frlg-story-sim-trace.json @@ -1277,7 +1277,7 @@ "[Checkpoint] 00.30: done, 24 run, 0 skipped", "[Checkpoint] 00.30: passed on attempt 1 (one-shot)", "begin 00.31", - "[Checkpoint] 00.31: start, 20 events", + "[Checkpoint] 00.31: start, 22 events", "[Event] 00.31/1 from_save: start", "[Event] 00.31/1 from_save: done", "[Event] 00.31/2 celadon_below_game_corner: start", @@ -1319,26 +1319,32 @@ "[Event] 00.31/14 lift_key_grunt: start", "00.31/lift_key_grunt: ok at -", "[Event] 00.31/14 lift_key_grunt: done", - "[Event] 00.31/15 below_lift_key: start", + "[Event] 00.31/15 beside_lift_key: start", + "00.31/beside_lift_key: ok at RocketHideout_B4F (3, 3) facing west (tile)", + "[Event] 00.31/15 beside_lift_key: done", + "[Event] 00.31/16 below_lift_key: start", "00.31/below_lift_key: ok at RocketHideout_B4F (3, 3) facing north (tile)", - "[Event] 00.31/15 below_lift_key: done", - "[Event] 00.31/16 lift_key: start", + "[Event] 00.31/16 below_lift_key: done", + "[Event] 00.31/17 lift_key: start", "00.31/lift_key: ok at -", - "[Event] 00.31/16 lift_key: done", - "[Event] 00.31/17 b3f_from_b4f: start", + "[Event] 00.31/17 lift_key: done", + "[Event] 00.31/18 b4f_to_stairs: start", + "00.31/b4f_to_stairs: ok at RocketHideout_B4F (11, 15) facing south (tile)", + "[Event] 00.31/18 b4f_to_stairs: done", + "[Event] 00.31/19 b3f_from_b4f: start", "00.31/b3f_from_b4f: ok at RocketHideout_B3F (15, 18) facing west (tile)", - "[Event] 00.31/17 b3f_from_b4f: done", - "[Event] 00.31/18 b3f_back_to_candy_row: start", + "[Event] 00.31/19 b3f_from_b4f: done", + "[Event] 00.31/20 b3f_back_to_candy_row: start", "00.31/b3f_back_to_candy_row: ok at RocketHideout_B3F (10, 13) facing north (tile)", - "[Event] 00.31/18 b3f_back_to_candy_row: done", - "[Event] 00.31/19 beside_b3f_rare_candy: start", + "[Event] 00.31/20 b3f_back_to_candy_row: done", + "[Event] 00.31/21 beside_b3f_rare_candy: start", "00.31/beside_b3f_rare_candy: ok at RocketHideout_B3F (12, 13) facing north (tile)", - "[Event] 00.31/19 beside_b3f_rare_candy: done", - "[Event] 00.31/20 b3f_rare_candy: start", + "[Event] 00.31/21 beside_b3f_rare_candy: done", + "[Event] 00.31/22 b3f_rare_candy: start", "00.31/b3f_rare_candy: ok at -", - "[Event] 00.31/20 b3f_rare_candy: done", + "[Event] 00.31/22 b3f_rare_candy: done", "save at RocketHideout_B3F (12, 13) facing north (tile)", - "[Checkpoint] 00.31: done, 20 run, 0 skipped", + "[Checkpoint] 00.31: done, 22 run, 0 skipped", "[Checkpoint] 00.31: passed on attempt 1 (one-shot)", "[Segment] 00: 35 of 35 checkpoints one-shot", "[Segment] 00: done, 35 checkpoints", diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.31.plan.json b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.31.plan.json index 1787f57fab..af8f3bbbe4 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.31.plan.json +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.31.plan.json @@ -92,24 +92,38 @@ "declared_after": {"certainty": "tile", "map": "RocketHideout_B4F", "where": {"facing": "west", "kind": "tiles", "tiles": [[4, 3]]}}, "why": "Rocket Grunt (TRAINER_TEAM_ROCKET_GRUNT_18): Koffing, Zubat Lv21; he drops the LIFT KEY" }, + { + "id": "beside_lift_key", + "kind": "legs", + "variant": "taps", + "legs": [{"direction": "west", "tiles": 1}], + "why": "a tap west from the Grunt's line (4, 3) to below the LIFT KEY (3, 3)" + }, { "id": "below_lift_key", "kind": "route", "target": {"certainty": "tile", "map": "RocketHideout_B4F", "where": {"facing": "north", "kind": "tiles", "tiles": [[3, 3]]}}, "variant": "run", - "why": "a tile west, below the LIFT KEY (3, 2)" + "why": "turn to face the LIFT KEY (3, 2): no tile to walk" }, { "id": "lift_key", "kind": "talk", "why": "pick up the LIFT KEY (pokeguy 57:33)" }, + { + "id": "b4f_to_stairs", + "kind": "legs", + "variant": "taps", + "legs": [{"direction": "east", "tiles": 3}, {"direction": "south", "tiles": 4}, {"direction": "east", "tiles": 5}, {"direction": "south", "tiles": 8}], + "why": "a tap a tile from below the LIFT KEY (3, 3): east to the wall (6, 3), down to (6, 7), east to (11, 7) and down onto the stairs (11, 15)" + }, { "id": "b3f_from_b4f", "kind": "route", "target": {"certainty": "tile", "map": "RocketHideout_B3F", "where": {"facing": "west", "kind": "tiles", "tiles": [[15, 18]]}}, "variant": "run", - "why": "back to B4F's stairs (11, 15) and up them to B3F's (15, 18)" + "why": "east up B4F's stairs (11, 15) to B3F's (15, 18)" }, { "id": "b3f_back_to_candy_row", From d9190da1c346a382d5c87202c137f11a34c7c89f Mon Sep 17 00:00:00 2001 From: dayfine Date: Tue, 10 Nov 2026 04:13:34 -0800 Subject: [PATCH 65/79] FRLG overworld: confirm a warp's destination after its fade A black that clears with the old scene back is no warp: wait_out_warp() now compares the screen after the fade with one taken before the hold (warp_left_scene()) and fails 'warp to X not confirmed'. Sim fault black_without_warp and rule confirm_warp_destination, with WarpFade cases. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss --- .../PokemonFRLG_OverworldRecoveryWalk.cpp | 6 +- .../Overworld/PokemonFRLG_OverworldSim.cpp | 18 ++++ .../Overworld/PokemonFRLG_OverworldSim.h | 11 +++ .../Overworld/PokemonFRLG_OverworldWalk.cpp | 97 ++++++++++++++++++- .../Overworld/PokemonFRLG_OverworldWalk.h | 22 ++++- .../PokemonFRLG_OverworldWarpFade_Tests.cpp | 22 ++++- .../AutoStory/PokemonFRLG_AutoStoryRooms.cpp | 7 +- 7 files changed, 170 insertions(+), 13 deletions(-) diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldRecoveryWalk.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldRecoveryWalk.cpp index 18b365317f..6d969a2147 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldRecoveryWalk.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldRecoveryWalk.cpp @@ -200,6 +200,7 @@ StepWalk walk_step( } context.wait_for_all_requests(); out.dark = on_dark_cave(console); + const VideoSnapshot before = console.video().snapshot(); out.hold_start = current_time(); BlackScreenOverWatcher arrival(COLOR_RED); Pokemon::WatchAlong fade(arrival); @@ -212,7 +213,7 @@ StepWalk walk_step( return out; } if (step.warps){ - wait_out_warp(console, context, step, fade); + wait_out_warp(console, context, step, fade, before); static_assert(AFTER_WARP_BATTLE_WATCH >= AFTER_WARP); if (run_from_battle_after_warp(console, context)){ console.log("Route: a wild battle, not the warp to " + step.end.map + "; the player is on " + to_string(step) + " before the warp.", COLOR_ORANGE); @@ -349,6 +350,7 @@ void hold_to_warp( callbacks.emplace_back(*watchers.back()); } context.wait_for_all_requests(); + const VideoSnapshot before = console.video().snapshot(); const int ret = run_until( console, context, [&](ProControllerContext& context){ @@ -358,7 +360,7 @@ void hold_to_warp( callbacks ); if (ret == 0){ - wait_out_warp(console, context, step); + wait_out_warp(console, context, step, before); check_warp_was_no_battle(console, context, step); return; } diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSim.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSim.cpp index 938dab9efc..56734b1174 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSim.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSim.cpp @@ -358,6 +358,13 @@ bool OverworldSim::trainer_sees(Milliseconds pressed){ // game stopped them there: a warp, a trainer, a wild battle. bool OverworldSim::after_step(const Step& step, Milliseconds pressed){ const SimTiming& timing = m_script.timing; + if (step.warped && m_script.black_without_warp.contains(++m_warp_steps)){ + m_frozen = true; + schedule(pressed + timing.tile, SimScreen::FADE, false); + schedule(pressed + timing.tile + timing.fade, SimScreen::OVERWORLD, true); + note("black without a warp; the player stays at " + to_string(m_state.position) + "."); + return true; + } m_map = step.map; m_player = step.player; m_state.steps++; @@ -797,6 +804,17 @@ bool OverworldSimWalker::fade_over_since(Milliseconds from) const{ // the battle screen stands in for the wipe. The fade is watched for from // `watched_from`: a fade over by then is missed. bool OverworldSimWalker::after_warp(const RouteStep& step, int warps_before, Milliseconds watched_from){ + // A fade seen with no warp: the console's screen check + // (warp_left_scene()) finds the scene from before the hold. + const bool black_only = m_sim.state().warps == warps_before + && (m_sim.state().screen == SimScreen::FADE || fade_over_since(watched_from)); + if (black_only){ + if (m_rules.confirm_warp_destination){ + fail("walk_overworld_route(): the warp to " + step.end.map + " not confirmed: the screen after the fade shows the scene from before the hold."); + } + m_sim.watch({}, AFTER_WARP); + return true; + } if (m_sim.state().warps == warps_before){ if (!m_sim.watch({SimWatcher::BATTLE_SCREEN}, WARP_TIMEOUT)){ fail("walk_overworld_route(): no fade in and out after walking onto the warp to " + step.end.map + "."); diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSim.h b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSim.h index 70b4f088e5..0c29a98946 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSim.h +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSim.h @@ -141,6 +141,10 @@ struct SimScript{ // (SimWalkerRules::confirm_turn) after 00.28 run 2 (console B, // 2026-11-09), where a one-tile leg only turned the player. std::set dropped_turn_taps; + // Fault injection: steps onto a warp, by number from 1, that show the + // fade's black and clear with the player where they were, not warped + // (console B, 2026-11-10 01:44, 00.31 run 4, "east 1 (warp)" on B4F). + std::set black_without_warp; // The player rides the Bicycle: a tap facing another way takes a step // too, a hold through a turn loses no tile // (MovementMechanics::BIKE_TAP_ONLY_TURNS), and no step tap is @@ -387,6 +391,8 @@ class OverworldSim{ int m_encounter_rate_buff = 0; // The turn taps so far, for SimScript::dropped_turn_taps. int m_turn_taps = 0; + // Steps onto a warp so far (SimScript::black_without_warp). + int m_warp_steps = 0; // The last tap, until a hold. std::optional m_last_tap; // When the last Bicycle tap started, and how many came too soon. @@ -465,6 +471,11 @@ struct SimWalkerRules{ // 2026-11-09 01:41, 00.27, the warp to CeruleanCity: the watch started // about 1.3 s into the hold). bool watch_fade_along_hold = true; + // A warp's fade is taken as the warp only once the screen after it + // shows the player off the map they held from (warp_left_scene()). + // Without it a black that cleared with the player where they were was + // taken as the warp (console B, 2026-11-10 01:44, 00.31 run 4). + bool confirm_warp_destination = true; // A turn tap is checked by the facing on screen, and tapped again // while the player faces another way (OverworldWalkSteps::turn_to()). // Without it a dropped tap left a one-tile leg turning the player diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldWalk.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldWalk.cpp index 104d07542f..8de83e0b7a 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldWalk.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldWalk.cpp @@ -7,7 +7,9 @@ #include #include #include "CommonFramework/Exceptions/OperationFailedExceptionWithScreenshot.h" +#include #include "CommonFramework/ImageTools/ImageBoxes.h" +#include "CommonFramework/ImageTools/ImageDiff.h" #include "CommonFramework/ImageTools/ImageStats.h" #include "CommonTools/Async/InferenceRoutines.h" #include "CommonTools/VisualDetectors/BlackScreenDetector.h" @@ -293,9 +295,66 @@ std::vector warp_hold_watchers(const RouteStep& step, Poke return {&fade}; } +namespace{ + +// How close (pixel RMSD) the overlap of two screens is for the same scene. +constexpr double SAME_SCENE_RMSD = 25; +// The GBA screen's tiles across and down. +constexpr int SCREEN_TILES_X = 15; +constexpr int SCREEN_TILES_Y = 10; +// From the fade's end until the new map is in full light. +constexpr Milliseconds WARP_FADE_IN(300); + +// The RMSD of `before` and `after` where they overlap, with the scene +// scrolled `dx`, `dy` pixels: `after` at (x, y) shows `before` at +// (x + dx, y + dy). +double scrolled_rmsd(const ImageViewRGB32& before, const ImageViewRGB32& after, int dx, int dy){ + const size_t width = before.width() - (size_t)std::abs(dx); + const size_t height = before.height() - (size_t)std::abs(dy); + const ImageViewRGB32 old_part = before.sub_image(dx > 0 ? dx : 0, dy > 0 ? dy : 0, width, height); + const ImageViewRGB32 new_part = after.sub_image(dx < 0 ? -dx : 0, dy < 0 ? -dy : 0, width, height); + return ImageMatch::pixel_RMSD(old_part, new_part); +} + +} // namespace + +bool warp_left_scene( + const ImageViewRGB32& before, const ImageViewRGB32& after, + const ImageFloatBox& game, Direction direction, int max_tiles +){ + const ImageViewRGB32 old_box = extract_box_reference(before, game); + const ImageViewRGB32 new_box = extract_box_reference(after, game); + if (old_box.width() != new_box.width() || old_box.height() != new_box.height()){ + return true; + } + if (dark_cave_screen(before) || dark_cave_screen(after)){ + return true; + } + const int tile_x = (int)old_box.width() / SCREEN_TILES_X; + const int tile_y = (int)old_box.height() / SCREEN_TILES_Y; + // Keep at least 5 tiles of overlap to compare. + const int most = std::min(max_tiles, (direction == Direction::NORTH || direction == Direction::SOUTH ? SCREEN_TILES_Y : SCREEN_TILES_X) - 5); + for (int tiles = 0; tiles <= most; tiles++){ + int dx = 0; + int dy = 0; + switch (direction){ + case Direction::NORTH: dy = -tiles * tile_y; break; + case Direction::SOUTH: dy = tiles * tile_y; break; + case Direction::WEST: dx = -tiles * tile_x; break; + case Direction::EAST: dx = tiles * tile_x; break; + } + if (scrolled_rmsd(old_box, new_box, dx, dy) < SAME_SCENE_RMSD){ + return false; + } + } + return true; +} + +namespace{ + // One watcher for the whole fade: a ladder's black is short enough to be // over before a second watcher, started once the fade is seen, looks. -void wait_out_warp(ConsoleHandle& console, ProControllerContext& context, const RouteStep& step, Pokemon::WatchAlong& fade){ +void wait_out_fade(ConsoleHandle& console, ProControllerContext& context, const RouteStep& step, Pokemon::WatchAlong& fade){ if (fade.fired()){ console.log("Route: the fade to " + step.end.map + " was over before the hold ended."); return; @@ -310,10 +369,38 @@ void wait_out_warp(ConsoleHandle& console, ProControllerContext& context, const } } -void wait_out_warp(ConsoleHandle& console, ProControllerContext& context, const RouteStep& step){ +} // namespace + +// A black screen that clears with the player where they were is no warp +// (console B, 2026-11-10 01:44, 00.31 run 4: "east 1 (warp)" was taken as +// walked while the player stayed on B4F). +void wait_out_warp( + ConsoleHandle& console, ProControllerContext& context, const RouteStep& step, + Pokemon::WatchAlong& fade, const VideoSnapshot& before +){ + wait_out_fade(console, context, step, fade); + if (!before){ + return; + } + pbf_wait(context, WARP_FADE_IN); + context.wait_for_all_requests(); + const VideoSnapshot after = console.video().snapshot(); + if (!after){ + return; + } + if (!warp_left_scene(*before.frame, *after.frame, GameSettings::instance().GAME_BOX, step.direction, step.tiles + step.warp_slack + 2)){ + OperationFailedExceptionWithScreenshot::fire( + ErrorReportMode::SEND_ERROR_REPORT, + "walk_overworld_route(): the warp to " + step.end.map + " not confirmed: the screen after the fade shows the scene from before the hold.", + console + ); + } +} + +void wait_out_warp(ConsoleHandle& console, ProControllerContext& context, const RouteStep& step, const VideoSnapshot& before){ BlackScreenOverWatcher arrival(COLOR_RED); Pokemon::WatchAlong fade(arrival); - wait_out_warp(console, context, step, fade); + wait_out_warp(console, context, step, fade, before); } // Fails unless the overworld is up. Under the START menu or a message the @@ -606,6 +693,8 @@ void walk_step_leg( ConsoleHandle& console, ProControllerContext& context, const RouteStep& step, const OverworldInterruptSet& interrupts, MoveSpeed speed ){ + context.wait_for_all_requests(); + const VideoSnapshot before = console.video().snapshot(); BlackScreenOverWatcher arrival(COLOR_RED); Pokemon::WatchAlong fade(arrival); Pokemon::walk_leg( @@ -619,7 +708,7 @@ void walk_step_leg( if (!step.warps){ return; } - wait_out_warp(console, context, step, fade); + wait_out_warp(console, context, step, fade, before); static_assert(AFTER_WARP_BATTLE_WATCH >= AFTER_WARP); check_warp_was_no_battle(console, context, step); } diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldWalk.h b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldWalk.h index 5666f54367..a07ff14ac6 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldWalk.h +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldWalk.h @@ -23,7 +23,9 @@ #include #include #include "Common/Cpp/TestRunners/UnitTestDatabase.h" +#include "CommonFramework/ImageTools/ImageBoxes.h" #include "CommonFramework/ImageTypes/ImageViewRGB32.h" +#include "CommonFramework/VideoPipeline/VideoFeed.h" #include "Pokemon/AutoStory/Pokemon_ScreenEvents.h" #include "Pokemon/Navigation/Pokemon_LegWalker.h" #include "NintendoSwitch/Controllers/Procon/NintendoSwitch_ProController.h" @@ -176,10 +178,24 @@ std::vector warp_hold_watchers(const RouteStep& step, Poke // After a hold onto `step`'s warp: waits out its fade, unless `fade`, a // BlackScreenOverWatcher watched along the hold, saw it over already; -// else waits on with that watcher, which may have seen the black. -void wait_out_warp(ConsoleHandle& console, ProControllerContext& context, const RouteStep& step, Pokemon::WatchAlong& fade); +// else waits on with that watcher, which may have seen the black. Then +// fails unless the screen after the fade differs from `before`, taken +// before the hold (warp_left_scene()). +void wait_out_warp( + ConsoleHandle& console, ProControllerContext& context, const RouteStep& step, + Pokemon::WatchAlong& fade, const VideoSnapshot& before +); // The same, watching only from now: for a caller that saw the black itself. -void wait_out_warp(ConsoleHandle& console, ProControllerContext& context, const RouteStep& step); +void wait_out_warp(ConsoleHandle& console, ProControllerContext& context, const RouteStep& step, const VideoSnapshot& before); + +// Whether `after` no longer shows the scene `before` showed, scrolled 0 to +// `max_tiles` tiles on toward `direction` inside the game box `game`: +// black then clear with the old scene back is no warp. A screen too dark to +// compare (a dark cave) counts as left. +bool warp_left_scene( + const ImageViewRGB32& before, const ImageViewRGB32& after, + const ImageFloatBox& game, Direction direction, int max_tiles +); // Before `step`: fails unless the overworld is up. void check_overworld(ConsoleHandle& console, ProControllerContext& context, const RouteStep& step); diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldWarpFade_Tests.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldWarpFade_Tests.cpp index de344c2dc1..dbaa49462c 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldWarpFade_Tests.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldWarpFade_Tests.cpp @@ -8,6 +8,7 @@ */ #include +#include #include #include #include "Common/Cpp/Exceptions.h" @@ -31,11 +32,15 @@ struct WarpFadeInput{ Milliseconds fade{0}; // SimWalkerRules::watch_fade_along_hold. bool watch_along_hold = true; + // SimScript::black_without_warp and SimWalkerRules::confirm_warp_destination. + std::set black_without_warp = {}; + bool confirm_destination = true; }; struct WarpFadeExpectation{ // The failure the walk stops on; empty: the route is walked. std::string failure; + int warps = 1; }; struct WarpFadeCase{ @@ -73,15 +78,17 @@ class Test_OverworldWarpFade : public UnitTest{ out.end = OUTSIDE; SimScript script; script.timing.fade = m_case.input.fade; + script.black_without_warp = m_case.input.black_without_warp; SimWalkerRules rules; rules.watch_fade_along_hold = m_case.input.watch_along_hold; + rules.confirm_warp_destination = m_case.input.confirm_destination; OverworldSim sim(maps(), MART, Direction::SOUTH, script); OverworldSimWalker walker(sim, rules); const RoutePlanning planning{.maps = &maps(), .costs = default_route_costs(), .start = MART, .label = "Sim"}; const std::string failure = walker.run({out}, planning); const std::string& expected = m_case.expectation.failure; const bool as_expected = expected.empty() ? failure.empty() : failure.find(expected) != std::string::npos; - if (as_expected && sim.state().warps == 1){ + if (as_expected && sim.state().warps == m_case.expectation.warps){ return true; } std::string log; @@ -89,8 +96,8 @@ class Test_OverworldWarpFade : public UnitTest{ log += "\n " + line; } return std::format( - "Expected failure \"{}\" after 1 warp; got \"{}\" after {}:{}", - expected, failure, sim.state().warps, log + "Expected failure \"{}\" after {} warp(s); got \"{}\" after {}:{}", + expected, m_case.expectation.warps, failure, sim.state().warps, log ); } @@ -114,6 +121,15 @@ const WarpFadeCase WARP_FADE_CASES[] = { .input = {.name = "a fade still on when the hold ends, watched from its end", .fade = 1000ms, .watch_along_hold = false}, .expectation = {.failure = ""}, }, + { + .input = {.name = "black without a warp, destination confirmed", .fade = 1000ms, .black_without_warp = {1}}, + .expectation = {.failure = "the warp to ViridianCity not confirmed", .warps = 0}, + }, + { + // 00.31 run 4 (console B, 2026-11-10 01:44): taken as walked. + .input = {.name = "black without a warp, any black taken as the warp", .fade = 1000ms, .black_without_warp = {1}, .confirm_destination = false}, + .expectation = {.failure = "", .warps = 0}, + }, }; void add_tests_OverworldWarpFade(UnitTestDatabase& database){ diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRooms.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRooms.cpp index e6dbf9cb22..290f50c27d 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRooms.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRooms.cpp @@ -71,7 +71,12 @@ void walk_room_legs( facing = leg.direction; continue; } + VideoSnapshot before; for (int tile = 0; tile < leg.tiles; tile++){ + if (leg.warps && tile + 1 == leg.tiles){ + context.wait_for_all_requests(); + before = console.video().snapshot(); + } step_once(console, context, leg.direction, facing); facing = leg.direction; } @@ -80,7 +85,7 @@ void walk_room_legs( step.direction = leg.direction; step.tiles = 1; step.warps = true; - OverworldWalkSteps::wait_out_warp(console, context, step); + OverworldWalkSteps::wait_out_warp(console, context, step, before); } } } From 17c8115f28c4c36c957deb3965b586d2a473aa45 Mon Sep 17 00:00:00 2001 From: dayfine Date: Tue, 10 Nov 2026 04:14:28 -0800 Subject: [PATCH 66/79] FRLG overworld: keep warp confirmation within code health limits Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss --- .../PokemonFRLG_OverworldRecoveryWalk.cpp | 5 +-- .../Overworld/PokemonFRLG_OverworldSim.cpp | 27 +------------ .../Overworld/PokemonFRLG_OverworldSim.h | 7 +++- .../PokemonFRLG_OverworldSimTaps.cpp | 38 +++++++++++++++++++ .../Overworld/PokemonFRLG_OverworldWalk.cpp | 8 ++-- .../Overworld/PokemonFRLG_OverworldWalk.h | 9 ----- 6 files changed, 52 insertions(+), 42 deletions(-) diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldRecoveryWalk.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldRecoveryWalk.cpp index 6d969a2147..d2d935c811 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldRecoveryWalk.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldRecoveryWalk.cpp @@ -189,9 +189,8 @@ StepWalk walk_step( StepWalk out{std::nullopt, current_time(), false, false}; switch (step.action){ case RouteAction::WALK:{ - // Turning first, with a tap, makes the hold start from a standstill - // facing the right way: holding through a turn lost a tile on the - // console, while holds from a standstill were exact over 15 tiles. + // Turning first, with a tap, starts the hold from a standstill facing + // the right way: exact over 15 tiles, where a turn lost one. if (turns_first(step, speed, facing)){ turn_to(console, context, step.direction); } diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSim.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSim.cpp index 56734b1174..cd3c1f38d4 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSim.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSim.cpp @@ -358,11 +358,7 @@ bool OverworldSim::trainer_sees(Milliseconds pressed){ // game stopped them there: a warp, a trainer, a wild battle. bool OverworldSim::after_step(const Step& step, Milliseconds pressed){ const SimTiming& timing = m_script.timing; - if (step.warped && m_script.black_without_warp.contains(++m_warp_steps)){ - m_frozen = true; - schedule(pressed + timing.tile, SimScreen::FADE, false); - schedule(pressed + timing.tile + timing.fade, SimScreen::OVERWORLD, true); - note("black without a warp; the player stays at " + to_string(m_state.position) + "."); + if (step.warped && black_without_warp(pressed)){ return true; } m_map = step.map; @@ -787,32 +783,13 @@ std::optional OverworldSimWalker::hold_watching(const RouteStep& step, } // Whether a warp's fade showed and was over between `from` and now. -bool OverworldSimWalker::fade_over_since(Milliseconds from) const{ - const SimState& state = m_sim.state(); - if (state.screen == SimScreen::FADE){ - return false; - } - return std::any_of( - state.shown.begin(), state.shown.end(), - [&](const SimShown& shown){ return shown.screen == SimScreen::FADE && shown.at >= from; } - ); -} - // wait_out_warp(), then run_from_battle_after_warp(): false if the fade // was a wild battle's, run from. wait_out_warp()'s watcher takes a wild // battle's wipe for the fade (run 7; console B, 2026-11-03, Mt. Moon 1F): // the battle screen stands in for the wipe. The fade is watched for from // `watched_from`: a fade over by then is missed. bool OverworldSimWalker::after_warp(const RouteStep& step, int warps_before, Milliseconds watched_from){ - // A fade seen with no warp: the console's screen check - // (warp_left_scene()) finds the scene from before the hold. - const bool black_only = m_sim.state().warps == warps_before - && (m_sim.state().screen == SimScreen::FADE || fade_over_since(watched_from)); - if (black_only){ - if (m_rules.confirm_warp_destination){ - fail("walk_overworld_route(): the warp to " + step.end.map + " not confirmed: the screen after the fade shows the scene from before the hold."); - } - m_sim.watch({}, AFTER_WARP); + if (black_without_warp(step, warps_before, watched_from)){ return true; } if (m_sim.state().warps == warps_before){ diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSim.h b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSim.h index 0c29a98946..2eb49aedbe 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSim.h +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSim.h @@ -391,8 +391,10 @@ class OverworldSim{ int m_encounter_rate_buff = 0; // The turn taps so far, for SimScript::dropped_turn_taps. int m_turn_taps = 0; - // Steps onto a warp so far (SimScript::black_without_warp). + // Steps onto a warp so far, and the fault on one + // (SimScript::black_without_warp): its black without the warp. int m_warp_steps = 0; + bool black_without_warp(Milliseconds pressed); // The last tap, until a hold. std::optional m_last_tap; // When the last Bicycle tap started, and how many came too soon. @@ -579,6 +581,9 @@ class OverworldSimWalker{ std::optional walk_step(const RouteStep& step, std::optional facing); bool after_warp(const RouteStep& step, int warps_before, Milliseconds watched_from); bool fade_over_since(Milliseconds from) const; + // after_warp() on a fade seen with no warp: fails, or with + // SimWalkerRules::confirm_warp_destination off, takes it as the warp. + bool black_without_warp(const RouteStep& step, int warps_before, Milliseconds watched_from); [[noreturn]] void fail_off_route(const RouteStep& step); std::optional hold_watching(const RouteStep& step, Milliseconds hold, const std::vector& interrupts); size_t clear_late(const std::vector& interrupts, Milliseconds watch, size_t max); diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSimTaps.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSimTaps.cpp index 65ff730b5c..578d0fb1e9 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSimTaps.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSimTaps.cpp @@ -140,6 +140,44 @@ void sim_step_once(OverworldSim& sim, Direction direction){ } +bool OverworldSimWalker::fade_over_since(Milliseconds from) const{ + const SimState& state = m_sim.state(); + if (state.screen == SimScreen::FADE){ + return false; + } + return std::any_of( + state.shown.begin(), state.shown.end(), + [&](const SimShown& shown){ return shown.screen == SimScreen::FADE && shown.at >= from; } + ); +} + + +// A fade seen with no warp: the console's screen check +// (warp_left_scene()) finds the scene from before the hold. +bool OverworldSimWalker::black_without_warp(const RouteStep& step, int warps_before, Milliseconds watched_from){ + const bool black_only = m_sim.state().warps == warps_before + && (m_sim.state().screen == SimScreen::FADE || fade_over_since(watched_from)); + if (!black_only){ + return false; + } + if (m_rules.confirm_warp_destination){ + fail("walk_overworld_route(): the warp to " + step.end.map + " not confirmed: the screen after the fade shows the scene from before the hold."); + } + m_sim.watch({}, OverworldWalkSteps::AFTER_WARP); + return true; +} + +bool OverworldSim::black_without_warp(Milliseconds pressed){ + if (!m_script.black_without_warp.contains(++m_warp_steps)){ + return false; + } + m_frozen = true; + schedule(pressed + m_script.timing.tile, SimScreen::FADE, false); + schedule(pressed + m_script.timing.tile + m_script.timing.fade, SimScreen::OVERWORLD, true); + note("black without a warp; the player stays at " + to_string(m_state.position) + "."); + return true; +} + } // namespace PokemonFRLG } // namespace NintendoSwitch } // namespace PokemonAutomation diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldWalk.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldWalk.cpp index 8de83e0b7a..54987045d8 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldWalk.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldWalk.cpp @@ -316,8 +316,10 @@ double scrolled_rmsd(const ImageViewRGB32& before, const ImageViewRGB32& after, return ImageMatch::pixel_RMSD(old_part, new_part); } -} // namespace - +// Whether `after` no longer shows the scene `before` showed, scrolled 0 to +// `max_tiles` tiles on toward `direction` inside the game box `game`: black +// then clear with the old scene back is no warp. A screen too dark to +// compare (a dark cave) counts as left. bool warp_left_scene( const ImageViewRGB32& before, const ImageViewRGB32& after, const ImageFloatBox& game, Direction direction, int max_tiles @@ -350,8 +352,6 @@ bool warp_left_scene( return true; } -namespace{ - // One watcher for the whole fade: a ladder's black is short enough to be // over before a second watcher, started once the fade is seen, looks. void wait_out_fade(ConsoleHandle& console, ProControllerContext& context, const RouteStep& step, Pokemon::WatchAlong& fade){ diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldWalk.h b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldWalk.h index a07ff14ac6..8ec2f7cacf 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldWalk.h +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldWalk.h @@ -188,15 +188,6 @@ void wait_out_warp( // The same, watching only from now: for a caller that saw the black itself. void wait_out_warp(ConsoleHandle& console, ProControllerContext& context, const RouteStep& step, const VideoSnapshot& before); -// Whether `after` no longer shows the scene `before` showed, scrolled 0 to -// `max_tiles` tiles on toward `direction` inside the game box `game`: -// black then clear with the old scene back is no warp. A screen too dark to -// compare (a dark cave) counts as left. -bool warp_left_scene( - const ImageViewRGB32& before, const ImageViewRGB32& after, - const ImageFloatBox& game, Direction direction, int max_tiles -); - // Before `step`: fails unless the overworld is up. void check_overworld(ConsoleHandle& console, ProControllerContext& context, const RouteStep& step); From ed2f97cc251edd64165fe00b2e709234d27bbd52 Mon Sep 17 00:00:00 2001 From: dayfine Date: Tue, 10 Nov 2026 22:12:18 -0800 Subject: [PATCH 67/79] FRLG hideout: red test for a blocked tap beside B2F's arrow Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss --- .../PokemonFRLG_AutoStoryHideout_Tests.cpp | 49 +++++++++++++++++++ 1 file changed, 49 insertions(+) diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryHideout_Tests.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryHideout_Tests.cpp index 80f4dd02a0..21cb0548ca 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryHideout_Tests.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryHideout_Tests.cpp @@ -6,6 +6,7 @@ #include #include +#include #include #include #include "Common/Cpp/TestRunners/UnitTest.h" @@ -14,6 +15,7 @@ #include "VideoGames/PokemonFRLG/Overworld/PokemonFRLG_MovementMechanics.h" #include "VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldMaps.h" #include "VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSim.h" +#include "VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldRecovery.h" #include "PokemonFRLG_AutoStoryHideout.h" #include "PokemonFRLG_AutoStoryHideoutLift.h" #include "PokemonFRLG_AutoStoryLegs.h" @@ -375,6 +377,49 @@ UnitTestResult test_b2f_maze_taps(){ return true; } +// Console B, 2026-11-10 22:08: on 00.32's B2F taps "west 2" from +// (19, 5) to (17, 5), beside the arrow (16, 5), no tap moved the player. +// The blocked tap was taken to stand where the way ahead is blocked, and +// the arrow ahead of (17, 5) counted as blocked: the player was "found" on +// (17, 5) with no holds, and the slide on to the MOON STONE's stop (1, 4) +// was walked from wherever they stood. An arrow ahead is no wall: the +// player is found from every tile the taps may have left them on. +UnitTestResult test_b2f_blocked_tap_beside_arrow(){ + const std::vector& maps = story_maps(); + const MapPosition start{"RocketHideout_B2F", {19, 5}}; + const std::optional> route = fixed_route(maps, start, { + {Direction::WEST, 2}, {Direction::SOUTH, 1}, {Direction::WEST, 1}, + }); + if (!route || !(route->back().end == MapPosition{"RocketHideout_B2F", {1, 4}})){ + return "Expected the legs from (19, 5) to slide to (1, 4)."; + } + std::vector tapped = *route; + for (RouteStep& step : tapped){ + step.tapped = true; + } + std::vector logs; + size_t walks = 0; + RouteCalls calls; + calls.walk = [&](const RouteStep&, std::optional){ + return walks++ == 0 + ? StepOutcome{.end = StepEnd::STOPPED, .walked = WalkedTiles{0, BLOCKED_TAP_SLACK}, .blocked = true} + : StepOutcome{}; + }; + calls.hold_to_warp = [](const RouteStep&){}; + calls.log = [&](const std::string& message){ logs.push_back(message); }; + calls.fail = [](const std::string& message){ throw std::runtime_error(message); }; + const RoutePlanning planning{.maps = &maps, .costs = default_route_costs(), .start = start, .label = "Sim", .wall_check = WallCheck::SKIP}; + try{ + run_route(tapped, Direction::WEST, &planning, calls); + }catch (std::runtime_error&){} + for (const std::string& line : logs){ + if (line.find("the player is on one of: RocketHideout_B2F (17, 5).") != std::string::npos){ + return "The arrow ahead of (17, 5) was taken for a wall: " + line; + } + } + return true; +} + struct AutoStoryHideoutBodyInput{ std::string name; UnitTestResult (*body)(); @@ -422,6 +467,10 @@ const AutoStoryHideoutBodyCase HIDEOUT_BODY_CASES[] = { .input = {.name = "B2F's arrow floor to the lift a tap at a time", .body = test_b2f_maze_taps}, .expectation = {.description = "00.32's taps and the routes between them, any turn dropped or hold short"}, }, + { + .input = {.name = "a blocked tap beside B2F's arrow", .body = test_b2f_blocked_tap_beside_arrow}, + .expectation = {.description = "an arrow ahead is no wall: the player isn't placed beside it"}, + }, }; const LiftCase LIFT_CASES[] = { From f02c16068783de269db29f5db8c854c71cb23420 Mon Sep 17 00:00:00 2001 From: dayfine Date: Tue, 10 Nov 2026 22:13:09 -0800 Subject: [PATCH 68/79] FRLG overworld: a spinner ahead of a blocked tap is no wall Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss --- .../Overworld/PokemonFRLG_OverworldRecovery.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldRecovery.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldRecovery.cpp index c9f6dfc447..5ffd53c687 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldRecovery.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldRecovery.cpp @@ -7,6 +7,7 @@ #include #include #include "Pokemon/Navigation/Pokemon_RouteLog.h" +#include "PokemonFRLG_CodedRooms.h" #include "PokemonFRLG_OverworldBikeTaps.h" #include "PokemonFRLG_OverworldReanchor.h" #include "PokemonFRLG_OverworldRecovery.h" @@ -342,6 +343,8 @@ class RouteRun{ // Of `candidates`, where a Bicycle tap along `step` stopped the // player, those the maps block the way ahead of; all of them if none. + // A spinner ahead is no block: a tap steps onto it and slides (B2F's + // (16, 5), console B, 2026-11-10), though leg_tiles() stops before it. std::vector blocked_ahead(const RouteStep& step, std::vector candidates) const{ std::vector blocked; for (const StopCandidate& candidate : candidates){ @@ -349,7 +352,10 @@ class RouteRun{ ahead.direction = step.direction; ahead.tiles = 1; ahead.surfing = step.surfing; - if (!candidate.trainer && leg_tiles(*maps(), candidate.player, ahead).size() < 2){ + const TilePos next = candidate.player.point.next(step.direction); + if (!candidate.trainer && !coded_spin_direction(candidate.player.map, next) + && leg_tiles(*maps(), candidate.player, ahead).size() < 2 + ){ blocked.push_back(candidate); } } From 5f08240375e65c5dd35febbd2532aa4410f6a9ad Mon Sep 17 00:00:00 2001 From: dayfine Date: Tue, 10 Nov 2026 22:14:48 -0800 Subject: [PATCH 69/79] FRLG hideout test: std::format for the failure message Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss --- .../Programs/AutoStory/PokemonFRLG_AutoStoryHideout_Tests.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryHideout_Tests.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryHideout_Tests.cpp index 21cb0548ca..2444ecf559 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryHideout_Tests.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryHideout_Tests.cpp @@ -414,7 +414,7 @@ UnitTestResult test_b2f_blocked_tap_beside_arrow(){ }catch (std::runtime_error&){} for (const std::string& line : logs){ if (line.find("the player is on one of: RocketHideout_B2F (17, 5).") != std::string::npos){ - return "The arrow ahead of (17, 5) was taken for a wall: " + line; + return std::format("The arrow ahead of (17, 5) was taken for a wall: {}", line); } } return true; From ca60cff52534b8641808beac12795cdc3912dcca Mon Sep 17 00:00:00 2001 From: dayfine Date: Tue, 10 Nov 2026 22:40:53 -0800 Subject: [PATCH 70/79] FRLG hideout: tap the spinner mazes blind 00.31's B3F maze legs and 00.32's B2F legs to the MOON STONE and the lift room are now "blind_taps": fixed taps, each waited out, never checked, and the end trusted. Checked taps read slides as no move, tapped again and re-planned off the route (console B, 2026-11-10 22:35). Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss --- .../PokemonFRLG_OverworldBikeTaps.cpp | 7 +++ .../Overworld/PokemonFRLG_OverworldBikeTaps.h | 4 +- .../PokemonFRLG_OverworldRecovery.cpp | 2 +- .../Overworld/PokemonFRLG_OverworldRoute.h | 7 +++ .../Programs/AutoStory/Data/JsonParser.cpp | 3 +- .../AutoStory/PokemonFRLG_AutoStoryEvents.cpp | 10 ++-- .../PokemonFRLG_AutoStoryHideout_Tests.cpp | 52 +++++++++++++++++++ .../AutoStory/PokemonFRLG_AutoStoryLegs.cpp | 14 +++++ .../AutoStory/PokemonFRLG_AutoStoryLegs.h | 9 ++++ .../AutoStory/PokemonFRLG_AutoStory_Tests.cpp | 2 +- .../AutoStory/StoryData/frlg-00.31.plan.json | 4 +- .../AutoStory/StoryData/frlg-00.32.plan.json | 4 +- 12 files changed, 105 insertions(+), 13 deletions(-) diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldBikeTaps.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldBikeTaps.cpp index 4dad679747..a701a084c5 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldBikeTaps.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldBikeTaps.cpp @@ -15,6 +15,13 @@ namespace PokemonFRLG{ StepOutcome count_bike_taps(const RouteStep& step, const BikeTapCalls& calls){ + if (step.blind_taps > 0){ + calls.log(std::format("Taps: {} blind tap(s) for {}, not checked.", step.blind_taps, step.tiles)); + for (int press = 1; press <= step.blind_taps; press++){ + calls.tap(press - (step.blind_taps - step.tiles)); + } + return StepOutcome{}; + } int moved = 0; for (int tap = 1; tap <= step.tiles; tap++){ BikeTap result = calls.tap(tap); diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldBikeTaps.h b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldBikeTaps.h index fb5bb67188..4f097db346 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldBikeTaps.h +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldBikeTaps.h @@ -58,7 +58,9 @@ constexpr int BLOCKED_TAP_SLACK = 3; // STOPPED, with the tiles walked: blocked, the taps that moved, and up // to BLOCKED_TAP_SLACK more for a start that was off (run_route() keeps // the tiles with a blocked one ahead); interrupted, the taps that moved -// and one more, which may have moved before its battle showed. +// and one more, which may have moved before its battle showed. A blind +// leg (RouteStep::blind_taps) plays its taps, numbered from 0 with a turn +// tap first, and is DONE. StepOutcome count_bike_taps(const RouteStep& step, const BikeTapCalls& calls); // Whether `step` is walked on foot a tap at a time (RouteStep::tapped), diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldRecovery.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldRecovery.cpp index 5ffd53c687..0b425e18a9 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldRecovery.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldRecovery.cpp @@ -445,7 +445,7 @@ class RouteRun{ // only holds walk 30. An open leg after a short one walks on off the // route, which isn't checked. void check_open_leg(const RouteStep& step, const std::optional& start){ - if (maps() == nullptr || m_planning->open_leg_check != OpenLegCheck::REANCHOR || !start + if (maps() == nullptr || m_planning->open_leg_check != OpenLegCheck::REANCHOR || !start || step.blind_taps > 0 || step.action != RouteAction::WALK || step.to_wall || step.warps || m_next >= m_plan.size() || !(is_wall_hold(m_plan[m_next]) || is_slide(m_plan[m_next])) ){ diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldRoute.h b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldRoute.h index 8841226edd..3a5bc203a7 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldRoute.h +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldRoute.h @@ -85,6 +85,13 @@ struct RouteStep{ // floors, where a hold that ends a tile off slides the player // elsewhere (console B, 2026-11-10, 00.31 r1). bool tapped = false; + // WALK, tapped: played blind, this many taps (the leg's tiles, and a + // turn tap first if the player faced another way), each waited out + // (step_tap_settle()) and never checked, the end trusted: the + // hideout's spinner mazes, where a slide read as no move was tapped + // again and re-planned off the route (console B, 2026-11-10 22:35). + // 0: not blind. + int blind_taps = 0; // WALK, SURF: a wild Pokemon can appear on the way: the step crosses // tall grass or water. Elsewhere (indoors, streets) no wild battle can // start, so the walker doesn't watch for one. diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/Data/JsonParser.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/Data/JsonParser.cpp index f0a4649081..38c6ecde65 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/Data/JsonParser.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/Data/JsonParser.cpp @@ -239,7 +239,8 @@ bool known_variant(const StoryStep& step){ case StoryStepKind::ROUTE: return step.variant.empty() || step.variant == RUN_VARIANT || step.variant == BIKE_VARIANT; case StoryStepKind::LEGS: - return step.variant.empty() || step.variant == RUN_VARIANT || step.variant == BIKE_VARIANT || step.variant == TAPS_VARIANT; + return step.variant.empty() || step.variant == RUN_VARIANT || step.variant == BIKE_VARIANT + || step.variant == TAPS_VARIANT || step.variant == BLIND_TAPS_VARIANT; case StoryStepKind::STEP: return step.variant.empty() || step.variant == TRAINER_LINE_VARIANT || step.variant == TRAINER_WAIT_VARIANT; case StoryStepKind::GAME: diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryEvents.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryEvents.cpp index f24e642cf2..cef69e9ce2 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryEvents.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryEvents.cpp @@ -170,14 +170,14 @@ Outcome walk_legs(StoryEnv& env, RunState& state, const StoryStep& step){ facing = face_a_wall(env, start); } std::optional> route = fixed_route(story_maps(), start, step.legs); - if (route && step.variant == TAPS_VARIANT){ - for (RouteStep& leg : *route){ - leg.tapped = true; - } - } if (!facing || !route || route->empty()){ return Pokemon::outcome_failed("bad_legs", to_string(start)); } + if (step.variant == TAPS_VARIANT){ + tap_legs(*route); + }else if (step.variant == BLIND_TAPS_VARIANT){ + blind_tap_legs(*route, *facing); + } const OverworldInterruptSet interrupts = walk_interrupts(env, step); // Planning lets the walker recover a stopped open leg: it plans back to // the leg's end, then walks the rest as given. diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryHideout_Tests.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryHideout_Tests.cpp index 2444ecf559..2ebd8953f0 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryHideout_Tests.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryHideout_Tests.cpp @@ -420,6 +420,54 @@ UnitTestResult test_b2f_blocked_tap_beside_arrow(){ return true; } +// `legs` from `start`, facing `facing`, tapped blind on the sim +// (BLIND_TAPS_VARIANT). Empty if the taps end where the legs do. +std::string blind_legs_on_sim(const MapPosition& start, Direction facing, const std::vector& legs){ + const std::vector& maps = story_maps(); + std::optional> route = fixed_route(maps, start, legs); + if (!route || route->empty()){ + return "No legs from " + to_string(start) + "."; + } + blind_tap_legs(*route, facing); + OverworldSim sim(maps, start, facing, SimScript{}); + OverworldSimWalker walker(sim); + const RoutePlanning planning{.maps = &maps, .costs = default_route_costs(), .start = start, .label = "Sim"}; + const std::string failure = walker.run(*route, planning); + if (!failure.empty() || !(sim.state().position == route->back().end)){ + return std::format("Blind taps from {} walked to {}, not {}, failure \"{}\".", to_string(start), to_string(sim.state().position), to_string(route->back().end), failure); + } + return ""; +} + +// The spinner mazes' blind legs: 00.31's B3F maze and way back, 00.32's +// B2F legs to the MOON STONE and to the lift room. +UnitTestResult test_blind_maze_taps(){ + using Pokemon::StoryLeg; + const std::vector failures{ + blind_legs_on_sim({"RocketHideout_B3F", {18, 2}}, Direction::EAST, { + {Direction::WEST, 6}, {Direction::SOUTH, 5}, {Direction::WEST, 7}, {Direction::SOUTH, 2}, {Direction::WEST, 1}, + {Direction::SOUTH, 2}, {Direction::WEST, 2}, {Direction::SOUTH, 3}, {Direction::WEST, 3}, {Direction::SOUTH, 2}, + {Direction::EAST, 2}, {Direction::WEST, 2}, {Direction::SOUTH, 5}, {Direction::EAST, 10}, {Direction::NORTH, 6}, + }), + blind_legs_on_sim({"RocketHideout_B3F", {15, 18}}, Direction::WEST, { + {Direction::SOUTH, 2}, {Direction::WEST, 5}, {Direction::NORTH, 6}, + }), + blind_legs_on_sim({"RocketHideout_B2F", {21, 2}}, Direction::EAST, { + {Direction::SOUTH, 1}, {Direction::WEST, 2}, {Direction::SOUTH, 2}, {Direction::WEST, 2}, {Direction::SOUTH, 1}, {Direction::WEST, 1}, + }), + blind_legs_on_sim({"RocketHideout_B2F", {2, 4}}, Direction::SOUTH, { + {Direction::SOUTH, 4}, {Direction::EAST, 1}, {Direction::SOUTH, 1}, {Direction::EAST, 1}, {Direction::EAST, 2}, {Direction::WEST, 2}, + {Direction::EAST, 3}, {Direction::SOUTH, 2}, {Direction::WEST, 1}, {Direction::EAST, 1}, {Direction::SOUTH, 1}, + }), + }; + for (const std::string& failure : failures){ + if (!failure.empty()){ + return failure; + } + } + return true; +} + struct AutoStoryHideoutBodyInput{ std::string name; UnitTestResult (*body)(); @@ -471,6 +519,10 @@ const AutoStoryHideoutBodyCase HIDEOUT_BODY_CASES[] = { .input = {.name = "a blocked tap beside B2F's arrow", .body = test_b2f_blocked_tap_beside_arrow}, .expectation = {.description = "an arrow ahead is no wall: the player isn't placed beside it"}, }, + { + .input = {.name = "the spinner mazes tapped blind", .body = test_blind_maze_taps}, + .expectation = {.description = "00.31's and 00.32's blind legs end where the legs do"}, + }, }; const LiftCase LIFT_CASES[] = { diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryLegs.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryLegs.cpp index 420268e05a..158a772842 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryLegs.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryLegs.cpp @@ -71,6 +71,20 @@ std::optional> fixed_route( return route; } +void tap_legs(std::vector& route){ + for (RouteStep& step : route){ + step.tapped = true; + } +} + +void blind_tap_legs(std::vector& route, Direction facing){ + for (RouteStep& step : route){ + step.tapped = true; + step.blind_taps = step.tiles + (step.direction == facing ? 0 : 1); + facing = step.facing_after; + } +} + } // namespace PokemonFRLG } // namespace NintendoSwitch diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryLegs.h b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryLegs.h index d19c8fd42f..07ba111365 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryLegs.h +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryLegs.h @@ -23,6 +23,9 @@ namespace PokemonFRLG{ // have moved the player a tile (RouteStep::tapped): the Rocket Hideout's // arrow floors, where a hold a tile off slides the player elsewhere. inline const std::string TAPS_VARIANT = "taps"; +// The variant of LEGS tapped blind (RouteStep::blind_taps): the spinner +// mazes, whose slides the tap check misread as no move. +inline const std::string BLIND_TAPS_VARIANT = "blind_taps"; // `legs` from `start` as route steps for the walker, each checked against // the map: nothing if a step is blocked or leaves the map. A leg ends "to @@ -31,6 +34,12 @@ std::optional> fixed_route( const std::vector& maps, const MapPosition& start, const std::vector& legs ); +// Marks each of `route`'s steps tapped (TAPS_VARIANT). +void tap_legs(std::vector& route); +// Marks each of `route`'s steps tapped blind (BLIND_TAPS_VARIANT), from +// `facing`: a turn tap first where the player faces another way. +void blind_tap_legs(std::vector& route, Direction facing); + } // namespace PokemonFRLG diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStory_Tests.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStory_Tests.cpp index 9cfe7926b6..430f851103 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStory_Tests.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStory_Tests.cpp @@ -360,7 +360,7 @@ UnitTestResult test_runs_after_shoes(){ size_t runs = 0; for (const StoryCheckpoint& checkpoint : story_checkpoints()){ for (const StoryStep& step : checkpoint.steps){ - if ((step.kind != StoryStepKind::ROUTE && step.kind != StoryStepKind::LEGS) || step.variant == TAPS_VARIANT){ + if ((step.kind != StoryStepKind::ROUTE && step.kind != StoryStepKind::LEGS) || step.variant == TAPS_VARIANT || step.variant == BLIND_TAPS_VARIANT){ continue; } const MoveSpeed expected = has_shoes ? MoveSpeed::RUN : MoveSpeed::WALK; diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.31.plan.json b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.31.plan.json index af8f3bbbe4..1fe0937b9e 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.31.plan.json +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.31.plan.json @@ -68,7 +68,7 @@ { "id": "b3f_arrow_maze", "kind": "legs", - "variant": "taps", + "variant": "blind_taps", "legs": [{"direction": "west", "tiles": 6}, {"direction": "south", "tiles": 5}, {"direction": "west", "tiles": 7}, {"direction": "south", "tiles": 2}, {"direction": "west", "tiles": 1}, {"direction": "south", "tiles": 2}, {"direction": "west", "tiles": 2}, {"direction": "south", "tiles": 3}, {"direction": "west", "tiles": 3}, {"direction": "south", "tiles": 2}, {"direction": "east", "tiles": 2}, {"direction": "west", "tiles": 2}, {"direction": "south", "tiles": 5}, {"direction": "east", "tiles": 10}, {"direction": "north", "tiles": 6}], "why": "pokeguy's way through the arrow floor (video 56:39-56:50), a tap a tile: west along the top corridor and down column 12 to row 7, west to (5, 7), down to (5, 9) between the arrows; west onto (4, 9), which slides to the stop (2, 9); south onto (2, 11), which slides east to the stop (6, 11); west to (4, 11), down column 4 to (4, 14), west to the wall (1, 14), down to (1, 16); east onto (3, 16), which slides east and, turned by (7, 16), south to the stop (7, 20); west to (5, 20), down column 5 to row 25, east to column 15 and up to (15, 19), below the stairs to B4F (15, 18). He detours to the BLACKGLASSES on the way down column 5; we don't." }, @@ -128,7 +128,7 @@ { "id": "b3f_back_to_candy_row", "kind": "legs", - "variant": "taps", + "variant": "blind_taps", "legs": [{"direction": "south", "tiles": 2}, {"direction": "west", "tiles": 5}, {"direction": "north", "tiles": 6}], "why": "pokeguy's way back (video 57:39-57:42), a tap a tile: down to row 20, west to column 10, up it onto the arrow (10, 14), which slides a tile north to the stop (10, 13)" }, diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.32.plan.json b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.32.plan.json index 8b706af9b0..cd618a06ba 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.32.plan.json +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.32.plan.json @@ -66,7 +66,7 @@ { "id": "b2f_arrows_to_moon_stone", "kind": "legs", - "variant": "taps", + "variant": "blind_taps", "legs": [ { "direction": "south", @@ -135,7 +135,7 @@ { "id": "b2f_arrows_to_lift_room", "kind": "legs", - "variant": "taps", + "variant": "blind_taps", "legs": [ { "direction": "south", From e2a5cc290d4f71e08a1b0471ccfdaaee0d1c7dfe Mon Sep 17 00:00:00 2001 From: dayfine Date: Tue, 10 Nov 2026 22:44:05 -0800 Subject: [PATCH 71/79] FRLG hideout: blind taps' inputs first, std::format Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss --- .../Programs/AutoStory/PokemonFRLG_AutoStoryEvents.cpp | 2 +- .../Programs/AutoStory/PokemonFRLG_AutoStoryHideout_Tests.cpp | 4 ++-- .../Programs/AutoStory/PokemonFRLG_AutoStoryLegs.cpp | 2 +- .../Programs/AutoStory/PokemonFRLG_AutoStoryLegs.h | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryEvents.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryEvents.cpp index cef69e9ce2..2599df01cf 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryEvents.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryEvents.cpp @@ -176,7 +176,7 @@ Outcome walk_legs(StoryEnv& env, RunState& state, const StoryStep& step){ if (step.variant == TAPS_VARIANT){ tap_legs(*route); }else if (step.variant == BLIND_TAPS_VARIANT){ - blind_tap_legs(*route, *facing); + blind_tap_legs(*facing, *route); } const OverworldInterruptSet interrupts = walk_interrupts(env, step); // Planning lets the walker recover a stopped open leg: it plans back to diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryHideout_Tests.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryHideout_Tests.cpp index 2ebd8953f0..7991e0fc78 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryHideout_Tests.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryHideout_Tests.cpp @@ -426,9 +426,9 @@ std::string blind_legs_on_sim(const MapPosition& start, Direction facing, const const std::vector& maps = story_maps(); std::optional> route = fixed_route(maps, start, legs); if (!route || route->empty()){ - return "No legs from " + to_string(start) + "."; + return std::format("No legs from {}.", to_string(start)); } - blind_tap_legs(*route, facing); + blind_tap_legs(facing, *route); OverworldSim sim(maps, start, facing, SimScript{}); OverworldSimWalker walker(sim); const RoutePlanning planning{.maps = &maps, .costs = default_route_costs(), .start = start, .label = "Sim"}; diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryLegs.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryLegs.cpp index 158a772842..b08c66ccef 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryLegs.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryLegs.cpp @@ -77,7 +77,7 @@ void tap_legs(std::vector& route){ } } -void blind_tap_legs(std::vector& route, Direction facing){ +void blind_tap_legs(Direction facing, std::vector& route){ for (RouteStep& step : route){ step.tapped = true; step.blind_taps = step.tiles + (step.direction == facing ? 0 : 1); diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryLegs.h b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryLegs.h index 07ba111365..c46cf8b412 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryLegs.h +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryLegs.h @@ -38,7 +38,7 @@ std::optional> fixed_route( void tap_legs(std::vector& route); // Marks each of `route`'s steps tapped blind (BLIND_TAPS_VARIANT), from // `facing`: a turn tap first where the player faces another way. -void blind_tap_legs(std::vector& route, Direction facing); +void blind_tap_legs(Direction facing, std::vector& route); From cb72a20be371fdf4174dea5a1be26023e3b2c432 Mon Sep 17 00:00:00 2001 From: dayfine Date: Tue, 10 Nov 2026 23:24:58 -0800 Subject: [PATCH 72/79] FRLG hideout: lift exit confirmed without a black fade The lift's exit fade only dims the screen (console B, 2026-11-10, 00.32 lift_to_b4f), so the black-fade check missed it and the retries walked into the wall outside. The lift-out leg is now south 3 marked RoomLeg::dims: confirmed by the scene from before the leg gone and the screen settled (RouteStep::fade_dims). Room warps name their place in the log. The sim no longer shows a fade for a lift exit, and its room legs fail on a warp with no fade, as the console does. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss --- .../Overworld/PokemonFRLG_OverworldRoute.h | 3 ++ .../Overworld/PokemonFRLG_OverworldSim.cpp | 5 +- .../Overworld/PokemonFRLG_OverworldSim.h | 3 ++ .../Overworld/PokemonFRLG_OverworldWalk.cpp | 48 +++++++++++++++++++ .../Overworld/PokemonFRLG_OverworldWalk.h | 2 + .../AutoStory/PokemonFRLG_AutoStoryRoomLegs.h | 6 ++- .../AutoStory/PokemonFRLG_AutoStoryRooms.cpp | 14 +++--- .../AutoStory/PokemonFRLG_AutoStoryRooms.h | 8 +++- .../AutoStory/PokemonFRLG_AutoStoryRowSim.cpp | 35 ++++++++++---- 9 files changed, 105 insertions(+), 19 deletions(-) diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldRoute.h b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldRoute.h index 3a5bc203a7..14b8a1f030 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldRoute.h +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldRoute.h @@ -92,6 +92,9 @@ struct RouteStep{ // again and re-planned off the route (console B, 2026-11-10 22:35). // 0: not blind. int blind_taps = 0; + // WALK, warps: the warp's fade only dims the screen, never black (the + // hideout lift's way out; console B, 2026-11-10, 00.32 lift_to_b4f). + bool fade_dims = false; // WALK, SURF: a wild Pokemon can appear on the way: the step crosses // tall grass or water. Elsewhere (indoors, streets) no wild battle can // start, so the walker doesn't watch for one. diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSim.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSim.cpp index 6b354a5d94..afea47e930 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSim.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSim.cpp @@ -360,6 +360,7 @@ bool OverworldSim::after_step(const Step& step, Milliseconds pressed){ if (step.warped && black_without_warp(pressed)){ return true; } + const bool dims = step.warped && m_script.lift_exit_dims && m_script.lift_floors.contains(map().name); m_map = step.map; m_player = step.player; m_state.steps++; @@ -376,7 +377,9 @@ bool OverworldSim::after_step(const Step& step, Milliseconds pressed){ note("the warp takes the player off the Bicycle."); } m_frozen = true; - schedule(pressed + timing.tile, SimScreen::FADE, false); + if (!dims){ + schedule(pressed + timing.tile, SimScreen::FADE, false); + } schedule(pressed + timing.tile + timing.fade, SimScreen::OVERWORLD, true); note("warped to " + to_string(m_state.position) + "."); return true; diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSim.h b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSim.h index 2eb49aedbe..5441df6a9e 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSim.h +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSim.h @@ -169,6 +169,9 @@ struct SimScript{ // game's placeholder. The hideout's: rocket_hideout_lift_room() under // LIFT_MAP, with rocket_hideout_lift_doors(). std::map> lift_floors = {}; + // The fade out of a lift only dims the screen, never black (console B, + // 2026-11-10, 00.32 lift_to_b4f): no FADE shows for it. + bool lift_exit_dims = true; SimTiming timing; }; diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldWalk.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldWalk.cpp index 24abe22202..5e0c306b0a 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldWalk.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldWalk.cpp @@ -304,6 +304,8 @@ constexpr int SCREEN_TILES_X = 15; constexpr int SCREEN_TILES_Y = 10; // From the fade's end until the new map is in full light. constexpr Milliseconds WARP_FADE_IN(300); +// Between screens compared for a dim warp's fade (wait_out_dim_warp()). +constexpr Milliseconds DIM_WARP_POLL(150); // The RMSD of `before` and `after` where they overlap, with the scene // scrolled `dx`, `dy` pixels: `after` at (x, y) shows `before` at @@ -384,6 +386,48 @@ void wait_out_fade(ConsoleHandle& console, ProControllerContext& context, const } // namespace +namespace{ + +// After the steps onto a warp whose fade only dims the screen +// (RouteStep::fade_dims): waits, up to the warp timeout, for the scene +// from `before`, taken before the first of those steps, to be gone and +// the screen settled; fails if it never is. +void wait_out_dim_warp(ConsoleHandle& console, ProControllerContext& context, const RouteStep& step, const VideoSnapshot& before){ + context.wait_for_all_requests(); + if (!before){ + OperationFailedExceptionWithScreenshot::fire( + ErrorReportMode::SEND_ERROR_REPORT, + std::format("walk_overworld_route(): no screen before the steps onto the warp to {}.", step.end.map), + console + ); + } + const ImageFloatBox& game = GameSettings::instance().GAME_BOX; + VideoSnapshot last; + const WallClock deadline = current_time() + WARP_TIMEOUT; + while (current_time() < deadline){ + context.wait_for(DIM_WARP_POLL); + VideoSnapshot now = console.video().snapshot(); + if (!now){ + continue; + } + const bool left = warp_left_scene(*before.frame, *now.frame, game, step.direction, step.tiles + 2); + if (left && last && scrolled_rmsd( + extract_box_reference(*last.frame, game), extract_box_reference(*now.frame, game), 0, 0 + ) < SAME_SCENE_RMSD){ + console.log(std::format("Route: the dim fade to {} is over.", step.end.map)); + return; + } + last = left ? std::move(now) : VideoSnapshot(); + } + OperationFailedExceptionWithScreenshot::fire( + ErrorReportMode::SEND_ERROR_REPORT, + std::format("walk_overworld_route(): the scene from before the steps onto the warp to {} is still up.", step.end.map), + console + ); +} + +} // namespace + // A black screen that clears with the player where they were is no warp // (console B, 2026-11-10 01:44, 00.31 run 4: "east 1 (warp)" was taken as // walked while the player stayed on B4F). @@ -413,6 +457,10 @@ void wait_out_warp( void wait_out_warp(ConsoleHandle& console, ProControllerContext& context, const RouteStep& step, const VideoSnapshot& before){ BlackScreenOverWatcher arrival(COLOR_RED); Pokemon::WatchAlong fade(arrival); + if (step.fade_dims){ + wait_out_dim_warp(console, context, step, before); + return; + } wait_out_warp(console, context, step, fade, before); } diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldWalk.h b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldWalk.h index 8ec2f7cacf..1a949b8851 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldWalk.h +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldWalk.h @@ -186,6 +186,8 @@ void wait_out_warp( Pokemon::WatchAlong& fade, const VideoSnapshot& before ); // The same, watching only from now: for a caller that saw the black itself. +// A step whose fade only dims (RouteStep::fade_dims) is confirmed by the +// scene from `before` gone and the screen settled instead. void wait_out_warp(ConsoleHandle& console, ProControllerContext& context, const RouteStep& step, const VideoSnapshot& before); // Before `step`: fails unless the overworld is up. diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRoomLegs.h b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRoomLegs.h index aa8fc199a9..0b562fbbc8 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRoomLegs.h +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRoomLegs.h @@ -30,8 +30,10 @@ const std::vector& center_exit_legs(); // panel (LIFT_PANEL_FRONT), facing it. const std::vector& lift_in_legs(); -// Out of the lift, from below the panel: east 2, south 2 onto the arrow -// warp, south through it, onto the floor picked's lift door. +// Out of the lift, from below the panel: east 2, south 3 onto the arrow +// warp and through it, onto the floor picked's lift door. On the console +// the second step may take the warp; the third then walks into the wall +// below the door. The fade only dims the screen (RoomLeg::dims). const std::vector& lift_out_legs(); // The legs of the Center's step `variant`; empty if it isn't one. diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRooms.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRooms.cpp index 290f50c27d..45dc23d814 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRooms.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRooms.cpp @@ -4,6 +4,7 @@ * */ +#include "VideoGames/PokemonFRLG/Overworld/PokemonFRLG_HideoutLiftRoom.h" #include "VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldWalk.h" #include "PokemonFRLG_AutoStoryActions.h" #include "PokemonFRLG_AutoStoryRooms.h" @@ -20,7 +21,7 @@ bool is_center_variant(std::string_view variant){ const std::vector& center_enter_legs(){ static const std::vector LEGS{ - {Pokemon::Direction::NORTH, 1, true}, + {Pokemon::Direction::NORTH, 1, true, false, "the Center"}, {Pokemon::Direction::NORTH, 4, false}, }; return LEGS; @@ -28,13 +29,13 @@ const std::vector& center_enter_legs(){ const std::vector& center_exit_legs(){ static const std::vector LEGS{ {Pokemon::Direction::SOUTH, 4, false}, - {Pokemon::Direction::SOUTH, 1, true}, + {Pokemon::Direction::SOUTH, 1, true, false, "outside the Center"}, }; return LEGS; } const std::vector& lift_in_legs(){ static const std::vector LEGS{ - {Pokemon::Direction::NORTH, 1, true}, + {Pokemon::Direction::NORTH, 1, true, false, LIFT_MAP}, {Pokemon::Direction::NORTH, 2, false}, {Pokemon::Direction::WEST, 2, false}, {Pokemon::Direction::NORTH, 0, false}, @@ -44,8 +45,7 @@ const std::vector& lift_in_legs(){ const std::vector& lift_out_legs(){ static const std::vector LEGS{ {Pokemon::Direction::EAST, 2, false}, - {Pokemon::Direction::SOUTH, 2, false}, - {Pokemon::Direction::SOUTH, 1, true}, + {Pokemon::Direction::SOUTH, 3, true, true, "the lift's floor picked"}, }; return LEGS; } @@ -73,7 +73,7 @@ void walk_room_legs( } VideoSnapshot before; for (int tile = 0; tile < leg.tiles; tile++){ - if (leg.warps && tile + 1 == leg.tiles){ + if (leg.warps && tile + 1 == (leg.dims ? 1 : leg.tiles)){ context.wait_for_all_requests(); before = console.video().snapshot(); } @@ -85,6 +85,8 @@ void walk_room_legs( step.direction = leg.direction; step.tiles = 1; step.warps = true; + step.fade_dims = leg.dims; + step.end.map = std::string(leg.to); OverworldWalkSteps::wait_out_warp(console, context, step, before); } } diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRooms.h b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRooms.h index 3cb36443b0..0e6c71d3d8 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRooms.h +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRooms.h @@ -41,11 +41,17 @@ bool is_center_variant(std::string_view variant); // A straight piece of a room's script: `tiles` steps `direction`, one // tap a tile; none: a turn to face `direction`. `warps`: the last step -// takes a warp, whose fade is waited out. +// takes a warp, whose fade is waited out. `dims`: the warp's fade only +// dims the screen, never black (the lift's way out; console B, +// 2026-11-10, 00.32 lift_to_b4f), so the warp is confirmed by the scene +// from before the leg's first step gone and settled, and any step of the +// leg may take it. `to`: the warp's place, for the log. struct RoomLeg{ Pokemon::Direction direction = Pokemon::Direction::NORTH; int tiles = 0; bool warps = false; + bool dims = false; + std::string_view to = {}; }; // On the console: the legs, a step tap a tile (step_once()), each warp's diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRowSim.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRowSim.cpp index a3fbdc9155..4ac2deb9ea 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRowSim.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRowSim.cpp @@ -532,20 +532,34 @@ std::string OverworldStepSim::cut(const StoryStep& step){ namespace{ // walk_room_legs() on the sim: a step tap a tile, each warp's fade and -// the walk out of a door waited out. -void sim_walk_room_legs(OverworldSim& sim, const std::vector& legs){ +// the walk out of a door waited out. A warp taken with no black fade +// fails, as on the console, unless the leg `dims`. A leg with no warp +// isn't failed: the 00.32 story sim is already in the lift when +// lift_in_legs() starts (B2F's lift door a tile off the plan's). +std::string sim_walk_room_legs(OverworldSim& sim, const std::vector& legs){ for (const RoomLeg& leg : legs){ if (leg.tiles == 0){ sim_turn_to(sim, leg.direction); continue; } + const int warps_before = sim.state().warps; + const Milliseconds started = sim.state().time; for (int tile = 0; tile < leg.tiles; tile++){ sim_step_once(sim, leg.direction); } - if (leg.warps){ - sim.watch({}, OverworldWalkSteps::AFTER_WARP); + if (!leg.warps){ + continue; + } + const std::vector& shown = sim.state().shown; + const bool faded = std::any_of(shown.begin(), shown.end(), [&](const SimShown& s){ + return s.screen == SimScreen::FADE && s.at >= started; + }) || sim.watch({SimWatcher::FADE}, OverworldWalkSteps::AFTER_WARP).has_value(); + if (sim.state().warps != warps_before && !leg.dims && !faded){ + return std::format("walk_overworld_route(): no fade in and out after walking onto the warp to {}.", leg.to); } + sim.watch({}, OverworldWalkSteps::AFTER_WARP); } + return ""; } } // namespace @@ -590,19 +604,22 @@ std::string OverworldStepSim::hideout(const StoryStep& step){ return m_sim.use_field(SimField::POSTER_SWITCH) ? "" : "no poster ahead."; } if (is_center_variant(step.variant)){ - sim_walk_room_legs(m_sim, center_legs(step.variant)); - return ended_on(step); + const std::string failure = sim_walk_room_legs(m_sim, center_legs(step.variant)); + return failure.empty() ? ended_on(step) : failure; } const std::optional ride = parse_lift_floor_step(step); if (!ride){ return "no lift ride \"" + step.variant + "\"."; } - sim_walk_room_legs(m_sim, lift_in_legs()); + const std::string in = sim_walk_room_legs(m_sim, lift_in_legs()); + if (!in.empty()){ + return in; + } if (!m_sim.use_field(SimField::LIFT_FLOOR, ride->to)){ return "no lift panel for \"" + step.variant + "\"."; } - sim_walk_room_legs(m_sim, lift_out_legs()); - return ended_on(step); + const std::string out = sim_walk_room_legs(m_sim, lift_out_legs()); + return out.empty() ? ended_on(step) : out; } // After a scripted step: the player's pose, and whether it is the step's From 7c1a3f14d40d18b134de4afbcb067bbf6f75aeec Mon Sep 17 00:00:00 2001 From: dayfine Date: Tue, 10 Nov 2026 23:31:01 -0800 Subject: [PATCH 73/79] FRLG rooms: name RoomLeg fields; one anonymous namespace in OverworldWalk Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss --- .../Overworld/PokemonFRLG_OverworldWalk.cpp | 4 ---- .../AutoStory/PokemonFRLG_AutoStoryRooms.cpp | 20 +++++++++---------- 2 files changed, 10 insertions(+), 14 deletions(-) diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldWalk.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldWalk.cpp index 5e0c306b0a..7792a34821 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldWalk.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldWalk.cpp @@ -384,10 +384,6 @@ void wait_out_fade(ConsoleHandle& console, ProControllerContext& context, const ); } -} // namespace - -namespace{ - // After the steps onto a warp whose fade only dims the screen // (RouteStep::fade_dims): waits, up to the warp timeout, for the scene // from `before`, taken before the first of those steps, to be gone and diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRooms.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRooms.cpp index 45dc23d814..8f4174ecc3 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRooms.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRooms.cpp @@ -21,31 +21,31 @@ bool is_center_variant(std::string_view variant){ const std::vector& center_enter_legs(){ static const std::vector LEGS{ - {Pokemon::Direction::NORTH, 1, true, false, "the Center"}, - {Pokemon::Direction::NORTH, 4, false}, + {.direction = Pokemon::Direction::NORTH, .tiles = 1, .warps = true, .to = "the Center"}, + {.direction = Pokemon::Direction::NORTH, .tiles = 4}, }; return LEGS; } const std::vector& center_exit_legs(){ static const std::vector LEGS{ - {Pokemon::Direction::SOUTH, 4, false}, - {Pokemon::Direction::SOUTH, 1, true, false, "outside the Center"}, + {.direction = Pokemon::Direction::SOUTH, .tiles = 4}, + {.direction = Pokemon::Direction::SOUTH, .tiles = 1, .warps = true, .to = "outside the Center"}, }; return LEGS; } const std::vector& lift_in_legs(){ static const std::vector LEGS{ - {Pokemon::Direction::NORTH, 1, true, false, LIFT_MAP}, - {Pokemon::Direction::NORTH, 2, false}, - {Pokemon::Direction::WEST, 2, false}, - {Pokemon::Direction::NORTH, 0, false}, + {.direction = Pokemon::Direction::NORTH, .tiles = 1, .warps = true, .to = LIFT_MAP}, + {.direction = Pokemon::Direction::NORTH, .tiles = 2}, + {.direction = Pokemon::Direction::WEST, .tiles = 2}, + {.direction = Pokemon::Direction::NORTH, .tiles = 0}, }; return LEGS; } const std::vector& lift_out_legs(){ static const std::vector LEGS{ - {Pokemon::Direction::EAST, 2, false}, - {Pokemon::Direction::SOUTH, 3, true, true, "the lift's floor picked"}, + {.direction = Pokemon::Direction::EAST, .tiles = 2}, + {.direction = Pokemon::Direction::SOUTH, .tiles = 3, .warps = true, .dims = true, .to = "the lift's floor picked"}, }; return LEGS; } From c5f78c9398297cb1143d2986ee6d8c2873b7aaa3 Mon Sep 17 00:00:00 2001 From: dayfine Date: Tue, 10 Nov 2026 23:40:38 -0800 Subject: [PATCH 74/79] FRLG AutoStory: number checkpoints by Bulbapedia walkthrough part Checkpoint 00.NN ids become part.NN (01.01 to 09.02), story files, tests, sim trace and docs renamed to match. Start/end settings are indexes, so saved settings are unchanged. The PokemonSimulation-pinned replay fixtures (pin, binding, route-candidate) keep their paths. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss --- .../workflows/cpp-ci-serial-programs-base.yml | 8 +- .../Menus/PokemonFRLG_TeachScreenReader.cpp | 2 +- .../Overworld/PokemonFRLG_BikeSpinMechanics.h | 2 +- .../Overworld/PokemonFRLG_MovementMechanics.h | 4 +- .../Overworld/PokemonFRLG_OverworldBikeTaps.h | 2 +- .../PokemonFRLG_OverworldBike_Tests.cpp | 2 +- .../PokemonFRLG_OverworldLateBattle_Tests.cpp | 4 +- .../PokemonFRLG_OverworldMaps_Tests.cpp | 4 +- .../Overworld/PokemonFRLG_OverworldReanchor.h | 4 +- .../PokemonFRLG_OverworldRecovery.cpp | 4 +- .../PokemonFRLG_OverworldRecoveryWalk.h | 2 +- .../Overworld/PokemonFRLG_OverworldRoute.h | 8 +- .../Overworld/PokemonFRLG_OverworldSim.cpp | 2 +- .../Overworld/PokemonFRLG_OverworldSim.h | 36 +- .../PokemonFRLG_OverworldSim_Tests.cpp | 28 +- .../PokemonFRLG_OverworldSpin_Tests.cpp | 4 +- .../Overworld/PokemonFRLG_OverworldWalk.cpp | 4 +- .../Overworld/PokemonFRLG_OverworldWalk.h | 8 +- .../PokemonFRLG_OverworldWalk_Tests.cpp | 4 +- .../PokemonFRLG_OverworldWarpFade_Tests.cpp | 4 +- .../AutoStory/Data/AuthoredStory_Tests.cpp | 24 +- .../Programs/AutoStory/Data/Json_Tests.cpp | 16 +- .../AutoStory/PokemonFRLG_AutoStory.cpp | 52 +- .../AutoStory/PokemonFRLG_AutoStory.h | 8 +- .../AutoStory/PokemonFRLG_AutoStoryActions.h | 2 +- .../PokemonFRLG_AutoStoryBattleData.cpp | 2 +- .../PokemonFRLG_AutoStoryBattleData_Tests.cpp | 2 +- .../PokemonFRLG_AutoStoryBattleDecisions.h | 2 +- .../PokemonFRLG_AutoStoryBattleSim_Tests.cpp | 6 +- .../PokemonFRLG_AutoStoryCeladon_Tests.cpp | 88 +- .../PokemonFRLG_AutoStoryChoice_Tests.cpp | 2 +- .../AutoStory/PokemonFRLG_AutoStoryEvents.cpp | 4 +- .../AutoStory/PokemonFRLG_AutoStoryEvents.h | 6 +- .../PokemonFRLG_AutoStoryFaultSweep_Tests.cpp | 12 +- .../AutoStory/PokemonFRLG_AutoStoryGrind.h | 2 +- .../PokemonFRLG_AutoStoryGrind_Tests.cpp | 4 +- .../PokemonFRLG_AutoStoryHideout_Tests.cpp | 16 +- .../PokemonFRLG_AutoStoryLavender_Tests.cpp | 146 +- .../PokemonFRLG_AutoStoryPaceSim_Tests.cpp | 4 +- .../AutoStory/PokemonFRLG_AutoStoryPacing.h | 2 +- .../AutoStory/PokemonFRLG_AutoStoryParty.cpp | 4 +- .../PokemonFRLG_AutoStoryParty_Tests.cpp | 2 +- .../PokemonFRLG_AutoStoryRngLoop.cpp | 18 +- .../AutoStory/PokemonFRLG_AutoStoryRngLoop.h | 4 +- .../PokemonFRLG_AutoStoryRngLoop_Tests.cpp | 42 +- .../AutoStory/PokemonFRLG_AutoStoryRooms.h | 2 +- .../AutoStory/PokemonFRLG_AutoStoryRowSim.cpp | 6 +- .../AutoStory/PokemonFRLG_AutoStoryRowSim.h | 4 +- .../PokemonFRLG_AutoStoryRunPlan_Tests.cpp | 202 +- ...okemonFRLG_AutoStoryScreenEvents_Tests.cpp | 2 +- .../PokemonFRLG_AutoStorySimulation_Tests.cpp | 180 +- ...PokemonFRLG_AutoStoryStartFrames_Tests.cpp | 24 +- .../AutoStory/PokemonFRLG_AutoStoryTable.h | 30 +- .../PokemonFRLG_AutoStoryTeachScreens.h | 2 +- ...okemonFRLG_AutoStoryTeachScreens_Tests.cpp | 6 +- .../PokemonFRLG_AutoStoryTrashCans.h | 2 +- ...okemonFRLG_AutoStoryVermilionGym_Tests.cpp | 60 +- .../PokemonFRLG_AutoStoryVermilion_Tests.cpp | 36 +- .../AutoStory/PokemonFRLG_AutoStory_Tests.cpp | 56 +- .../AutoStory/PokemonFRLG_StoryReplay.cpp | 2 +- .../ReplayData/frlg-story-sim-trace.json | 2778 ++++++++--------- .../Programs/AutoStory/StoryData/README.md | 10 +- ...g-00.01.plan.json => frlg-01.01.plan.json} | 2 +- ...-00.01b.plan.json => frlg-01.02.plan.json} | 2 +- ...g-00.02.plan.json => frlg-01.03.plan.json} | 2 +- ...g-00.03.plan.json => frlg-01.04.plan.json} | 2 +- ...g-00.04.plan.json => frlg-01.05.plan.json} | 2 +- ...-00.04b.plan.json => frlg-01.06.plan.json} | 2 +- ...g-00.06.plan.json => frlg-02.02.plan.json} | 2 +- ...g-00.07.plan.json => frlg-02.03.plan.json} | 2 +- ...g-00.08.plan.json => frlg-03.01.plan.json} | 4 +- ...g-00.09.plan.json => frlg-03.02.plan.json} | 2 +- ...g-00.10.plan.json => frlg-03.03.plan.json} | 4 +- ...g-00.11.plan.json => frlg-04.01.plan.json} | 2 +- ...g-00.12.plan.json => frlg-04.02.plan.json} | 2 +- ...-00.12b.plan.json => frlg-04.03.plan.json} | 4 +- ...-00.12c.plan.json => frlg-04.04.plan.json} | 2 +- ...g-00.13.plan.json => frlg-04.05.plan.json} | 2 +- ...g-00.14.plan.json => frlg-04.06.plan.json} | 2 +- ...-00.14b.plan.json => frlg-05.01.plan.json} | 8 +- ...-00.14c.plan.json => frlg-05.02.plan.json} | 4 +- ...g-00.15.plan.json => frlg-05.03.plan.json} | 4 +- ...-00.15b.plan.json => frlg-05.04.plan.json} | 4 +- ...g-00.16.plan.json => frlg-05.05.plan.json} | 2 +- ...g-00.17.plan.json => frlg-05.06.plan.json} | 2 +- ...g-00.18.plan.json => frlg-05.07.plan.json} | 2 +- ...g-00.19.plan.json => frlg-05.08.plan.json} | 2 +- ...g-00.20.plan.json => frlg-05.09.plan.json} | 6 +- ...g-00.21.plan.json => frlg-05.10.plan.json} | 2 +- ...g-00.22.plan.json => frlg-06.01.plan.json} | 4 +- ...g-00.23.plan.json => frlg-06.02.plan.json} | 6 +- ...g-00.24.plan.json => frlg-06.03.plan.json} | 2 +- ...g-00.25.plan.json => frlg-06.04.plan.json} | 2 +- ...g-00.26.plan.json => frlg-07.01.plan.json} | 8 +- ...g-00.27.plan.json => frlg-07.02.plan.json} | 4 +- ...g-00.28.plan.json => frlg-08.01.plan.json} | 6 +- ...g-00.29.plan.json => frlg-08.02.plan.json} | 2 +- ...g-00.30.plan.json => frlg-08.03.plan.json} | 8 +- ...g-00.31.plan.json => frlg-09.01.plan.json} | 2 +- ...g-00.32.plan.json => frlg-09.02.plan.json} | 2 +- ...rcel-00.05.json => frlg-parcel-02.01.json} | 2 +- ....plan.json => frlg-parcel-02.01.plan.json} | 2 +- devtools/story-export/README.md | 2 +- devtools/story-export/frlg_main.cpp | 2 +- devtools/story-replay/README.md | 2 +- docs/design/AutoStory-FRLG-Sizing.md | 2 +- docs/design/AutoStory.md | 4 +- 107 files changed, 2076 insertions(+), 2070 deletions(-) rename SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/{frlg-00.01.plan.json => frlg-01.01.plan.json} (98%) rename SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/{frlg-00.01b.plan.json => frlg-01.02.plan.json} (98%) rename SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/{frlg-00.02.plan.json => frlg-01.03.plan.json} (97%) rename SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/{frlg-00.03.plan.json => frlg-01.04.plan.json} (98%) rename SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/{frlg-00.04.plan.json => frlg-01.05.plan.json} (97%) rename SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/{frlg-00.04b.plan.json => frlg-01.06.plan.json} (99%) rename SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/{frlg-00.06.plan.json => frlg-02.02.plan.json} (98%) rename SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/{frlg-00.07.plan.json => frlg-02.03.plan.json} (99%) rename SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/{frlg-00.08.plan.json => frlg-03.01.plan.json} (98%) rename SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/{frlg-00.09.plan.json => frlg-03.02.plan.json} (99%) rename SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/{frlg-00.10.plan.json => frlg-03.03.plan.json} (96%) rename SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/{frlg-00.11.plan.json => frlg-04.01.plan.json} (99%) rename SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/{frlg-00.12.plan.json => frlg-04.02.plan.json} (99%) rename SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/{frlg-00.12b.plan.json => frlg-04.03.plan.json} (87%) rename SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/{frlg-00.12c.plan.json => frlg-04.04.plan.json} (98%) rename SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/{frlg-00.13.plan.json => frlg-04.05.plan.json} (99%) rename SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/{frlg-00.14.plan.json => frlg-04.06.plan.json} (99%) rename SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/{frlg-00.14b.plan.json => frlg-05.01.plan.json} (93%) rename SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/{frlg-00.14c.plan.json => frlg-05.02.plan.json} (98%) rename SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/{frlg-00.15.plan.json => frlg-05.03.plan.json} (91%) rename SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/{frlg-00.15b.plan.json => frlg-05.04.plan.json} (96%) rename SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/{frlg-00.16.plan.json => frlg-05.05.plan.json} (99%) rename SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/{frlg-00.17.plan.json => frlg-05.06.plan.json} (99%) rename SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/{frlg-00.18.plan.json => frlg-05.07.plan.json} (99%) rename SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/{frlg-00.19.plan.json => frlg-05.08.plan.json} (99%) rename SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/{frlg-00.20.plan.json => frlg-05.09.plan.json} (96%) rename SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/{frlg-00.21.plan.json => frlg-05.10.plan.json} (99%) rename SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/{frlg-00.22.plan.json => frlg-06.01.plan.json} (98%) rename SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/{frlg-00.23.plan.json => frlg-06.02.plan.json} (96%) rename SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/{frlg-00.24.plan.json => frlg-06.03.plan.json} (99%) rename SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/{frlg-00.25.plan.json => frlg-06.04.plan.json} (99%) rename SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/{frlg-00.26.plan.json => frlg-07.01.plan.json} (95%) rename SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/{frlg-00.27.plan.json => frlg-07.02.plan.json} (99%) rename SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/{frlg-00.28.plan.json => frlg-08.01.plan.json} (99%) rename SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/{frlg-00.29.plan.json => frlg-08.02.plan.json} (99%) rename SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/{frlg-00.30.plan.json => frlg-08.03.plan.json} (97%) rename SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/{frlg-00.31.plan.json => frlg-09.01.plan.json} (99%) rename SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/{frlg-00.32.plan.json => frlg-09.02.plan.json} (99%) rename SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/{frlg-parcel-00.05.json => frlg-parcel-02.01.json} (99%) rename SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/{frlg-parcel-00.05.plan.json => frlg-parcel-02.01.plan.json} (98%) diff --git a/.github/workflows/cpp-ci-serial-programs-base.yml b/.github/workflows/cpp-ci-serial-programs-base.yml index 48e45d1d1c..6b7514886a 100644 --- a/.github/workflows/cpp-ci-serial-programs-base.yml +++ b/.github/workflows/cpp-ci-serial-programs-base.yml @@ -127,7 +127,7 @@ jobs: assert pin['status'] == 'preview-unmerged-PR-73' and revision == pin['revision'] for name, entry in pin['files'].items(): published = (source / entry['path']).read_bytes() - copied = (native / 'StoryData/frlg-parcel-00.05.json' if name == 'capture' else folder / (name + '.json')).read_bytes() + copied = (native / 'StoryData/frlg-parcel-02.01.json' if name == 'capture' else folder / (name + '.json')).read_bytes() assert hashlib.sha256(published).hexdigest() == entry['sha256'], name assert copied == published, name binding = load_binding(source / pin['files']['binding']['path'], source) @@ -166,7 +166,7 @@ jobs: source = Path('AuthoredStorySource') folder = source / 'data/story/parcel-pilot' native = Path('Arduino-Source/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData') - assert (native / 'frlg-parcel-00.05.plan.json').read_bytes() == (folder / 'frlg-parcel-00.05.plan.json').read_bytes() + assert (native / 'frlg-parcel-02.01.plan.json').read_bytes() == (folder / 'frlg-parcel-00.05.plan.json').read_bytes() binding = load_binding(folder / 'authored-binding.json', source) cases = read_cases(folder / 'cases.json') for case in cases: @@ -307,12 +307,12 @@ jobs: if: startsWith(inputs.os, 'ubuntu') && inputs.run-tests run: | cd Arduino-Source/SerialPrograms/bin - ./StoryCheckpointExport 00.05 > frlg-parcel.native.json + ./StoryCheckpointExport 02.01 > frlg-parcel.native.json python3 - <<'PYTHON' import json from pathlib import Path data = json.loads(Path('frlg-parcel.native.json').read_text()) - assert data['game'] == 'frlg' and data['checkpoint']['id'] == '00.05' + assert data['game'] == 'frlg' and data['checkpoint']['id'] == '02.01' assert len(data['checkpoint']['events']) == 3 PYTHON diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Inference/Menus/PokemonFRLG_TeachScreenReader.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Inference/Menus/PokemonFRLG_TeachScreenReader.cpp index 9ec2eaa77c..8a3bc2546c 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Inference/Menus/PokemonFRLG_TeachScreenReader.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Inference/Menus/PokemonFRLG_TeachScreenReader.cpp @@ -528,7 +528,7 @@ void add_tests_TeachScreenReader(UnitTestDatabase& database){ "KnownMoves_eng.png", "StopQuestion_eng.png", "DidNotLearn_eng.png", - // HM01 to an Oddish with two free slots (00.23, console B). + // HM01 to an Oddish with two free slots (06.02, console B). "MachineSet_eng.png", }){ database.add(std::string("PokemonFRLG/TeachScreenReader/") + image); diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_BikeSpinMechanics.h b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_BikeSpinMechanics.h index ae9283b104..b610810a8c 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_BikeSpinMechanics.h +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_BikeSpinMechanics.h @@ -26,7 +26,7 @@ namespace MovementMechanics{ // tiles, the same each time: a tile per 100ms, so an open leg's hold of // (n - 1) tiles and a half moves n. 112ms a tile (a wall-to-wall time // of the motion on screen) held "west 16 (open)" for 17 or 18 tiles on -// Route 8 (00.30 run 2). Not the decompilation's 4 frames a tile (67ms): +// Route 8 (08.03 run 2). Not the decompilation's 4 frames a tile (67ms): // the bike speeds up from rest. inline constexpr Milliseconds BIKE_TILE_TIME(100); diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_MovementMechanics.h b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_MovementMechanics.h index 461c103777..65f943e3c3 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_MovementMechanics.h +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_MovementMechanics.h @@ -21,7 +21,7 @@ * tap's start is ignored. * - Taps with no release between them are one hold: after a turn, 3 of * them took 0 or 1 steps. - * After a battle (console B, 2026-11-09 15:50, 00.28 winston_line): a + * After a battle (console B, 2026-11-09 15:50, 08.01 winston_line): a * step tap sent as flee_battle() returned, on the black's end, was lost; * one more tap by hand stepped. * @@ -44,7 +44,7 @@ namespace MovementMechanics{ // Walking: a tile per 16 frames at 60 fps (console B, 2026-11-09). inline constexpr Milliseconds TILE_TIME(267); // Running with B held: a tile per 8 frames (console B, 2026-11-02, video -// of run 00.11). +// of run 04.01). inline constexpr Milliseconds RUN_TILE_TIME(133); // Surfing: a tile per 8 frames. inline constexpr Milliseconds SURF_TILE_TIME(133); diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldBikeTaps.h b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldBikeTaps.h index 4f097db346..ffae906f2b 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldBikeTaps.h +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldBikeTaps.h @@ -48,7 +48,7 @@ struct BikeTapCalls{ // game may miss a turn tap (MovementMechanics::MAX_TURN_TAPS). constexpr int STEP_TAP_TRIES = 3; // How far a sure start may be off before a blocked tap finds the player: -// three runs of 00.30 stood 3 tiles off (console B, 2026-11-09). +// three runs of 08.03 stood 3 tiles off (console B, 2026-11-09). constexpr int BLOCKED_TAP_SLACK = 3; // Walks the open leg `step` a tap at a time: on the Bicycle each tap is diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldBike_Tests.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldBike_Tests.cpp index 8fc91a73c5..701d7faf3a 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldBike_Tests.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldBike_Tests.cpp @@ -234,7 +234,7 @@ ImageRGB32 periodic_floor(size_t scroll){ return image; } -// Rocket Hideout B3F (00.32 run 1): a tap east over a floor that repeats +// Rocket Hideout B3F (09.02 run 1): a tap east over a floor that repeats // every tile left the top band the same, so the tap read as a turn. UnitTestResult test_scroll_over_periodic_floor(){ const ImageFloatBox game(0, 0, 1, 1); diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldLateBattle_Tests.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldLateBattle_Tests.cpp index d6b6b4e46b..895d809f79 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldLateBattle_Tests.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldLateBattle_Tests.cpp @@ -112,7 +112,7 @@ std::string bound_text(const std::optional& bound){ return bound ? std::format("{} to {}", bound->min, bound->max) : std::string("no bound"); } -// Console B, FRLG 00.27 run 2, 2026-11-09 (~/FRLGLab/captures/ +// Console B, FRLG 07.02 run 2, 2026-11-09 (~/FRLGLab/captures/ // 2026-11-09-0027-route10-legs.log): on the open leg "east 11" across // Route 10, wild battles (Voltorb) showed only after the hold. The walker // took the player to be anywhere on the leg ("stopped 0 to 11 tiles in") @@ -120,7 +120,7 @@ std::string bound_text(const std::optional& bound){ // the leg crosses Route 10's grass on row 10, the battle's flashes are // missed, its text box ("Wild appeared!") shows // LATE_WILD_BATTLE_DELAY after its step and its HP boxes 800 ms after -// that, as in Mt. Moon (console B, 2026-11-03, row 00.13). After running, +// that, as in Mt. Moon (console B, 2026-11-03, row 04.05). After running, // the walker must bound the player to a few tiles around the battle's. class Test_OverworldLateBattle : public UnitTest{ public: diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldMaps_Tests.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldMaps_Tests.cpp index e10f6d7816..cedde526bc 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldMaps_Tests.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldMaps_Tests.cpp @@ -591,7 +591,7 @@ UnitTestResult check_found_again(const std::vector& maps, const MapPosi return true; } -// 00.11's way from Pewter into Route 3 and 00.12's over Route 3 and 4. +// 04.01's way from Pewter into Route 3 and 04.02's over Route 3 and 4. UnitTestResult test_found_again_route3_route4(){ const std::vector maps = overworld_maps(); const UnitTestResult into_route3 = check_found_again(maps, {"PewterCity", {17, 26}}, {"Route3", {13, 8}}); @@ -617,7 +617,7 @@ UnitTestResult test_trainer_stops(){ }; const Case cases[] = { { - .name = "Route 3, Lass Robin, east along row 9 (00.12)", + .name = "Route 3, Lass Robin, east along row 9 (04.02)", .start = {"Route3", {36, 9}}, .direction = Direction::EAST, .tiles = 11, .to_wall = true, .player = {"Route3", {40, 9}}, .trainer = {"Route3", {40, 10}}, }, diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldReanchor.h b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldReanchor.h index ae962e95b7..6bfcf5e16d 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldReanchor.h +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldReanchor.h @@ -52,7 +52,7 @@ WalkedTiles walked_near(const RouteStep& step, int estimate, Milliseconds tile_t // there, which it doesn't always do: south from Route 6 into Vermilion // City it didn't, the player ended a tile further south, and the north 1 // onto the Pokemon Center's door stopped below it (console B, 2026-11-03, -// row 00.24). Until a leg to a wall that way or a warp places the player +// row 06.03). Until a leg to a wall that way or a warp places the player // again, they may stand a tile further on; a warp walked back that way is // held a tile further for it. std::vector with_warp_slack(std::vector route); @@ -63,7 +63,7 @@ WalkedTiles whole_leg(const RouteStep& step); // cave's screen (OverworldWalkSteps::dark_cave_screen()). There the timing // has no basis: the screen is black before any battle's wipe, and a // battle at the end of "east 12" on Rock Tunnel B1F was placed 0 to 3 -// tiles in (console B, 2026-11-09, 00.28). The player, "found again" at +// tiles in (console B, 2026-11-09, 08.01). The player, "found again" at // a wall from those, was 5 tiles off. WalkedTiles stop_tiles(const RouteStep& step, WalkedTiles timed, bool dark); diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldRecovery.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldRecovery.cpp index 0b425e18a9..c2e3114bd5 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldRecovery.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldRecovery.cpp @@ -63,7 +63,7 @@ int sight_onto(const std::vector& maps, const MapPosition& tile){ // How far the holds that find the player after an open leg, and the way // back, may walk, per tile of the leg. 2 left Rocket Hideout B3F's "west // 7" off the stairs unchecked: the hold to its west wall and back walk up -// to 18, and the leg ended short (00.31 r1, console B, 2026-11-10). Route +// to 18, and the leg ended short (09.01 r1, console B, 2026-11-10). Route // 1's "west 4", whose holds walk 30, stays unchecked. constexpr int OPEN_LEG_CHECK_TILES_PER_TILE = 3; @@ -87,7 +87,7 @@ bool is_wall_hold(const RouteStep& next){ // misses the arrow, or walks onto another, and ends elsewhere in the maze: // "south 2" before Rocket Hideout B3F's "east 2" onto the arrow (3, 16) // ended a tile short, the east leg walked into a wall, and the walk after -// it slid up to (10, 13) (00.31 r1 run 3, console B, 2026-11-10). +// it slid up to (10, 13) (09.01 r1 run 3, console B, 2026-11-10). bool is_slide(const RouteStep& next){ return next.action == RouteAction::WALK && next.spin_tiles && !next.warps; } diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldRecoveryWalk.h b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldRecoveryWalk.h index a65eca8c20..f119a51436 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldRecoveryWalk.h +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldRecoveryWalk.h @@ -38,7 +38,7 @@ constexpr double WALL_TAP_MOVED_RMSD = 20.0; // How much a counted tap scrolled the map: the largest RMSD between `before` // and `after` over the four edge quarters (top, bottom, left, right) of // `game`, all clear of the player in the middle. One band alone misses a -// step over a floor that repeats every tile (Rocket Hideout B3F, 00.32): a +// step over a floor that repeats every tile (Rocket Hideout B3F, 09.02): a // one-tile scroll leaves the band nearly the same. double tap_scroll_change(const ImageViewRGB32& before, const ImageViewRGB32& after, const ImageFloatBox& game); diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldRoute.h b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldRoute.h index 14b8a1f030..05677e4c29 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldRoute.h +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldRoute.h @@ -83,7 +83,7 @@ struct RouteStep{ // WALK on foot: walked a tap at a time, each a tile, and each checked // to have moved (count_step_taps()), as through the hideout's arrow // floors, where a hold that ends a tile off slides the player - // elsewhere (console B, 2026-11-10, 00.31 r1). + // elsewhere (console B, 2026-11-10, 09.01 r1). bool tapped = false; // WALK, tapped: played blind, this many taps (the leg's tiles, and a // turn tap first if the player faced another way), each waited out @@ -93,7 +93,7 @@ struct RouteStep{ // 0: not blind. int blind_taps = 0; // WALK, warps: the warp's fade only dims the screen, never black (the - // hideout lift's way out; console B, 2026-11-10, 00.32 lift_to_b4f). + // hideout lift's way out; console B, 2026-11-10, 09.02 lift_to_b4f). bool fade_dims = false; // WALK, SURF: a wild Pokemon can appear on the way: the step crosses // tall grass or water. Elsewhere (indoors, streets) no wild battle can @@ -107,13 +107,13 @@ struct RouteStep{ // WALK: the steps (from 1) onto a connected map. The game holds the // player up a tile before each while it loads the map: a hold timed // by the tiles alone ended a tile short (console B, 2026-11-03, rows - // 00.14, 00.16 and 00.20). + // 04.06, 05.05 and 05.09). std::vector connection_steps = {}; // WALK onto a warp: how many tiles further the player may stand from // it than planned, which the hold goes on for, stopping at the fade. // An open leg over a map connection before it may end a tile further // on, when the game doesn't hold the player up there (console B, - // 2026-11-03, row 00.24). Set by with_warp_slack() when a route runs. + // 2026-11-03, row 06.03). Set by with_warp_slack() when a route runs. int warp_slack = 0; }; // Formats a RouteStep as a string. diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSim.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSim.cpp index afea47e930..bd1aec8936 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSim.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSim.cpp @@ -502,7 +502,7 @@ void OverworldSim::take_steps(Direction direction, Milliseconds pressed, Millise if (m_script.connections_stall && step->map != m_map && !step->warped){ // The step onto a connected map waits a tile while the game // loads it: a hold timed by its tiles alone ended a tile short - // (console B, 2026-11-03, rows 00.14, 00.16 and 00.20). + // (console B, 2026-11-03, rows 04.06, 05.05 and 05.09). pressed += tile; if (pressed >= end){ return; diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSim.h b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSim.h index 5441df6a9e..736752e7d3 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSim.h +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSim.h @@ -126,8 +126,8 @@ struct SimScript{ std::set wild_floor_maps; // Whether the game holds the player up a tile on a step onto a // connected map. It did north onto Nugget Bridge (console B, - // 2026-11-03, rows 00.16 and 00.20), not south from Route 6 into - // Vermilion City (row 00.24). + // 2026-11-03, rows 05.05 and 05.09), not south from Route 6 into + // Vermilion City (row 06.03). bool connections_stall = true; // Wild battles at the game's own odds instead of `encounters`, on the // maps named here, with their land encounter rate (pokefirered @@ -138,18 +138,18 @@ struct SimScript{ // the game misses, by number from 1; the player goes on facing the old // way. The game drops none from a standstill (MovementMechanics: 70 of // 70 turned); these test the walker's check of the turn - // (SimWalkerRules::confirm_turn) after 00.28 run 2 (console B, + // (SimWalkerRules::confirm_turn) after 08.01 run 2 (console B, // 2026-11-09), where a one-tile leg only turned the player. std::set dropped_turn_taps; // Fault injection: steps onto a warp, by number from 1, that show the // fade's black and clear with the player where they were, not warped - // (console B, 2026-11-10 01:44, 00.31 run 4, "east 1 (warp)" on B4F). + // (console B, 2026-11-10 01:44, 09.01 run 4, "east 1 (warp)" on B4F). std::set black_without_warp; // The player rides the Bicycle: a tap facing another way takes a step // too, a hold through a turn loses no tile // (MovementMechanics::BIKE_TAP_ONLY_TURNS), and no step tap is // ignored: a 40ms turn tap and a 56ms hold 340ms after it took two - // tiles (console B, 2026-11-09, 00.30). At the start: SELECT gets on + // tiles (console B, 2026-11-09, 08.03). At the start: SELECT gets on // and off (OverworldSim::press_select()), a warp gets off. Each tap is // a tile; one in MovementMechanics::BIKE_FAST_TAP_DROP_EVERY of those // that start sooner than BIKE_TAP_DROP_PERIOD after the last is @@ -161,7 +161,7 @@ struct SimScript{ // Caves dark without Flash (Rock Tunnel): the overworld is black but // for a lit circle on the player, which the walker's battle text box // check and screen observer read as a battle on its way (console B, - // 2026-11-09, 00.28), unless SimWalkerRules::dark_cave_not_battle. + // 2026-11-09, 08.01), unless SimWalkerRules::dark_cave_not_battle. std::set dark_maps; // A lift's map, and where its door lets the player out for each floor // on its panel's menu, top first (pokefirered setdynamicwarp in @@ -170,7 +170,7 @@ struct SimScript{ // LIFT_MAP, with rocket_hideout_lift_doors(). std::map> lift_floors = {}; // The fade out of a lift only dims the screen, never black (console B, - // 2026-11-10, 00.32 lift_to_b4f): no FADE shows for it. + // 2026-11-10, 09.02 lift_to_b4f): no FADE shows for it. bool lift_exit_dims = true; SimTiming timing; }; @@ -440,20 +440,20 @@ struct SimWalkerRules{ // A leg onto a warp whose fade was a wild battle's (its wipe passes for // the fade) stops before the warp, and the player is found again on it. // Without it the walker stopped as off the route (console B, - // 2026-11-03, Mt. Moon 1F, row 00.13). + // 2026-11-03, Mt. Moon 1F, row 04.05). bool find_player_after_warp_battle = true; // After a leg's watch saw nothing, a battle's text box on screen (its // HP boxes still to come) is watched on for, and the leg taken as // stopped part-way. Without it the walker took "south 15 (to wall)" // as walked and the next leg into the battle (console B, 2026-11-03, - // Mt. Moon B1F, row 00.13). + // Mt. Moon B1F, row 04.05). bool watch_on_for_unseen_battle = true; // The same after a leg the maps see no wild tiles on (RouteStep::wild), // which the leg and its watch don't watch for battles: on Mt. Moon // B2F's tiles closed on one side, which the maps don't mark as wild, a // battle on "east 7 (to wall)" left black after the leg, the leg was // taken as walked and the next one held from where the battle was - // (console B, 2026-11-03, row 00.13). + // (console B, 2026-11-03, row 04.05). bool watch_on_after_unmarked_leg = true; // Before a step, a battle on its way (its text box or wipe) is watched // on for, and the step before it taken as stopped part-way, not the @@ -462,29 +462,29 @@ struct SimWalkerRules{ // A hold over a step onto a connected map is a tile longer for it // (RouteStep::connection_steps). Without it the open leg north from // Cerulean City onto Nugget Bridge ended a tile short (console B, - // 2026-11-03, rows 00.16 and 00.20). + // 2026-11-03, rows 05.05 and 05.09). bool hold_over_connections = true; // An open leg after whose hold a wild battle was seen is placed by the // battle's first timed screen event (place_late_stop()). Without it the // player may be anywhere on the leg: on Route 10, "east 11" was found - // again from all 12 of its tiles (console B, 2026-11-09, 00.27 run 2). + // again from all 12 of its tiles (console B, 2026-11-09, 07.02 run 2). bool place_late_battle = true; // The watch for a warp's fade starts with the hold onto the warp // (Pokemon::WatchAlong), not when it ends. Without it a fade over // before the hold ended was missed, and the walk stopped on "no fade in // and out after walking onto the warp" though it had warped (console B, - // 2026-11-09 01:41, 00.27, the warp to CeruleanCity: the watch started + // 2026-11-09 01:41, 07.02, the warp to CeruleanCity: the watch started // about 1.3 s into the hold). bool watch_fade_along_hold = true; // A warp's fade is taken as the warp only once the screen after it // shows the player off the map they held from (warp_left_scene()). // Without it a black that cleared with the player where they were was - // taken as the warp (console B, 2026-11-10 01:44, 00.31 run 4). + // taken as the warp (console B, 2026-11-10 01:44, 09.01 run 4). bool confirm_warp_destination = true; // A turn tap is checked by the facing on screen, and tapped again // while the player faces another way (OverworldWalkSteps::turn_to()). // Without it a dropped tap left a one-tile leg turning the player - // only, taken as walked (console B, 2026-11-09, 00.28 run 2). + // only, taken as walked (console B, 2026-11-09, 08.01 run 2). bool confirm_turn = true; // The speed the walker goes at: its turn taps // (OverworldWalkSteps::turns_first()) and its holds' tile time. @@ -493,7 +493,7 @@ struct SimWalkerRules{ // tile (count_bike_taps()), and one that doesn't move finds the player // ahead of a block. Without it the leg is one hold, and a start off // along the leg ends it off with nothing to show it (console B, - // 2026-11-09, 00.30: three runs 3 tiles east after Route 8's legs). + // 2026-11-09, 08.03: three runs 3 tiles east after Route 8's legs). bool count_bike_taps = true; // How far apart, start to start, the counted taps are // (MovementMechanics::BIKE_TAP_PERIOD). @@ -505,14 +505,14 @@ struct SimWalkerRules{ // A dark cave's overworld isn't a battle on its way // (OverworldWalkSteps::dark_cave_screen()). Without it the check // before each step watched for a battle on it (console B, 2026-11-09, - // 00.28: "running from a wild Pokemon", then "not a battle"). + // 08.01: "running from a wild Pokemon", then "not a battle"). bool dark_cave_not_battle = true; // A stop on an open leg that started in a dark cave may be anywhere on // the leg (whole_leg()). Without it the stop is placed by the dark // screen's black, read as the battle at the hold's start: a battle at // the end of "east 12" on Rock Tunnel B1F was placed 0 to 3 tiles in, // and the player was found again at a wall 5 tiles off (console B, - // 2026-11-09, 00.28). + // 2026-11-09, 08.01). bool whole_leg_in_dark = true; // The end of a trainer's battle the walker fought, as the story's // battle loop takes it on the screen the sim shows after it: its diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSim_Tests.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSim_Tests.cpp index 25d6f4bfc4..d3cb7b0349 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSim_Tests.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSim_Tests.cpp @@ -292,7 +292,7 @@ UnitTestResult test_forest_north_gate(){ return true; } -// Console B, 2026-11-03, Mt. Moon 1F (row 00.13): a wild battle whose +// Console B, 2026-11-03, Mt. Moon 1F (row 04.05): a wild battle whose // flashes were missed started on the leg south onto the ladder; its wipe // passed for the ladder's fade, and the walker stopped as off the route, // on the leg a tile short of the ladder. Here on the leg through the @@ -521,7 +521,7 @@ UnitTestResult test_mart_exit(){ return true; } -// Mt. Moon (story row 00.13): every floor tile has wild encounters, and +// Mt. Moon (story row 04.05): every floor tile has wild encounters, and // the floors join by ladders taken on stepping onto them. From the Moon // Stone (3, 2) on 1F down to the foot of B2F's ladder: two ladders, each // a fade. @@ -535,7 +535,7 @@ UnitTestResult test_mt_moon_ladders(){ } // The Moon Stone's ball (3, 2) on Mt. Moon 1F is a short way off the way -// down: from (11, 3), where 00.13's walk up column 11 ends, to face it +// down: from (11, 3), where 04.05's walk up column 11 ends, to face it // and then on to B1F costs a few tiles more than going straight, and // both walks end where they were planned to. UnitTestResult test_moon_stone_detour(){ @@ -566,7 +566,7 @@ UnitTestResult test_moon_stone_detour(){ } // Mt. Moon B2F: the Grunt at (37, 21) looks around (sight 3) over the -// only way east. 00.13 crosses his room on legs to walls; the sim's +// only way east. 04.05 crosses his room on legs to walls; the sim's // trainers see every way they may look, so he sees the player on // (37, 22), is fought, and the leg is held on to its wall. UnitTestResult test_mt_moon_grunt_mid_leg(){ @@ -584,7 +584,7 @@ UnitTestResult test_mt_moon_grunt_mid_leg(){ return true; } -// Mt. Moon B2F: 00.13's open leg east along the bottom row, (8, 38) to +// Mt. Moon B2F: 04.05's open leg east along the bottom row, (8, 38) to // (11, 38), ends a tile short with nothing on screen. The hold north // after it would end on (10, 21), a column west of the Grunt's line the // table steps into from (11, 21): the walker finds the player at walls @@ -622,7 +622,7 @@ UnitTestResult test_mt_moon_late_battle(){ return true; } -// Console B, 2026-11-03 (row 00.13, b2f_ladder_foot): a wild battle whose +// Console B, 2026-11-03 (row 04.05, b2f_ladder_foot): a wild battle whose // flashes were missed started on "south 3 (warp)" from (5, 3) to 1F's // ladder; its wipe passed for the ladder's fade, and the walker stopped as // off the route, with the player on (5, 5). A battle on the leg's first or @@ -650,7 +650,7 @@ UnitTestResult test_mt_moon_battle_on_ladder_leg(){ return true; } -// Console B, 2026-11-03 (row 00.13, b2f_ladder_foot): on B1F a wild +// Console B, 2026-11-03 (row 04.05, b2f_ladder_foot): on B1F a wild // battle started part-way down "south 15 (to wall)" from (3, 3), with its // flashes missed. Its HP boxes came over 5 s after the step, after the // leg's watch had ended on the battle's empty text box: the leg was taken @@ -689,7 +689,7 @@ UnitTestResult test_mt_moon_battle_seen_after_wall_leg(){ return true; } -// Console B, 2026-11-03 (row 00.13, b2f_south): on Mt. Moon B2F a wild +// Console B, 2026-11-03 (row 04.05, b2f_south): on Mt. Moon B2F a wild // battle started on the first step of "east 7 (to wall)" from (39, 14), // along tiles closed on their north side, which the maps didn't mark as // wild then: the leg watched only for messages, and the screen was black @@ -791,7 +791,7 @@ UnitTestResult test_mt_moon_way_out(){ return true; } -// Story row 00.14: from Route 4 east of Mt. Moon along the upper road to +// Story row 04.06: from Route 4 east of Mt. Moon along the upper road to // above the ledge row 9, out of Lass Crissy's line (75, 3); one step // south hops the ledge onto the lower road two tiles down; from there // into Cerulean City and its Pokemon Center by one door. No route plans @@ -816,7 +816,7 @@ UnitTestResult test_route4_to_cerulean(){ return true; } -// Story rows 00.14b and 00.14c in Cerulean Gym (pokefirered map.json): +// Story rows 05.01 and 05.02 in Cerulean Gym (pokefirered map.json): // from the Center into the Gym, up column 9 to (9, 13), west to (4, 13), // then to walls round the pool's west and north sides and west to (9, 7) // below Misty's platform, meeting no one; and back from beside her (9, 6) @@ -865,7 +865,7 @@ UnitTestResult test_cerulean_gym_walks(){ return true; } -// The straight ways in Cerulean Gym that 00.14b and 00.14c keep off: the +// The straight ways in Cerulean Gym that 05.01 and 05.02 keep off: the // step onto (9, 12) meets Swimmer Luis, and the step onto (8, 7), // misty_front, Picnicker Diana. UnitTestResult test_cerulean_gym_lines(){ @@ -889,7 +889,7 @@ UnitTestResult test_cerulean_gym_lines(){ return true; } -// Story rows 00.15 and 00.16: out of Cerulean's Pokemon Center by its mat +// Story rows 05.03 and 05.05: out of Cerulean's Pokemon Center by its mat // to below the rival's trigger row, and on north across the city's edge // onto Nugget Bridge, below Cale's row, meeting no one. UnitTestResult test_cerulean_to_bridge(){ @@ -904,7 +904,7 @@ UnitTestResult test_cerulean_to_bridge(){ return true; } -// Story row 00.16 up Nugget Bridge: the short legs between the five +// Story row 05.05 up Nugget Bridge: the short legs between the five // trainers' rows meet no one; and the step from the tile below each row // onto it is in that trainer's sight, beside them, so they fight there // without walking: Cale, Ali, Timmy, Reli and Ethan. @@ -934,7 +934,7 @@ UnitTestResult test_nugget_bridge_legs(){ -// Story row 00.24 from Route 6 to Vermilion City's nurse: the open leg +// Story row 06.03 from Route 6 to Vermilion City's nurse: the open leg // south 14 crosses onto Vermilion City and is held a tile longer for the // game holding the player up there. It didn't: the player ended a tile // south of (23, 7), the leg west on (15, 8), and the north 1 onto the diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSpin_Tests.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSpin_Tests.cpp index 433eb39443..25e5fd55c5 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSpin_Tests.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSpin_Tests.cpp @@ -193,7 +193,7 @@ UnitTestResult test_sim_walker_walks_slide(){ } -// 00.31 r1 (console B, 2026-11-10), Rocket Hideout B3F: off the stairs from +// 09.01 r1 (console B, 2026-11-10), Rocket Hideout B3F: off the stairs from // B2F, the open leg west along the top corridor ended short, so the hold // south to the wall stayed in the corridor, and the legs through the // spinners after it all ran there: the walk ended a few tiles west of the @@ -224,7 +224,7 @@ UnitTestResult test_short_leg_off_hideout_stairs(){ } -// 00.31 r1 run 3 (console B, 2026-11-10), Rocket Hideout B3F: "south 2" +// 09.01 r1 run 3 (console B, 2026-11-10), Rocket Hideout B3F: "south 2" // from (1, 14), at the wall, ended a tile short at (1, 15) with nothing // seen. "east 2", meant to step onto the arrow (3, 16), walked into the // wall east of (1, 15); the position check after the next leg took that diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldWalk.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldWalk.cpp index 7792a34821..fe4056935c 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldWalk.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldWalk.cpp @@ -425,7 +425,7 @@ void wait_out_dim_warp(ConsoleHandle& console, ProControllerContext& context, co } // namespace // A black screen that clears with the player where they were is no warp -// (console B, 2026-11-10 01:44, 00.31 run 4: "east 1 (warp)" was taken as +// (console B, 2026-11-10 01:44, 09.01 run 4: "east 1 (warp)" was taken as // walked while the player stayed on B4F). void wait_out_warp( ConsoleHandle& console, ProControllerContext& context, const RouteStep& step, @@ -505,7 +505,7 @@ void clear_open_message( // the watch after "south 15 (to wall)" ended on the box still empty, the // leg was taken as walked to its wall, and the next leg was walked into // the battle, 5 tiles short of where it was planned from (console B, -// 2026-11-03, row 00.13). +// 2026-11-03, row 04.05). namespace{ // What on screen shows a wild battle on its way: its text box, or the diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldWalk.h b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldWalk.h index 1a949b8851..e666f17472 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldWalk.h +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldWalk.h @@ -131,7 +131,7 @@ inline constexpr Milliseconds AFTER_WILD_LEG_WATCH(3500); // After a leg's watch saw nothing, but the screen shows a battle on its // way: how long to watch on for its HP boxes. In Mt. Moon they came over // 5s after the step that set the battle off, after the watch had ended on -// the battle's empty text box (console B, 2026-11-03, row 00.13). +// the battle's empty text box (console B, 2026-11-03, row 04.05). inline constexpr Milliseconds UNSEEN_BATTLE_WATCH(5000); // How long clear_open_message() watches for the message it saw. inline constexpr Milliseconds OPEN_MESSAGE_WATCH(1000); @@ -211,7 +211,7 @@ void clear_open_message( // the maps see no wild tiles (RouteStep::wild): they miss some. Mt. Moon // B2F's tiles closed on one side are cave floor too, and a battle on // "east 7 (to wall)" there left the screen black after the leg, which -// was taken as walked (console B, 2026-11-03, row 00.13). +// was taken as walked (console B, 2026-11-03, row 04.05). size_t clear_unseen_battle( ConsoleHandle& console, ProControllerContext& context, const OverworldInterrupts& wild, const RouteStep& step @@ -229,7 +229,7 @@ size_t clear_battle_before( // Whether `screen` is the overworld of a cave dark without Flash (Rock // Tunnel): black around a lit circle on the player in the middle. The // battle text box detector and the black screen check read its black as -// a battle on its way (console B, 2026-11-09, 00.28: the check before +// a battle on its way (console B, 2026-11-09, 08.01: the check before // each step ran a 15 s battle loop on it, "not a battle", and an open // leg's stop was placed by it 0 to 3 tiles in, where the battle came at // the leg's end). A battle's wipe is black in the middle too; its text @@ -253,7 +253,7 @@ std::optional read_facing(ConsoleHandle& console, ProControllerContex // old way, and a leg's hold then spends its first 8 frames turning // (pokefirered PlayerTurnInPlace(), a fast walk in place): a one-tile // hold only turns the player, with nothing to show it (console B, -// 2026-11-09, 00.28 run 2: the step north onto Rock Tunnel B1F row 34). +// 2026-11-09, 08.01 run 2: the step north onto Rock Tunnel B1F row 34). // A facing that can't be read is taken as turned: a tap while facing the // way already would take a step. void turn_to(ConsoleHandle& console, ProControllerContext& context, Direction direction); diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldWalk_Tests.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldWalk_Tests.cpp index a0f8605ca0..f7f4e445ef 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldWalk_Tests.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldWalk_Tests.cpp @@ -155,7 +155,7 @@ struct TurnTapCase{ const MapPosition TURN_START{"ViridianForest", {13, 28}}; const MapPosition TURN_END{"ViridianForest", {12, 28}}; -// Console B, 2026-11-09 (00.28 run 2): the game missed the turn tap before +// Console B, 2026-11-09 (08.01 run 2): the game missed the turn tap before // a one-tile open leg, the leg's hold only turned the player, and the leg // was taken as walked. On the sim, a leg west 1 for a player facing north. class Test_OverworldTurnTap : public UnitTest{ @@ -202,7 +202,7 @@ const TurnTapCase TURN_TAP_CASES[] = { {.input = {.name = "dropped, tapped again", .dropped_turn_taps = {1}}, .expectation = {.end = TURN_END}}, {.input = {.name = "dropped twice, tapped again", .dropped_turn_taps = {1, 2}}, .expectation = {.end = TURN_END}}, {.input = {.name = "dropped, not checked: the leg only turns", .dropped_turn_taps = {1}, .confirm_turn = false}, .expectation = {.end = TURN_START}}, - // Console B, 2026-11-09 (00.30): on the Bicycle the turn tap took a + // Console B, 2026-11-09 (08.03): on the Bicycle the turn tap took a // step, each one-tile leg went two, and the walk to Route 8 ended on // Route 12. {.input = {.name = "on the bike, no turn tap", .on_bike = true}, .expectation = {.end = TURN_END}}, diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldWarpFade_Tests.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldWarpFade_Tests.cpp index dbaa49462c..30f666859b 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldWarpFade_Tests.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldWarpFade_Tests.cpp @@ -57,7 +57,7 @@ const MapPosition MART{"ViridianCity_Mart", {4, 3}}; // Where the Mart's exit mat, (4, 7), puts the player. const MapPosition OUTSIDE{"ViridianCity", {36, 20}}; -// 00.27 (console B, 2026-11-09 01:41), the warp to CeruleanCity: "no fade +// 07.02 (console B, 2026-11-09 01:41), the warp to CeruleanCity: "no fade // in and out after walking onto the warp", the watch for the fade having // started about 1.3 s into the hold, after the fade was over. Here the // walk out of Viridian Mart, south 5 onto its mat, is held as to a wall, @@ -126,7 +126,7 @@ const WarpFadeCase WARP_FADE_CASES[] = { .expectation = {.failure = "the warp to ViridianCity not confirmed", .warps = 0}, }, { - // 00.31 run 4 (console B, 2026-11-10 01:44): taken as walked. + // 09.01 run 4 (console B, 2026-11-10 01:44): taken as walked. .input = {.name = "black without a warp, any black taken as the warp", .fade = 1000ms, .black_without_warp = {1}, .confirm_destination = false}, .expectation = {.failure = "", .warps = 0}, }, diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/Data/AuthoredStory_Tests.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/Data/AuthoredStory_Tests.cpp index dacd5dc049..f41f7980f6 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/Data/AuthoredStory_Tests.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/Data/AuthoredStory_Tests.cpp @@ -29,7 +29,7 @@ namespace PokemonFRLG{ namespace{ -// "[Event] 00.28/12 [b1f_east] winston_line: start" without its section, +// "[Event] 08.01/12 [b1f_east] winston_line: start" without its section, // as the table logged it before it had sections. std::string without_section(const std::string& line){ const size_t open = line.find(" [", 1); @@ -98,16 +98,16 @@ std::vector story_sim_trace(const std::vector& tab namespace{ -// 00.28's plan, changed by `mutate`, read as an authored plan. +// 08.01's plan, changed by `mutate`, read as an authored plan. StoryCheckpoint read_changed_rock_tunnel(void (*mutate)(JsonObject& root)){ JsonValue plan; for (const auto& [name, text] : autostory_checkpoint_json()){ - if (name == "frlg-00.28.plan"){ + if (name == "frlg-08.01.plan"){ plan = parse_json(text); } } mutate(plan.to_object_throw()); - return read_authored_checkpoint(plan, "frlg-00.28.plan (changed)"); + return read_authored_checkpoint(plan, "frlg-08.01.plan (changed)"); } JsonObject& first_event(JsonObject& root){ @@ -168,8 +168,8 @@ void unchanged(JsonObject&){} UnitTestResult test_rejects(){ // Unchanged, it reads: each rejection is the change's. - if (read_changed_rock_tunnel(unchanged).id != "00.28"){ - return "Expected the unchanged plan to read as 00.28."; + if (read_changed_rock_tunnel(unchanged).id != "08.01"){ + return "Expected the unchanged plan to read as 08.01."; } for (const RejectCase& test : REJECT_CASES){ try{ @@ -180,17 +180,17 @@ UnitTestResult test_rejects(){ return true; } -// 00.28 in its sections, numbered across them, each event's line naming +// 08.01 in its sections, numbered across them, each event's line naming // its section: Winston is event 12 (after from_save), on B1F's east side. UnitTestResult test_rock_tunnel_sections(){ const StoryCheckpoint* rock_tunnel = nullptr; for (const StoryCheckpoint& row : story_checkpoints()){ - if (row.id == "00.28"){ + if (row.id == "08.01"){ rock_tunnel = &row; } } if (rock_tunnel == nullptr){ - return "Expected a checkpoint 00.28."; + return "Expected a checkpoint 08.01."; } std::vector ids; for (const Pokemon::StorySection& section : rock_tunnel->sections){ @@ -200,13 +200,13 @@ UnitTestResult test_rock_tunnel_sections(){ "route10_to_mouth", "1f_north", "b1f_east", "1f_west", "b1f_west", "1f_south", "route10_south", }; if (ids != expected){ - return "Expected 00.28's sections by area, read " + std::to_string(ids.size()) + " others."; + return "Expected 08.01's sections by area, read " + std::to_string(ids.size()) + " others."; } StoryMapsSim game; Pokemon::Checkpoint checkpoint = Pokemon::build_story_checkpoint(*rock_tunnel, game); const Pokemon::Event& winston = checkpoint.events[11]; const std::string line = Pokemon::event_log_line(checkpoint.id, 12, winston.name, "start", winston.section); - if (line != "[Event] 00.28/12 [b1f_east] winston_line: start"){ + if (line != "[Event] 08.01/12 [b1f_east] winston_line: start"){ return "Expected Winston's line in b1f_east, read: " + line; } return true; @@ -249,7 +249,7 @@ const AuthoredTestCase AUTHORED_CASES[] = { {.input = {.name = "malformed plans are rejected", .body = test_rejects}, .expectation = {.description = "a ParseException for each change"}}, {.input = {.name = "Rock Tunnel's sections", .body = test_rock_tunnel_sections}, - .expectation = {.description = "00.28 split by area, sections in its log lines"}}, + .expectation = {.description = "08.01 split by area, sections in its log lines"}}, }; class AuthoredTest : public UnitTest{ diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/Data/Json_Tests.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/Data/Json_Tests.cpp index 47c937a9cd..33fe750344 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/Data/Json_Tests.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/Data/Json_Tests.cpp @@ -36,8 +36,8 @@ struct ExportCase{ }; const ExportCase CASES[] = { - {.input = {.id = "00.05"}, .expectation = {.events = {"below_mart_door", "mart_door", "parcel_from_clerk"}, .menu = "before_pokedex"}}, - {.input = {.id = "00.05", .custom = true}, .expectation = { + {.input = {.id = "02.01"}, .expectation = {.events = {"below_mart_door", "mart_door", "parcel_from_clerk"}, .menu = "before_pokedex"}}, + {.input = {.id = "02.01", .custom = true}, .expectation = { .events = {"below_mart_door", "mart_door", "parcel_from_clerk"}, .menu = "full", .native_json = R"({"menu":"full","supplies":{"potions":2,"antidotes":3,"parlyz_heals":4,"pocket":["antidote",""],"status":"PSN","hurt":true,"hp_red":true,"hp_fill":0.25,"lead":{"species":"wartortle","moves":[{"move":"bite","pp":0}],"moves_through_level":18,"moves_read":true,"level":19,"stats":{"hp":50,"attack":20,"defense":30,"sp_attack":40,"sp_defense":35,"speed":25}},"protected_slots":[0,2],"foes":["staryu"],"trainer":"misty","risk":"high","foe_out":0,"wild_foes":["pidgey"]}})" }}, @@ -120,8 +120,8 @@ class ExportTest : public UnitTest{ // Reading the Parcel capture built into the program (StoryData/ -// frlg-parcel-00.05.json, PokemonSimulation's data/story/native copy of -// the export tool's output): as written, it is row 00.05 and exports back +// frlg-parcel-02.01.json, PokemonSimulation's data/story/native copy of +// the export tool's output): as written, it is row 02.01 and exports back // to the same file; changed, it is refused rather than read with a guess. struct LoadInput{ std::string_view name; @@ -191,11 +191,11 @@ void unknown_execution_menu(JsonObject& root){ } const LoadCase LOAD_CASES[] = { - {.input = {.name = "authored Parcel plan", .authored = true}, .expectation = {.row = "00.05"}}, + {.input = {.name = "authored Parcel plan", .authored = true}, .expectation = {.row = "02.01"}}, {.input = {.name = "authored plan unknown field", .mutate = add_top_level_field, .authored = true}, .expectation = {.rejected = true}}, {.input = {.name = "authored plan unknown format", .mutate = change_format, .authored = true}, .expectation = {.rejected = true}}, {.input = {.name = "authored plan unknown menu", .mutate = unknown_execution_menu, .authored = true}, .expectation = {.rejected = true}}, - {.input = {.name = "the Parcel capture is row 00.05"}, .expectation = {.row = "00.05"}}, + {.input = {.name = "the Parcel capture is row 02.01"}, .expectation = {.row = "02.01"}}, {.input = {.name = "an unknown envelope field", .mutate = add_top_level_field}, .expectation = {.rejected = true}}, {.input = {.name = "another format", .mutate = change_format}, .expectation = {.rejected = true}}, {.input = {.name = "an unknown native field", .mutate = add_native_field}, .expectation = {.rejected = true}}, @@ -208,11 +208,11 @@ const LoadCase LOAD_CASES[] = { const std::string& parcel_text(const LoadInput& input){ for (const auto& [name, text] : autostory_checkpoint_json()){ - if (name == (input.authored ? "frlg-parcel-00.05.plan" : "frlg-parcel-00.05")){ + if (name == (input.authored ? "frlg-parcel-02.01.plan" : "frlg-parcel-02.01")){ return text; } } - throw InternalProgramError(nullptr, PA_CURRENT_FUNCTION, "StoryData/frlg-parcel-00.05.json is not built into the program."); + throw InternalProgramError(nullptr, PA_CURRENT_FUNCTION, "StoryData/frlg-parcel-02.01.json is not built into the program."); } const StoryCheckpoint* table_row(std::string_view id){ diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStory.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStory.cpp index a7b676ef5e..f912145450 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStory.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStory.cpp @@ -55,8 +55,8 @@ std::unique_ptr AutoStory_Descriptor::make_stats() const{ namespace{ -// The start and end dropdowns' entries: the table's checkpoints, 00.01 to -// 00.12b. The options hold a reference to it. +// The start and end dropdowns' entries: the table's checkpoints, 01.01 to +// 04.03. The options hold a reference to it. const StringSelectDatabase& checkpoint_database(){ static const StringSelectDatabase database = Pokemon::story_checkpoint_database(story_checkpoints()); return database; @@ -72,37 +72,37 @@ const char* const KEEP_START_FRAME_TEXT = const char* const RUN_STARTER_RNG_TEXT = "Run Starter RNG in AutoStory:
Off by default. Instead of stopping for them, run SID Helper's steps on the " "new game's keyboard when the RNG plan has no SID, and Starter RNG's attempts from a save south of the table at the " - "end of 00.04, as the RNG plan lists them. A shiny Squirtle goes on to the rival's battle, saves after it and the run " + "end of 01.05, as the RNG plan lists them. A shiny Squirtle goes on to the rival's battle, saves after it and the run " "goes on; otherwise the run stops with the save south of the table.
" "SID Helper's timing needs the text speed and button settings already saved, as with Stop for SID Helper."; const char* const RUN_GIFT_RNG_TEXT = - "Run Gift RNG in AutoStory:
Off by default. After 00.12 saves beside the Magikarp salesman in Route 4's " + "Run Gift RNG in AutoStory:
Off by default. After 04.02 saves beside the Magikarp salesman in Route 4's " "Pokemon Center, run Gift RNG's attempts for the Magikarp from that save, as the RNG plan lists them for its TID and " - "SID (set by Run Starter RNG in AutoStory, or typed in). A shiny Magikarp is saved there (00.12b) and the run goes " + "SID (set by Run Starter RNG in AutoStory, or typed in). A shiny Magikarp is saved there (04.03) and the run goes " "on; otherwise the run stops with the save beside the salesman.
" - "To try again from that save, start at 00.12b with this on: it loads the save and runs the attempts first. " - "After Gift RNG run by hand, start at 00.12b with this off.
" + "To try again from that save, start at 04.03 with this on: it loads the save and runs the attempts first. " + "After Gift RNG run by hand, start at 04.03 with this off.
" "English only. The Magikarp costs 500 and needs a free party slot; AutoStory's options leave the text fast."; AutoStory::AutoStory() : RUN(checkpoint_database()) , NEW_GAME_FROM_TITLE( "New game from the title screen:
The game is on its title screen with no save data. " - "Needed to start at 00.01. Otherwise the program loads the save, which must be the one the start checkpoint begins from.", + "Needed to start at 01.01. Otherwise the program loads the save, which must be the one the start checkpoint begins from.", LockMode::LOCK_WHILE_RUNNING, true ) , PLAYER_NAME( false, - "Player name:
Typed on the new game's keyboard (00.01). Empty keeps the game's default name. " + "Player name:
Typed on the new game's keyboard (01.01). Empty keeps the game's default name. " "The rival always keeps the default name.", LockMode::LOCK_WHILE_RUNNING, "Kosmos", "" ) , STOP_FOR_SID_HELPER( - "Stop for SID Helper:
Off by default. At 00.01, stop on the player's keyboard with the name typed and OK not pressed, " - "where the SID Helper program starts. After SID Helper, start AutoStory at 00.01b, with the game as SID Helper left it " + "Stop for SID Helper:
Off by default. At 01.01, stop on the player's keyboard with the name typed and OK not pressed, " + "where the SID Helper program starts. After SID Helper, start AutoStory at 01.02, with the game as SID Helper left it " "(the Trainer Card, or HOME): it closes the card, sets the options and saves in the bedroom.
" "SID Helper needs the text speed and button settings already saved. On a cartridge with that save, choose NEW GAME " "by hand and start AutoStory on the first message.", @@ -110,10 +110,10 @@ AutoStory::AutoStory() false ) , STOP_FOR_STARTER_RNG( - "Stop for Starter RNG:
Off by default. At the end of 00.04, save south of the table facing Squirtle's ball " + "Stop for Starter RNG:
Off by default. At the end of 01.05, save south of the table facing Squirtle's ball " "and stop, where the Starter RNG program starts. After Starter RNG, save right after the rival's battle without moving " - "and start AutoStory at 00.05, listing the targets to try from the RNG plan.
" - "With this off, 00.04 and 00.04b run as one checkpoint, as before.", + "and start AutoStory at 02.01, listing the targets to try from the RNG plan.
" + "With this off, 01.05 and 01.06 run as one checkpoint, as before.", LockMode::LOCK_WHILE_RUNNING, false ) @@ -139,7 +139,7 @@ AutoStory::AutoStory() // The save loaded must be the one checkpoint `first` starts from: one left // by an earlier checkpoint (a run that failed before saving) would start -// it in the wrong place (console B, 2026-11-01: 00.09 on the forest's +// it in the wrong place (console B, 2026-11-01: 03.02 on the forest's // save). Checked on the SAVE card; a card that can't be read is let pass. static void check_start_save( SingleSwitchProgramEnvironment& env, StoryEnv& story, const StoryCheckpoint& checkpoint @@ -189,7 +189,7 @@ Pokemon::SegmentHooks story_hooks(SingleSwitchProgramEnvironment& env, StoryEnv& } // The save reloaded must be where the checkpoint starts: a save // that didn't happen leaves an older one (console B, 2026-11-02: - // 00.02 walked the bedroom's route in Pewter City). + // 01.03 walked the bedroom's route in Pewter City). try{ soft_reset(story.console, story.context); const std::string error = check_save_place(story, story.start_map); @@ -282,7 +282,7 @@ static void check_setup( throw UserSetupError(console, "The start checkpoint must not come after the end checkpoint."); } if (first == 0 && !new_game_from_title){ - throw UserSetupError(console, "Checkpoint 00.01 starts a new game: start on the title screen with no save."); + throw UserSetupError(console, "Checkpoint 01.01 starts a new game: start on the title screen with no save."); } if (first == 0){ check_player_name(console, player_name); @@ -351,7 +351,7 @@ static void stop_for_sid_helper( play_new_game_to_player_name(env.console, context, player_name); stop_for_handoff(env, notification, "Stopped for SID Helper: the player's name is typed and OK is not pressed. Run SID Helper now, " - "enter its Target Advances and # Candidate SIDs in the RNG plan, then start AutoStory at 00.01b." + "enter its Target Advances and # Candidate SIDs in the RNG plan, then start AutoStory at 01.02." ); } @@ -424,7 +424,7 @@ static void stop_for_starter_rng( "Run Starter RNG (Squirtle, FireRed, Sound " + sound + ") with attempt 1's Target Seed and Advances. " "If it hits the target and it isn't shiny, load this save and run the next attempt. If it is shiny, " "its SID is the one listed (or one of them): enter it as the RNG plan's SID. " - "Then save right after the rival's battle, without moving, and start AutoStory at 00.05.", + "Then save right after the rival's battle, without moving, and start AutoStory at 02.01.", attempts ); } @@ -462,7 +462,7 @@ static void run_story_rows( // SID Helper's steps in the program, from the player's keyboard: the name // typed, then the intro at SID Helper's timing into the bedroom, and the -// Trainer Card opened to read the TID. Ends on the card, where 00.01b +// Trainer Card opened to read the TID. Ends on the card, where 01.02 // starts. static void set_sid_in_program( SingleSwitchProgramEnvironment& env, ProControllerContext& context, @@ -481,7 +481,7 @@ static void set_sid_in_program( navigate_to_trainer_card(env.console, context); const std::optional tid = try_read_trainer_card_tid(env.console, context, language); if (!tid){ - env.console.log("Couldn't read the TID on the Trainer Card; 00.04 reads it again.", COLOR_ORANGE); + env.console.log("Couldn't read the TID on the Trainer Card; 01.05 reads it again.", COLOR_ORANGE); return; } env.console.log(rng_log_tid(*tid, true)); @@ -583,7 +583,7 @@ static bool run_gift_rng_in_program( } // After a shiny Squirtle: off its summary, and the rows to run next: the -// rival's battle, which saves (00.04b), and the rows after it to `last`. +// rival's battle, which saves (01.06), and the rows after it to `last`. // Until that save, a reload would load the save under the ball and lose // the shiny, so a failure stops the run instead. static StoryRunPlan after_shiny_starter( @@ -600,7 +600,7 @@ static StoryRunPlan after_shiny_starter( return plan; } -// After a shiny Magikarp: the rows to run next, from 00.12b, which leaves +// After a shiny Magikarp: the rows to run next, from 04.03, which leaves // its summary and saves, to `last`. Until that save, a failure stops the // run, as after a shiny Squirtle. static StoryRunPlan after_shiny_magikarp( @@ -628,8 +628,8 @@ static void send_story_finished( } StoryHandoffs AutoStory::story_handoffs() const{ - // Running Starter RNG here splits 00.04 at the ball as its stop does, - // and sets the SID at 00.01 when it isn't known. + // Running Starter RNG here splits 01.05 at the ball as its stop does, + // and sets the SID at 01.01 when it isn't known. return StoryHandoffs{ .sid_helper = RUN_STARTER_RNG ? static_cast(RNG_PLAN.SID).empty() : bool(STOP_FOR_SID_HELPER), .starter_rng = STOP_FOR_STARTER_RNG || RUN_STARTER_RNG, @@ -660,7 +660,7 @@ void AutoStory::program(SingleSwitchProgramEnvironment& env, ProControllerContex } if (plan.stop == StoryHandoff::SID_HELPER){ set_sid_in_program(env, context, player_name, RNG_PLAN, RUN.language()); - first = checkpoint_index(checkpoints, "00.01b"); + first = checkpoint_index(checkpoints, "01.02"); plan = plan_story_run(checkpoints, first, last, handoffs); } StoryEnv story = story_env(env, context, checkpoints[first], RUN.checks(), KEEP_START_FRAME); diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStory.h b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStory.h index 03849904cc..b21f9ed433 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStory.h +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStory.h @@ -58,21 +58,21 @@ class AutoStory : public SingleSwitchProgramInstance{ SingleSwitchProgramEnvironment& env, ProControllerContext& context, StoryEnv& story, StoryExecutor& executor, StoryRunPlan plan ); - // After 00.04 saved under Squirtle's ball (row `ball_row`): the stop + // After 01.05 saved under Squirtle's ball (row `ball_row`): the stop // for Starter RNG, or its attempts run here. Returns the rows to run // after a shiny, or nothing once the run has stopped. std::optional after_starter_ball( SingleSwitchProgramEnvironment& env, ProControllerContext& context, StoryEnv& story, const StarterRngPlanned& planned, size_t ball_row ); - // Started at 00.12b (row `first`) with Run Gift RNG in AutoStory on, + // Started at 04.03 (row `first`) with Run Gift RNG in AutoStory on, // the save beside the salesman loaded: Gift RNG's attempts, then for a // shiny the rows after them. As run_story_plan() returns. std::optional run_from_gift_rng_save( SingleSwitchProgramEnvironment& env, ProControllerContext& context, StoryEnv& story, StoryExecutor& executor, size_t first ); - // After 00.12 saved beside the Magikarp salesman (row `salesman_row`): + // After 04.02 saved beside the Magikarp salesman (row `salesman_row`): // Gift RNG's attempts run here. Returns the rows to run after a shiny, // or nothing once the run has stopped. std::optional after_magikarp_salesman( @@ -91,7 +91,7 @@ class AutoStory : public SingleSwitchProgramInstance{ // Runs SID Helper's steps and Starter RNG's attempts in the program // instead of stopping for them. BooleanCheckBoxOption RUN_STARTER_RNG; - // Runs Gift RNG's attempts for the Magikarp in the program after 00.12. + // Runs Gift RNG's attempts for the Magikarp in the program after 04.02. BooleanCheckBoxOption RUN_GIFT_RNG; StarterRngPlanOptions RNG_PLAN; EventNotificationOption NOTIFICATION_SHINY; diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryActions.h b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryActions.h index 07e37e35c9..e78bf1b792 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryActions.h +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryActions.h @@ -155,7 +155,7 @@ inline constexpr Milliseconds BATTLE_EXIT_TIMEOUT(10000); // nothing (wait_for_quiet_overworld()) for MovementMechanics:: // AFTER_BATTLE_QUIET, at most BATTLE_EXIT_TIMEOUT, and logs how the screen // ended. A tap sent as the battle's black ends is lost (console B, -// 2026-11-09, 00.28 winston_line). +// 2026-11-09, 08.01 winston_line). void wait_out_battle_exit(ConsoleHandle& console, ProControllerContext& context); // How long a step into the line of a trainer who looks around waits for diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryBattleData.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryBattleData.cpp index a70c1da706..4f1b034a19 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryBattleData.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryBattleData.cpp @@ -87,7 +87,7 @@ constexpr StoryTrainer STORY_TRAINERS[] = { {.map = "RockTunnel_B1F", .battle = "pokemaniac_cooper", .trainer = "TRAINER_POKEMANIAC_COOPER"}, {.map = "RockTunnel_1F", .battle = "picnicker_dana", .trainer = "TRAINER_PICNICKER_DANA"}, {.map = "Route8", .battle = "gamer_rich", .trainer = "TRAINER_GAMER_RICH"}, - // The Rocket Hideout, as PokeGuy's run fights it (the 00.31 and 00.32 + // The Rocket Hideout, as PokeGuy's run fights it (the 09.01 and 09.02 // drafts): the Grunt at the Game Corner's poster (11, 2) // (CeladonCity_GameCorner_EventScript_RocketGrunt); on B4F, Grunt1 at // (4, 2), who drops the LIFT KEY, the door guards Grunt2 (16, 14) and diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryBattleData_Tests.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryBattleData_Tests.cpp index 4b4a442605..37ebca198a 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryBattleData_Tests.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryBattleData_Tests.cpp @@ -141,7 +141,7 @@ UnitTestResult test_story_trainers(){ } // The Rocket Hideout's battles, which no table row fights yet (the -// 00.31 and 00.32 drafts): each names its map's trainer, with pret's +// 09.01 and 09.02 drafts): each names its map's trainer, with pret's // party. UnitTestResult test_hideout_trainers(){ struct Expected{ diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryBattleDecisions.h b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryBattleDecisions.h index 6d63a5ecf6..525b383118 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryBattleDecisions.h +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryBattleDecisions.h @@ -210,7 +210,7 @@ class EvolutionHold{ // safely!"), the text box with no HP box and no arrow or YES/NO, as // "What? is evolving!" shows through the animation; not a // dark cave's overworld, whose black reads as the text box (console B, - // 2026-11-09, 00.28 hiker_lenny: three holds, then a stop). Nothing + // 2026-11-09, 08.01 hiker_lenny: three holds, then a stop). Nothing // is pressed while it shows, for at most EVOLUTION_HOLDS in all in a // battle, in case it is something else. bool holds(const BattleTextScreen& screen) const; diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryBattleSim_Tests.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryBattleSim_Tests.cpp index 9a640ebaaf..d3d008542e 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryBattleSim_Tests.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryBattleSim_Tests.cpp @@ -289,7 +289,7 @@ UnitTestResult test_risks(){ // The Cerulean rival (Pidgeotto, Abra, Rattata, then a Bulbasaur with // Sleep Powder, Poison Powder and Leech Seed): the Lv22 Wartortle with 5 -// Potions that 00.15's GRIND plans for wins about a quarter of the sim's +// Potions that 05.03's GRIND plans for wins about a quarter of the sim's // battles, and is refused with the reason; at Lv30 it wins over 90%. UnitTestResult test_rival_win_chance(){ const std::optional planned = story_win_chance(grown_to(new_member("squirtle", 5), 22), SimItems{.potions = 5}, 1.0, RIVAL); @@ -469,7 +469,7 @@ UnitTestResult test_rival_real_moves(){ } -// Console B, 2026-11-03 (m56, 00.15b, run 2): the Wartortle Lv22, 65 HP, +// Console B, 2026-11-03 (m56, 05.04, run 2): the Wartortle Lv22, 65 HP, // Bite, Water Pulse, Bubble and Withdraw. PartyMember m56_lead(){ Stats stats = combatant("wartortle", 22, OWN_GENES)->stats; @@ -660,7 +660,7 @@ UnitTestResult test_rival_potions_raise_chance(){ -// 00.22's lead: Wartortle Lv27 at 78 HP, its other stats at OWN_GENES. +// 06.01's lead: Wartortle Lv27 at 78 HP, its other stats at OWN_GENES. PartyMember ss_anne_lead(){ Stats stats = combatant("wartortle", 27, OWN_GENES)->stats; stats.hp = 78; diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryCeladon_Tests.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryCeladon_Tests.cpp index f1f8f71bf6..9edc3a61a2 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryCeladon_Tests.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryCeladon_Tests.cpp @@ -2,12 +2,12 @@ * * From: https://github.com/PokemonAutomation/ * - * Rows from 00.26 on (PokemonFRLG_AutoStoryTableCeladon.cpp) on the - * overworld sim: 00.26 from where 00.25 ends, to the Fan Club's chairman, + * Rows from 07.01 on (PokemonFRLG_AutoStoryTableCeladon.cpp) on the + * overworld sim: 07.01 from where 06.04 ends, to the Fan Club's chairman, * north past Route 6's trainers, through the tree into Cerulean, to the * Bike Shop's clerk, the Mart and the nurse, with Oak's aide on - * Vermilion's (25, 7); and what its Mart step buys. 00.27 from where - * 00.26 ends, east over Route 9 to Route 10's Pokemon Center. + * Vermilion's (25, 7); and what its Mart step buys. 07.02 from where + * 07.01 ends, east over Route 9 to Route 10's Pokemon Center. * */ @@ -90,9 +90,9 @@ MapData& map_named(std::vector& maps, const std::string& name){ throw InternalProgramError(nullptr, PA_CURRENT_FUNCTION, "No map " + name + "."); } -// The maps as 00.25 leaves them: story_maps() with Oak's aide on +// The maps as 06.04 leaves them: story_maps() with Oak's aide on // Vermilion's (25, 7), shown by Lt. Surge's win, and Route 6's Jeff -// beaten (00.21). Isabelle and Elijah are not. +// beaten (05.10). Isabelle and Elijah are not. std::vector maps_after_surge(){ const std::vector all = overworld_maps(); std::set flags = map_flag_set(all, "after_hall_of_fame"); @@ -147,23 +147,23 @@ UnitTestResult starts_where_ends(const std::string& previous, const std::string& return true; } -// 00.26 starts at Vermilion's nurse, where 00.25 ends. +// 07.01 starts at Vermilion's nurse, where 06.04 ends. UnitTestResult test_starts_where_lt_surge_ends(){ - return starts_where_ends("00.25", "00.26"); + return starts_where_ends("06.04", "07.01"); } -// 00.27 starts at Cerulean's nurse, where 00.26 ends. +// 07.02 starts at Cerulean's nurse, where 07.01 ends. UnitTestResult test_starts_where_bicycle_ends(){ - return starts_where_ends("00.26", "00.27"); + return starts_where_ends("07.01", "07.02"); } -// 00.26 on the sim from Vermilion's nurse to Cerulean's, the maps as -// 00.25 leaves them: no trainer meets the player (Isabelle and Elijah +// 07.01 on the sim from Vermilion's nurse to Cerulean's, the maps as +// 06.04 leaves them: no trainer meets the player (Isabelle and Elijah // stay unfought), no violation, each talk faces the one it's for (the // chairman beside the player, the Bike Shop's clerk across the counter), // and the walk ends at Cerulean's nurse. UnitTestResult test_bike_voucher_row(){ - const StoryCheckpoint& row = checkpoint("00.26"); + const StoryCheckpoint& row = checkpoint("07.01"); const std::vector maps = maps_after_surge(); const MapData& city = *std::find_if(maps.begin(), maps.end(), [](const MapData& map){ return map.name == StoryTable::VERMILION; }); if (object_at(city, {25, 7}) == nullptr){ @@ -178,7 +178,7 @@ UnitTestResult test_bike_voucher_row(){ const bool counter = here.map == StoryTable::BIKE_SHOP; const MapObject* person = object_ahead(maps, here, counter ? 2 : 1); if (person == nullptr || (counter && object_ahead(maps, here, 1) != nullptr)){ - return std::format("00.26/{}: no one to talk to from {}.", step.name, to_string(sim.state().position)); + return std::format("07.01/{}: no one to talk to from {}.", step.name, to_string(sim.state().position)); } talked_to.push_back(person->name); } @@ -188,39 +188,39 @@ UnitTestResult test_bike_voucher_row(){ // A walk the sim's player didn't finish, stopped by someone the // maps the program plans on don't have. if (!(sim.state().position == MapPosition{at.map, at.tile})){ - return std::format("00.26/{}: expected {}, on {}.", step.name, to_string(MapPosition{at.map, at.tile}), to_string(sim.state().position)); + return std::format("07.01/{}: expected {}, on {}.", step.name, to_string(MapPosition{at.map, at.tile}), to_string(sim.state().position)); } } if (talked_to != std::vector{"gentleman", "man"}){ - return "00.26: expected to talk to the chairman, then the Bike Shop's clerk."; + return "07.01: expected to talk to the chairman, then the Bike Shop's clerk."; } if (!sim.state().trainers_beaten.empty() || !sim.state().violations.empty()){ - return "00.26: a battle or a violation on the way" + (sim.state().violations.empty() ? std::string(".") : ": " + sim.state().violations.back()); + return "07.01: a battle or a violation on the way" + (sim.state().violations.empty() ? std::string(".") : ": " + sim.state().violations.back()); } const MapPosition nurse{StoryTable::CERULEAN_CENTER, {7, 4}}; if (!(sim.state().position == nurse)){ - return "00.26: ended on " + to_string(sim.state().position) + ", not Cerulean's nurse."; + return "07.01: ended on " + to_string(sim.state().position) + ", not Cerulean's nurse."; } return true; } -// 00.26's Mart step, at its money floor: 5 Repels and 2 Escape Ropes, +// 07.01's Mart step, at its money floor: 5 Repels and 2 Escape Ropes, // and 3000 or more left. UnitTestResult test_repels_and_escape_ropes(){ - const StoryCheckpoint& row = checkpoint("00.26"); + const StoryCheckpoint& row = checkpoint("07.01"); const auto step = std::find_if(row.steps.begin(), row.steps.end(), [](const StoryStep& data){ return parse_mart_step(data).has_value(); }); if (step == row.steps.end()){ - return "00.26: expected a Mart step."; + return "07.01: expected a Mart step."; } const MartPlan plan = *parse_mart_step(*step); if (plan.map != StoryTable::CERULEAN_MART || !plan.money_floor){ - return "00.26: expected the Mart step at Cerulean's Mart, with a money floor."; + return "07.01: expected the Mart step at Cerulean's Mart, with a money floor."; } const std::optional> buys = plan_mart_buys(mart_stock(plan.map), plan, *plan.money_floor); if (!buys){ - return "00.26: the Mart step names an item Cerulean's Mart doesn't sell."; + return "07.01: the Mart step names an item Cerulean's Mart doesn't sell."; } size_t repels = 0; size_t escape_ropes = 0; @@ -231,18 +231,18 @@ UnitTestResult test_repels_and_escape_ropes(){ spent += buy.cost; } if (repels < 5 || escape_ropes != 2 || *plan.money_floor < spent + 3000){ - return std::format("00.26: bought {} Repels and {} Escape Ropes for {} from {}.", repels, escape_ropes, spent, *plan.money_floor); + return std::format("07.01: bought {} Repels and {} Escape Ropes for {} from {}.", repels, escape_ropes, spent, *plan.money_floor); } return true; } -// 00.27 on the sim from Cerulean's nurse to Route 10's, the maps as 00.26 +// 07.02 on the sim from Cerulean's nurse to Route 10's, the maps as 07.01 // leaves them, both trees grown back: the trees cut, Alicia, Jeremy and // Conner fought where the table steps into their lines and no one else // met (Brice, Caitlin and the rest unfought), no violation, each step // ending where the table says, and the walk ending at Route 10's nurse. UnitTestResult test_route10_row(){ - const StoryCheckpoint& row = checkpoint("00.27"); + const StoryCheckpoint& row = checkpoint("07.02"); const std::vector maps = maps_after_surge(); StoryPose at = *story_pose(*row.start); OverworldSim sim(maps, MapPosition{at.map, at.tile}, *at.facing); @@ -253,23 +253,23 @@ UnitTestResult test_route10_row(){ // A step into a trainer's line ends where the battle after it says. const bool into_line = step.kind == StoryStepKind::STEP && !step.variant.empty(); if (!into_line && !(sim.state().position == MapPosition{at.map, at.tile})){ - return std::format("00.27/{}: expected {}, on {}.", step.name, to_string(MapPosition{at.map, at.tile}), to_string(sim.state().position)); + return std::format("07.02/{}: expected {}, on {}.", step.name, to_string(MapPosition{at.map, at.tile}), to_string(sim.state().position)); } } if (sim.state().trainers_beaten != std::vector{"picnicker", "hiker", "bug_catcher"}){ - return "00.27: expected to fight Alicia, Jeremy and Conner, no one else; fought " + std::to_string(sim.state().trainers_beaten.size()) + "."; + return "07.02: expected to fight Alicia, Jeremy and Conner, no one else; fought " + std::to_string(sim.state().trainers_beaten.size()) + "."; } if (!sim.state().violations.empty()){ - return "00.27: a violation on the way: " + sim.state().violations.back(); + return "07.02: a violation on the way: " + sim.state().violations.back(); } const MapPosition nurse{StoryTable::ROUTE10_CENTER, {7, 4}}; if (!(sim.state().position == nurse)){ - return "00.27: ended on " + to_string(sim.state().position) + ", not Route 10's nurse."; + return "07.02: ended on " + to_string(sim.state().position) + ", not Route 10's nurse."; } return true; } -// The next row starts from 00.27's save in Route 10's Center, whose save +// The next row starts from 07.02's save in Route 10's Center, whose save // card says ROUTE 10: a place of its own, not Route 1's. UnitTestResult test_route10_save_place(){ if (save_card_place(StoryTable::ROUTE10_CENTER) != "route-10" || save_card_place("Route1") == "route-10"){ @@ -278,7 +278,7 @@ UnitTestResult test_route10_save_place(){ return true; } -// 00.27's walk from Route 9 (70, 8) to Route 10's nurse: its steps from +// 07.02's walk from Route 9 (70, 8) to Route 10's nurse: its steps from // route10_ledge_end to route10_nurse. Console B, 2026-11-09, the walk // then planned in one ended its open legs a tile from a blocker, and both // runs ended "no fade in and out" at the Center's door (13, 20): @@ -289,14 +289,14 @@ UnitTestResult test_route10_save_place(){ // - run 2: the leg down column 16 ended a tile short, on (16, 20), west // 3 met the Center's east wall (15, 20) and north 1 ended on (16, 19). std::vector route10_walk(){ - const StoryCheckpoint& row = checkpoint("00.27"); + const StoryCheckpoint& row = checkpoint("07.02"); const auto named = [&row](std::string_view name){ return std::find_if(row.steps.begin(), row.steps.end(), [&](const StoryStep& data){ return data.name == name; }); }; const auto first = named("route10_ledge_end"); const auto last = named("route10_nurse"); if (first == row.steps.end() || last == row.steps.end() || last < first){ - throw InternalProgramError(nullptr, PA_CURRENT_FUNCTION, "00.27: no steps route10_ledge_end to route10_nurse."); + throw InternalProgramError(nullptr, PA_CURRENT_FUNCTION, "07.02: no steps route10_ledge_end to route10_nurse."); } return std::vector(first, last + 1); } @@ -308,7 +308,7 @@ const StoryPose ROUTE10_WALK_START{StoryTable::ROUTE9, {70, 8}, Direction::EAST} std::string route10_walk_rest(OverworldSim& sim, StoryPose at, const std::vector& steps, size_t first){ std::string failure; for (size_t c = first; c < steps.size() && failure.empty(); c++){ - failure = row_step_on_sim(sim, at, steps[c], "00.27"); + failure = row_step_on_sim(sim, at, steps[c], "07.02"); } const MapPosition nurse{StoryTable::ROUTE10_CENTER, {7, 4}}; if (!failure.empty() || !(sim.state().position == nurse)){ @@ -393,39 +393,39 @@ UnitTestResult test_route10_tile_off_after_open_legs(){ const AutoStoryCeladonCase AUTO_STORY_CELADON_CASES[] = { { - .input = {"00.26 starts where 00.25 ends", test_starts_where_lt_surge_ends}, + .input = {"07.01 starts where 06.04 ends", test_starts_where_lt_surge_ends}, .expectation = {}, }, { - .input = {"00.26 the Fan Club, Route 6 and the Underground Path north, the Bike Shop, past Oak's aide", test_bike_voucher_row}, + .input = {"07.01 the Fan Club, Route 6 and the Underground Path north, the Bike Shop, past Oak's aide", test_bike_voucher_row}, .expectation = {}, }, { - .input = {"00.26 Repels and Escape Ropes, 3000 left", test_repels_and_escape_ropes}, + .input = {"07.01 Repels and Escape Ropes, 3000 left", test_repels_and_escape_ropes}, .expectation = {}, }, { - .input = {"00.27 starts where 00.26 ends", test_starts_where_bicycle_ends}, + .input = {"07.02 starts where 07.01 ends", test_starts_where_bicycle_ends}, .expectation = {}, }, { - .input = {"00.27 the two trees, Route 9's Alicia, Jeremy and Conner, to Route 10's Pokemon Center", test_route10_row}, + .input = {"07.02 the two trees, Route 9's Alicia, Jeremy and Conner, to Route 10's Pokemon Center", test_route10_row}, .expectation = {}, }, { - .input = {"00.27 saves in Route 10's Pokemon Center, ROUTE 10 on the save card", test_route10_save_place}, + .input = {"07.02 saves in Route 10's Pokemon Center, ROUTE 10 on the save card", test_route10_save_place}, .expectation = {}, }, { - .input = {"00.27 route10_nurse: the crossing onto Route 10 not held up", test_route10_crossing_not_held_up}, + .input = {"07.02 route10_nurse: the crossing onto Route 10 not held up", test_route10_crossing_not_held_up}, .expectation = {}, }, { - .input = {"00.27 route10_nurse: the leg down column 16 a tile short", test_route10_column_16_short}, + .input = {"07.02 route10_nurse: the leg down column 16 a tile short", test_route10_column_16_short}, .expectation = {}, }, { - .input = {"00.27 route10_nurse: a tile off after each open leg", test_route10_tile_off_after_open_legs}, + .input = {"07.02 route10_nurse: a tile off after each open leg", test_route10_tile_off_after_open_legs}, .expectation = {}, }, }; diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryChoice_Tests.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryChoice_Tests.cpp index c144af3703..066e23d891 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryChoice_Tests.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryChoice_Tests.cpp @@ -134,7 +134,7 @@ std::vector choice_cases(){ }, // The console has no reader for the prompt's text: the table has // walked the player to face the wanted fossil, so YES takes it - // (console B: answering NO and stopping left 00.13 stuck there). + // (console B: answering NO and stopping left 04.05 stuck there). { .name = "an unread prompt: YES, facing the wanted fossil", .setup = [](FakeFossilRoom& room){ room.offer_readable = false; }, diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryEvents.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryEvents.cpp index 2599df01cf..d7e8add733 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryEvents.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryEvents.cpp @@ -369,7 +369,7 @@ const std::vector& story_maps(){ std::set flags = map_flag_set(all, "after_hall_of_fame"); flags.merge(map_flag_set(all, "new_game")); // The one ball the story picks up in its way: B2F's MOON STONE - // blocks column 2 of the arrow floor (00.32's moon_stone). + // blocks column 2 of the arrow floor (09.02's moon_stone). flags.insert("FLAG_HIDE_ROCKET_HIDEOUT_B2F_MOON_STONE"); return overworld_maps(flags); }(); @@ -501,7 +501,7 @@ std::optional wall_beside(const MapData& map, const TilePos& tile){ namespace{ // A talk to a person or an item ball opens a message; an A that opens -// none faced nothing (00.31 b3f_rare_candy, console B, 2026-11-10: one A, +// none faced nothing (09.01 b3f_rare_candy, console B, 2026-11-10: one A, // "done", on the wrong floor). The message is left open for the next step. bool talk_opens_message(ConsoleHandle& console, ProControllerContext& context){ WhiteDialogWatcher opened(COLOR_RED); diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryEvents.h b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryEvents.h index 74631b27cf..17d08f3bb4 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryEvents.h +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryEvents.h @@ -61,7 +61,7 @@ struct StoryPose{ }; // The variant of a ROUTE or LEGS step that runs, with B held: the player -// has the Running Shoes (00.10 on). +// has the Running Shoes (03.03 on). inline const std::string RUN_VARIANT = "run"; // The variant of a STEP into a trainer's line: a tile at a time, at most @@ -151,14 +151,14 @@ struct StoryRunPlan{ // plays the new game to the player's keyboard and stops there. // STARTER_RNG: the run stops after `rows`, the last of which saves at // the starter's ball. GIFT_RNG: likewise, beside the Magikarp salesman; - // with `rows` empty, the run started at 00.12b and takes Gift RNG from + // with `rows` empty, the run started at 04.03 and takes Gift RNG from // the save beside the salesman, where the row before `first` ends. StoryHandoff stop = StoryHandoff::NONE; }; // The rows of `checkpoints` from `first` to `last`, both inclusive, as a // run with `handoffs` takes them: live-start rows only when the run -// starts there (00.12b with Gift RNG's handoff on starts at the handoff +// starts there (04.03 with Gift RNG's handoff on starts at the handoff // instead), a run that reaches a handoff that is on stops for it, and // a STARTER_RNG row whose handoff is off is joined with the row after it, // under its own id. diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryFaultSweep_Tests.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryFaultSweep_Tests.cpp index 288a6c4fb7..16c050c69a 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryFaultSweep_Tests.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryFaultSweep_Tests.cpp @@ -8,18 +8,18 @@ * - SCENE_END_POSE: a step the sim does not play (a scene, a talk, an * event) that moved the player leaves them on another walkable tile * within one of the table's pose, while the program goes on from the - * table's (BDSP 00.03, lab-B 2026-11-09). + * table's (BDSP 01.04, lab-B 2026-11-09). * - WILD_BATTLES: wild battles at the game's own odds on every map with - * land encounters, over GAME_ODDS_SEEDS seeds (00.28's Rock Tunnel). + * land encounters, over GAME_ODDS_SEEDS seeds (08.01's Rock Tunnel). * - LATE_FADE: every warp's fade ends LATE_FADE later than the sim's - * usual (00.27's warp to Cerulean City). + * usual (07.02's warp to Cerulean City). * - DARK_CAVE: the caves without Flash dark (DARK_MAPS), so each * battle there ends on the dark cave's overworld, with no wild - * battles and with them at the game's odds (00.28 hiker_lenny, lab-B + * battles and with them at the game's odds (08.01 hiker_lenny, lab-B * 2026-11-09). * - LOST_TAP: a wild battle on each tile of each step into a trainer's * line before its last, so the next tap comes as the overworld comes - * back, inside the lockout after a battle (00.28 winston_line, console + * back, inside the lockout after a battle (08.01 winston_line, console * B, 2026-11-09 15:50). The step alone, from where the clean run took * it, on its map made a wild floor. * @@ -89,7 +89,7 @@ const char* fault_class_name(FaultClass fault){ // Sweeps the program fails today, by test name, with the likely fix. const std::map KNOWN_FAILING{ - {"PokemonFRLG::AutoStory - Fault sweep: 00.06, wild battles at the game's odds", + {"PokemonFRLG::AutoStory - Fault sweep: 02.02, wild battles at the game's odds", "below_oak on Route 1 gives up after 9 stops part-way (seeds 16, 30): count stops that make no progress, not every battle"}, }; diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryGrind.h b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryGrind.h index 8c02694d9b..ced1ae1ee1 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryGrind.h +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryGrind.h @@ -182,7 +182,7 @@ GrindResult run_grind(Logger& logger, GrindActions& actions, const MemberReader& // Before the walk out to the patch: whether the member `plan` grinds, as // read, already has its level, or with a trainer its win chance. Nothing -// is fought. 00.24 walked to Route 6's grass and back at Lv29 with the +// is fought. 06.03 walked to Route 6's grass and back at Lv29 with the // chance against Lt. Surge already 79% (console B, 2026-11-03). bool grind_reached_already(Logger& logger, GrindActions& actions, const MemberReader& reader, const GrindPlan& plan); diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryGrind_Tests.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryGrind_Tests.cpp index e9337729e7..6f0acce653 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryGrind_Tests.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryGrind_Tests.cpp @@ -405,7 +405,7 @@ UnitTestResult test_lead_as_read(){ } -// Console B at the end of 00.15 (2026-11-03): Wartortle Lv22, 65 HP, +// Console B at the end of 05.03 (2026-11-03): Wartortle Lv22, 65 HP, // with Water Pulse taught over Tail Whip, and 10 Potions. The sim, the // levels since the summary added to its stats, wins against the // Cerulean rival about 52% at Lv22 (42% when the sim's Potion was sized @@ -481,7 +481,7 @@ UnitTestResult test_grind_variant(){ } // The check in the Center before the walk out: a lead that already has -// the chance needs no trip (00.24 at Lv29, 79% against Lt. Surge, console +// the chance needs no trip (06.03 at Lv29, 79% against Lt. Surge, console // B, 2026-11-03); one short of it does. Nothing is fought either way. UnitTestResult test_grind_reached_already(){ QuietLogger logger; diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryHideout_Tests.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryHideout_Tests.cpp index 7991e0fc78..37c88414b2 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryHideout_Tests.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryHideout_Tests.cpp @@ -139,7 +139,7 @@ std::string poster_on_sim(){ const MapPosition below_poster{"CeladonCity_GameCorner", {GAME_CORNER_POSTER.x, GAME_CORNER_POSTER.y + 1}}; OverworldSim sim({room}, below_poster, Direction::NORTH); StoryPose at{below_poster.map, below_poster.point, Direction::NORTH}; - const std::string failure = row_step_on_sim(sim, at, StoryTable::poster_switch("poster_switch", "test"), "00.31"); + const std::string failure = row_step_on_sim(sim, at, StoryTable::poster_switch("poster_switch", "test"), "09.01"); if (!failure.empty()){ return failure; } @@ -183,7 +183,7 @@ std::string lift_on_sim(){ const MapPosition below_door{"RocketHideout_B2F", doors[1].point.next(Direction::SOUTH)}; OverworldSim sim(maps, below_door, Direction::NORTH, script); StoryPose at{below_door.map, below_door.point, Direction::NORTH}; - const std::string failure = row_step_on_sim(sim, at, StoryTable::lift_floor("lift_to_b4f", "B2F", "B4F", "test"), "00.32"); + const std::string failure = row_step_on_sim(sim, at, StoryTable::lift_floor("lift_to_b4f", "B2F", "B4F", "test"), "09.02"); if (!failure.empty()){ return failure; } @@ -271,7 +271,7 @@ std::string short_holds_on_sim(const MapPosition& start, Direction facing, const return ""; } -// 00.31's taps through B3F's arrow floor (frlg-00.31.plan.json's +// 09.01's taps through B3F's arrow floor (frlg-09.01.plan.json's // b3f_arrow_maze and b3f_back_to_candy_row, pokeguy's way): down from // the stairs (18, 2) to below the stairs to B4F (15, 19), and back from // them (15, 18) to the stop (10, 13). The routes planned after them, @@ -322,7 +322,7 @@ UnitTestResult test_b3f_maze_taps(){ return true; } -// 00.32's taps (frlg-00.32.plan.json): B3F from below its Rare Candy up +// 09.02's taps (frlg-09.02.plan.json): B3F from below its Rare Candy up // to the top corridor, and B2F's arrows to the MOON STONE's stop and on // to the lift room's stop (13, 20), up to row 17 and on to below the // lift, and B4F from the lift door to the guards, Giovanni and the @@ -377,7 +377,7 @@ UnitTestResult test_b2f_maze_taps(){ return true; } -// Console B, 2026-11-10 22:08: on 00.32's B2F taps "west 2" from +// Console B, 2026-11-10 22:08: on 09.02's B2F taps "west 2" from // (19, 5) to (17, 5), beside the arrow (16, 5), no tap moved the player. // The blocked tap was taken to stand where the way ahead is blocked, and // the arrow ahead of (17, 5) counted as blocked: the player was "found" on @@ -439,7 +439,7 @@ std::string blind_legs_on_sim(const MapPosition& start, Direction facing, const return ""; } -// The spinner mazes' blind legs: 00.31's B3F maze and way back, 00.32's +// The spinner mazes' blind legs: 09.01's B3F maze and way back, 09.02's // B2F legs to the MOON STONE and to the lift room. UnitTestResult test_blind_maze_taps(){ using Pokemon::StoryLeg; @@ -513,7 +513,7 @@ const AutoStoryHideoutBodyCase HIDEOUT_BODY_CASES[] = { }, { .input = {.name = "B2F's arrow floor to the lift a tap at a time", .body = test_b2f_maze_taps}, - .expectation = {.description = "00.32's taps and the routes between them, any turn dropped or hold short"}, + .expectation = {.description = "09.02's taps and the routes between them, any turn dropped or hold short"}, }, { .input = {.name = "a blocked tap beside B2F's arrow", .body = test_b2f_blocked_tap_beside_arrow}, @@ -521,7 +521,7 @@ const AutoStoryHideoutBodyCase HIDEOUT_BODY_CASES[] = { }, { .input = {.name = "the spinner mazes tapped blind", .body = test_blind_maze_taps}, - .expectation = {.description = "00.31's and 00.32's blind legs end where the legs do"}, + .expectation = {.description = "09.01's and 09.02's blind legs end where the legs do"}, }, }; diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryLavender_Tests.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryLavender_Tests.cpp index 0909dd3e37..9bcadcfb8e 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryLavender_Tests.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryLavender_Tests.cpp @@ -2,10 +2,10 @@ * * From: https://github.com/PokemonAutomation/ * - * Rows from 00.28 on (PokemonFRLG_AutoStoryTableLavender.cpp) on the - * overworld sim: 00.28 from Route 10's Pokemon Center through Rock Tunnel - * to its south mouth, 00.29 down Route 10 to Lavender Town's Center, and - * 00.30 west over Route 8 and under Saffron to Celadon City. + * Rows from 08.01 on (PokemonFRLG_AutoStoryTableLavender.cpp) on the + * overworld sim: 08.01 from Route 10's Pokemon Center through Rock Tunnel + * to its south mouth, 08.02 down Route 10 to Lavender Town's Center, and + * 08.03 west over Route 8 and under Saffron to Celadon City. * Each row whole, each open leg a tile short or long, and a wild battle * on every open leg in the tunnel. * @@ -85,7 +85,7 @@ const StoryCheckpoint& checkpoint(std::string_view id){ return *row; } -// The maps as 00.27 leaves them: the story's flags, Rock Tunnel's and +// The maps as 07.02 leaves them: the story's flags, Rock Tunnel's and // Route 10's trainers unfought. std::vector maps_after_route10(){ const std::vector all = overworld_maps(); @@ -152,20 +152,20 @@ const std::vector ROCK_TUNNEL_TRAINERS{ "poke_maniac", "poke_maniac", "picnicker", "hiker", "hiker", "picnicker", "hiker", "poke_maniac", "picnicker", }; -// 00.28 on the sim: the tree cut, the nine trainers fought where the +// 08.01 on the sim: the tree cut, the nine trainers fought where the // table steps into their lines (Cooper by the walker, on the leg past // him), no one else met, and the walk out of the south mouth. UnitTestResult test_rock_tunnel_row(Logger&){ - return row_on_sim("00.28", SimScript{}, {ROCK_TUNNEL_TRAINERS}, MapPosition{StoryTable::ROUTE10, {8, 58}}); + return row_on_sim("08.01", SimScript{}, {ROCK_TUNNEL_TRAINERS}, MapPosition{StoryTable::ROUTE10, {8, 58}}); } -// 00.28 with a wild battle on the 3rd step on the tunnel's floor, mid-way +// 08.01 with a wild battle on the 3rd step on the tunnel's floor, mid-way // down the leg to the wall (17, 8): the walker runs, holds the leg to its // wall again, and nothing else changes. UnitTestResult test_rock_tunnel_wild_battles(Logger&){ SimScript script; script.encounters.push_back(SimEncounter{.grass_step = 3}); - return row_on_sim("00.28", script, {ROCK_TUNNEL_TRAINERS}, MapPosition{StoryTable::ROUTE10, {8, 58}}); + return row_on_sim("08.01", script, {ROCK_TUNNEL_TRAINERS}, MapPosition{StoryTable::ROUTE10, {8, 58}}); } // Wild battles on the tunnel's floor, `gaps` steps apart in turn, from the @@ -180,7 +180,7 @@ SimScript battles_every(const std::vector& gaps){ return script; } -// 00.28's step `name`: where it is in the row. +// 08.01's step `name`: where it is in the row. size_t step_index(const StoryCheckpoint& row, std::string_view name){ for (size_t c = 0; c < row.steps.size(); c++){ if (row.steps[c].name == name){ @@ -197,7 +197,7 @@ size_t step_index(const StoryCheckpoint& row, std::string_view name){ // ("stopped part-way 9 times"). From Winston's tile, with a battle every // 10 to 14 steps, the steps from below_martha_line on reach Martha's line. UnitTestResult test_b1f_row37_battles_every_12(Logger&){ - const StoryCheckpoint& row = checkpoint("00.28"); + const StoryCheckpoint& row = checkpoint("08.01"); const size_t first = step_index(row, "below_martha_line"); StoryPose at{StoryTable::ROCK_TUNNEL_B1F, {29, 37}, Direction::NORTH}; OverworldSim sim(maps_after_route10(), MapPosition{at.map, at.tile}, *at.facing, battles_every({12, 10, 14, 11, 13})); @@ -214,7 +214,7 @@ UnitTestResult test_b1f_row37_battles_every_12(Logger&){ // From Winston's tile, below_martha_line, martha_line and Martha's battle // on `sim`: the failure, or empty once Martha alone is fought. std::string winston_to_martha(OverworldSim& sim){ - const StoryCheckpoint& row = checkpoint("00.28"); + const StoryCheckpoint& row = checkpoint("08.01"); StoryPose at{StoryTable::ROCK_TUNNEL_B1F, {29, 37}, Direction::NORTH}; for (size_t c = step_index(row, "below_martha_line"); c <= step_index(row, "picnicker_martha"); c++){ if (const std::string failure = row_step_on_sim(sim, at, row.steps[c], row.id); !failure.empty()){ @@ -248,14 +248,14 @@ UnitTestResult test_b1f_martha_after_row38_battle(Logger&){ return true; } -// Regression: console B, 2026-11-09 15:50, 00.28 winston_line, dark: from +// Regression: console B, 2026-11-09 15:50, 08.01 winston_line, dark: from // (32, 37) west into Winston's line, a wild battle on the 2nd tap's tile // (30, 37), run from; the 3rd tap, sent as the battle's black ended, was // lost, and the step failed no_trainer. After the battle the next tap // waits for the overworld (wait_out_battle_exit()): Winston sees the // player on (29, 37). UnitTestResult test_winston_line_battle_on_tap_2(Logger&){ - const StoryCheckpoint& row = checkpoint("00.28"); + const StoryCheckpoint& row = checkpoint("08.01"); SimScript script; script.dark_maps = {StoryTable::ROCK_TUNNEL_1F, StoryTable::ROCK_TUNNEL_B1F}; script.wild_floor_maps = {StoryTable::ROCK_TUNNEL_B1F}; @@ -278,13 +278,13 @@ UnitTestResult test_winston_line_battle_on_tap_2(Logger&){ // Rock Tunnel has no Flash: both floors are dark. const std::set ROCK_TUNNEL_DARK{StoryTable::ROCK_TUNNEL_1F, StoryTable::ROCK_TUNNEL_B1F}; -// Regression: console B, 2026-11-09, 00.28 hiker_lenny: won, and the dark +// Regression: console B, 2026-11-09, 08.01 hiker_lenny: won, and the dark // overworld after it was taken for an evolution until fight_battle() gave -// up. 00.28 dark: every trainer's battle ends on the dark cave's overworld. +// up. 08.01 dark: every trainer's battle ends on the dark cave's overworld. UnitTestResult test_rock_tunnel_dark_battle_ends(Logger&){ SimScript script; script.dark_maps = ROCK_TUNNEL_DARK; - return row_on_sim("00.28", script, {ROCK_TUNNEL_TRAINERS}, MapPosition{StoryTable::ROUTE10, {8, 58}}); + return row_on_sim("08.01", script, {ROCK_TUNNEL_TRAINERS}, MapPosition{StoryTable::ROUTE10, {8, 58}}); } // below_martha_line as `legs` from Winston's tile (29, 37) on `sim`, by the @@ -366,7 +366,7 @@ UnitTestResult test_b1f_dark_martha_battle_anywhere(Logger&){ return true; } -// 00.28 whole with a wild battle every 7 to 25 steps on the tunnel's floor, +// 08.01 whole with a wild battle every 7 to 25 steps on the tunnel's floor, // the gaps drawn from each of these seeds: the row ends where it should. UnitTestResult test_rock_tunnel_frequent_battles(Logger&){ std::string failures; @@ -378,7 +378,7 @@ UnitTestResult test_rock_tunnel_frequent_battles(Logger&){ gaps.push_back(gap(random)); } const UnitTestResult result = row_on_sim( - "00.28", battles_every(gaps), {ROCK_TUNNEL_TRAINERS}, MapPosition{StoryTable::ROUTE10, {8, 58}} + "08.01", battles_every(gaps), {ROCK_TUNNEL_TRAINERS}, MapPosition{StoryTable::ROUTE10, {8, 58}} ); if (result.result != UnitTestResult::PASSED){ failures += std::format("{}Seed {}: {}", failures.empty() ? "" : " | ", seed, result.message); @@ -458,7 +458,7 @@ std::string numbers_summary(const std::vector& runs){ ); } -// The land encounter rates of the maps 00.28 and 00.29 walk (pokefirered +// The land encounter rates of the maps 08.01 and 08.02 walk (pokefirered // src/data/wild_encounters.json, FireRed). const std::map ROCK_TUNNEL_ENCOUNTER_RATES{ {StoryTable::ROCK_TUNNEL_1F, 7}, @@ -468,12 +468,12 @@ const std::map ROCK_TUNNEL_ENCOUNTER_RATES{ constexpr unsigned GAME_ODDS_SEEDS = 30; -// 00.28 whole, its wild battles at the game's own odds (OverworldSim:: +// 08.01 whole, its wild battles at the game's own odds (OverworldSim:: // rolls_encounter()), from each of these seeds: every run ends where it // should. Logs the runs' numbers and the step taps the game ignored. UnitTestResult test_rock_tunnel_game_odds(Logger& logger){ - OverworldSim clean_sim = row_start_sim("00.28", SimScript{}); - if (const UnitTestResult clean = row_checked(clean_sim, "00.28", {ROCK_TUNNEL_TRAINERS}, MapPosition{StoryTable::ROUTE10, {8, 58}}); clean.result != UnitTestResult::PASSED){ + OverworldSim clean_sim = row_start_sim("08.01", SimScript{}); + if (const UnitTestResult clean = row_checked(clean_sim, "08.01", {ROCK_TUNNEL_TRAINERS}, MapPosition{StoryTable::ROUTE10, {8, 58}}); clean.result != UnitTestResult::PASSED){ return clean; } std::vector runs; @@ -484,8 +484,8 @@ UnitTestResult test_rock_tunnel_game_odds(Logger& logger){ script.encounter_rates = ROCK_TUNNEL_ENCOUNTER_RATES; script.encounter_seed = seed; script.dark_maps = ROCK_TUNNEL_DARK; - OverworldSim sim = row_start_sim("00.28", script); - const UnitTestResult result = row_checked(sim, "00.28", {ROCK_TUNNEL_TRAINERS}, MapPosition{StoryTable::ROUTE10, {8, 58}}); + OverworldSim sim = row_start_sim("08.01", script); + const UnitTestResult result = row_checked(sim, "08.01", {ROCK_TUNNEL_TRAINERS}, MapPosition{StoryTable::ROUTE10, {8, 58}}); const bool passed = result.result == UnitTestResult::PASSED; runs.push_back(row_numbers(sim.state(), passed, clean_sim.state())); ignored += sim.state().step_taps_ignored; @@ -494,7 +494,7 @@ UnitTestResult test_rock_tunnel_game_odds(Logger& logger){ } } logger.log(std::format( - "00.28 at the game's encounter odds, {} step taps ignored: {}", ignored, numbers_summary(runs) + "08.01 at the game's encounter odds, {} step taps ignored: {}", ignored, numbers_summary(runs) )); if (!failures.empty()){ return failures; @@ -503,9 +503,9 @@ UnitTestResult test_rock_tunnel_game_odds(Logger& logger){ } -// 00.29 on the sim: no trainer met, the ledge hopped, Lavender's nurse. +// 08.02 on the sim: no trainer met, the ledge hopped, Lavender's nurse. UnitTestResult test_lavender_row(Logger&){ - return row_on_sim("00.29", SimScript{}, {{}}, MapPosition{StoryTable::LAVENDER_CENTER, {7, 4}}); + return row_on_sim("08.02", SimScript{}, {{}}, MapPosition{StoryTable::LAVENDER_CENTER, {7, 4}}); } // Where an open leg of two tiles or more ends a tile short or long, the @@ -562,15 +562,15 @@ UnitTestResult tile_off_after_open_legs(std::string_view id){ } UnitTestResult test_rock_tunnel_tile_off(Logger&){ - return tile_off_after_open_legs("00.28"); + return tile_off_after_open_legs("08.01"); } UnitTestResult test_lavender_tile_off(Logger&){ - return tile_off_after_open_legs("00.29"); + return tile_off_after_open_legs("08.02"); } -// 00.29 saves in Lavender Town's Pokemon Center, LAVENDER TOWN on the -// save card; 00.28 on Route 10. +// 08.02 saves in Lavender Town's Pokemon Center, LAVENDER TOWN on the +// save card; 08.01 on Route 10. UnitTestResult test_save_places(Logger&){ if (save_card_place(StoryTable::LAVENDER_CENTER) != "lavender-town" || save_card_place(StoryTable::ROUTE10) != "route-10"){ return "Wrong save card places for Lavender Town's Center or Route 10."; @@ -578,18 +578,18 @@ UnitTestResult test_save_places(Logger&){ return true; } -// 00.30 on the sim: the Mart, Route 8 with only Rich fought (the walker +// 08.03 on the sim: the Mart, Route 8 with only Rich fought (the walker // keeps out of the other trainers' lines), the Underground Path, the // Pidgey's grass and Celadon City, below its Center's door. The Center // has no map: its way in is stubbed. UnitTestResult test_celadon_way_row(Logger&){ - return row_on_sim("00.30", SimScript{}, {{"old_man_1"}}, MapPosition{"CeladonCity", {48, 12}}); + return row_on_sim("08.03", SimScript{}, {{"old_man_1"}}, MapPosition{"CeladonCity", {48, 12}}); } -// 00.30's walk into Route 7's grass with a wild battle on its one grass +// 08.03's walk into Route 7's grass with a wild battle on its one grass // step (Route 7's land rate is 21): it still ends on the Pidgey's tile. UnitTestResult test_route7_grass_battles(Logger&){ - const StoryCheckpoint& row = checkpoint("00.30"); + const StoryCheckpoint& row = checkpoint("08.03"); const size_t index = step_index(row, "pidgey_grass"); const MapPosition end{"Route7", {14, 6}}; SimScript script; @@ -623,7 +623,7 @@ std::vector maps_after_rich(){ return maps; } -// The walker believes the player stands on `believed`, a tile 00.30's +// The walker believes the player stands on `believed`, a tile 08.03's // steps from Rich's battle on pass through, while the player stands on // `actual`. struct OffStart{ @@ -642,7 +642,7 @@ const OffStart ROUTE8_OFF_STARTS[] = { {{26, 7}, {28, 10}}, }; -// 00.30's steps from `first` to `last`, as the table lays them out from +// 08.03's steps from `first` to `last`, as the table lays them out from // `at`: the first that starts on `tile`, and where the table says the // player stands then. Nothing if none does. std::optional> step_starting_on( @@ -661,7 +661,7 @@ std::optional> step_starting_on( return std::nullopt; } -// Console B, 2026-11-09 (00.30, three runs): after Route 8's open legs +// Console B, 2026-11-09 (08.03, three runs): after Route 8's open legs // the player stood 3 tiles east of where the walker believed, the hold // north to the Underground Path's door ran up column 17 to the cliff // (16, 2), and the step onto the door bumped the house: "no fade in and @@ -669,7 +669,7 @@ std::optional> step_starting_on( // steps on to Route 7 meet no trainer and come out of the Underground // Path where the table says. UnitTestResult test_route8_west_off_start(Logger&){ - const StoryCheckpoint& row = checkpoint("00.30"); + const StoryCheckpoint& row = checkpoint("08.03"); const size_t first = step_index(row, "west_of_glenn_column"); const size_t last = step_index(row, "route7_underground_exit"); const StoryPose after_rich{"Route8", {55, 18}, Direction::NORTH}; @@ -703,7 +703,7 @@ UnitTestResult test_route8_west_off_start(Logger&){ return true; } -// 00.30 saves in Celadon City's Pokemon Center: CELADON CITY on the save +// 08.03 saves in Celadon City's Pokemon Center: CELADON CITY on the save // card. UnitTestResult test_celadon_save_place(Logger&){ if (save_card_place("CeladonCity_PokemonCenter_1F") != "celadon-city"){ @@ -712,14 +712,14 @@ UnitTestResult test_celadon_save_place(Logger&){ return true; } -// 00.31 on the sim: out of Celadon's Center, the Game Corner's poster +// 09.01 on the sim: out of Celadon's Center, the Game Corner's poster // Grunt, the switch, the Rocket Hideout down to B4F's Lift Key Grunt, the // LIFT KEY, and back up to B3F below its Rare Candy. // A battle a talk starts (the poster Grunt's) is the sim's to skip: it // leaves the player where the plan says, and the trainer walks off // (talk_battle_hide_flag()). UnitTestResult test_hideout_row(Logger&){ - const StoryCheckpoint& row = checkpoint("00.31"); + const StoryCheckpoint& row = checkpoint("09.01"); StoryPose at = *story_pose(*row.start); std::vector maps = maps_after_route10(); auto sim = std::make_unique(maps, MapPosition{at.map, at.tile}, *at.facing); @@ -728,7 +728,7 @@ UnitTestResult test_hideout_row(Logger&){ const std::optional hidden = talk_battle_hide_flag(step); if (!hidden){ if (const std::string failure = row_step_on_sim(*sim, at, step, row.id); !failure.empty()){ - return "00.31: ended on " + to_string(sim->state().position) + "; " + failure; + return "09.01: ended on " + to_string(sim->state().position) + "; " + failure; } continue; } @@ -741,14 +741,14 @@ UnitTestResult test_hideout_row(Logger&){ } fought.insert(fought.end(), sim->state().trainers_beaten.begin(), sim->state().trainers_beaten.end()); if (fought != std::vector{"rocket_m"}){ - return std::format("00.31: fought {} trainers on the sim, not the Lift Key Grunt alone.", fought.size()); + return std::format("09.01: fought {} trainers on the sim, not the Lift Key Grunt alone.", fought.size()); } if (!sim->state().violations.empty()){ - return "00.31: a violation on the way: " + sim->state().violations.back(); + return "09.01: a violation on the way: " + sim->state().violations.back(); } const MapPosition end{"RocketHideout_B3F", {12, 13}}; if (!(sim->state().position == end)){ - return "00.31: ended on " + to_string(sim->state().position) + ", not " + to_string(end) + "."; + return "09.01: ended on " + to_string(sim->state().position) + ", not " + to_string(end) + "."; } return true; } @@ -756,13 +756,13 @@ UnitTestResult test_hideout_row(Logger&){ } // namespace -// 00.32 on the sim: from below B3F's Rare Candy back up to B2F, through +// 09.02 on the sim: from below B3F's Rare Candy back up to B2F, through // its arrows (the MOON STONE ball stands in the way and is picked up), // the lift to B4F, the two door guards, Giovanni, and beside the SILPH // SCOPE. The talk-started battles are the sim's to skip; the MOON // STONE's pickup hides its ball, as the game does. UnitTestResult test_hideout_giovanni_row(Logger&){ - const StoryCheckpoint& row = checkpoint("00.32"); + const StoryCheckpoint& row = checkpoint("09.02"); StoryPose at = *story_pose(*row.start); std::vector maps = maps_after_route10(); if (std::none_of(maps.begin(), maps.end(), [](const MapData& map){ return map.name == LIFT_MAP; })){ @@ -780,7 +780,7 @@ UnitTestResult test_hideout_giovanni_row(Logger&){ continue; } if (const std::string failure = row_step_on_sim(*sim, at, step, row.id); !failure.empty()){ - return "00.32: ended on " + to_string(sim->state().position) + "; " + failure; + return "09.02: ended on " + to_string(sim->state().position) + "; " + failure; } if (step.name == "moon_stone"){ for (MapData& map : maps){ @@ -790,39 +790,39 @@ UnitTestResult test_hideout_giovanni_row(Logger&){ } } if (!sim->state().trainers_beaten.empty()){ - return std::format("00.32: walked into {} trainers' lines on the sim.", sim->state().trainers_beaten.size()); + return std::format("09.02: walked into {} trainers' lines on the sim.", sim->state().trainers_beaten.size()); } if (!sim->state().violations.empty()){ - return "00.32: a violation on the way: " + sim->state().violations.back(); + return "09.02: a violation on the way: " + sim->state().violations.back(); } const MapPosition end{"RocketHideout_B4F", {21, 5}}; if (!(sim->state().position == end)){ - return "00.32: ended on " + to_string(sim->state().position) + ", not " + to_string(end) + "."; + return "09.02: ended on " + to_string(sim->state().position) + ", not " + to_string(end) + "."; } return true; } const AutoStoryLavenderCase AUTO_STORY_LAVENDER_CASES[] = { - {.input = {"00.28 the tree, Rock Tunnel's nine trainers, out of its south mouth", test_rock_tunnel_row}, .expectation = {}}, - {.input = {"00.28 a wild battle mid-leg in the tunnel", test_rock_tunnel_wild_battles}, .expectation = {}}, - {.input = {"00.28 dark: each trainer's battle ends on the dark cave's overworld", test_rock_tunnel_dark_battle_ends}, .expectation = {}}, - {.input = {"00.28 a tile off after each open leg", test_rock_tunnel_tile_off}, .expectation = {}}, - {.input = {"00.28 B1F row 37 with a wild battle every 10 to 14 steps", test_b1f_row37_battles_every_12}, .expectation = {}}, - {.input = {"00.28 a wild battle every 7 to 25 steps, 12 seeds", test_rock_tunnel_frequent_battles}, .expectation = {}}, - {.input = {"00.28 wild battles at the game's odds, 30 seeds", test_rock_tunnel_game_odds}, .expectation = {}}, - {.input = {"00.28 B1F a wild battle into row 38, then a step short: Martha still sees the player", test_b1f_martha_after_row38_battle}, .expectation = {}}, - {.input = {"00.28 B1F dark, the 13:35 legs: a battle at the end of the walk back along row 38", test_b1f_dark_row38_battle_old_legs}, .expectation = {}}, - {.input = {"00.28 B1F dark, a wild battle on any step to Martha's line", test_b1f_dark_martha_battle_anywhere}, .expectation = {}}, - {.input = {"00.28 B1F dark, winston_line: a wild battle on the 2nd tap, the 3rd after it", test_winston_line_battle_on_tap_2}, .expectation = {}}, - {.input = {"00.29 Route 10 south, the ledge, Lavender Town's Pokemon Center", test_lavender_row}, .expectation = {}}, - {.input = {"00.29 a tile off after each open leg", test_lavender_tile_off}, .expectation = {}}, - {.input = {"00.28 and 00.29 save on Route 10 and in Lavender Town", test_save_places}, .expectation = {}}, - {.input = {"00.30 Lavender's Mart, Route 8 past Rich alone, the Underground Path, Route 7 to Celadon City", test_celadon_way_row}, .expectation = {}}, - {.input = {"00.30 a wild battle on the step into Route 7's grass", test_route7_grass_battles}, .expectation = {}}, - {.input = {"00.30 Route 8 west from a start up to 3 tiles off", test_route8_west_off_start}, .expectation = {}}, - {.input = {"00.30 saves in Celadon City's Pokemon Center", test_celadon_save_place}, .expectation = {}}, - {.input = {"00.31 the Game Corner's poster, the Rocket Hideout to B4F's LIFT KEY and B3F's Rare Candy", test_hideout_row}, .expectation = {}}, - {.input = {"00.32 B2F's arrows, the lift, the door guards, Giovanni and the SILPH SCOPE", test_hideout_giovanni_row}, .expectation = {}}, + {.input = {"08.01 the tree, Rock Tunnel's nine trainers, out of its south mouth", test_rock_tunnel_row}, .expectation = {}}, + {.input = {"08.01 a wild battle mid-leg in the tunnel", test_rock_tunnel_wild_battles}, .expectation = {}}, + {.input = {"08.01 dark: each trainer's battle ends on the dark cave's overworld", test_rock_tunnel_dark_battle_ends}, .expectation = {}}, + {.input = {"08.01 a tile off after each open leg", test_rock_tunnel_tile_off}, .expectation = {}}, + {.input = {"08.01 B1F row 37 with a wild battle every 10 to 14 steps", test_b1f_row37_battles_every_12}, .expectation = {}}, + {.input = {"08.01 a wild battle every 7 to 25 steps, 12 seeds", test_rock_tunnel_frequent_battles}, .expectation = {}}, + {.input = {"08.01 wild battles at the game's odds, 30 seeds", test_rock_tunnel_game_odds}, .expectation = {}}, + {.input = {"08.01 B1F a wild battle into row 38, then a step short: Martha still sees the player", test_b1f_martha_after_row38_battle}, .expectation = {}}, + {.input = {"08.01 B1F dark, the 13:35 legs: a battle at the end of the walk back along row 38", test_b1f_dark_row38_battle_old_legs}, .expectation = {}}, + {.input = {"08.01 B1F dark, a wild battle on any step to Martha's line", test_b1f_dark_martha_battle_anywhere}, .expectation = {}}, + {.input = {"08.01 B1F dark, winston_line: a wild battle on the 2nd tap, the 3rd after it", test_winston_line_battle_on_tap_2}, .expectation = {}}, + {.input = {"08.02 Route 10 south, the ledge, Lavender Town's Pokemon Center", test_lavender_row}, .expectation = {}}, + {.input = {"08.02 a tile off after each open leg", test_lavender_tile_off}, .expectation = {}}, + {.input = {"08.01 and 08.02 save on Route 10 and in Lavender Town", test_save_places}, .expectation = {}}, + {.input = {"08.03 Lavender's Mart, Route 8 past Rich alone, the Underground Path, Route 7 to Celadon City", test_celadon_way_row}, .expectation = {}}, + {.input = {"08.03 a wild battle on the step into Route 7's grass", test_route7_grass_battles}, .expectation = {}}, + {.input = {"08.03 Route 8 west from a start up to 3 tiles off", test_route8_west_off_start}, .expectation = {}}, + {.input = {"08.03 saves in Celadon City's Pokemon Center", test_celadon_save_place}, .expectation = {}}, + {.input = {"09.01 the Game Corner's poster, the Rocket Hideout to B4F's LIFT KEY and B3F's Rare Candy", test_hideout_row}, .expectation = {}}, + {.input = {"09.02 B2F's arrows, the lift, the door guards, Giovanni and the SILPH SCOPE", test_hideout_giovanni_row}, .expectation = {}}, }; void add_tests_AutoStoryLavender(UnitTestDatabase& database){ diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryPaceSim_Tests.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryPaceSim_Tests.cpp index a796111168..28e4e50f8f 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryPaceSim_Tests.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryPaceSim_Tests.cpp @@ -70,7 +70,7 @@ class SimCapture : public CaptureActions{ SimPatch& m_patch; }; -// Console B, 2026-11-03 (m63, 00.20 run 2): the capture paced on Route +// Console B, 2026-11-03 (m63, 05.09 run 2): the capture paced on Route // 24's (5, 19), in Camper Shane's sight; after the first wild battle he // walked up ("I saw your feat from the grass!"), and pacing ended // "no-battle-not-overworld" under his message. On the sim, a capture @@ -155,7 +155,7 @@ class SimConsoleCapture : public CaptureActions{ size_t m_read = 0; }; -// Console B, 2026-11-09 (00.30 run 5): catch_pidgey started on Route 7's +// Console B, 2026-11-09 (08.03 run 5): catch_pidgey started on Route 7's // (14, 6) on the Bicycle, ran from 4 wild battles and then paced 4 minutes // on the flowers east of the grass (11..18, 2..6). On the Bicycle a tap // facing another way steps too, so each turn of the pace took a tile, and diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryPacing.h b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryPacing.h index 7c36a7674a..6145e6a245 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryPacing.h +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryPacing.h @@ -24,7 +24,7 @@ namespace PokemonFRLG{ // Before pacing: gets the player off the Bicycle with SELECT, checked, // and once more if they still ride. On the Bicycle a tap facing another // way steps as well as turns, so pacing's turns walk it off the patch -// (console B, 2026-11-09, 00.30 run 5: Route 7's grass). Returns whether +// (console B, 2026-11-09, 08.03 run 5: Route 7's grass). Returns whether // the player is on foot. bool select_off_bike(const OverworldWalkSteps::BikeSelectCalls& calls); diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryParty.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryParty.cpp index ffa92fc042..466af5572a 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryParty.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryParty.cpp @@ -94,8 +94,8 @@ constexpr Evolution EVOLUTIONS[] = { // other move offered over four is declined. Squirtle's is the speedrun's: // Water Gun where Bubble was (so the attack stays bottom left), Bite over // Tail Whip. TM and tutor moves are not level-up prompts and are not -// here; no rule replaces them, so Water Pulse (TM03, 00.14c) and Mega Kick -// (Route 4's tutor, 00.14) are kept over every later level-up move. +// here; no rule replaces them, so Water Pulse (TM03, 05.02) and Mega Kick +// (Route 4's tutor, 04.06) are kept over every later level-up move. struct LearnRule{ std::string_view line; std::string_view move; diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryParty_Tests.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryParty_Tests.cpp index 8694afd9e4..1d56740933 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryParty_Tests.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryParty_Tests.cpp @@ -616,7 +616,7 @@ UnitTestResult test_run_then_overworld(Logger&){ return "START never looked for the overworld in the dark cave."; } -// Regression: console B, 2026-11-09, 00.28 hiker_lenny in Rock Tunnel +// Regression: console B, 2026-11-09, 08.01 hiker_lenny in Rock Tunnel // without Flash: the battle won with a move, then the dark cave's // overworld, black but for the lit circle on the player, read as the // text box with no HP box. The loop held B for an evolution three times diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRngLoop.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRngLoop.cpp index 4ecb06c609..31fc40210f 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRngLoop.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRngLoop.cpp @@ -44,19 +44,19 @@ std::string starter_rng_loop_message(const StarterRngLoopResult& result){ ); case StarterRngLoopEnd::TARGET: return "Starter RNG hit the target (shiny not required). Nothing was saved after it: the game is where " - "Starter RNG's calibration left it. Play to the rival's battle and save by hand, then start AutoStory at 00.05."; + "Starter RNG's calibration left it. Play to the rival's battle and save by hand, then start AutoStory at 02.01."; case StarterRngLoopEnd::OUT_OF_ATTEMPTS: return std::format( "Starter RNG: every planned attempt hit its target and none was shiny. SIDs left: {}. " - "The save is still south of the table: raise the RNG plan's max attempts and start AutoStory at 00.04 again.", sids + "The save is still south of the table: raise the RNG plan's max attempts and start AutoStory at 01.05 again.", sids ); case StarterRngLoopEnd::MISSED_EVERY_ATTEMPT_LEFT: return "Starter RNG: every attempt left missed its target more often than the retries allow, or Starter RNG " "refused its timings (see the log). The save is still south of the table: check the RNG plan's sound setting " - "and start AutoStory at 00.04 again."; + "and start AutoStory at 01.05 again."; case StarterRngLoopEnd::OUT_OF_TIME: return std::format( - "Starter RNG: out of time after {} attempts. The save is still south of the table: start AutoStory at 00.04 again.", + "Starter RNG: out of time after {} attempts. The save is still south of the table: start AutoStory at 01.05 again.", result.attempts_run ); } @@ -65,16 +65,16 @@ std::string starter_rng_loop_message(const StarterRngLoopResult& result){ std::string gift_rng_loop_message(const StarterRngLoopResult& result){ - const std::string save = "The save is still beside the salesman, facing him: start AutoStory at 00.12b with Run Gift " + const std::string save = "The save is still beside the salesman, facing him: start AutoStory at 04.03 with Run Gift " "RNG in AutoStory on to try again, or run Gift RNG (Magikarp) from it by hand with an attempt from the log, then " - "start AutoStory at 00.12b with that option off."; + "start AutoStory at 04.03 with that option off."; switch (result.end){ case StarterRngLoopEnd::SHINY: - return "Gift RNG: shiny Magikarp, on the planned target. 00.12b saves it."; + return "Gift RNG: shiny Magikarp, on the planned target. 04.03 saves it."; case StarterRngLoopEnd::SHINY_OFF_TARGET: - return "Gift RNG: shiny Magikarp, but not the planned target. 00.12b saves it."; + return "Gift RNG: shiny Magikarp, but not the planned target. 04.03 saves it."; case StarterRngLoopEnd::TARGET: - return "Gift RNG hit the target (shiny not required). Nothing was saved after it: start AutoStory at 00.12b " + return "Gift RNG hit the target (shiny not required). Nothing was saved after it: start AutoStory at 04.03 " "to save the Magikarp where it stands."; case StarterRngLoopEnd::OUT_OF_ATTEMPTS: return std::format( diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRngLoop.h b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRngLoop.h index cdbb0c4591..46a8cb06e2 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRngLoop.h +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRngLoop.h @@ -58,7 +58,7 @@ class CalibrationSavingSteps : public StarterRngLoopSteps{ // The rows a run takes after a shiny from the loop, which leaves the player // under Squirtle's ball with the rival's ball taken: the row after -// `ball_row` (00.04b) from its step after "rival_takes_bulbasaur", then +// `ball_row` (01.06) from its step after "rival_takes_bulbasaur", then // the rows after it to `last` as plan_story_run() takes them with // `handoffs`, with the handoff they stop at. Throws InternalProgramError // for a table without that row or step. @@ -68,7 +68,7 @@ StoryRunPlan rows_after_starter_rng( // The rows a run takes after a shiny Magikarp from the loop, which leaves // its summary open beside the salesman: the row after `salesman_row` -// (00.12b), which leaves the summary and saves, then the rows after it to +// (04.03), which leaves the summary and saves, then the rows after it to // `last` as plan_story_run() takes them with `handoffs`. Throws // InternalProgramError for a table whose next row doesn't leave the // summary. diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRngLoop_Tests.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRngLoop_Tests.cpp index ce3ab7c091..aa263d99ca 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRngLoop_Tests.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRngLoop_Tests.cpp @@ -118,11 +118,11 @@ std::string first_step(const StoryRunPlan& plan){ return plan.rows.empty() || plan.rows.front().steps.empty() ? "" : plan.rows.front().steps.front().name; } -// After a shiny, 00.04b picks up at the rival's trigger and runs on, to +// After a shiny, 01.06 picks up at the rival's trigger and runs on, to // Gift RNG's stop when it is on. UnitTestResult test_rows_after_shiny(){ const std::vector& checkpoints = story_checkpoints(); - const size_t ball_row = row_index("00.04"); + const size_t ball_row = row_index("01.05"); struct Case{ std::string last; StoryHandoffs handoffs = {}; @@ -130,14 +130,14 @@ UnitTestResult test_rows_after_shiny(){ StoryHandoff stop = StoryHandoff::NONE; }; const std::vector cases = { - {.last = "00.04", .ids = "00.04b"}, - {.last = "00.04b", .ids = "00.04b"}, - {.last = "00.05", .ids = "00.04b,00.05"}, - {.last = "00.12b", .ids = "00.04b,00.05,00.06,00.07,00.08,00.09,00.10,00.11,00.12"}, + {.last = "01.05", .ids = "01.06"}, + {.last = "01.06", .ids = "01.06"}, + {.last = "02.01", .ids = "01.06,02.01"}, + {.last = "04.03", .ids = "01.06,02.01,02.02,02.03,03.01,03.02,03.03,04.01,04.02"}, { - .last = "00.12b", + .last = "04.03", .handoffs = {.starter_rng = true, .gift_rng = true}, - .ids = "00.04b,00.05,00.06,00.07,00.08,00.09,00.10,00.11,00.12", + .ids = "01.06,02.01,02.02,02.03,03.01,03.02,03.03,04.01,04.02", .stop = StoryHandoff::GIFT_RNG, }, }; @@ -154,24 +154,24 @@ UnitTestResult test_rows_after_shiny(){ } -// What the run says when Gift RNG's loop ends: a shiny goes on to 00.12b; +// What the run says when Gift RNG's loop ends: a shiny goes on to 04.03; // otherwise the save beside the salesman is where to go on from. UnitTestResult test_gift_messages(){ struct Case{ StarterRngLoopResult result; std::string expected; }; - const std::string save = "The save is still beside the salesman, facing him: start AutoStory at 00.12b with Run Gift " + const std::string save = "The save is still beside the salesman, facing him: start AutoStory at 04.03 with Run Gift " "RNG in AutoStory on to try again, or run Gift RNG (Magikarp) from it by hand with an attempt from the log, then " - "start AutoStory at 00.12b with that option off."; + "start AutoStory at 04.03 with that option off."; const std::vector cases = { { .result = {.end = StarterRngLoopEnd::SHINY, .attempts_run = 1, .remaining_sids = {300}, .sid = uint16_t(300)}, - .expected = "Gift RNG: shiny Magikarp, on the planned target. 00.12b saves it.", + .expected = "Gift RNG: shiny Magikarp, on the planned target. 04.03 saves it.", }, { .result = {.end = StarterRngLoopEnd::SHINY_OFF_TARGET, .attempts_run = 1, .remaining_sids = {300}, .sid = std::nullopt}, - .expected = "Gift RNG: shiny Magikarp, but not the planned target. 00.12b saves it.", + .expected = "Gift RNG: shiny Magikarp, but not the planned target. 04.03 saves it.", }, { .result = {.end = StarterRngLoopEnd::OUT_OF_ATTEMPTS, .attempts_run = 3, .remaining_sids = {}, .sid = std::nullopt}, @@ -192,24 +192,24 @@ UnitTestResult test_gift_messages(){ return true; } -// 00.12 saves facing the salesman for Gift RNG; after a shiny Magikarp, -// 00.12b leaves its summary and saves there, then the run goes on. +// 04.02 saves facing the salesman for Gift RNG; after a shiny Magikarp, +// 04.03 leaves its summary and saves there, then the run goes on. UnitTestResult test_rows_after_magikarp(){ const std::vector& checkpoints = story_checkpoints(); - const size_t salesman_row = row_index("00.12"); + const size_t salesman_row = row_index("04.02"); const StoryCheckpoint& salesman = checkpoints[salesman_row]; const StoryCheckpoint& after = checkpoints[salesman_row + 1]; const std::optional start = after.start ? story_pose(*after.start) : std::nullopt; if (salesman.handoff != StoryHandoff::GIFT_RNG || !after.live_start || !start || start->map != "Route4_PokemonCenter_1F" || !(start->tile == TilePos{2, 3}) || start->facing != Direction::WEST ){ - return "Expected 00.12 to be Gift RNG's handoff and 00.12b to start from the live game at (2, 3) facing west."; + return "Expected 04.02 to be Gift RNG's handoff and 04.03 to start from the live game at (2, 3) facing west."; } - for (std::string_view last : {"00.12", "00.12b"}){ + for (std::string_view last : {"04.02", "04.03"}){ const StoryRunPlan plan = rows_after_gift_rng(checkpoints, salesman_row, row_index(last), StoryHandoffs{.gift_rng = true}); - if (joined_ids(plan) != "00.12b" || first_step(plan) != LEAVE_GIFT_SUMMARY || plan.stop != StoryHandoff::NONE){ + if (joined_ids(plan) != "04.03" || first_step(plan) != LEAVE_GIFT_SUMMARY || plan.stop != StoryHandoff::NONE){ return std::format( - "To {}: expected 00.12b from {}; got {} from {}", last, LEAVE_GIFT_SUMMARY, joined_ids(plan), first_step(plan) + "To {}: expected 04.03 from {}; got {} from {}", last, LEAVE_GIFT_SUMMARY, joined_ids(plan), first_step(plan) ); } } @@ -356,7 +356,7 @@ const AutoStoryRngLoopTestCase AUTO_STORY_RNG_LOOP_CASES[] = { .expectation = {.description = "formats notifications for gift rng encounters"}, }, { - .input = {.name = "00.12 and 00.12b: rows after a shiny Magikarp", .body = test_rows_after_magikarp}, + .input = {.name = "04.02 and 04.03: rows after a shiny Magikarp", .body = test_rows_after_magikarp}, .expectation = {.description = "plans continuation rows following shiny magikarp"}, }, { diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRooms.h b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRooms.h index 0e6c71d3d8..a7d561a24d 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRooms.h +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRooms.h @@ -43,7 +43,7 @@ bool is_center_variant(std::string_view variant); // tap a tile; none: a turn to face `direction`. `warps`: the last step // takes a warp, whose fade is waited out. `dims`: the warp's fade only // dims the screen, never black (the lift's way out; console B, -// 2026-11-10, 00.32 lift_to_b4f), so the warp is confirmed by the scene +// 2026-11-10, 09.02 lift_to_b4f), so the warp is confirmed by the scene // from before the leg's first step gone and settled, and any step of the // leg may take it. `to`: the warp's place, for the log. struct RoomLeg{ diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRowSim.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRowSim.cpp index 4ac2deb9ea..c08feaade6 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRowSim.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRowSim.cpp @@ -395,7 +395,7 @@ namespace{ // with a move: the battle loop's polls replayed through its EvolutionHold // and BattleEndWatch, as BattleLoop::step() takes them. The overworld of a // dark cave reads as the battle's text box with no HP box (console B, -// 2026-11-09, 00.28 hiker_lenny: three 20 s holds for an evolution, then +// 2026-11-09, 08.01 hiker_lenny: three 20 s holds for an evolution, then // "no battle screen and no START menu for 60 s after the battle"). Empty // once START would look for the overworld, else the loop's failure. std::string battle_end_on_sim(const OverworldSim& sim){ @@ -534,7 +534,7 @@ namespace{ // walk_room_legs() on the sim: a step tap a tile, each warp's fade and // the walk out of a door waited out. A warp taken with no black fade // fails, as on the console, unless the leg `dims`. A leg with no warp -// isn't failed: the 00.32 story sim is already in the lift when +// isn't failed: the 09.02 story sim is already in the lift when // lift_in_legs() starts (B2F's lift door a tile off the plan's). std::string sim_walk_room_legs(OverworldSim& sim, const std::vector& legs){ for (const RoomLeg& leg : legs){ @@ -568,7 +568,7 @@ namespace{ // Whether the sim can walk a Pokemon Center's way in or out of `step`: // the map it ends on is built into the program. Celadon's Center has no -// map yet (00.30), so its way in is stubbed. +// map yet (08.03), so its way in is stubbed. bool center_walkable(const StoryStep& step){ if (!is_center_variant(step.variant)){ return false; diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRowSim.h b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRowSim.h index 401b5b9b34..637e4cb995 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRowSim.h +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRowSim.h @@ -56,7 +56,7 @@ class SimStubs{ std::vector m_rows; }; -// Each attempt's stubs, a line a row: "00.03: 2 stubbed: oak, rival". +// Each attempt's stubs, a line a row: "01.04: 2 stubbed: oak, rival". std::string stub_report(const std::vector& rows); // A failed step fails the run as it threw: a simulation has no save to @@ -110,7 +110,7 @@ class StoryMapsSim : public Pokemon::TableExecutor{ const std::map& bag() const{ return m_bag; } - // "00.03/oak: a dialog pops up before it.", and how it was cleared. + // "01.04/oak: a dialog pops up before it.", and how it was cleared. const std::vector& dialog_notes() const{ return m_dialog_notes; } diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRunPlan_Tests.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRunPlan_Tests.cpp index f02be1c314..25569d12cd 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRunPlan_Tests.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRunPlan_Tests.cpp @@ -4,7 +4,7 @@ * * Which rows of the story table a run takes (plan_story_run()) with the * RNG programs' handoffs on and off, the rows the handoffs split or - * join, Misty in Cerulean Gym, and what 00.15 runs before the rival. + * join, Misty in Cerulean Gym, and what 05.03 runs before the rival. * */ @@ -138,24 +138,24 @@ class Test_RunPlan : public UnitTest{ const RunPlanScenario m_scenario; }; -const std::string TODAY = "00.01 00.02 00.03 00.04 00.05 00.06 00.07 00.08 00.09 00.10 00.11 00.12 00.12c 00.13 00.14 00.14b 00.14c 00.15 00.15b 00.16 00.17 00.18 00.19 00.20 00.21 00.22 00.23 00.24 00.25 00.26 00.27 00.28 00.29 00.30 00.31 00.32"; +const std::string TODAY = "01.01 01.03 01.04 01.05 02.01 02.02 02.03 03.01 03.02 03.03 04.01 04.02 04.04 04.05 04.06 05.01 05.02 05.03 05.04 05.05 05.06 05.07 05.08 05.09 05.10 06.01 06.02 06.03 06.04 07.01 07.02 08.01 08.02 08.03 09.01 09.02"; const RunPlanScenario RUN_PLAN_CASES[] = { { - .input = {.name = "handoffs off: the story as before", .first = "00.01"}, + .input = {.name = "handoffs off: the story as before", .first = "01.01"}, .expectation = {.expected_ids = TODAY}, }, { - .input = {.name = "handoffs off: a range", .first = "00.02", .last = "00.04"}, - .expectation = {.expected_ids = "00.02 00.03 00.04"}, + .input = {.name = "handoffs off: a range", .first = "01.03", .last = "01.05"}, + .expectation = {.expected_ids = "01.03 01.04 01.05"}, }, { - .input = {.name = "handoffs off: Mt. Moon to Nugget Bridge", .first = "00.13", .last = "00.16"}, - .expectation = {.expected_ids = "00.13 00.14 00.14b 00.14c 00.15 00.15b 00.16"}, + .input = {.name = "handoffs off: Mt. Moon to Nugget Bridge", .first = "04.05", .last = "05.05"}, + .expectation = {.expected_ids = "04.05 04.06 05.01 05.02 05.03 05.04 05.05"}, }, { - .input = { .name = "SID Helper: 00.01 stops on the keyboard", - .first = "00.01", + .input = { .name = "SID Helper: 01.01 stops on the keyboard", + .first = "01.01", .handoffs = {.sid_helper = true}, }, .expectation = { @@ -165,79 +165,79 @@ const RunPlanScenario RUN_PLAN_CASES[] = { }, { .input = { - .name = "SID Helper: back in at 00.01b", - .first = "00.01b", - .last = "00.03", + .name = "SID Helper: back in at 01.02", + .first = "01.02", + .last = "01.04", .handoffs = {.sid_helper = true}, }, .expectation = { - .expected_ids = "00.01b 00.02 00.03", + .expected_ids = "01.02 01.03 01.04", }, }, { - .input = {.name = "00.01b runs when started at, option off", .first = "00.01b", .last = "00.02"}, - .expectation = {.expected_ids = "00.01b 00.02"}, + .input = {.name = "01.02 runs when started at, option off", .first = "01.02", .last = "01.03"}, + .expectation = {.expected_ids = "01.02 01.03"}, }, { - .input = {.name = "SID Helper: a later start passes over it", .first = "00.02", .last = "00.03", .handoffs = {.sid_helper = true}}, - .expectation = {.expected_ids = "00.02 00.03"}, + .input = {.name = "SID Helper: a later start passes over it", .first = "01.03", .last = "01.04", .handoffs = {.sid_helper = true}}, + .expectation = {.expected_ids = "01.03 01.04"}, }, { - .input = {.name = "handoffs off: an end at 00.04 still takes the rival's battle", .first = "00.03", .last = "00.04"}, - .expectation = {.expected_ids = "00.03 00.04"}, + .input = {.name = "handoffs off: an end at 01.05 still takes the rival's battle", .first = "01.04", .last = "01.05"}, + .expectation = {.expected_ids = "01.04 01.05"}, }, { .input = { - .name = "Starter RNG: stops after 00.04's save", - .first = "00.02", + .name = "Starter RNG: stops after 01.05's save", + .first = "01.03", .handoffs = {.starter_rng = true}, }, .expectation = { - .expected_ids = "00.02 00.03 00.04", + .expected_ids = "01.03 01.04 01.05", .expected_stop = StoryHandoff::STARTER_RNG, }, }, { - .input = {.name = "00.04b runs from its own save", .first = "00.04b", .last = "00.05"}, - .expectation = {.expected_ids = "00.04b 00.05"}, + .input = {.name = "01.06 runs from its own save", .first = "01.06", .last = "02.01"}, + .expectation = {.expected_ids = "01.06 02.01"}, }, { - .input = {.name = "Starter RNG: a later start doesn't stop", .first = "00.05", .last = "00.06", .handoffs = {.starter_rng = true}}, - .expectation = {.expected_ids = "00.05 00.06"}, + .input = {.name = "Starter RNG: a later start doesn't stop", .first = "02.01", .last = "02.02", .handoffs = {.starter_rng = true}}, + .expectation = {.expected_ids = "02.01 02.02"}, }, { .input = { .name = "both handoffs, back in after SID Helper", - .first = "00.01b", + .first = "01.02", .handoffs = {.sid_helper = true, .starter_rng = true}, }, .expectation = { - .expected_ids = "00.01b 00.02 00.03 00.04", + .expected_ids = "01.02 01.03 01.04 01.05", .expected_stop = StoryHandoff::STARTER_RNG, }, }, { .input = { - .name = "Gift RNG: stops after 00.12's save", - .first = "00.11", + .name = "Gift RNG: stops after 04.02's save", + .first = "04.01", .handoffs = {.gift_rng = true}, }, .expectation = { - .expected_ids = "00.11 00.12", + .expected_ids = "04.01 04.02", .expected_stop = StoryHandoff::GIFT_RNG, }, }, { - .input = {.name = "Gift RNG off: 00.12b is passed over", .first = "00.11"}, - .expectation = {.expected_ids = "00.11 00.12 00.12c 00.13 00.14 00.14b 00.14c 00.15 00.15b 00.16 00.17 00.18 00.19 00.20 00.21 00.22 00.23 00.24 00.25 00.26 00.27 00.28 00.29 00.30 00.31 00.32"}, + .input = {.name = "Gift RNG off: 04.03 is passed over", .first = "04.01"}, + .expectation = {.expected_ids = "04.01 04.02 04.04 04.05 04.06 05.01 05.02 05.03 05.04 05.05 05.06 05.07 05.08 05.09 05.10 06.01 06.02 06.03 06.04 07.01 07.02 08.01 08.02 08.03 09.01 09.02"}, }, { - .input = {.name = "Gift RNG off: 00.12b runs when started at", .first = "00.12b"}, - .expectation = {.expected_ids = "00.12b 00.12c 00.13 00.14 00.14b 00.14c 00.15 00.15b 00.16 00.17 00.18 00.19 00.20 00.21 00.22 00.23 00.24 00.25 00.26 00.27 00.28 00.29 00.30 00.31 00.32"}, + .input = {.name = "Gift RNG off: 04.03 runs when started at", .first = "04.03"}, + .expectation = {.expected_ids = "04.03 04.04 04.05 04.06 05.01 05.02 05.03 05.04 05.05 05.06 05.07 05.08 05.09 05.10 06.01 06.02 06.03 06.04 07.01 07.02 08.01 08.02 08.03 09.01 09.02"}, }, { - .input = { .name = "Gift RNG: started at 00.12b, from the save beside the salesman", - .first = "00.12b", + .input = { .name = "Gift RNG: started at 04.03, from the save beside the salesman", + .first = "04.03", .handoffs = {.gift_rng = true}, }, .expectation = { @@ -247,8 +247,8 @@ const RunPlanScenario RUN_PLAN_CASES[] = { }, { .input = { - .name = "Gift RNG: started at 00.12b with Starter RNG on too", - .first = "00.12b", + .name = "Gift RNG: started at 04.03 with Starter RNG on too", + .first = "04.03", .handoffs = {.sid_helper = true, .starter_rng = true, .gift_rng = true}, }, .expectation = { @@ -257,16 +257,16 @@ const RunPlanScenario RUN_PLAN_CASES[] = { }, }, { - .input = {.name = "Starter RNG alone: 00.12b runs when started at", .first = "00.12b", .handoffs = {.starter_rng = true}}, - .expectation = {.expected_ids = "00.12b 00.12c 00.13 00.14 00.14b 00.14c 00.15 00.15b 00.16 00.17 00.18 00.19 00.20 00.21 00.22 00.23 00.24 00.25 00.26 00.27 00.28 00.29 00.30 00.31 00.32"}, + .input = {.name = "Starter RNG alone: 04.03 runs when started at", .first = "04.03", .handoffs = {.starter_rng = true}}, + .expectation = {.expected_ids = "04.03 04.04 04.05 04.06 05.01 05.02 05.03 05.04 05.05 05.06 05.07 05.08 05.09 05.10 06.01 06.02 06.03 06.04 07.01 07.02 08.01 08.02 08.03 09.01 09.02"}, }, { .input = { .name = "Starter RNG first, with both on", - .first = "00.03", + .first = "01.04", .handoffs = {.starter_rng = true, .gift_rng = true}, }, .expectation = { - .expected_ids = "00.03 00.04", + .expected_ids = "01.04 01.05", .expected_stop = StoryHandoff::STARTER_RNG, }, }, @@ -286,48 +286,48 @@ std::string step_names(const StoryCheckpoint& checkpoint){ return text; } -// With Starter RNG's handoff off, 00.04 and 00.04b run as the one 00.04 +// With Starter RNG's handoff off, 01.05 and 01.06 run as the one 01.05 // the story had before the split: from the lab's table to the rival's // battle, saving once with the starter's START menu. UnitTestResult test_starter_rows_joined(){ const std::vector& checkpoints = story_checkpoints(); - const StoryRunPlan plan = plan_story_run(checkpoints, row_index("00.04"), row_index("00.04b"), StoryHandoffs{}); + const StoryRunPlan plan = plan_story_run(checkpoints, row_index("01.05"), row_index("01.06"), StoryHandoffs{}); const std::string expected_steps = "below_squirtle squirtle_ball choose_squirtle no_nickname rival_takes_bulbasaur above_rival_trigger rival_trigger rival_battle"; if (plan.rows.size() != 1){ return "Expected one checkpoint, got \"" + joined_ids(plan.rows) + "\"."; } const StoryCheckpoint& row = plan.rows[0]; - if (row.id != "00.04" || row.title != "Squirtle, then the rival's battle" || step_names(row) != expected_steps){ - return "Expected 00.04 \"Squirtle, then the rival's battle\": " + expected_steps + if (row.id != "01.05" || row.title != "Squirtle, then the rival's battle" || step_names(row) != expected_steps){ + return "Expected 01.05 \"Squirtle, then the rival's battle\": " + expected_steps + "; got " + row.id + " \"" + row.title + "\": " + step_names(row); } const std::optional start = story_pose(*row.start); if (!start || start->map != "PalletTown_ProfessorOaksLab" || !(start->tile == TilePos{6, 4}) || row.menu != StartMenu::BEFORE_POKEDEX){ - return "Expected the joined 00.04 to start at the table (6, 4) and save with the starter's START menu."; + return "Expected the joined 01.05 to start at the table (6, 4) and save with the starter's START menu."; } - // Split, 00.04 saves under the ball facing it, before the starter. - const StoryCheckpoint& to_ball = checkpoints[row_index("00.04")]; - const std::optional ball = story_pose(*checkpoints[row_index("00.04b")].start); + // Split, 01.05 saves under the ball facing it, before the starter. + const StoryCheckpoint& to_ball = checkpoints[row_index("01.05")]; + const std::optional ball = story_pose(*checkpoints[row_index("01.06")].start); if (to_ball.handoff != StoryHandoff::STARTER_RNG || to_ball.menu != StartMenu::BEFORE_POKEMON || !ball || !(ball->tile == TilePos{9, 5}) || ball->facing != Direction::NORTH ){ - return "Expected 00.04 to end under Squirtle's ball (9, 5) facing north, saving before the starter."; + return "Expected 01.05 to end under Squirtle's ball (9, 5) facing north, saving before the starter."; } return true; } // The ways back in after SID Helper and Gift RNG load no save and start -// where 00.01 and 00.12 leave the player, so the rows after them follow +// where 01.01 and 04.02 leave the player, so the rows after them follow // unchanged. UnitTestResult test_after_sid_helper_row(){ - const StoryCheckpoint& sid = story_checkpoints()[row_index("00.01b")]; + const StoryCheckpoint& sid = story_checkpoints()[row_index("01.02")]; if (!sid.live_start || story_checkpoints()[0].handoff != StoryHandoff::SID_HELPER){ - return "Expected 00.01 to be SID Helper's handoff and 00.01b to start from the live game."; + return "Expected 01.01 to be SID Helper's handoff and 01.02 to start from the live game."; } for (const StoryCheckpoint& checkpoint : story_checkpoints()){ - if (checkpoint.live_start != (checkpoint.id == "00.01b" || checkpoint.id == "00.12b")){ - return checkpoint.id + ": only 00.01b and 00.12b start from the live game."; + if (checkpoint.live_start != (checkpoint.id == "01.02" || checkpoint.id == "04.03")){ + return checkpoint.id + ": only 01.02 and 04.03 start from the live game."; } } return true; @@ -357,23 +357,23 @@ bool plans(const Pokemon::Pose& from, const Pokemon::Pose& to){ ).has_value(); } -// 00.15, before the rival, from the Center: first TM03 Water Pulse over +// 05.03, before the rival, from the Center: first TM03 Water Pulse over // Tail Whip if the lead doesn't know it, so the sim plays it in the // GRIND; Potions from Cerulean's Mart (a loaded save's bag may hold too // few for the wild battles a GRIND fights), and at its money floor 2 or // more Awakenings for the rival's Sleep Powder; then a GRIND on Route 4's -// grass east of Mt. Moon until the sim beats the rival 00.15b fights 50% +// grass east of Mt. Moon until the sim beats the rival 05.04 fights 50% // or more, healing at Cerulean's Center; its trip there plans both ways. UnitTestResult test_cerulean_mart_and_grind(){ - const StoryCheckpoint& row = story_checkpoints()[row_index("00.15")]; + const StoryCheckpoint& row = story_checkpoints()[row_index("05.03")]; const std::vector& steps = row.steps; const std::optional start = row.start ? story_pose(*row.start) : std::nullopt; if (!start || start->map != "CeruleanCity_PokemonCenter_1F"){ - return "00.15: expected it to start in Cerulean's Center."; + return "05.03: expected it to start in Cerulean's Center."; } const std::optional teach = steps.empty() ? std::nullopt : parse_teach_step(steps[0]); if (!teach || teach->item != "tm03" || teach->move != "water-pulse" || teach->member != 0 || teach->forget_move != "tail-whip"){ - return "00.15: expected it to start with TM03 Water Pulse over the lead's Tail Whip."; + return "05.03: expected it to start with TM03 Water Pulse over the lead's Tail Whip."; } const size_t mart = find_step(steps, 0, [](const StoryStep& step){ const std::optional plan = parse_mart_step(step); @@ -386,7 +386,7 @@ UnitTestResult test_cerulean_mart_and_grind(){ && plan->level > 25; }); if (mart == steps.size() || grind == steps.size()){ - return "00.15: expected a Cerulean Mart step buying Potions, then a GRIND of the lead until the rival is 50%, capped above Lv25."; + return "05.03: expected a Cerulean Mart step buying Potions, then a GRIND of the lead until the rival is 50%, capped above Lv25."; } const MartPlan plan = *parse_mart_step(steps[mart]); const std::optional> buys = plan.money_floor @@ -396,64 +396,64 @@ UnitTestResult test_cerulean_mart_and_grind(){ return buy.item == "awakening" && buy.quantity >= 2; }); if (!awakenings){ - return "00.15: expected the Mart step to buy 2 or more Awakenings at its money floor."; + return "05.03: expected the Mart step to buy 2 or more Awakenings at its money floor."; } const std::optional clerk = mart > 0 && steps[mart - 1].target ? story_pose(*steps[mart - 1].target) : std::nullopt; if (!clerk || clerk->map != "CeruleanCity_Mart"){ - return "00.15: expected the Mart step right after a route to the clerk."; + return "05.03: expected the Mart step right after a route to the clerk."; } if (grind == 0 || !steps[grind - 1].target || !steps[grind].target){ - return "00.15: expected the GRIND right after a route to its patch, with the nurse as its target."; + return "05.03: expected the GRIND right after a route to its patch, with the nurse as its target."; } const Pokemon::Pose& patch = *steps[grind - 1].target; const Pokemon::Pose& nurse = *steps[grind].target; const std::optional nurse_pose = story_pose(nurse); if (!nurse_pose || nurse_pose->map != "CeruleanCity_PokemonCenter_1F" || !plans(patch, nurse) || !plans(nurse, patch)){ - return "00.15: expected the GRIND's trips to Cerulean's nurse and back to plan."; + return "05.03: expected the GRIND's trips to Cerulean's nurse and back to plan."; } return true; } -// 00.15b, the rival's battle as its own checkpoint, as every battle lost -// twice or more gets: it starts from a save, 00.15's on (23, 7) below his +// 05.04, the rival's battle as its own checkpoint, as every battle lost +// twice or more gets: it starts from a save, 05.03's on (23, 7) below his // trigger with the nurse just before, so a verify run or a retry reloads // right before him; and his is its only battle. First Water Pulse over // Tail Whip if the lead doesn't know it: console B's save (2026-11-03) is // past the TEACH that failed there, which does nothing once it is known. UnitTestResult test_cerulean_rival_row(){ const std::vector& checkpoints = story_checkpoints(); - const size_t index = row_index("00.15b"); + const size_t index = row_index("05.04"); const StoryCheckpoint& rival = checkpoints[index]; const std::optional start = rival.start ? story_pose(*rival.start) : std::nullopt; if (!start || rival.live_start || start->map != "CeruleanCity" || !(start->tile == TilePos{23, 7}) || save_card_place(start->map).empty() ){ - return "00.15b: expected it to start from a save on (23, 7) in Cerulean City."; + return "05.04: expected it to start from a save on (23, 7) in Cerulean City."; } std::string battles; for (const StoryStep& step : rival.steps){ battles += step.kind == StoryStepKind::BATTLE ? " " + step.name : ""; } if (battles != " rival_cerulean" || rival.steps.size() != 3 || rival.steps[1].name != "rival_trigger"){ - return "00.15b: expected a TEACH, the step onto his trigger and his battle; its battles:" + battles; + return "05.04: expected a TEACH, the step onto his trigger and his battle; its battles:" + battles; } const std::optional teach = parse_teach_step(rival.steps[0]); if (rival.steps[0].kind != StoryStepKind::GAME || !teach || teach->item != "tm03" || teach->move != "water-pulse" || teach->member != 0 || teach->forget_move != "tail-whip" ){ - return "00.15b: expected it to start with TM03 Water Pulse over the lead's Tail Whip."; + return "05.04: expected it to start with TM03 Water Pulse over the lead's Tail Whip."; } const StoryCheckpoint& before = checkpoints[index - 1]; const size_t n = before.steps.size(); const std::optional end = n > 0 && before.steps[n - 1].target ? story_pose(*before.steps[n - 1].target) : std::nullopt; - if (before.id != "00.15" || n < 2 || before.steps[n - 2].kind != StoryStepKind::HEAL + if (before.id != "05.03" || n < 2 || before.steps[n - 2].kind != StoryStepKind::HEAL || !end || end->map != start->map || !(end->tile == start->tile) ){ - return "00.15: expected it to end with the nurse, then the walk to (23, 7) where 00.15b starts."; + return "05.03: expected it to end with the nurse, then the walk to (23, 7) where 05.04 starts."; } for (const StoryStep& step : before.steps){ if (step.kind == StoryStepKind::BATTLE){ - return "00.15: expected no trainer battle before its save; found " + step.name + "."; + return "05.03: expected no trainer battle before its save; found " + step.name + "."; } } return true; @@ -468,17 +468,17 @@ std::string battle_names(const StoryCheckpoint& row){ return battles; } -// 00.14b, before Misty: Potions at Cerulean's Mart, then into the Gym to -// a save on (9, 7), below her platform; no battle. 00.14c, Misty's battle +// 05.01, before Misty: Potions at Cerulean's Mart, then into the Gym to +// a save on (9, 7), below her platform; no battle. 05.02, Misty's battle // as its own checkpoint: it starts from that save, talks to her from // beside her, (9, 6), and hers is its only battle; then TM03 Water Pulse // in place of Tail Whip. UnitTestResult test_misty_rows(){ const std::vector& checkpoints = story_checkpoints(); - const StoryCheckpoint& gym = checkpoints[row_index("00.14b")]; - const StoryCheckpoint& misty = checkpoints[row_index("00.14c")]; - if (checkpoints[row_index("00.14b") - 1].id != "00.14" || checkpoints[row_index("00.14c") + 1].id != "00.15"){ - return "Expected 00.14b and 00.14c between 00.14 and 00.15."; + const StoryCheckpoint& gym = checkpoints[row_index("05.01")]; + const StoryCheckpoint& misty = checkpoints[row_index("05.02")]; + if (checkpoints[row_index("05.01") - 1].id != "04.06" || checkpoints[row_index("05.02") + 1].id != "05.03"){ + return "Expected 05.01 and 05.02 between 04.06 and 05.03."; } const std::vector& steps = gym.steps; const size_t mart = find_step(steps, 0, [](const StoryStep& step){ @@ -486,41 +486,41 @@ UnitTestResult test_misty_rows(){ return plan && plan->map == "CeruleanCity_Mart" && !plan->lines.empty() && plan->lines[0].item == "potion"; }); if (mart == steps.size() || !battle_names(gym).empty()){ - return "00.14b: expected a Cerulean Mart step buying Potions and no battle; its battles:" + battle_names(gym); + return "05.01: expected a Cerulean Mart step buying Potions and no battle; its battles:" + battle_names(gym); } const std::optional start = misty.start ? story_pose(*misty.start) : std::nullopt; if (!start || misty.live_start || start->map != "CeruleanCity_Gym" || !(start->tile == TilePos{9, 7}) || save_card_place(start->map).empty() ){ - return "00.14c: expected it to start from a save on (9, 7) in Cerulean Gym."; + return "05.02: expected it to start from a save on (9, 7) in Cerulean Gym."; } if (battle_names(misty) != " misty" || misty.steps.size() < 3 || misty.steps[1].kind != StoryStepKind::TALK || misty.steps[2].name != "misty" ){ - return "00.14c: expected a walk beside Misty, the talk and her battle, the only one; its battles:" + battle_names(misty); + return "05.02: expected a walk beside Misty, the talk and her battle, the only one; its battles:" + battle_names(misty); } const std::optional beside = misty.steps[0].target ? story_pose(*misty.steps[0].target) : std::nullopt; if (!beside || !(beside->tile == TilePos{9, 6}) || beside->facing != Direction::WEST){ - return "00.14c: expected the talk from (9, 6), facing Misty (8, 6)."; + return "05.02: expected the talk from (9, 6), facing Misty (8, 6)."; } const size_t teach = find_step(misty.steps, 0, [](const StoryStep& step){ const std::optional plan = parse_teach_step(step); return plan && plan->item == "tm03" && plan->move == "water-pulse" && plan->member == 0 && plan->forget_move == "tail-whip"; }); if (teach == misty.steps.size()){ - return "00.14c: expected TM03 Water Pulse taught to the lead in place of Tail Whip."; + return "05.02: expected TM03 Water Pulse taught to the lead in place of Tail Whip."; } return true; } -// 00.14b in order (Misty lost to at Lv20, console B, run m51): the Mart +// 05.01 in order (Misty lost to at Lv20, console B, run m51): the Mart // first, Potions then Super Potions, the Potions enough for the GRIND's // wild battles at the table's money floor and at least one Super Potion // after them; a GRIND of the lead to Lv23 on Route 4, from a route to its // patch, with Cerulean's nurse as its target; the nurse; then the walk // into the Gym, ending on (9, 7). UnitTestResult test_misty_grind_order(){ - const std::vector& steps = story_checkpoints()[row_index("00.14b")].steps; + const std::vector& steps = story_checkpoints()[row_index("05.01")].steps; std::optional plan; const size_t mart = find_step(steps, 0, [&](const StoryStep& step){ plan = parse_mart_step(step); @@ -529,25 +529,25 @@ UnitTestResult test_misty_grind_order(){ if (mart == steps.size() || plan->lines.size() < 2 || plan->lines[0].item != "potion" || plan->lines[1].item != "super-potion" || !plan->money_floor ){ - return "00.14b: expected a Cerulean Mart step buying Potions, then Super Potions, with a money floor."; + return "05.01: expected a Cerulean Mart step buying Potions, then Super Potions, with a money floor."; } const std::optional> buys = plan_mart_buys(mart_stock(plan->map), *plan, *plan->money_floor); if (!buys || buys->size() < 2 || (*buys)[0].quantity < 2 || (*buys)[1].item != "super-potion"){ - return "00.14b: expected the money floor to buy 2 or more Potions and a Super Potion."; + return "05.01: expected the money floor to buy 2 or more Potions and a Super Potion."; } const size_t grind = find_step(steps, mart, [](const StoryStep& step){ const std::optional grind_plan = parse_grind_step(step); return grind_plan && grind_plan->member == 0 && grind_plan->level >= 23; }); if (grind == steps.size() || !steps[grind - 1].target || !steps[grind].target){ - return "00.14b: expected a GRIND of the lead to Lv23 after the Mart, right after a route to its patch, the nurse its target."; + return "05.01: expected a GRIND of the lead to Lv23 after the Mart, right after a route to its patch, the nurse its target."; } const std::optional patch = story_pose(*steps[grind - 1].target); const std::optional nurse = story_pose(*steps[grind].target); if (!patch || patch->map != "Route4" || !nurse || nurse->map != "CeruleanCity_PokemonCenter_1F" || !plans(*steps[grind - 1].target, *steps[grind].target) || !plans(*steps[grind].target, *steps[grind - 1].target) ){ - return "00.14b: expected the GRIND on Route 4, its trips to Cerulean's nurse and back planning."; + return "05.01: expected the GRIND on Route 4, its trips to Cerulean's nurse and back planning."; } const size_t heal = find_step(steps, grind + 1, [](const StoryStep& step){ return step.name == "heal_cerulean"; @@ -557,7 +557,7 @@ UnitTestResult test_misty_grind_order(){ return pose && pose->map == "CeruleanCity_Gym"; }); if (heal == steps.size() || gym == steps.size() || heal > gym){ - return "00.14b: expected the nurse after the GRIND, then the walk into the Gym."; + return "05.01: expected the nurse after the GRIND, then the walk into the Gym."; } StoryPose end; for (const StoryStep& step : steps){ @@ -565,7 +565,7 @@ UnitTestResult test_misty_grind_order(){ end = pose ? *pose : end; } if (end.map != "CeruleanCity_Gym"){ - return "00.14b: expected the row to end in Cerulean Gym."; + return "05.01: expected the row to end in Cerulean Gym."; } return true; } @@ -575,27 +575,27 @@ UnitTestResult test_misty_grind_order(){ const AutoStoryCase AUTO_STORY_CASES[] = { { - .input = {"00.01b and 00.12b: back in after SID Helper and Gift RNG", test_after_sid_helper_row}, + .input = {"01.02 and 04.03: back in after SID Helper and Gift RNG", test_after_sid_helper_row}, .expectation = {}, }, { - .input = {"00.04 and 00.04b: one checkpoint with Starter RNG off", test_starter_rows_joined}, + .input = {"01.05 and 01.06: one checkpoint with Starter RNG off", test_starter_rows_joined}, .expectation = {}, }, { - .input = {"00.15: Potions at Cerulean's Mart and a GRIND before the rival", test_cerulean_mart_and_grind}, + .input = {"05.03: Potions at Cerulean's Mart and a GRIND before the rival", test_cerulean_mart_and_grind}, .expectation = {}, }, { - .input = {"00.15b: the rival's battle alone, from a save before him", test_cerulean_rival_row}, + .input = {"05.04: the rival's battle alone, from a save before him", test_cerulean_rival_row}, .expectation = {}, }, { - .input = {"00.14b and 00.14c: Cerulean Gym, then Misty alone from a save before her", test_misty_rows}, + .input = {"05.01 and 05.02: Cerulean Gym, then Misty alone from a save before her", test_misty_rows}, .expectation = {}, }, { - .input = {"00.14b: Potions and Super Potions, a GRIND to Lv23, the nurse, then the Gym", test_misty_grind_order}, + .input = {"05.01: Potions and Super Potions, a GRIND to Lv23, the nurse, then the Gym", test_misty_grind_order}, .expectation = {}, }, }; diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryScreenEvents_Tests.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryScreenEvents_Tests.cpp index 4ed0f3d1a5..aa9d726f40 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryScreenEvents_Tests.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryScreenEvents_Tests.cpp @@ -93,7 +93,7 @@ const ScreenEventsCase SCREEN_EVENTS_CASES[] = { .expectation = {{ScreenEvent::FADE_WHITE}}, }, { - // Rock Tunnel without Flash (console B, 2026-11-09, 00.28): its + // Rock Tunnel without Flash (console B, 2026-11-09, 08.01): its // black read as a battle's text box before each step. .input = {"a dark cave, black but for a lit middle, shows nothing", 0xff000000, 0xff8c7c64}, .expectation = {{}}, diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStorySimulation_Tests.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStorySimulation_Tests.cpp index a11981cf33..55c3a77584 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStorySimulation_Tests.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStorySimulation_Tests.cpp @@ -225,7 +225,7 @@ UnitTestResult test_whole_story(){ if (report.one_shot_passes() != report.checkpoints_run){ return "Expected every checkpoint one-shot:" + joined(sim.lines); } - // 00.07's shopping, with the cursor staying on each row bought. + // 02.03's shopping, with the cursor staying on each row bought. const std::map bought{{"potion", 5}, {"antidote", 3}, {"parlyz_heal", 1}}; if (sim.game.bag() != bought){ std::string text; @@ -265,9 +265,9 @@ UnitTestResult test_stubbed_steps_need_the_console(Logger& logger){ UnitTestResult test_start_and_end(){ Simulation sim; - const Pokemon::SegmentReport report = sim.run({.from = "00.05", .to = "00.07"}); - if (!report.completed || sim.begun() != std::vector{"00.05", "00.06", "00.07"}){ - return "Expected 00.05 to 00.07 only:" + joined(sim.begun()); + const Pokemon::SegmentReport report = sim.run({.from = "02.01", .to = "02.03"}); + if (!report.completed || sim.begun() != std::vector{"02.01", "02.02", "02.03"}){ + return "Expected 02.01 to 02.03 only:" + joined(sim.begun()); } return true; } @@ -276,27 +276,27 @@ UnitTestResult test_start_and_end(){ // the checkpoint reloads its last save and runs again from its start. UnitTestResult test_retry_from_save(){ Simulation sim; - sim.game.failures["00.08/forest_north"] = {.failure = "operation_failed", .times = 1}; - const Pokemon::SegmentReport report = sim.run({.from = "00.08", .to = "00.09"}); - if (!report.completed || report.reloads != 1 || sim.begun() != std::vector{"00.08", "00.08", "00.09"} - || sim.count("00.08/forest_east") != 2 + sim.game.failures["03.01/forest_north"] = {.failure = "operation_failed", .times = 1}; + const Pokemon::SegmentReport report = sim.run({.from = "03.01", .to = "03.02"}); + if (!report.completed || report.reloads != 1 || sim.begun() != std::vector{"03.01", "03.01", "03.02"} + || sim.count("03.01/forest_east") != 2 ){ - return "Expected 00.08 reloaded once and run again from its start:" + joined(sim.game.trace); + return "Expected 03.01 reloaded once and run again from its start:" + joined(sim.game.trace); } - if (std::find(sim.lines.begin(), sim.lines.end(), "[Checkpoint] 00.08: passed on attempt 2 (1 reset)") == sim.lines.end()){ + if (std::find(sim.lines.begin(), sim.lines.end(), "[Checkpoint] 03.01: passed on attempt 2 (1 reset)") == sim.lines.end()){ return "Expected the retried pass logged:" + joined(sim.lines); } return true; } -// console B, FRLG 00.27, 2026-11-09: the save stood below Cerulean Center's -// door (22, 19), and the run walked as if from the counter where 00.27 -// starts. It, and 00.09 from below Pewter Center's door (17, 25), stop +// console B, FRLG 07.02, 2026-11-09: the save stood below Cerulean Center's +// door (22, 19), and the run walked as if from the counter where 07.02 +// starts. It, and 03.02 from below Pewter Center's door (17, 25), stop // before any step or save. UnitTestResult test_save_off_start_pose(){ const std::pair CASES[] = { - {"00.09", StoryPose{"PewterCity", TilePos{17, 26}, Direction::SOUTH}}, - {"00.27", StoryPose{"CeruleanCity", TilePos{22, 20}, Direction::SOUTH}}, + {"03.02", StoryPose{"PewterCity", TilePos{17, 26}, Direction::SOUTH}}, + {"07.02", StoryPose{"CeruleanCity", TilePos{22, 20}, Direction::SOUTH}}, }; for (const auto& [id, save] : CASES){ Simulation sim; @@ -316,21 +316,21 @@ UnitTestResult test_save_off_start_pose(){ // Brock's battle lost every time: three attempts, then the stop. UnitTestResult test_gives_up_after_attempts(){ Simulation sim; - sim.game.failures["00.09/brock"] = {.failure = "blackout", .times = 10}; - const Pokemon::SegmentReport report = sim.run({.from = "00.09", .to = std::nullopt}); - if (report.completed || report.reloads != 2 || report.failed_checkpoint != "00.09" || report.failed_event != "brock" - || report.failure.failure != "blackout" || sim.count("00.09/brock") != 3 || !sim.saves.empty() + sim.game.failures["03.02/brock"] = {.failure = "blackout", .times = 10}; + const Pokemon::SegmentReport report = sim.run({.from = "03.02", .to = std::nullopt}); + if (report.completed || report.reloads != 2 || report.failed_checkpoint != "03.02" || report.failed_event != "brock" + || report.failure.failure != "blackout" || sim.count("03.02/brock") != 3 || !sim.saves.empty() ){ - return "Expected 00.09 tried 3 times, then a stop on Brock:" + joined(sim.game.trace) + joined(sim.lines); + return "Expected 03.02 tried 3 times, then a stop on Brock:" + joined(sim.game.trace) + joined(sim.lines); } return true; } -// Walks `step` of 00.14 on `sim` from `at`, where the table says the +// Walks `step` of 04.06 on `sim` from `at`, where the table says the // player stands, and moves `at` to where it says the step ends. Returns // the failure, or empty. std::string walk_on_sim(OverworldSim& sim, StoryPose& at, const StoryStep& step){ - const std::string where = "00.14/" + step.name + ": "; + const std::string where = "04.06/" + step.name + ": "; // A walk that ends on an open leg may leave the player short of it. bool open_end = false; if (step.kind == StoryStepKind::ROUTE || step.kind == StoryStepKind::LEGS){ @@ -357,7 +357,7 @@ std::string walk_on_sim(OverworldSim& sim, StoryPose& at, const StoryStep& step) return ""; } -// Console B, 2026-11-03 (row 00.14): the open leg east from Route 4 +// Console B, 2026-11-03 (row 04.06): the open leg east from Route 4 // into Cerulean City ended a tile short, on (6, 20), with nothing on // screen. No hold to a wall finds the player there, and the walk went on // a column off, the hold south stopped by the fence on (6, 23), to a @@ -366,13 +366,13 @@ std::string walk_on_sim(OverworldSim& sim, StoryPose& at, const StoryStep& step) // with that leg whole or a tile short. UnitTestResult test_cerulean_entry_short(){ const std::vector& rows = story_checkpoints(); - const auto row = std::find_if(rows.begin(), rows.end(), [](const StoryCheckpoint& data){ return data.id == "00.14"; }); + const auto row = std::find_if(rows.begin(), rows.end(), [](const StoryCheckpoint& data){ return data.id == "04.06"; }); if (row == rows.end()){ - return "No checkpoint 00.14."; + return "No checkpoint 04.06."; } const auto hop = std::find_if(row->steps.begin(), row->steps.end(), [](const StoryStep& step){ return step.name == "ledge_hop"; }); if (hop == row->steps.end() || !hop->pose_after){ - return "00.14: no ledge_hop."; + return "04.06: no ledge_hop."; } for (int short_by : {0, 1}){ StoryPose at = *story_pose(*hop->pose_after); @@ -389,7 +389,7 @@ UnitTestResult test_cerulean_entry_short(){ return true; } -// Console B, 2026-11-03 (row 00.16), twice: the open leg north from +// Console B, 2026-11-03 (row 05.05), twice: the open leg north from // Cerulean City onto Nugget Bridge ended on (11, 33), a tile short of // (11, 32), and the one step onto Cale's row reached only (11, 32), out // of his sight: "bug_catcher_cale: failed: no_battle". From the walk's @@ -397,19 +397,19 @@ UnitTestResult test_cerulean_entry_short(){ // the sim, each battle on the trainer's row. UnitTestResult test_nugget_bridge_short(){ const std::vector& rows = story_checkpoints(); - const auto row = std::find_if(rows.begin(), rows.end(), [](const StoryCheckpoint& data){ return data.id == "00.16"; }); + const auto row = std::find_if(rows.begin(), rows.end(), [](const StoryCheckpoint& data){ return data.id == "05.05"; }); if (row == rows.end()){ - return "No checkpoint 00.16."; + return "No checkpoint 05.05."; } const auto walk = std::find_if(row->steps.begin(), row->steps.end(), [](const StoryStep& step){ return step.name == "below_cale_line"; }); if (walk == row->steps.end() || !walk->target){ - return "No step 00.16/below_cale_line."; + return "No step 05.05/below_cale_line."; } for (int short_by : {0, 1}){ StoryPose at = *story_pose(*walk->target); OverworldSim sim(story_maps(), MapPosition{at.map, {at.tile.x, at.tile.y + short_by}}, Direction::NORTH); for (auto step = walk + 1; step != row->steps.end() && step->kind != StoryStepKind::READY; ++step){ - const std::string failure = row_step_on_sim(sim, at, *step, "00.16"); + const std::string failure = row_step_on_sim(sim, at, *step, "05.05"); if (!failure.empty()){ return std::format("Walk {} tile(s) short: ", short_by) + failure; } @@ -421,21 +421,21 @@ UnitTestResult test_nugget_bridge_short(){ return true; } -// 00.17 on the sim, from its start on Route 24 to the Sea Cottage: +// 05.06 on the sim, from its start on Route 24 to the Sea Cottage: // Franklin, Kelsey, Nob and Haley are met on the steps into their lines // and beaten there. The sim's trainers who look around see every way // they may look, so Youngster Dan sees the player on (20, 4), walks up // to (21, 4) and is fought there, off the way on. UnitTestResult test_route25_trainers(){ const std::vector& rows = story_checkpoints(); - const auto row = std::find_if(rows.begin(), rows.end(), [](const StoryCheckpoint& data){ return data.id == "00.17"; }); + const auto row = std::find_if(rows.begin(), rows.end(), [](const StoryCheckpoint& data){ return data.id == "05.06"; }); if (row == rows.end()){ - return "No checkpoint 00.17."; + return "No checkpoint 05.06."; } StoryPose at = *story_pose(*row->start); OverworldSim sim(story_maps(), MapPosition{at.map, at.tile}, *at.facing); for (const StoryStep& step : row->steps){ - const std::string failure = row_step_on_sim(sim, at, step, "00.17"); + const std::string failure = row_step_on_sim(sim, at, step, "05.06"); if (!failure.empty()){ return failure; } @@ -446,23 +446,23 @@ UnitTestResult test_route25_trainers(){ for (const std::string& name : sim.state().trainers_beaten){ beaten += " " + name; } - return "00.17: expected Franklin, Dan, Kelsey, Nob and Haley beaten; beat" + beaten + "."; + return "05.06: expected Franklin, Dan, Kelsey, Nob and Haley beaten; beat" + beaten + "."; } if (!(sim.state().position == MapPosition{"Route25_SeaCottage", {7, 8}})){ - return "00.17: expected to end in the Sea Cottage on (7, 8), not " + to_string(sim.state().position) + "."; + return "05.06: expected to end in the Sea Cottage on (7, 8), not " + to_string(sim.state().position) + "."; } return true; } -// 00.20 on the sim, its walks from the Center: over Nugget Bridge, whose -// trainers 00.16 beat (they stand there, but don't battle), onto Route +// 05.09 on the sim, its walks from the Center: over Nugget Bridge, whose +// trainers 05.05 beat (they stand there, but don't battle), onto Route // 24's grass at (4, 19) out of Camper Shane's sight, and back to the // nurse. No trainer battles on the way. The open leg north from Cerulean // City onto the bridge crosses onto Route 24, where the game holds the // player up a tile: held for its tiles alone it ended on (11, 16), a tile // short, and the leg west bumped the bridge's posts (console B, -// 2026-11-03, row 00.20, twice). -// The story maps after 00.16: Nugget Bridge's trainers beaten, standing +// 2026-11-03, row 05.09, twice). +// The story maps after 05.05: Nugget Bridge's trainers beaten, standing // on columns 10 and 12 without battling. std::vector maps_bridge_beaten(){ std::vector maps = story_maps(); @@ -481,9 +481,9 @@ std::vector maps_bridge_beaten(){ UnitTestResult test_oddish_walks(){ const std::vector& rows = story_checkpoints(); - const auto row = std::find_if(rows.begin(), rows.end(), [](const StoryCheckpoint& data){ return data.id == "00.20"; }); + const auto row = std::find_if(rows.begin(), rows.end(), [](const StoryCheckpoint& data){ return data.id == "05.09"; }); if (row == rows.end()){ - return "No checkpoint 00.20."; + return "No checkpoint 05.09."; } StoryPose at = *story_pose(*row->start); OverworldSim sim(maps_bridge_beaten(), MapPosition{at.map, at.tile}, *at.facing); @@ -497,17 +497,17 @@ UnitTestResult test_oddish_walks(){ if (step.kind != StoryStepKind::ROUTE && step.kind != StoryStepKind::LEGS){ continue; } - const std::string failure = row_step_on_sim(sim, at, step, "00.20"); + const std::string failure = row_step_on_sim(sim, at, step, "05.09"); if (!failure.empty()){ return failure; } const auto end = ends.find(step.name); if (end == ends.end() || !(sim.state().position == end->second)){ - return "00.20/" + step.name + ": ended on " + to_string(sim.state().position) + "."; + return "05.09/" + step.name + ": ended on " + to_string(sim.state().position) + "."; } } if (!sim.state().trainers_beaten.empty() || !sim.state().violations.empty()){ - return "00.20: a trainer's battle or a violation on the way."; + return "05.09: a trainer's battle or a violation on the way."; } return true; } @@ -527,7 +527,7 @@ std::string walk_paced_route(OverworldSim& sim, const std::vector& ro return failure.empty() ? "" : label + ": " + failure + " On " + to_string(sim.state().position) + "."; } -// Console B, 2026-11-03 (row 00.20, run m61): the Oddish's battle came +// Console B, 2026-11-03 (row 05.09, run m61): the Oddish's battle came // on the pace's far step, so the capture left the player on (3, 19), not // the table's (4, 19). The walk back planned from (4, 19) went a column // west of its plan, down the bridge's column 10, not 11, and stopped @@ -535,7 +535,7 @@ std::string walk_paced_route(OverworldSim& sim, const std::vector& ro // warp to the Center never came. On the sim, the battle on either step // of the pace, the row's later walks, from the capture's tiles, reach the // nurse. -// Console B, 2026-11-03 (m63, 00.20 verify run 2): the open leg west +// Console B, 2026-11-03 (m63, 05.09 verify run 2): the open leg west // from Nugget Bridge's head ended a tile short, so the walk down onto the // grass ended on (5, 19), in Camper Shane's sight; after the first wild // battle he walked up ("I saw your feat from the grass!") and the capture @@ -543,14 +543,14 @@ std::string walk_paced_route(OverworldSim& sim, const std::vector& ro // his sight with the leg west whole or a tile short. UnitTestResult test_oddish_patch_west_short(){ const std::vector& rows = story_checkpoints(); - const auto row = std::find_if(rows.begin(), rows.end(), [](const StoryCheckpoint& data){ return data.id == "00.20"; }); + const auto row = std::find_if(rows.begin(), rows.end(), [](const StoryCheckpoint& data){ return data.id == "05.09"; }); if (row == rows.end()){ - return "No checkpoint 00.20."; + return "No checkpoint 05.09."; } const auto mart = std::find_if(row->steps.begin(), row->steps.end(), [](const StoryStep& step){ return step.name == "mart_clerk"; }); const auto patch = std::find_if(row->steps.begin(), row->steps.end(), [](const StoryStep& step){ return step.name == "oddish_patch"; }); if (mart == row->steps.end() || patch == row->steps.end() || !mart->target || !patch->target){ - return "00.20: no mart_clerk or oddish_patch."; + return "05.09: no mart_clerk or oddish_patch."; } for (int short_by : {0, 1}){ StoryPose at = *story_pose(*mart->target); @@ -559,7 +559,7 @@ UnitTestResult test_oddish_patch_west_short(){ // over the bridge, then the 8th, west from the bridge's head. script.short_holds[8] = short_by; OverworldSim sim(maps_bridge_beaten(), MapPosition{at.map, at.tile}, *at.facing, script); - const std::string failure = row_step_on_sim(sim, at, *patch, "00.20"); + const std::string failure = row_step_on_sim(sim, at, *patch, "05.09"); const std::string label = std::format("West leg {} tile(s) short: ", short_by); if (!failure.empty()){ return label + failure; @@ -577,17 +577,17 @@ UnitTestResult test_oddish_patch_west_short(){ UnitTestResult test_oddish_battle_on_far_step(){ const std::vector& rows = story_checkpoints(); - const auto row = std::find_if(rows.begin(), rows.end(), [](const StoryCheckpoint& data){ return data.id == "00.20"; }); + const auto row = std::find_if(rows.begin(), rows.end(), [](const StoryCheckpoint& data){ return data.id == "05.09"; }); if (row == rows.end()){ - return "No checkpoint 00.20."; + return "No checkpoint 05.09."; } const auto capture = std::find_if(row->steps.begin(), row->steps.end(), [](const StoryStep& step){ return step.name == "catch_oddish"; }); if (capture == row->steps.end() || capture + 1 == row->steps.end() || !(capture + 1)->target){ - return "00.20: no catch_oddish with a route after it."; + return "05.09: no catch_oddish with a route after it."; } const auto patch = std::find_if(row->steps.begin(), capture, [](const StoryStep& step){ return step.name == "oddish_patch"; }); if (patch == capture || !patch->target){ - return "00.20: no oddish_patch before catch_oddish."; + return "05.09: no oddish_patch before catch_oddish."; } // The sim starts on the patch (3, 19): grass step 1 is the pace's far // step onto (4, 19), step 2 the one back. @@ -610,17 +610,17 @@ UnitTestResult test_oddish_battle_on_far_step(){ if (!route){ return label + "no route from the capture's tiles."; } - if (const std::string failure = walk_paced_route(sim, *route, "00.20/" + back.name); !failure.empty()){ + if (const std::string failure = walk_paced_route(sim, *route, "05.09/" + back.name); !failure.empty()){ return label + failure; } for (auto step = capture + 2; step != row->steps.end(); ++step){ - const std::string failure = row_step_on_sim(sim, at, *step, "00.20"); + const std::string failure = row_step_on_sim(sim, at, *step, "05.09"); if (!failure.empty()){ return label + failure; } } if (!(sim.state().position == MapPosition{"CeruleanCity_PokemonCenter_1F", {7, 4}})){ - return label + "00.20 ended on " + to_string(sim.state().position) + ", not the nurse."; + return label + "05.09 ended on " + to_string(sim.state().position) + ", not the nurse."; } } return true; @@ -675,24 +675,24 @@ UnitTestResult test_routes_after_pacing(){ } } if (checked < 3){ - return std::format("Expected the routes after 00.14b's and 00.15's GRINDs and 00.20's capture; checked {}.", checked); + return std::format("Expected the routes after 05.01's and 05.03's GRINDs and 05.09's capture; checked {}.", checked); } return true; } -// 00.14 on the sim, from Mt. Moon's exit (32, 6): east and up through +// 04.06 on the sim, from Mt. Moon's exit (32, 6): east and up through // (48, 5) into the tutors' pen on Route 4 to (50, 4), facing the Mega // Kick tutor (50, 3), then on to above the ledge (93, 8). Each walk ends // where the table says, and no trainer sees the player on the way. UnitTestResult test_mega_kick_tutor_walks(){ const std::vector& rows = story_checkpoints(); - const auto row = std::find_if(rows.begin(), rows.end(), [](const StoryCheckpoint& data){ return data.id == "00.14"; }); + const auto row = std::find_if(rows.begin(), rows.end(), [](const StoryCheckpoint& data){ return data.id == "04.06"; }); if (row == rows.end()){ - return "No checkpoint 00.14."; + return "No checkpoint 04.06."; } const auto ledge = std::find_if(row->steps.begin(), row->steps.end(), [](const StoryStep& step){ return step.name == "above_ledge"; }); if (ledge == row->steps.end()){ - return "00.14: no above_ledge."; + return "04.06: no above_ledge."; } StoryPose at = *story_pose(*row->start); OverworldSim sim(story_maps(), MapPosition{at.map, at.tile}, *at.facing); @@ -701,27 +701,27 @@ UnitTestResult test_mega_kick_tutor_walks(){ if (step->kind != StoryStepKind::ROUTE && step->kind != StoryStepKind::LEGS){ continue; } - const std::string failure = row_step_on_sim(sim, at, *step, "00.14"); + const std::string failure = row_step_on_sim(sim, at, *step, "04.06"); if (!failure.empty()){ return failure; } if (!(sim.state().position == MapPosition{at.map, at.tile})){ - return "00.14/" + step->name + ": expected " + to_string(MapPosition{at.map, at.tile}) + ", but on " + to_string(sim.state().position) + "."; + return "04.06/" + step->name + ": expected " + to_string(MapPosition{at.map, at.tile}) + ", but on " + to_string(sim.state().position) + "."; } if (sim.state().position == MapPosition{"Route4", {50, 4}} && sim.state().facing == Direction::NORTH){ at_tutor = true; } } if (!at_tutor){ - return "00.14: no walk ended on Route 4's (50, 4) facing the Mega Kick tutor (50, 3)."; + return "04.06: no walk ended on Route 4's (50, 4) facing the Mega Kick tutor (50, 3)."; } if (!sim.state().trainers_beaten.empty() || !sim.state().violations.empty()){ - return "00.14: a trainer's battle or a violation on the way."; + return "04.06: a trainer's battle or a violation on the way."; } return true; } -// Console B, 2026-11-03 (row 00.18): after his scene Bill stands on +// Console B, 2026-11-03 (row 05.07): after his scene Bill stands on // (7, 6), east of the player on (6, 6), not on the maps' (7, 5). The // walk out planned east onto (7, 6) and south to the mat (7, 9); the // east tap bumped Bill, and the hold south took the player down column 6 @@ -731,13 +731,13 @@ UnitTestResult test_mega_kick_tutor_walks(){ // where the table says and leave on Route 25's (51, 5). UnitTestResult test_out_of_bill_cottage(){ const std::vector& rows = story_checkpoints(); - const auto row = std::find_if(rows.begin(), rows.end(), [](const StoryCheckpoint& data){ return data.id == "00.18"; }); + const auto row = std::find_if(rows.begin(), rows.end(), [](const StoryCheckpoint& data){ return data.id == "05.07"; }); if (row == rows.end()){ - return "No checkpoint 00.18."; + return "No checkpoint 05.07."; } const auto ticket = std::find_if(row->steps.begin(), row->steps.end(), [](const StoryStep& step){ return step.name == "ss_ticket"; }); if (ticket == row->steps.end() || !ticket->pose_after){ - return "00.18: no ss_ticket."; + return "05.07: no ss_ticket."; } std::vector maps = story_maps(); for (MapData& map : maps){ @@ -758,36 +758,36 @@ UnitTestResult test_out_of_bill_cottage(){ if (step->kind != StoryStepKind::ROUTE && step->kind != StoryStepKind::LEGS){ continue; } - const std::string failure = row_step_on_sim(sim, at, *step, "00.18"); + const std::string failure = row_step_on_sim(sim, at, *step, "05.07"); if (!failure.empty()){ return failure; } if (!(sim.state().position == MapPosition{at.map, at.tile})){ - return "00.18/" + step->name + ": expected " + to_string(MapPosition{at.map, at.tile}) + ", but on " + to_string(sim.state().position) + "."; + return "05.07/" + step->name + ": expected " + to_string(MapPosition{at.map, at.tile}) + ", but on " + to_string(sim.state().position) + "."; } } if (!(sim.state().position == MapPosition{"Route25", {51, 5}})){ - return "00.18: expected to leave onto Route 25's (51, 5), not " + to_string(sim.state().position) + "."; + return "05.07: expected to leave onto Route 25's (51, 5), not " + to_string(sim.state().position) + "."; } if (!sim.state().violations.empty()){ - return "00.18: violations:" + joined(sim.state().violations); + return "05.07: violations:" + joined(sim.state().violations); } return true; } -// 00.05 as the table authors it and as the data file built into the -// program (StoryData/frlg-parcel-00.05.json, the export tool's capture of +// 02.01 as the table authors it and as the data file built into the +// program (StoryData/frlg-parcel-02.01.json, the export tool's capture of // that row): the loaded row builds the same events, and run against the // fake game walks the same route, leaves the same trace and saves in the // same place. UnitTestResult test_data_row_parity(){ const std::vector& table = story_checkpoints(); - const auto authored = std::find_if(table.begin(), table.end(), [](const StoryCheckpoint& row){ return row.id == "00.05"; }); + const auto authored = std::find_if(table.begin(), table.end(), [](const StoryCheckpoint& row){ return row.id == "02.01"; }); if (authored == table.end()){ - return "Expected row 00.05 in the table."; + return "Expected row 02.01 in the table."; } - const StoryCheckpoint loaded = load_story_checkpoint("frlg-parcel-00.05"); + const StoryCheckpoint loaded = load_story_checkpoint("frlg-parcel-02.01"); FakeGame describer; const std::string authored_events = Pokemon::describe(Pokemon::build_story_checkpoint(*authored, describer)); const std::string loaded_events = Pokemon::describe(Pokemon::build_story_checkpoint(loaded, describer)); @@ -861,20 +861,20 @@ UnitTestResult test_dialogs_at_random(Logger& logger){ const AutoStorySimulationTestCase AUTO_STORY_SIMULATION_CASES[] = { - {.input = {.name = "00.05 loaded row parity", .body = test_data_row_parity}, .expectation = {.description = "loaded row preserves events, trace and save pose"}}, + {.input = {.name = "02.01 loaded row parity", .body = test_data_row_parity}, .expectation = {.description = "loaded row preserves events, trace and save pose"}}, {.input = {.name = "new game to Brock, in order, each start where the last save stood", .body = test_whole_story}, .expectation = {.description = "runs full story progression from new game through Brock gym"}}, {.input = {.name = "the steps it stubs need the console", .body = nullptr, .logged = test_stubbed_steps_need_the_console}, .expectation = {.description = "stubs each needs-console step of the whole story and plays the rest"}}, {.input = {.name = "start and end checkpoints", .body = test_start_and_end}, .expectation = {.description = "executes segment bounded by start and end checkpoints"}}, {.input = {.name = "a failed walk reloads its checkpoint's save", .body = test_retry_from_save}, .expectation = {.description = "reloads checkpoint save state on simulated movement failure"}}, {.input = {.name = "a battle lost every time stops after 3 attempts", .body = test_gives_up_after_attempts}, .expectation = {.description = "aborts after three consecutive battle blackouts"}}, - {.input = {.name = "00.14 into Cerulean, the entry leg a tile short", .body = test_cerulean_entry_short}, .expectation = {.description = "recovers when entering Cerulean City if movement ends one tile short"}}, - {.input = {.name = "00.14 from Mt. Moon to the Mega Kick tutor, then above the ledge", .body = test_mega_kick_tutor_walks}, .expectation = {.description = "verifies route navigation from Mt. Moon to tutor and past ledge"}}, - {.input = {.name = "00.16 Nugget Bridge, the walk onto it a tile short", .body = test_nugget_bridge_short}, .expectation = {.description = "completes Nugget Bridge battles even if initial approach stops short"}}, - {.input = {.name = "00.17 Route 25, its four trainers and Dan", .body = test_route25_trainers}, .expectation = {.description = "simulates Route 25 trainer battles and Dan detour"}}, - {.input = {.name = "00.18 out of Bill's Sea Cottage, Bill on (7, 6)", .body = test_out_of_bill_cottage}, .expectation = {.description = "simulates exiting Bill sea cottage with Bill relocated"}}, - {.input = {.name = "00.20 to Route 24's grass and back, past Shane", .body = test_oddish_walks}, .expectation = {.description = "navigates to Route 24 grass avoiding trainer line of sight"}}, - {.input = {.name = "00.20 back to the Center, the Oddish's battle on the pace's far step", .body = test_oddish_battle_on_far_step}, .expectation = {.description = "handles Oddish capture encounter occurring on far pace step"}}, - {.input = {.name = "00.20 onto the grass out of Shane's sight, the leg west a tile short", .body = test_oddish_patch_west_short}, .expectation = {.description = "recovers when approaching grass patch with short western leg"}}, + {.input = {.name = "04.06 into Cerulean, the entry leg a tile short", .body = test_cerulean_entry_short}, .expectation = {.description = "recovers when entering Cerulean City if movement ends one tile short"}}, + {.input = {.name = "04.06 from Mt. Moon to the Mega Kick tutor, then above the ledge", .body = test_mega_kick_tutor_walks}, .expectation = {.description = "verifies route navigation from Mt. Moon to tutor and past ledge"}}, + {.input = {.name = "05.05 Nugget Bridge, the walk onto it a tile short", .body = test_nugget_bridge_short}, .expectation = {.description = "completes Nugget Bridge battles even if initial approach stops short"}}, + {.input = {.name = "05.06 Route 25, its four trainers and Dan", .body = test_route25_trainers}, .expectation = {.description = "simulates Route 25 trainer battles and Dan detour"}}, + {.input = {.name = "05.07 out of Bill's Sea Cottage, Bill on (7, 6)", .body = test_out_of_bill_cottage}, .expectation = {.description = "simulates exiting Bill sea cottage with Bill relocated"}}, + {.input = {.name = "05.09 to Route 24's grass and back, past Shane", .body = test_oddish_walks}, .expectation = {.description = "navigates to Route 24 grass avoiding trainer line of sight"}}, + {.input = {.name = "05.09 back to the Center, the Oddish's battle on the pace's far step", .body = test_oddish_battle_on_far_step}, .expectation = {.description = "handles Oddish capture encounter occurring on far pace step"}}, + {.input = {.name = "05.09 onto the grass out of Shane's sight, the leg west a tile short", .body = test_oddish_patch_west_short}, .expectation = {.description = "recovers when approaching grass patch with short western leg"}}, {.input = {.name = "the routes after pacing, from either of its tiles", .body = test_routes_after_pacing}, .expectation = {.description = "plans valid routes regardless of which pacing tile character ends on"}}, {.input = {.name = "a save off the start pose stops before any step", .body = test_save_off_start_pose}, .expectation = {.description = "fails the start check without walking or saving"}}, {.input = {.name = "a dialog pops up before every step", .body = test_dialog_before_every_step}, .expectation = {.description = "cleared between steps, the story passes; left up, a walk fails on it"}}, diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryStartFrames_Tests.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryStartFrames_Tests.cpp index f6a9cfb692..27ab064b24 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryStartFrames_Tests.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryStartFrames_Tests.cpp @@ -298,8 +298,8 @@ const ReadCase READ_CASES[] = { }; -// console B, FRLG 00.27, 2026-11-09: the save stood outside Cerulean -// Center's door, not at the counter where 00.27 starts, and the run walked +// console B, FRLG 07.02, 2026-11-09: the save stood outside Cerulean +// Center's door, not at the counter where 07.02 starts, and the run walked // off. A checkpoint of one walk with the console's start check on frames // (add_start_check(), as build_checkpoint() adds it): the walk runs only // when the screen after the save loads shows the kept frame's place, or @@ -353,7 +353,7 @@ class Test_StartFrameCheck : public UnitTest{ private: static Pokemon::Checkpoint one_walk(size_t& walks){ Pokemon::Checkpoint checkpoint; - checkpoint.id = "00.27"; + checkpoint.id = "07.02"; Pokemon::Event walk; walk.name = "to_the_door"; walk.act = [&walks](Pokemon::RunState&){ @@ -389,15 +389,15 @@ const StartCheckCase START_CHECK_CASES[] = { }; -// The store, given two frames for 00.28 (outside the door, then the -// counter): what it finds for 00.28 and 00.27. +// The store, given two frames for 08.01 (outside the door, then the +// counter): what it finds for 08.01 and 07.02. struct StoreInput{ std::string name; // A folder to keep them in; none for the simulation's store. bool has_folder; }; struct StoreExpectation{ - // 00.28's frame is found, and is the last one kept (the counter). + // 08.01's frame is found, and is the last one kept (the counter). bool finds_last; }; struct StoreCase{ @@ -424,17 +424,17 @@ class Test_StartFrameStore : public UnitTest{ private: UnitTestResult check(const StartFrameStore& store) const{ - if (store.load("00.28")){ + if (store.load("08.01")){ return "expected no frame before one is kept"; } - const bool kept = store.save("00.28", start_frame(outside_door()), "test") - && store.save("00.28", start_frame(at_counter()), "test"); - const std::optional found = store.load("00.28"); + const bool kept = store.save("08.01", start_frame(outside_door()), "test") + && store.save("08.01", start_frame(at_counter()), "test"); + const std::optional found = store.load("08.01"); const bool finds_last = kept && found && found->width() == 240 && found->height() == 160 && same_start_place(compare_start_frames(*found, at_counter())); - if (finds_last != m_case.expectation.finds_last || store.load("00.27")){ + if (finds_last != m_case.expectation.finds_last || store.load("07.02")){ return std::format( - "expected 00.28's last frame {}found and none for 00.27; kept: {}, found: {}", + "expected 08.01's last frame {}found and none for 07.02; kept: {}, found: {}", m_case.expectation.finds_last ? "" : "not ", kept, found.has_value() ); } diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryTable.h b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryTable.h index 88dc3cea8c..119a9c7a38 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryTable.h +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryTable.h @@ -7,15 +7,21 @@ * Moon to Route 4 east of it, and on to Cerulean City, Misty, its rival, * Nugget Bridge and Bill, then Route 6 to Vermilion City, the S.S. * Anne's HM01 and Lt. Surge, on to Rock Tunnel and Lavender Town, as - * story checkpoints 00.01 to 00.29, each saved at its end. After 00.10 + * story checkpoints 01.01 to 08.02, each saved at its end. After 03.03 * every route and leg runs. Taken from a by-hand run on console B * (2026-11-01) and the pokefirered map scripts. * * Each checkpoint is an authored plan, StoryData/frlg-.plan.json - * (00.05: frlg-parcel-00.05.plan.json), built into the program and + * (02.01: frlg-parcel-02.01.plan.json), built into the program and * loaded by load_authored_story() (Data/JsonParser.h). Its sections, the * notes on how each step was planned and why, live there too. * + * An id is part.NN, checkpoint NN of that part of Bulbapedia's FireRed + * and LeafGreen walkthrough (parts 1 to 9 here). The order follows our + * setup and can differ in other runs: the rival battles depend on the + * starter, Route 11 and Diglett's Cave are skipped, the Bike Voucher is + * fetched as a detour, and the Rocket Hideout comes before Celadon Gym. + * */ #ifndef PokemonAutomation_PokemonFRLG_AutoStoryTable_H @@ -30,12 +36,12 @@ namespace NintendoSwitch{ namespace PokemonFRLG{ -// Checkpoints 00.01 to 00.29, in order of id, as authored in StoryData, -// with 00.01b, the way back in after SID Helper, after 00.01, 00.04 split in two at Squirtle's ball for -// Starter RNG: 00.04 and 00.04b, 00.12b, the way back in after Gift RNG, -// after 00.12, 00.12c, the Magikarp put in BOX 1, after it, 00.14b and -// 00.14c, Cerulean Gym to a save below Misty's platform and Misty alone -// from it, and 00.15b, the rival in Cerulean alone, from 00.15's save +// Checkpoints 01.01 to 08.02, in order of id, as authored in StoryData, +// with 01.02, the way back in after SID Helper, after 01.01, 01.05 split in two at Squirtle's ball for +// Starter RNG: 01.05 and 01.06, 04.03, the way back in after Gift RNG, +// after 04.02, 04.04, the Magikarp put in BOX 1, after it, 05.01 and +// 05.02, Cerulean Gym to a save below Misty's platform and Misty alone +// from it, and 05.04, the rival in Cerulean alone, from 05.03's save // below his trigger. const std::vector& story_checkpoints(); @@ -46,14 +52,14 @@ void add_tests_AutoStory(UnitTestDatabase& database); void add_tests_AutoStoryRunPlan(UnitTestDatabase& database); // The table run end to end against a fake game (PokemonFRLG_AutoStorySimulation_Tests.cpp). void add_tests_AutoStorySimulation(UnitTestDatabase& database); -// Rows 00.21 and 00.22 on the overworld sim (PokemonFRLG_AutoStoryVermilion_Tests.cpp). +// Rows 05.10 and 06.01 on the overworld sim (PokemonFRLG_AutoStoryVermilion_Tests.cpp). void add_tests_AutoStoryVermilion(UnitTestDatabase& database); -// Rows 00.23 to 00.25 on the overworld sim (PokemonFRLG_AutoStoryVermilionGym_Tests.cpp). +// Rows 06.02 to 06.04 on the overworld sim (PokemonFRLG_AutoStoryVermilionGym_Tests.cpp). void add_tests_AutoStoryVermilionGym(UnitTestDatabase& database); -// Rows from 00.26 on on the overworld sim (PokemonFRLG_AutoStoryCeladon_Tests.cpp), +// Rows from 07.01 on on the overworld sim (PokemonFRLG_AutoStoryCeladon_Tests.cpp), // with add_tests_AutoStoryLavender(). void add_tests_AutoStoryCeladon(UnitTestDatabase& database); -// Rows from 00.28 on on the overworld sim (PokemonFRLG_AutoStoryLavender_Tests.cpp). +// Rows from 08.01 on on the overworld sim (PokemonFRLG_AutoStoryLavender_Tests.cpp). void add_tests_AutoStoryLavender(UnitTestDatabase& database); diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryTeachScreens.h b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryTeachScreens.h index a6b36fbdf0..aea234d846 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryTeachScreens.h +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryTeachScreens.h @@ -17,7 +17,7 @@ * pokemon_special_anim.c), the member on pale blue diamonds: "Machine * set!", which waits for A (B there cancels the teach), the disc's * wobble, " learned !", then the TM CASE's list (console B, - * 00.23: HM01 to an Oddish with two free slots). With four: " + * 06.02: HM01 to an Oddish with two free slots). With four: " * wants to learn the move .", "However, already knows four * moves.", "Should a move be deleted and replaced with ?" YES/NO * (YES on top), YES: "Which move should be forgotten?", then KNOWN diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryTeachScreens_Tests.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryTeachScreens_Tests.cpp index 6a4e0ff1e6..aa1dc71488 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryTeachScreens_Tests.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryTeachScreens_Tests.cpp @@ -12,7 +12,7 @@ * pokemon_special_anim.c, Task_UseTM_NoForget / Task_ForgetMove, then * Task_MachineSet): "Machine set!" waits for A and B cancels the teach; * the wobble and " learned !" run on their own. Console B, - * 00.23 (2026-11-03): HM01 to an Oddish with two free slots stopped on + * 06.02 (2026-11-03): HM01 to an Oddish with two free slots stopped on * "Machine set!", read as "other", and gave up. * */ @@ -506,7 +506,7 @@ void three_moves_scene_unread(FakeTeachGame& game){ three_moves(game); game.scene_unread = true; } -// 00.23 on console B: HM01 to the Oddish (slot 2), ABSORB and SWEET +// 06.02 on console B: HM01 to the Oddish (slot 2), ABSORB and SWEET // SCENT. void oddish_cut(FakeTeachGame& game){ game.tms = {{"water-pulse", 1}, {"cut", 1}}; @@ -596,7 +596,7 @@ std::vector scene_screens_cases(){ .moves = {"bite", "bubble", "withdraw", "water-pulse"}, }, { - .name = "console B 00.23: HM01 to the Oddish, two free slots", + .name = "console B 06.02: HM01 to the Oddish, two free slots", .setup = oddish_cut, .plan = {.item = "hm01", .move = "cut", .member = 1}, .moves = {"absorb", "sweet-scent", "cut"}, diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryTrashCans.h b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryTrashCans.h index 3de89130a4..96103fb770 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryTrashCans.h +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryTrashCans.h @@ -81,7 +81,7 @@ struct TrashCanStand{ // Position and facing to inspect a trash can. TrashCanStand trash_can_stand(int can); -// `maps` with Vermilion Gym's trainers where their battles in 00.23 leave +// `maps` with Vermilion Gym's trainers where their battles in 06.02 leave // them, beaten (PokemonFRLG_AutoStoryTableVermilionGym.cpp): Sailor // Dwayne on (8, 14), Engineer Baily on (2, 12), Gentleman Tucker on // (6, 8). The search plans its walks between the cans on these, not on diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryVermilionGym_Tests.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryVermilionGym_Tests.cpp index 17a9b016b8..72ff452180 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryVermilionGym_Tests.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryVermilionGym_Tests.cpp @@ -2,7 +2,7 @@ * * From: https://github.com/PokemonAutomation/ * - * Rows 00.23 to 00.25 (PokemonFRLG_AutoStoryTableVermilionGym.cpp) on the + * Rows 06.02 to 06.04 (PokemonFRLG_AutoStoryTableVermilionGym.cpp) on the * overworld sim: the tree cut on the way in and out, the gym's three * trainers fought where the table says, the trash can search walking * between the cans clear of where the trainers stand after their battles @@ -116,8 +116,8 @@ MapData& map_named(std::vector& maps, const std::string& name){ throw InternalProgramError(nullptr, PA_CURRENT_FUNCTION, "No map " + name + "."); } -// `maps` with the trainers beaten that rows before 00.24 fought: Route -// 6's Jeff (00.21) and Vermilion Gym's three (00.23). +// `maps` with the trainers beaten that rows before 06.03 fought: Route +// 6's Jeff (05.10) and Vermilion Gym's three (06.02). std::vector maps_after_gym(std::vector maps = story_maps()){ for (MapObject& object : map_named(maps, GYM).objects){ object.trainer.reset(); @@ -230,10 +230,10 @@ class SimGym{ bool m_first_found = false; }; -// Row 00.23 from steps `first` to `last` (exclusive) on `sim`, the trash +// Row 06.02 from steps `first` to `last` (exclusive) on `sim`, the trash // cans drawn as `draws` say. std::string run_gym_steps(OverworldSim& sim, StoryPose& at, size_t first, size_t last, const std::vector& draws){ - const StoryCheckpoint& row = checkpoint("00.23"); + const StoryCheckpoint& row = checkpoint("06.02"); for (size_t c = first; c < last; c++){ const StoryStep& step = row.steps[c]; if (step.variant == TRASH_CANS_VARIANT){ @@ -241,7 +241,7 @@ std::string run_gym_steps(OverworldSim& sim, StoryPose& at, size_t first, size_t SimGym gym(sim, at, draws); const TrashCanResult result = run_trash_cans(logger, [&](int can){ return gym.check(can); }); if (result.end != TrashCanEnd::OPENED || !gym.open){ - return "00.23/trash_cans: " + std::string(trash_can_end_name(result.end)) + " " + gym.error; + return "06.02/trash_cans: " + std::string(trash_can_end_name(result.end)) + " " + gym.error; } continue; } @@ -252,13 +252,13 @@ std::string run_gym_steps(OverworldSim& sim, StoryPose& at, size_t first, size_t return ""; } -// 00.23 on the sim from the nurse to the nurse: the tree cut, Dwayne, +// 06.02 on the sim from the nurse to the nurse: the tree cut, Dwayne, // Baily and Tucker fought in that order where the table says and no one // else, the cans searched, out past the tree grown back. The switches // found at once (under 3 and 4), and after a wrong guess's reset (under // 3 and 8, then 13 and 14). UnitTestResult test_gym_row(){ - const StoryCheckpoint& row = checkpoint("00.23"); + const StoryCheckpoint& row = checkpoint("06.02"); for (const std::vector& draws : {std::vector{{3, 4}}, std::vector{{3, 8}, {13, 14}}}){ StoryPose at = *story_pose(*row.start); OverworldSim sim(story_maps(), MapPosition{at.map, at.tile}, *at.facing); @@ -267,10 +267,10 @@ UnitTestResult test_gym_row(){ } const std::vector expected{"sailor", "balding_man", "gentleman"}; if (sim.state().trainers_beaten != expected || !sim.state().violations.empty()){ - return "00.23: expected Dwayne, Baily and Tucker beaten and no violation; beat" + beaten_list(sim) + "."; + return "06.02: expected Dwayne, Baily and Tucker beaten and no violation; beat" + beaten_list(sim) + "."; } if (!(sim.state().position == MapPosition{StoryTable::VERMILION_CENTER, {7, 4}})){ - return "00.23: expected to end at Vermilion's nurse, not " + to_string(sim.state().position) + "."; + return "06.02: expected to end at Vermilion's nurse, not " + to_string(sim.state().position) + "."; } } return true; @@ -280,7 +280,7 @@ UnitTestResult test_gym_row(){ // their battles leave them: every can's stand reached from (5, 8) and from // every other stand, and the way out to the nurse from every stand. UnitTestResult test_cans_from_everywhere(){ - const StoryCheckpoint& row = checkpoint("00.23"); + const StoryCheckpoint& row = checkpoint("06.02"); StoryPose at = *story_pose(*row.start); OverworldSim sim(story_maps(), MapPosition{at.map, at.tile}, *at.facing); const size_t cans = step_index(row, "trash_cans"); @@ -336,11 +336,11 @@ UnitTestResult test_tree_shuts_the_yard(){ return true; } -// 00.24 and 00.25 on the sim, the gym as 00.23 leaves it: to Route 6's +// 06.03 and 06.04 on the sim, the gym as 06.02 leaves it: to Route 6's // grass round Isabelle's line and back, to below Surge through the beams, // and from him back out past the tree to the nurse, meeting no one. UnitTestResult test_to_surge_and_out(){ - for (const char* id : {"00.24", "00.25"}){ + for (const char* id : {"06.03", "06.04"}){ const StoryCheckpoint& row = checkpoint(id); StoryPose at = *story_pose(*row.start); OverworldSim sim(maps_after_gym(), MapPosition{at.map, at.tile}, *at.facing); @@ -352,25 +352,25 @@ UnitTestResult test_to_surge_and_out(){ if (!sim.state().trainers_beaten.empty() || !sim.state().violations.empty()){ return std::string(id) + ": a battle or a violation on the way."; } - const MapPosition end = std::string(id) == "00.24" ? MapPosition{GYM, {5, 3}} : MapPosition{StoryTable::VERMILION_CENTER, {7, 4}}; + const MapPosition end = std::string(id) == "06.03" ? MapPosition{GYM, {5, 3}} : MapPosition{StoryTable::VERMILION_CENTER, {7, 4}}; if (!(sim.state().position == end)){ return std::string(id) + ": ended on " + to_string(sim.state().position) + ", not " + to_string(end) + "."; } } - const StoryPose next = *story_pose(*checkpoint("00.25").start); + const StoryPose next = *story_pose(*checkpoint("06.04").start); if (!(next.tile == TilePos{5, 3}) || next.map != GYM){ - return "00.25 doesn't start where 00.24 ends."; + return "06.04 doesn't start where 06.03 ends."; } return true; } -// Console B, 00.25 (2026-11-03 18:17): the walk to the nurse went up +// Console B, 06.04 (2026-11-03 18:17): the walk to the nurse went up // column 27 to row 7 and west along it, into Oak's aide on (25, 7), there // since Surge's win; the leg was taken as walked and the step into the -// Center's door went into a house's wall. 00.25 from Surge to the nurse +// Center's door went into a house's wall. 06.04 from Surge to the nurse // with the aide there, meeting no one. UnitTestResult test_out_past_oaks_aide(){ - const StoryCheckpoint& row = checkpoint("00.25"); + const StoryCheckpoint& row = checkpoint("06.04"); const std::vector maps = maps_after_surge(); const MapData& city = *std::find_if(maps.begin(), maps.end(), [](const MapData& map){ return map.name == StoryTable::VERMILION; }); if (object_at(city, {25, 7}) == nullptr){ @@ -391,7 +391,7 @@ UnitTestResult test_out_past_oaks_aide(){ } // The story's lead before Surge: Wartortle at `level` with the S.S. -// Anne's moves (00.22), stats at OWN_GENES. +// Anne's moves (06.01), stats at OWN_GENES. PartyMember surge_lead(uint8_t level){ const Stats stats = combatant("wartortle", level, OWN_GENES)->stats; std::vector moves; @@ -404,7 +404,7 @@ PartyMember surge_lead(uint8_t level){ // Lt. Surge against the lead with 14 Potions: Raichu's Shock Wave, // Thunder Wave and Double Team beat Water Pulse and Bite (3% at Lv28); // TM28 Dig in place of Withdraw takes it to 27% at Lv28 and 61% at Lv30, -// past the GRIND's gate (00.23, 00.24). The battles still lost are to the +// past the GRIND's gate (06.02, 06.03). The battles still lost are to the // Raichu. The gym's three trainers are no risk. UnitTestResult test_surge_chance(){ const SimTrainer surge = *sim_trainer("TRAINER_LEADER_LT_SURGE"); @@ -489,16 +489,16 @@ UnitTestResult test_surge_dig_two_turns(){ return true; } -// 00.24 with a lead that beats Lt. Surge already: the check in the Center +// 06.03 with a lead that beats Lt. Surge already: the check in the Center // comes first, and with its flag set the walk to Route 6's grass, the // grind and the way back are skipped; the rest goes from the nurse to // below Surge on the sim. Console B walked out and back at Lv29, 79% // (2026-11-03). UnitTestResult test_surge_winnable_skips_grind(){ - const StoryCheckpoint& row = checkpoint("00.24"); + const StoryCheckpoint& row = checkpoint("06.03"); const StoryStep& check = row.steps.front(); if (!parse_grind_check_step(check)){ - return "Expected 00.24 to start with the grind's check, not " + check.name + "."; + return "Expected 06.03 to start with the grind's check, not " + check.name + "."; } StoryPose at = *story_pose(*row.start); OverworldSim sim(maps_after_gym(), MapPosition{at.map, at.tile}, *at.facing); @@ -525,23 +525,23 @@ UnitTestResult test_surge_winnable_skips_grind(){ const AutoStoryVermilionGymCase AUTO_STORY_VERMILION_GYM_CASES[] = { { - .input = {"00.23 the tree shuts the gym's yard until cut", test_tree_shuts_the_yard}, + .input = {"06.02 the tree shuts the gym's yard until cut", test_tree_shuts_the_yard}, .expectation = {}, }, { - .input = {"00.23 Vermilion Gym: Dwayne, Baily and Tucker, the cans at once or after a reset", test_gym_row}, + .input = {"06.02 Vermilion Gym: Dwayne, Baily and Tucker, the cans at once or after a reset", test_gym_row}, .expectation = {}, }, { - .input = {"00.23 every can's stand from Tucker's tile and from every other, and out", test_cans_from_everywhere}, + .input = {"06.02 every can's stand from Tucker's tile and from every other, and out", test_cans_from_everywhere}, .expectation = {}, }, { - .input = {"00.24 and 00.25 through the beams to Lt. Surge and out", test_to_surge_and_out}, + .input = {"06.03 and 06.04 through the beams to Lt. Surge and out", test_to_surge_and_out}, .expectation = {}, }, { - .input = {"00.25 out to the nurse past Oak's aide on (25, 7)", test_out_past_oaks_aide}, + .input = {"06.04 out to the nurse past Oak's aide on (25, 7)", test_out_past_oaks_aide}, .expectation = {}, }, { @@ -557,7 +557,7 @@ const AutoStoryVermilionGymCase AUTO_STORY_VERMILION_GYM_CASES[] = { .expectation = {}, }, { - .input = {"00.24 with Lt. Surge winnable already: no trip to Route 6", test_surge_winnable_skips_grind}, + .input = {"06.03 with Lt. Surge winnable already: no trip to Route 6", test_surge_winnable_skips_grind}, .expectation = {}, }, }; diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryVermilion_Tests.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryVermilion_Tests.cpp index 14ca17705a..737dec1814 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryVermilion_Tests.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryVermilion_Tests.cpp @@ -2,7 +2,7 @@ * * From: https://github.com/PokemonAutomation/ * - * Rows 00.21 (Cerulean to Vermilion City) and 00.22 (the S.S. Anne) on + * Rows 05.10 (Cerulean to Vermilion City) and 06.01 (the S.S. Anne) on * the overworld sim: their walks reach their ends, and meet only the * trainers the table fights. * @@ -82,7 +82,7 @@ size_t step_index(const StoryCheckpoint& row, const std::string& name){ return step - row.steps.begin(); } -// Runs row 00.21's steps from `first` to its end on `sim` from `at`, and +// Runs row 05.10's steps from `first` to its end on `sim` from `at`, and // checks that only Jeff ("camper") was fought and the walk ended at // Vermilion's nurse. std::string run_to_vermilion(OverworldSim& sim, StoryPose at, const StoryCheckpoint& row, size_t first){ @@ -93,15 +93,15 @@ std::string run_to_vermilion(OverworldSim& sim, StoryPose at, const StoryCheckpo } } if (sim.state().trainers_beaten != std::vector{"camper"} || !sim.state().violations.empty()){ - return "00.21: expected Jeff alone beaten and no violation; beat" + beaten_list(sim) + "."; + return "05.10: expected Jeff alone beaten and no violation; beat" + beaten_list(sim) + "."; } if (!(sim.state().position == MapPosition{"VermilionCity_PokemonCenter_1F", {7, 4}})){ - return "00.21: expected to end at Vermilion's nurse, not " + to_string(sim.state().position) + "."; + return "05.10: expected to end at Vermilion's nurse, not " + to_string(sim.state().position) + "."; } return ""; } -// 00.21 on the sim, from Cerulean's Pokemon Center through the burgled +// 05.10 on the sim, from Cerulean's Pokemon Center through the burgled // house to (32, 7), west of the Rocket, meeting no one; his trigger and // battle aren't the sim's, so from where his battle leaves the player: // Route 5, the Underground Path and Route 6, down column 15 out of @@ -110,9 +110,9 @@ std::string run_to_vermilion(OverworldSim& sim, StoryPose at, const StoryCheckpo // walk onto Route 6's column 15 ended a tile short, on column 16: the // same. UnitTestResult test_route6_jeff_only(){ - const StoryCheckpoint* row = checkpoint("00.21"); + const StoryCheckpoint* row = checkpoint("05.10"); if (row == nullptr){ - return "No checkpoint 00.21."; + return "No checkpoint 05.10."; } StoryPose at = *story_pose(*row->start); OverworldSim house(story_maps(), MapPosition{at.map, at.tile}, *at.facing); @@ -123,7 +123,7 @@ UnitTestResult test_route6_jeff_only(){ } } if (!(house.state().position == MapPosition{"CeruleanCity", {32, 7}}) || !house.state().trainers_beaten.empty()){ - return "00.21: expected to reach (32, 7) west of the Rocket, meeting no one, not " + to_string(house.state().position) + "."; + return "05.10: expected to reach (32, 7) west of the Rocket, meeting no one, not " + to_string(house.state().position) + "."; } const size_t battle = step_index(*row, "rocket_grunt"); const StoryPose after_rocket = *story_pose(*row->steps[battle].pose_after); @@ -165,15 +165,15 @@ StoryPose pose_after(const StoryPose& at, const StoryStep& step){ return at; } -// 00.22's walks on the sim, each from where the table says it starts: to +// 06.01's walks on the sim, each from where the table says it starts: to // the harbor short of the ticket check, aboard and along 2F short of the // rival's trigger row (30..32, 6), into the Captain's office behind him, // back to 1F's door, and from the pier to the nurse. None meets a // trainer: the ship's are in its cabins and on its deck. UnitTestResult test_ss_anne_walks(){ - const StoryCheckpoint* row = checkpoint("00.22"); + const StoryCheckpoint* row = checkpoint("06.01"); if (row == nullptr){ - return "No checkpoint 00.22."; + return "No checkpoint 06.01."; } StoryPose at = *story_pose(*row->start); bool before_rival = true; @@ -185,27 +185,27 @@ UnitTestResult test_ss_anne_walks(){ } const std::optional> route = walked_route(at, step); if (!route || route->empty()){ - return "00.22/" + step.name + ": no route."; + return "06.01/" + step.name + ": no route."; } const MapPosition start{at.map, at.tile}; if (steps_onto(*route, start, "VermilionCity", {{22, 33}, {23, 33}}) || (before_rival && steps_onto(*route, start, "SSAnne_2F_Corridor", {{30, 6}, {31, 6}, {32, 6}})) ){ - return "00.22/" + step.name + ": crosses a trigger before its step."; + return "06.01/" + step.name + ": crosses a trigger before its step."; } OverworldSim sim(story_maps(), start, *at.facing); if (const std::string failure = row_step_on_sim(sim, at, step, row->id); !failure.empty()){ return failure; } if (!(sim.state().position == MapPosition{at.map, at.tile})){ - return "00.22/" + step.name + ": ended on " + to_string(sim.state().position) + ", not " + to_string(MapPosition{at.map, at.tile}) + "."; + return "06.01/" + step.name + ": ended on " + to_string(sim.state().position) + ", not " + to_string(MapPosition{at.map, at.tile}) + "."; } if (!sim.state().trainers_beaten.empty() || !sim.state().violations.empty()){ - return "00.22/" + step.name + ": a trainer's battle or a violation on the way."; + return "06.01/" + step.name + ": a trainer's battle or a violation on the way."; } } if (!(MapPosition{at.map, at.tile} == MapPosition{"VermilionCity_PokemonCenter_1F", {7, 4}})){ - return "00.22: expected to end at Vermilion's nurse."; + return "06.01: expected to end at Vermilion's nurse."; } return true; } @@ -215,11 +215,11 @@ UnitTestResult test_ss_anne_walks(){ const AutoStoryVermilionCase AUTO_STORY_VERMILION_CASES[] = { { - .input = {"00.21 to Vermilion, only Jeff on Route 6, the walk onto column 15 whole or a tile short", test_route6_jeff_only}, + .input = {"05.10 to Vermilion, only Jeff on Route 6, the walk onto column 15 whole or a tile short", test_route6_jeff_only}, .expectation = {}, }, { - .input = {"00.22 the S.S. Anne's walks, short of the ticket check and the rival's trigger", test_ss_anne_walks}, + .input = {"06.01 the S.S. Anne's walks, short of the ticket check and the rival's trigger", test_ss_anne_walks}, .expectation = {}, }, }; diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStory_Tests.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStory_Tests.cpp index 430f851103..42afb44c46 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStory_Tests.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStory_Tests.cpp @@ -287,7 +287,7 @@ UnitTestResult check_legs_on( return true; } -// 00.09, each walk from where the one before leaves the player. +// 03.02, each walk from where the one before leaves the player. UnitTestResult test_pewter_gym_walks(){ const MapPosition nurse{"PewterCity_PokemonCenter_1F", {7, 4}}; // In by the door's mat (6, 14), straight up column 6 to below Liam's row. @@ -318,7 +318,7 @@ UnitTestResult test_pewter_gym_walks(){ ); } -// 00.10: out of the Gym to the aide's top trigger. The route keeps off his +// 03.03: out of the Gym to the aide's top trigger. The route keeps off his // three trigger tiles (46, 21..23), which would start the scene a step // early, and the step east from its end lands on (46, 21). UnitTestResult test_pewter_aide_walk(){ @@ -352,8 +352,8 @@ UnitTestResult test_pewter_aide_walk(){ return true; } -// Every ROUTE and LEGS after the Running Shoes (00.10) runs, or after the -// BICYCLE (00.26) may ride; none before. +// Every ROUTE and LEGS after the Running Shoes (03.03) runs, or after the +// BICYCLE (07.01) may ride; none before. UnitTestResult test_runs_after_shoes(){ bool has_shoes = false; bool has_bike = false; @@ -369,11 +369,11 @@ UnitTestResult test_runs_after_shoes(){ } runs += has_shoes ? 1 : 0; } - has_shoes = has_shoes || checkpoint.id == "00.10"; - has_bike = has_bike || checkpoint.id == "00.26"; + has_shoes = has_shoes || checkpoint.id == "03.03"; + has_bike = has_bike || checkpoint.id == "07.01"; } if (!has_shoes || runs == 0){ - return "No checkpoint 00.10, where the player gets the Running Shoes, or no route after it."; + return "No checkpoint 03.03, where the player gets the Running Shoes, or no route after it."; } return true; } @@ -617,7 +617,7 @@ UnitTestResult test_trainer_lines(){ return result; } } - has_shoes = has_shoes || checkpoint.id == "00.10"; + has_shoes = has_shoes || checkpoint.id == "03.03"; } if (beaten.size() != 30){ return "Expected to fight Colton, Greg and James on Route 3, the Grunt at (12, 20) in Mt. Moon, Nugget Bridge's five" @@ -628,22 +628,22 @@ UnitTestResult test_trainer_lines(){ return true; } -// 00.12's walk east over Route 3 crosses Lass Robin's sight (she wanders +// 04.02's walk east over Route 3 crosses Lass Robin's sight (she wanders // x 40, y 10..12, looking north and south, sight 3) on (40, 9) only: if // she sees the player, the walk goes on from there (console B, // 2026-11-02, she stopped "east 11 (to wall)" there). UnitTestResult test_robin_crossing(){ for (const StoryCheckpoint& checkpoint : story_checkpoints()){ - if (checkpoint.id != "00.12" || checkpoint.steps.empty() || checkpoint.steps[0].name != "route4_nurse"){ + if (checkpoint.id != "04.02" || checkpoint.steps.empty() || checkpoint.steps[0].name != "route4_nurse"){ continue; } const std::vector> expected{MapPosition{"Route3", {40, 9}}}; if (wanderer_stops(one_tile(*checkpoint.start), checkpoint.steps[0]) != expected){ - return "Expected 00.12/route4_nurse to cross Lass Robin's sight once, the walk placing her stop on Route3 (40, 9)."; + return "Expected 04.02/route4_nurse to cross Lass Robin's sight once, the walk placing her stop on Route3 (40, 9)."; } return true; } - return "No step 00.12/route4_nurse."; + return "No step 04.02/route4_nurse."; } // A scene the table starts on a step onto its trigger, and the walks of @@ -699,14 +699,14 @@ UnitTestResult check_trigger(const TriggerCase& c){ return "No step " + c.checkpoint + "/" + c.step + "."; } -// 00.15b meets the rival on the middle of his three trigger tiles, row 6 +// 05.04 meets the rival on the middle of his three trigger tiles, row 6 // at x 22..24 north of Cerulean (VAR_MAP_SCENE_CERULEAN_CITY_RIVAL 0), -// and 00.16 the Rocket on the east one of his two, (10..11, 15) on Nugget +// and 05.05 the Rocket on the east one of his two, (10..11, 15) on Nugget // Bridge (VAR_MAP_SCENE_ROUTE24 0), each from the tile below. UnitTestResult test_cerulean_triggers(){ const TriggerCase CASES[] = { - {.checkpoint = "00.15b", .step = "rival_trigger", .map = "CeruleanCity", .y = 6, .x0 = 22, .x1 = 24, .onto_x = 23}, - {.checkpoint = "00.16", .step = "rocket_trigger", .map = "Route24", .y = 15, .x0 = 10, .x1 = 11, .onto_x = 11}, + {.checkpoint = "05.04", .step = "rival_trigger", .map = "CeruleanCity", .y = 6, .x0 = 22, .x1 = 24, .onto_x = 23}, + {.checkpoint = "05.05", .step = "rocket_trigger", .map = "Route24", .y = 15, .x0 = 10, .x1 = 11, .onto_x = 11}, }; for (const TriggerCase& c : CASES){ if (UnitTestResult result = check_trigger(c); result.result != UnitTestResult::PASSED){ @@ -716,13 +716,13 @@ UnitTestResult test_cerulean_triggers(){ return true; } -// 00.16 steps beside Nugget Bridge's five trainers from the south, one +// 05.05 steps beside Nugget Bridge's five trainers from the south, one // step at a time, each battle right after its step: Cale, Ali, Timmy, // Reli and Ethan, by where they stand. UnitTestResult test_nugget_bridge_order(){ - const StoryCheckpoint* checkpoint = find_checkpoint("00.16"); + const StoryCheckpoint* checkpoint = find_checkpoint("05.05"); if (checkpoint == nullptr){ - return "No checkpoint 00.16."; + return "No checkpoint 05.05."; } const std::vector& steps = checkpoint->steps; std::string met; @@ -731,16 +731,16 @@ UnitTestResult test_nugget_bridge_order(){ const MapData* map = find_map_named(pose.map); const MapObject* trainer = steps[c].kind == StoryStepKind::STEP && map ? trainer_seeing(*map, step_end(pose, steps[c], {}), {}, false) : nullptr; if (trainer != nullptr && (c + 1 == steps.size() || steps[c + 1].kind != StoryStepKind::BATTLE)){ - return "00.16/" + steps[c].name + ": no battle right after the step."; + return "05.05/" + steps[c].name + ": no battle right after the step."; } met += trainer ? " " + to_string(TilePos{trainer->x, trainer->y}) : ""; if (UnitTestResult result = advance(pose, steps[c]); result.result != UnitTestResult::PASSED){ - return "00.16 " + result.message; + return "05.05 " + result.message; } } const std::string expected = " (12, 31) (10, 28) (12, 25) (10, 22) (12, 19)"; if (met != expected){ - return "00.16: expected the five bridge trainers south to north," + expected + "; met" + met + "."; + return "05.05: expected the five bridge trainers south to north," + expected + "; met" + met + "."; } return true; } @@ -776,7 +776,7 @@ UnitTestResult test_save_places(){ } // A reload's save checked against the checkpoint's start: a save left in -// Pewter City (a new game whose save didn't happen) can't start 00.02 in +// Pewter City (a new game whose save didn't happen) can't start 01.03 in // the bedroom. The check takes no checks level: Fast runs it too. UnitTestResult test_save_place_error(){ struct Case{ @@ -910,11 +910,11 @@ UnitTestResult test_intro_names(){ return true; } -// 00.12c stores the Magikarp Gift RNG bought; with Gift RNG off there is +// 04.04 stores the Magikarp Gift RNG bought; with Gift RNG off there is // none, and the deposit is skipped instead of refused. UnitTestResult test_magikarp_deposit_skippable(){ for (const StoryCheckpoint& checkpoint : story_checkpoints()){ - if (checkpoint.id != "00.12c"){ + if (checkpoint.id != "04.04"){ continue; } for (const StoryStep& step : checkpoint.steps){ @@ -923,9 +923,9 @@ UnitTestResult test_magikarp_deposit_skippable(){ return true; } } - return "00.12c: expected a deposit of the second slot, skipped if the party hasn't got it."; + return "04.04: expected a deposit of the second slot, skipped if the party hasn't got it."; } - return "No checkpoint 00.12c."; + return "No checkpoint 04.04."; } // set_options()'s RIGHT presses from each value an old save can leave: @@ -982,7 +982,7 @@ const AutoStoryTestCase AUTO_STORY_CASES[] = { {.input = {.name = "options: RIGHT presses from the shown value", .body = test_option_presses}, .expectation = {.description = "calculates Dpad RIGHT inputs for setting game options"},}, {.input = {.name = "Route 3: only the planned trainers' lines", .body = test_trainer_lines}, .expectation = {.description = "verifies route 3 trainer interaction sightlines"},}, {.input = {.name = "Route 3: Lass Robin stops the walk on (40, 9)", .body = test_robin_crossing}, .expectation = {.description = "verifies trainer interruption on route 3"},}, - {.input = {.name = "00.12c: the Magikarp's deposit is skipped without Gift RNG", .body = test_magikarp_deposit_skippable}, .expectation = {.description = "skips magikarp deposit when gift rng is disabled"},}, + {.input = {.name = "04.04: the Magikarp's deposit is skipped without Gift RNG", .body = test_magikarp_deposit_skippable}, .expectation = {.description = "skips magikarp deposit when gift rng is disabled"},}, {.input = {"Cerulean: the rival's and the Rocket's triggers", test_cerulean_triggers}, .expectation = {},}, {.input = {"Nugget Bridge: its five trainers, south to north", test_nugget_bridge_order}, .expectation = {},},}; diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_StoryReplay.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_StoryReplay.cpp index c9b9fe14d6..9ef7ce124b 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_StoryReplay.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_StoryReplay.cpp @@ -17,7 +17,7 @@ const std::string& story_replay_fixture(std::string_view name){ } if (name == "capture"){ for (const auto& [file, text] : autostory_checkpoint_json()){ - if (file == "frlg-parcel-00.05"){ + if (file == "frlg-parcel-02.01"){ return text; } } diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/ReplayData/frlg-story-sim-trace.json b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/ReplayData/frlg-story-sim-trace.json index dd16d7f0e2..0eac46a3cf 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/ReplayData/frlg-story-sim-trace.json +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/ReplayData/frlg-story-sim-trace.json @@ -1,1433 +1,1433 @@ { - "about": "story_sim_trace() of the FRLG story table (Data/AuthoredStory_Tests.h), taken from the C++ rows before they moved to StoryData; from 00.30 on, from their plans.", + "about": "story_sim_trace() of the FRLG story table (Data/AuthoredStory_Tests.h), taken from the C++ rows before they moved to StoryData; from 08.03 on, from their plans.", "trace": [ "[Segment] 00: start, 36 checkpoints", - "begin 00.01", - "[Checkpoint] 00.01: start, 2 events", - "[Event] 00.01/1 intro: start", - "00.01/intro: ok at -", - "[Event] 00.01/1 intro: done", - "[Event] 00.01/2 options: start", - "00.01/options: ok at -", - "[Event] 00.01/2 options: done", + "begin 01.01", + "[Checkpoint] 01.01: start, 2 events", + "[Event] 01.01/1 intro: start", + "01.01/intro: ok at -", + "[Event] 01.01/1 intro: done", + "[Event] 01.01/2 options: start", + "01.01/options: ok at -", + "[Event] 01.01/2 options: done", "save at PalletTown_PlayersHouse_2F (6, 6) facing north (tile)", - "[Checkpoint] 00.01: done, 2 run, 0 skipped", - "[Checkpoint] 00.01: passed on attempt 1 (one-shot)", - "begin 00.02", - "[Checkpoint] 00.02: start, 2 events", - "[Event] 00.02/1 from_save: start", - "[Event] 00.02/1 from_save: done", - "[Event] 00.02/2 front_door: start", - "00.02/front_door: ok at PalletTown (6, 8) facing south (tile)", - "[Event] 00.02/2 front_door: done", + "[Checkpoint] 01.01: done, 2 run, 0 skipped", + "[Checkpoint] 01.01: passed on attempt 1 (one-shot)", + "begin 01.03", + "[Checkpoint] 01.03: start, 2 events", + "[Event] 01.03/1 from_save: start", + "[Event] 01.03/1 from_save: done", + "[Event] 01.03/2 front_door: start", + "01.03/front_door: ok at PalletTown (6, 8) facing south (tile)", + "[Event] 01.03/2 front_door: done", "save at PalletTown (6, 8) facing south (tile)", - "[Checkpoint] 00.02: done, 2 run, 0 skipped", - "[Checkpoint] 00.02: passed on attempt 1 (one-shot)", - "begin 00.03", - "[Checkpoint] 00.03: start, 4 events", - "[Event] 00.03/1 from_save: start", - "[Event] 00.03/1 from_save: done", - "[Event] 00.03/2 below_oaks_trigger: start", - "00.03/below_oaks_trigger: ok at PalletTown (12, 2) facing north (tile)", - "[Event] 00.03/2 below_oaks_trigger: done", - "[Event] 00.03/3 oaks_trigger: start", - "00.03/oaks_trigger: ok at PalletTown (12, 1) facing north (tile)", - "[Event] 00.03/3 oaks_trigger: done", - "[Event] 00.03/4 to_the_lab: start", - "00.03/to_the_lab: ok at -", - "[Event] 00.03/4 to_the_lab: done", + "[Checkpoint] 01.03: done, 2 run, 0 skipped", + "[Checkpoint] 01.03: passed on attempt 1 (one-shot)", + "begin 01.04", + "[Checkpoint] 01.04: start, 4 events", + "[Event] 01.04/1 from_save: start", + "[Event] 01.04/1 from_save: done", + "[Event] 01.04/2 below_oaks_trigger: start", + "01.04/below_oaks_trigger: ok at PalletTown (12, 2) facing north (tile)", + "[Event] 01.04/2 below_oaks_trigger: done", + "[Event] 01.04/3 oaks_trigger: start", + "01.04/oaks_trigger: ok at PalletTown (12, 1) facing north (tile)", + "[Event] 01.04/3 oaks_trigger: done", + "[Event] 01.04/4 to_the_lab: start", + "01.04/to_the_lab: ok at -", + "[Event] 01.04/4 to_the_lab: done", "save at PalletTown_ProfessorOaksLab (6, 4) facing north (tile)", - "[Checkpoint] 00.03: done, 4 run, 0 skipped", - "[Checkpoint] 00.03: passed on attempt 1 (one-shot)", - "begin 00.04", - "[Checkpoint] 00.04: start, 9 events", - "[Event] 00.04/1 from_save: start", - "[Event] 00.04/1 from_save: done", - "[Event] 00.04/2 below_squirtle: start", - "00.04/below_squirtle: ok at PalletTown_ProfessorOaksLab (9, 5) facing north (tile)", - "[Event] 00.04/2 below_squirtle: done", - "[Event] 00.04/3 squirtle_ball: start", - "00.04/squirtle_ball: ok at -", - "[Event] 00.04/3 squirtle_ball: done", - "[Event] 00.04/4 choose_squirtle: start", - "00.04/choose_squirtle: ok at -", - "[Event] 00.04/4 choose_squirtle: done", - "[Event] 00.04/5 no_nickname: start", - "00.04/no_nickname: ok at -", - "[Event] 00.04/5 no_nickname: done", - "[Event] 00.04/6 rival_takes_bulbasaur: start", - "00.04/rival_takes_bulbasaur: ok at -", - "[Event] 00.04/6 rival_takes_bulbasaur: done", - "[Event] 00.04/7 above_rival_trigger: start", - "00.04/above_rival_trigger: ok at PalletTown_ProfessorOaksLab (7, 7) facing south (tile)", - "[Event] 00.04/7 above_rival_trigger: done", - "[Event] 00.04/8 rival_trigger: start", - "00.04/rival_trigger: ok at PalletTown_ProfessorOaksLab (7, 8) facing south (tile)", - "[Event] 00.04/8 rival_trigger: done", - "[Event] 00.04/9 rival_battle: start", - "00.04/rival_battle: ok at -", - "[Event] 00.04/9 rival_battle: done", + "[Checkpoint] 01.04: done, 4 run, 0 skipped", + "[Checkpoint] 01.04: passed on attempt 1 (one-shot)", + "begin 01.05", + "[Checkpoint] 01.05: start, 9 events", + "[Event] 01.05/1 from_save: start", + "[Event] 01.05/1 from_save: done", + "[Event] 01.05/2 below_squirtle: start", + "01.05/below_squirtle: ok at PalletTown_ProfessorOaksLab (9, 5) facing north (tile)", + "[Event] 01.05/2 below_squirtle: done", + "[Event] 01.05/3 squirtle_ball: start", + "01.05/squirtle_ball: ok at -", + "[Event] 01.05/3 squirtle_ball: done", + "[Event] 01.05/4 choose_squirtle: start", + "01.05/choose_squirtle: ok at -", + "[Event] 01.05/4 choose_squirtle: done", + "[Event] 01.05/5 no_nickname: start", + "01.05/no_nickname: ok at -", + "[Event] 01.05/5 no_nickname: done", + "[Event] 01.05/6 rival_takes_bulbasaur: start", + "01.05/rival_takes_bulbasaur: ok at -", + "[Event] 01.05/6 rival_takes_bulbasaur: done", + "[Event] 01.05/7 above_rival_trigger: start", + "01.05/above_rival_trigger: ok at PalletTown_ProfessorOaksLab (7, 7) facing south (tile)", + "[Event] 01.05/7 above_rival_trigger: done", + "[Event] 01.05/8 rival_trigger: start", + "01.05/rival_trigger: ok at PalletTown_ProfessorOaksLab (7, 8) facing south (tile)", + "[Event] 01.05/8 rival_trigger: done", + "[Event] 01.05/9 rival_battle: start", + "01.05/rival_battle: ok at -", + "[Event] 01.05/9 rival_battle: done", "save at PalletTown_ProfessorOaksLab (7, 8) facing south (tile)", - "[Checkpoint] 00.04: done, 9 run, 0 skipped", - "[Checkpoint] 00.04: passed on attempt 1 (one-shot)", - "begin 00.05", - "[Checkpoint] 00.05: start, 4 events", - "[Event] 00.05/1 from_save: start", - "[Event] 00.05/1 from_save: done", - "[Event] 00.05/2 below_mart_door: start", - "00.05/below_mart_door: ok at ViridianCity (36, 20) facing north (tile)", - "[Event] 00.05/2 below_mart_door: done", - "[Event] 00.05/3 mart_door: start", - "00.05/mart_door: ok at ViridianCity (36, 19) facing north (tile)", - "[Event] 00.05/3 mart_door: done", - "[Event] 00.05/4 parcel_from_clerk: start", - "00.05/parcel_from_clerk: ok at -", - "[Event] 00.05/4 parcel_from_clerk: done", + "[Checkpoint] 01.05: done, 9 run, 0 skipped", + "[Checkpoint] 01.05: passed on attempt 1 (one-shot)", + "begin 02.01", + "[Checkpoint] 02.01: start, 4 events", + "[Event] 02.01/1 from_save: start", + "[Event] 02.01/1 from_save: done", + "[Event] 02.01/2 below_mart_door: start", + "02.01/below_mart_door: ok at ViridianCity (36, 20) facing north (tile)", + "[Event] 02.01/2 below_mart_door: done", + "[Event] 02.01/3 mart_door: start", + "02.01/mart_door: ok at ViridianCity (36, 19) facing north (tile)", + "[Event] 02.01/3 mart_door: done", + "[Event] 02.01/4 parcel_from_clerk: start", + "02.01/parcel_from_clerk: ok at -", + "[Event] 02.01/4 parcel_from_clerk: done", "save at ViridianCity_Mart (4, 3) facing west (tile)", - "[Checkpoint] 00.05: done, 4 run, 0 skipped", - "[Checkpoint] 00.05: passed on attempt 1 (one-shot)", - "begin 00.06", - "[Checkpoint] 00.06: start, 4 events", - "[Event] 00.06/1 from_save: start", - "[Event] 00.06/1 from_save: done", - "[Event] 00.06/2 below_oak: start", - "00.06/below_oak: ok at PalletTown_ProfessorOaksLab (6, 4) facing north (tile)", - "[Event] 00.06/2 below_oak: done", - "[Event] 00.06/3 give_parcel: start", - "00.06/give_parcel: ok at -", - "[Event] 00.06/3 give_parcel: done", - "[Event] 00.06/4 pokedex_scene: start", - "00.06/pokedex_scene: ok at -", - "[Event] 00.06/4 pokedex_scene: done", + "[Checkpoint] 02.01: done, 4 run, 0 skipped", + "[Checkpoint] 02.01: passed on attempt 1 (one-shot)", + "begin 02.02", + "[Checkpoint] 02.02: start, 4 events", + "[Event] 02.02/1 from_save: start", + "[Event] 02.02/1 from_save: done", + "[Event] 02.02/2 below_oak: start", + "02.02/below_oak: ok at PalletTown_ProfessorOaksLab (6, 4) facing north (tile)", + "[Event] 02.02/2 below_oak: done", + "[Event] 02.02/3 give_parcel: start", + "02.02/give_parcel: ok at -", + "[Event] 02.02/3 give_parcel: done", + "[Event] 02.02/4 pokedex_scene: start", + "02.02/pokedex_scene: ok at -", + "[Event] 02.02/4 pokedex_scene: done", "save at PalletTown_ProfessorOaksLab (6, 4) facing south (tile)", - "[Checkpoint] 00.06: done, 4 run, 0 skipped", - "[Checkpoint] 00.06: passed on attempt 1 (one-shot)", - "begin 00.07", - "[Checkpoint] 00.07: start, 10 events", - "[Event] 00.07/1 from_save: start", - "[Event] 00.07/1 from_save: done", - "[Event] 00.07/2 mart_clerk: start", - "00.07/mart_clerk: ok at ViridianCity_Mart (4, 3) facing west (tile)", - "[Event] 00.07/2 mart_clerk: done", - "[Event] 00.07/3 potions_and_antidotes: start", - "00.07/potions_and_antidotes: ok at -", - "[Event] 00.07/3 potions_and_antidotes: done", - "[Event] 00.07/4 viridian_nurse: start", - "00.07/viridian_nurse: ok at ViridianCity_PokemonCenter_1F (7, 4) facing north (tile)", - "[Event] 00.07/4 viridian_nurse: done", - "[Event] 00.07/5 heal_viridian: start", - "00.07/heal_viridian: ok at -", - "[Event] 00.07/5 heal_viridian: done", - "[Event] 00.07/6 below_old_man_trigger: start", - "00.07/below_old_man_trigger: ok at ViridianCity (20, 9) facing north (tile)", - "[Event] 00.07/6 below_old_man_trigger: done", - "[Event] 00.07/7 old_man_trigger: start", - "00.07/old_man_trigger: ok at ViridianCity (20, 8) facing north (tile)", - "[Event] 00.07/7 old_man_trigger: done", - "[Event] 00.07/8 old_man_tutorial: start", - "00.07/old_man_tutorial: ok at -", - "[Event] 00.07/8 old_man_tutorial: done", - "[Event] 00.07/9 past_old_man: start", - "00.07/past_old_man: ok at ViridianCity (20, 5) facing north (tile)", - "[Event] 00.07/9 past_old_man: done", - "[Event] 00.07/10 forest_entrance: start", - "00.07/forest_entrance: ok at ViridianForest (29, 62) facing north (tile)", - "[Event] 00.07/10 forest_entrance: done", + "[Checkpoint] 02.02: done, 4 run, 0 skipped", + "[Checkpoint] 02.02: passed on attempt 1 (one-shot)", + "begin 02.03", + "[Checkpoint] 02.03: start, 10 events", + "[Event] 02.03/1 from_save: start", + "[Event] 02.03/1 from_save: done", + "[Event] 02.03/2 mart_clerk: start", + "02.03/mart_clerk: ok at ViridianCity_Mart (4, 3) facing west (tile)", + "[Event] 02.03/2 mart_clerk: done", + "[Event] 02.03/3 potions_and_antidotes: start", + "02.03/potions_and_antidotes: ok at -", + "[Event] 02.03/3 potions_and_antidotes: done", + "[Event] 02.03/4 viridian_nurse: start", + "02.03/viridian_nurse: ok at ViridianCity_PokemonCenter_1F (7, 4) facing north (tile)", + "[Event] 02.03/4 viridian_nurse: done", + "[Event] 02.03/5 heal_viridian: start", + "02.03/heal_viridian: ok at -", + "[Event] 02.03/5 heal_viridian: done", + "[Event] 02.03/6 below_old_man_trigger: start", + "02.03/below_old_man_trigger: ok at ViridianCity (20, 9) facing north (tile)", + "[Event] 02.03/6 below_old_man_trigger: done", + "[Event] 02.03/7 old_man_trigger: start", + "02.03/old_man_trigger: ok at ViridianCity (20, 8) facing north (tile)", + "[Event] 02.03/7 old_man_trigger: done", + "[Event] 02.03/8 old_man_tutorial: start", + "02.03/old_man_tutorial: ok at -", + "[Event] 02.03/8 old_man_tutorial: done", + "[Event] 02.03/9 past_old_man: start", + "02.03/past_old_man: ok at ViridianCity (20, 5) facing north (tile)", + "[Event] 02.03/9 past_old_man: done", + "[Event] 02.03/10 forest_entrance: start", + "02.03/forest_entrance: ok at ViridianForest (29, 62) facing north (tile)", + "[Event] 02.03/10 forest_entrance: done", "save at ViridianForest (29, 62) facing north (tile)", - "[Checkpoint] 00.07: done, 10 run, 0 skipped", - "[Checkpoint] 00.07: passed on attempt 1 (one-shot)", - "begin 00.08", - "[Checkpoint] 00.08: start, 7 events", - "[Event] 00.08/1 from_save: start", - "[Event] 00.08/1 from_save: done", - "[Event] 00.08/2 forest_east: start", - "00.08/forest_east: ok at ViridianForest (44, 43) facing north (tile)", - "[Event] 00.08/2 forest_east: done", - "[Event] 00.08/3 forest_north: start", - "00.08/forest_north: ok at ViridianForest (39, 25) facing west (tile)", - "[Event] 00.08/3 forest_north: done", - "[Event] 00.08/4 forest_exit: start", - "00.08/forest_exit: ok at ViridianForest (4, 13) facing east (tile)", - "[Event] 00.08/4 forest_exit: done", - "[Event] 00.08/5 forest_gate: start", - "00.08/forest_gate: ok at Route2_ViridianForest_NorthEntrance (7, 10) facing north (tile)", - "[Event] 00.08/5 forest_gate: done", - "[Event] 00.08/6 pewter_nurse: start", - "00.08/pewter_nurse: ok at PewterCity_PokemonCenter_1F (7, 4) facing north (tile)", - "[Event] 00.08/6 pewter_nurse: done", - "[Event] 00.08/7 heal_pewter: start", - "00.08/heal_pewter: ok at -", - "[Event] 00.08/7 heal_pewter: done", + "[Checkpoint] 02.03: done, 10 run, 0 skipped", + "[Checkpoint] 02.03: passed on attempt 1 (one-shot)", + "begin 03.01", + "[Checkpoint] 03.01: start, 7 events", + "[Event] 03.01/1 from_save: start", + "[Event] 03.01/1 from_save: done", + "[Event] 03.01/2 forest_east: start", + "03.01/forest_east: ok at ViridianForest (44, 43) facing north (tile)", + "[Event] 03.01/2 forest_east: done", + "[Event] 03.01/3 forest_north: start", + "03.01/forest_north: ok at ViridianForest (39, 25) facing west (tile)", + "[Event] 03.01/3 forest_north: done", + "[Event] 03.01/4 forest_exit: start", + "03.01/forest_exit: ok at ViridianForest (4, 13) facing east (tile)", + "[Event] 03.01/4 forest_exit: done", + "[Event] 03.01/5 forest_gate: start", + "03.01/forest_gate: ok at Route2_ViridianForest_NorthEntrance (7, 10) facing north (tile)", + "[Event] 03.01/5 forest_gate: done", + "[Event] 03.01/6 pewter_nurse: start", + "03.01/pewter_nurse: ok at PewterCity_PokemonCenter_1F (7, 4) facing north (tile)", + "[Event] 03.01/6 pewter_nurse: done", + "[Event] 03.01/7 heal_pewter: start", + "03.01/heal_pewter: ok at -", + "[Event] 03.01/7 heal_pewter: done", "save at PewterCity_PokemonCenter_1F (7, 4) facing north (tile)", - "[Checkpoint] 00.08: done, 7 run, 0 skipped", - "[Checkpoint] 00.08: passed on attempt 1 (one-shot)", - "begin 00.09", - "[Checkpoint] 00.09: start, 8 events", - "[Event] 00.09/1 from_save: start", - "[Event] 00.09/1 from_save: done", - "[Event] 00.09/2 below_liam_line: start", - "00.09/below_liam_line: ok at PewterCity_Gym (6, 9) facing north (tile)", - "[Event] 00.09/2 below_liam_line: done", - "[Event] 00.09/3 liam_line: start", - "00.09/liam_line: ok at PewterCity_Gym (6, 8) facing north (tile)", - "[Event] 00.09/3 liam_line: done", - "[Event] 00.09/4 camper_liam: start", - "00.09/camper_liam: ok at -", - "[Event] 00.09/4 camper_liam: done", - "[Event] 00.09/5 ready_for_brock: start", - "00.09/ready_for_brock: ok at -", - "[Event] 00.09/5 ready_for_brock: done", - "[Event] 00.09/6 before_brock: start", - "00.09/before_brock: ok at PewterCity_Gym (6, 6) facing north (tile)", - "[Event] 00.09/6 before_brock: done", - "[Event] 00.09/7 challenge_brock: start", - "00.09/challenge_brock: ok at -", - "[Event] 00.09/7 challenge_brock: done", - "[Event] 00.09/8 brock: start", - "00.09/brock: ok at -", - "[Event] 00.09/8 brock: done", + "[Checkpoint] 03.01: done, 7 run, 0 skipped", + "[Checkpoint] 03.01: passed on attempt 1 (one-shot)", + "begin 03.02", + "[Checkpoint] 03.02: start, 8 events", + "[Event] 03.02/1 from_save: start", + "[Event] 03.02/1 from_save: done", + "[Event] 03.02/2 below_liam_line: start", + "03.02/below_liam_line: ok at PewterCity_Gym (6, 9) facing north (tile)", + "[Event] 03.02/2 below_liam_line: done", + "[Event] 03.02/3 liam_line: start", + "03.02/liam_line: ok at PewterCity_Gym (6, 8) facing north (tile)", + "[Event] 03.02/3 liam_line: done", + "[Event] 03.02/4 camper_liam: start", + "03.02/camper_liam: ok at -", + "[Event] 03.02/4 camper_liam: done", + "[Event] 03.02/5 ready_for_brock: start", + "03.02/ready_for_brock: ok at -", + "[Event] 03.02/5 ready_for_brock: done", + "[Event] 03.02/6 before_brock: start", + "03.02/before_brock: ok at PewterCity_Gym (6, 6) facing north (tile)", + "[Event] 03.02/6 before_brock: done", + "[Event] 03.02/7 challenge_brock: start", + "03.02/challenge_brock: ok at -", + "[Event] 03.02/7 challenge_brock: done", + "[Event] 03.02/8 brock: start", + "03.02/brock: ok at -", + "[Event] 03.02/8 brock: done", "save at PewterCity_Gym (6, 6) facing north (tile)", - "[Checkpoint] 00.09: done, 8 run, 0 skipped", - "[Checkpoint] 00.09: passed on attempt 1 (one-shot)", - "begin 00.10", - "[Checkpoint] 00.10: start, 5 events", - "[Event] 00.10/1 from_save: start", - "[Event] 00.10/1 from_save: done", - "[Event] 00.10/2 before_aide_trigger: start", - "00.10/before_aide_trigger: ok at PewterCity (45, 21) facing east (tile)", - "[Event] 00.10/2 before_aide_trigger: done", - "[Event] 00.10/3 aide_trigger: start", - "00.10/aide_trigger: ok at PewterCity (46, 21) facing east (tile)", - "[Event] 00.10/3 aide_trigger: done", - "[Event] 00.10/4 shoes_from_aide: start", - "00.10/shoes_from_aide: ok at -", - "[Event] 00.10/4 shoes_from_aide: done", - "[Event] 00.10/5 below_pewter_center: start", - "00.10/below_pewter_center: ok at PewterCity (17, 26) facing south (tile)", - "[Event] 00.10/5 below_pewter_center: done", + "[Checkpoint] 03.02: done, 8 run, 0 skipped", + "[Checkpoint] 03.02: passed on attempt 1 (one-shot)", + "begin 03.03", + "[Checkpoint] 03.03: start, 5 events", + "[Event] 03.03/1 from_save: start", + "[Event] 03.03/1 from_save: done", + "[Event] 03.03/2 before_aide_trigger: start", + "03.03/before_aide_trigger: ok at PewterCity (45, 21) facing east (tile)", + "[Event] 03.03/2 before_aide_trigger: done", + "[Event] 03.03/3 aide_trigger: start", + "03.03/aide_trigger: ok at PewterCity (46, 21) facing east (tile)", + "[Event] 03.03/3 aide_trigger: done", + "[Event] 03.03/4 shoes_from_aide: start", + "03.03/shoes_from_aide: ok at -", + "[Event] 03.03/4 shoes_from_aide: done", + "[Event] 03.03/5 below_pewter_center: start", + "03.03/below_pewter_center: ok at PewterCity (17, 26) facing south (tile)", + "[Event] 03.03/5 below_pewter_center: done", "save at PewterCity (17, 26) facing south (tile)", - "[Checkpoint] 00.10: done, 5 run, 0 skipped", - "[Checkpoint] 00.10: passed on attempt 1 (one-shot)", - "begin 00.11", - "[Checkpoint] 00.11: start, 14 events", - "[Event] 00.11/1 from_save: start", - "[Event] 00.11/1 from_save: done", - "[Event] 00.11/2 pewter_nurse: start", - "00.11/pewter_nurse: ok at PewterCity_PokemonCenter_1F (7, 4) facing north (tile)", - "[Event] 00.11/2 pewter_nurse: done", - "[Event] 00.11/3 heal_pewter: start", - "00.11/heal_pewter: ok at -", - "[Event] 00.11/3 heal_pewter: done", - "[Event] 00.11/4 west_of_janice_line: start", - "00.11/west_of_janice_line: ok at Route3 (13, 8) facing east (tile)", - "[Event] 00.11/4 west_of_janice_line: done", - "[Event] 00.11/5 below_colton_line: start", - "00.11/below_colton_line: ok at Route3 (14, 7) facing north (tile)", - "[Event] 00.11/5 below_colton_line: done", - "[Event] 00.11/6 colton_line: start", - "00.11/colton_line: ok at Route3 (14, 6) facing north (tile)", - "[Event] 00.11/6 colton_line: done", - "[Event] 00.11/7 bug_catcher_colton: start", - "00.11/bug_catcher_colton: ok at -", - "[Event] 00.11/7 bug_catcher_colton: done", - "[Event] 00.11/8 past_ben: start", - "00.11/past_ben: ok at Route3 (24, 5) facing east (tile)", - "[Event] 00.11/8 past_ben: done", - "[Event] 00.11/9 greg_line: start", - "00.11/greg_line: ok at Route3 (25, 5) facing east (tile)", - "[Event] 00.11/9 greg_line: done", - "[Event] 00.11/10 bug_catcher_greg: start", - "00.11/bug_catcher_greg: ok at -", - "[Event] 00.11/10 bug_catcher_greg: done", - "[Event] 00.11/11 above_james_line: start", - "00.11/above_james_line: ok at Route3 (36, 5) facing east (tile)", - "[Event] 00.11/11 above_james_line: done", - "[Event] 00.11/12 james_line: start", - "00.11/james_line: ok at Route3 (36, 6) facing south (tile)", - "[Event] 00.11/12 james_line: done", - "[Event] 00.11/13 bug_catcher_james: start", - "00.11/bug_catcher_james: ok at -", - "[Event] 00.11/13 bug_catcher_james: done", - "[Event] 00.11/14 save_spot: start", - "00.11/save_spot: ok at Route3 (36, 8) facing south (tile)", - "[Event] 00.11/14 save_spot: done", + "[Checkpoint] 03.03: done, 5 run, 0 skipped", + "[Checkpoint] 03.03: passed on attempt 1 (one-shot)", + "begin 04.01", + "[Checkpoint] 04.01: start, 14 events", + "[Event] 04.01/1 from_save: start", + "[Event] 04.01/1 from_save: done", + "[Event] 04.01/2 pewter_nurse: start", + "04.01/pewter_nurse: ok at PewterCity_PokemonCenter_1F (7, 4) facing north (tile)", + "[Event] 04.01/2 pewter_nurse: done", + "[Event] 04.01/3 heal_pewter: start", + "04.01/heal_pewter: ok at -", + "[Event] 04.01/3 heal_pewter: done", + "[Event] 04.01/4 west_of_janice_line: start", + "04.01/west_of_janice_line: ok at Route3 (13, 8) facing east (tile)", + "[Event] 04.01/4 west_of_janice_line: done", + "[Event] 04.01/5 below_colton_line: start", + "04.01/below_colton_line: ok at Route3 (14, 7) facing north (tile)", + "[Event] 04.01/5 below_colton_line: done", + "[Event] 04.01/6 colton_line: start", + "04.01/colton_line: ok at Route3 (14, 6) facing north (tile)", + "[Event] 04.01/6 colton_line: done", + "[Event] 04.01/7 bug_catcher_colton: start", + "04.01/bug_catcher_colton: ok at -", + "[Event] 04.01/7 bug_catcher_colton: done", + "[Event] 04.01/8 past_ben: start", + "04.01/past_ben: ok at Route3 (24, 5) facing east (tile)", + "[Event] 04.01/8 past_ben: done", + "[Event] 04.01/9 greg_line: start", + "04.01/greg_line: ok at Route3 (25, 5) facing east (tile)", + "[Event] 04.01/9 greg_line: done", + "[Event] 04.01/10 bug_catcher_greg: start", + "04.01/bug_catcher_greg: ok at -", + "[Event] 04.01/10 bug_catcher_greg: done", + "[Event] 04.01/11 above_james_line: start", + "04.01/above_james_line: ok at Route3 (36, 5) facing east (tile)", + "[Event] 04.01/11 above_james_line: done", + "[Event] 04.01/12 james_line: start", + "04.01/james_line: ok at Route3 (36, 6) facing south (tile)", + "[Event] 04.01/12 james_line: done", + "[Event] 04.01/13 bug_catcher_james: start", + "04.01/bug_catcher_james: ok at -", + "[Event] 04.01/13 bug_catcher_james: done", + "[Event] 04.01/14 save_spot: start", + "04.01/save_spot: ok at Route3 (36, 8) facing south (tile)", + "[Event] 04.01/14 save_spot: done", "save at Route3 (36, 8) facing south (tile)", - "[Checkpoint] 00.11: done, 14 run, 0 skipped", - "[Checkpoint] 00.11: passed on attempt 1 (one-shot)", - "begin 00.12", - "[Checkpoint] 00.12: start, 4 events", - "[Event] 00.12/1 from_save: start", - "[Event] 00.12/1 from_save: done", - "[Event] 00.12/2 route4_nurse: start", - "00.12/route4_nurse: ok at Route4_PokemonCenter_1F (7, 4) facing north (tile)", - "[Event] 00.12/2 route4_nurse: done", - "[Event] 00.12/3 heal_route4: start", - "00.12/heal_route4: ok at -", - "[Event] 00.12/3 heal_route4: done", - "[Event] 00.12/4 before_salesman: start", - "00.12/before_salesman: ok at Route4_PokemonCenter_1F (2, 3) facing west (tile)", - "[Event] 00.12/4 before_salesman: done", + "[Checkpoint] 04.01: done, 14 run, 0 skipped", + "[Checkpoint] 04.01: passed on attempt 1 (one-shot)", + "begin 04.02", + "[Checkpoint] 04.02: start, 4 events", + "[Event] 04.02/1 from_save: start", + "[Event] 04.02/1 from_save: done", + "[Event] 04.02/2 route4_nurse: start", + "04.02/route4_nurse: ok at Route4_PokemonCenter_1F (7, 4) facing north (tile)", + "[Event] 04.02/2 route4_nurse: done", + "[Event] 04.02/3 heal_route4: start", + "04.02/heal_route4: ok at -", + "[Event] 04.02/3 heal_route4: done", + "[Event] 04.02/4 before_salesman: start", + "04.02/before_salesman: ok at Route4_PokemonCenter_1F (2, 3) facing west (tile)", + "[Event] 04.02/4 before_salesman: done", "save at Route4_PokemonCenter_1F (2, 3) facing west (tile)", - "[Checkpoint] 00.12: done, 4 run, 0 skipped", - "[Checkpoint] 00.12: passed on attempt 1 (one-shot)", - "begin 00.12c", - "[Checkpoint] 00.12c: start, 3 events", - "[Event] 00.12c/1 from_save: start", - "[Event] 00.12c/1 from_save: done", - "[Event] 00.12c/2 pc_front: start", - "00.12c/pc_front: ok at Route4_PokemonCenter_1F (11, 2) facing north (tile)", - "[Event] 00.12c/2 pc_front: done", - "[Event] 00.12c/3 magikarp_to_box: start", - "00.12c/magikarp_to_box: ok at Route4_PokemonCenter_1F (11, 2) facing north (tile)", - "[Event] 00.12c/3 magikarp_to_box: done", + "[Checkpoint] 04.02: done, 4 run, 0 skipped", + "[Checkpoint] 04.02: passed on attempt 1 (one-shot)", + "begin 04.04", + "[Checkpoint] 04.04: start, 3 events", + "[Event] 04.04/1 from_save: start", + "[Event] 04.04/1 from_save: done", + "[Event] 04.04/2 pc_front: start", + "04.04/pc_front: ok at Route4_PokemonCenter_1F (11, 2) facing north (tile)", + "[Event] 04.04/2 pc_front: done", + "[Event] 04.04/3 magikarp_to_box: start", + "04.04/magikarp_to_box: ok at Route4_PokemonCenter_1F (11, 2) facing north (tile)", + "[Event] 04.04/3 magikarp_to_box: done", "save at Route4_PokemonCenter_1F (11, 2) facing north (tile)", - "[Checkpoint] 00.12c: done, 3 run, 0 skipped", - "[Checkpoint] 00.12c: passed on attempt 1 (one-shot)", - "begin 00.13", - "[Checkpoint] 00.13: start, 20 events", - "[Event] 00.13/1 from_save: start", - "[Event] 00.13/1 from_save: done", - "[Event] 00.13/2 route4_nurse: start", - "00.13/route4_nurse: ok at Route4_PokemonCenter_1F (7, 4) facing north (tile)", - "[Event] 00.13/2 route4_nurse: done", - "[Event] 00.13/3 heal_route4: start", - "00.13/heal_route4: ok at -", - "[Event] 00.13/3 heal_route4: done", - "[Event] 00.13/4 mt_moon_entrance: start", - "00.13/mt_moon_entrance: ok at MtMoon_1F (18, 37) facing north (tile)", - "[Event] 00.13/4 mt_moon_entrance: done", - "[Event] 00.13/5 mt_moon_1f: start", - "00.13/mt_moon_1f: ok at MtMoon_1F (3, 3) facing east (tile)", - "[Event] 00.13/5 mt_moon_1f: done", - "[Event] 00.13/6 below_moon_stone: start", - "00.13/below_moon_stone: ok at MtMoon_1F (3, 3) facing north (tile)", - "[Event] 00.13/6 below_moon_stone: done", - "[Event] 00.13/7 moon_stone_ball: start", - "00.13/moon_stone_ball: ok at -", - "[Event] 00.13/7 moon_stone_ball: done", - "[Event] 00.13/8 found_moon_stone: start", - "00.13/found_moon_stone: ok at -", - "[Event] 00.13/8 found_moon_stone: done", - "[Event] 00.13/9 b2f_ladder_foot: start", - "00.13/b2f_ladder_foot: ok at MtMoon_B2F (26, 21) facing east (tile)", - "[Event] 00.13/9 b2f_ladder_foot: done", - "[Event] 00.13/10 b2f_south: start", - "00.13/b2f_south: ok at MtMoon_B2F (11, 21) facing north (tile)", - "[Event] 00.13/10 b2f_south: done", - "[Event] 00.13/11 grunt_line: start", - "00.13/grunt_line: ok at MtMoon_B2F (12, 21) facing east (tile)", - "[Event] 00.13/11 grunt_line: done", - "[Event] 00.13/12 rocket_grunt: start", - "00.13/rocket_grunt: ok at -", - "[Event] 00.13/12 rocket_grunt: done", - "[Event] 00.13/13 ready_for_miguel: start", - "00.13/ready_for_miguel: ok at -", - "[Event] 00.13/13 ready_for_miguel: done", - "[Event] 00.13/14 below_miguel_trigger: start", - "00.13/below_miguel_trigger: ok at MtMoon_B2F (14, 12) facing east (tile)", - "[Event] 00.13/14 below_miguel_trigger: done", - "[Event] 00.13/15 miguel_trigger: start", - "00.13/miguel_trigger: ok at MtMoon_B2F (14, 11) facing north (tile)", - "[Event] 00.13/15 miguel_trigger: done", - "[Event] 00.13/16 super_nerd_miguel: start", - "00.13/super_nerd_miguel: ok at -", - "[Event] 00.13/16 super_nerd_miguel: done", - "[Event] 00.13/17 below_helix_fossil: start", - "00.13/below_helix_fossil: ok at MtMoon_B2F (14, 8) facing north (tile)", - "[Event] 00.13/17 below_helix_fossil: done", - "[Event] 00.13/18 helix_fossil: start", - "00.13/helix_fossil: ok at MtMoon_B2F (14, 8) facing north (tile)", - "[Event] 00.13/18 helix_fossil: done", - "[Event] 00.13/19 helix_gap: start", - "00.13/helix_gap: ok at MtMoon_B2F (14, 7) facing north (tile)", - "[Event] 00.13/19 helix_gap: done", - "[Event] 00.13/20 route4_east: start", - "00.13/route4_east: ok at Route4 (32, 6) facing south (tile)", - "[Event] 00.13/20 route4_east: done", + "[Checkpoint] 04.04: done, 3 run, 0 skipped", + "[Checkpoint] 04.04: passed on attempt 1 (one-shot)", + "begin 04.05", + "[Checkpoint] 04.05: start, 20 events", + "[Event] 04.05/1 from_save: start", + "[Event] 04.05/1 from_save: done", + "[Event] 04.05/2 route4_nurse: start", + "04.05/route4_nurse: ok at Route4_PokemonCenter_1F (7, 4) facing north (tile)", + "[Event] 04.05/2 route4_nurse: done", + "[Event] 04.05/3 heal_route4: start", + "04.05/heal_route4: ok at -", + "[Event] 04.05/3 heal_route4: done", + "[Event] 04.05/4 mt_moon_entrance: start", + "04.05/mt_moon_entrance: ok at MtMoon_1F (18, 37) facing north (tile)", + "[Event] 04.05/4 mt_moon_entrance: done", + "[Event] 04.05/5 mt_moon_1f: start", + "04.05/mt_moon_1f: ok at MtMoon_1F (3, 3) facing east (tile)", + "[Event] 04.05/5 mt_moon_1f: done", + "[Event] 04.05/6 below_moon_stone: start", + "04.05/below_moon_stone: ok at MtMoon_1F (3, 3) facing north (tile)", + "[Event] 04.05/6 below_moon_stone: done", + "[Event] 04.05/7 moon_stone_ball: start", + "04.05/moon_stone_ball: ok at -", + "[Event] 04.05/7 moon_stone_ball: done", + "[Event] 04.05/8 found_moon_stone: start", + "04.05/found_moon_stone: ok at -", + "[Event] 04.05/8 found_moon_stone: done", + "[Event] 04.05/9 b2f_ladder_foot: start", + "04.05/b2f_ladder_foot: ok at MtMoon_B2F (26, 21) facing east (tile)", + "[Event] 04.05/9 b2f_ladder_foot: done", + "[Event] 04.05/10 b2f_south: start", + "04.05/b2f_south: ok at MtMoon_B2F (11, 21) facing north (tile)", + "[Event] 04.05/10 b2f_south: done", + "[Event] 04.05/11 grunt_line: start", + "04.05/grunt_line: ok at MtMoon_B2F (12, 21) facing east (tile)", + "[Event] 04.05/11 grunt_line: done", + "[Event] 04.05/12 rocket_grunt: start", + "04.05/rocket_grunt: ok at -", + "[Event] 04.05/12 rocket_grunt: done", + "[Event] 04.05/13 ready_for_miguel: start", + "04.05/ready_for_miguel: ok at -", + "[Event] 04.05/13 ready_for_miguel: done", + "[Event] 04.05/14 below_miguel_trigger: start", + "04.05/below_miguel_trigger: ok at MtMoon_B2F (14, 12) facing east (tile)", + "[Event] 04.05/14 below_miguel_trigger: done", + "[Event] 04.05/15 miguel_trigger: start", + "04.05/miguel_trigger: ok at MtMoon_B2F (14, 11) facing north (tile)", + "[Event] 04.05/15 miguel_trigger: done", + "[Event] 04.05/16 super_nerd_miguel: start", + "04.05/super_nerd_miguel: ok at -", + "[Event] 04.05/16 super_nerd_miguel: done", + "[Event] 04.05/17 below_helix_fossil: start", + "04.05/below_helix_fossil: ok at MtMoon_B2F (14, 8) facing north (tile)", + "[Event] 04.05/17 below_helix_fossil: done", + "[Event] 04.05/18 helix_fossil: start", + "04.05/helix_fossil: ok at MtMoon_B2F (14, 8) facing north (tile)", + "[Event] 04.05/18 helix_fossil: done", + "[Event] 04.05/19 helix_gap: start", + "04.05/helix_gap: ok at MtMoon_B2F (14, 7) facing north (tile)", + "[Event] 04.05/19 helix_gap: done", + "[Event] 04.05/20 route4_east: start", + "04.05/route4_east: ok at Route4 (32, 6) facing south (tile)", + "[Event] 04.05/20 route4_east: done", "save at Route4 (32, 6) facing south (tile)", - "[Checkpoint] 00.13: done, 20 run, 0 skipped", - "[Checkpoint] 00.13: passed on attempt 1 (one-shot)", - "begin 00.14", - "[Checkpoint] 00.14: start, 10 events", - "[Event] 00.14/1 from_save: start", - "[Event] 00.14/1 from_save: done", - "[Event] 00.14/2 mega_kick_tutor: start", - "00.14/mega_kick_tutor: ok at Route4 (50, 4) facing north (tile)", - "[Event] 00.14/2 mega_kick_tutor: done", - "[Event] 00.14/3 teach_mega_kick: start", - "00.14/teach_mega_kick: ok at Route4 (50, 4) facing north (tile)", - "[Event] 00.14/3 teach_mega_kick: done", - "[Event] 00.14/4 above_ledge: start", - "00.14/above_ledge: ok at Route4 (93, 8) facing south (tile)", - "[Event] 00.14/4 above_ledge: done", - "[Event] 00.14/5 ledge_hop: start", - "00.14/ledge_hop: ok at Route4 (93, 9) facing south (tile)", - "[Event] 00.14/5 ledge_hop: done", - "[Event] 00.14/6 cerulean_entry: start", - "00.14/cerulean_entry: ok at CeruleanCity (9, 20) facing east (tile)", - "[Event] 00.14/6 cerulean_entry: done", - "[Event] 00.14/7 above_city_ledge: start", - "00.14/above_city_ledge: ok at CeruleanCity (25, 17) facing west (tile)", - "[Event] 00.14/7 above_city_ledge: done", - "[Event] 00.14/8 city_ledge_hop: start", - "00.14/city_ledge_hop: ok at CeruleanCity (25, 18) facing south (tile)", - "[Event] 00.14/8 city_ledge_hop: done", - "[Event] 00.14/9 cerulean_nurse: start", - "00.14/cerulean_nurse: ok at CeruleanCity_PokemonCenter_1F (7, 4) facing north (tile)", - "[Event] 00.14/9 cerulean_nurse: done", - "[Event] 00.14/10 heal_cerulean: start", - "00.14/heal_cerulean: ok at -", - "[Event] 00.14/10 heal_cerulean: done", + "[Checkpoint] 04.05: done, 20 run, 0 skipped", + "[Checkpoint] 04.05: passed on attempt 1 (one-shot)", + "begin 04.06", + "[Checkpoint] 04.06: start, 10 events", + "[Event] 04.06/1 from_save: start", + "[Event] 04.06/1 from_save: done", + "[Event] 04.06/2 mega_kick_tutor: start", + "04.06/mega_kick_tutor: ok at Route4 (50, 4) facing north (tile)", + "[Event] 04.06/2 mega_kick_tutor: done", + "[Event] 04.06/3 teach_mega_kick: start", + "04.06/teach_mega_kick: ok at Route4 (50, 4) facing north (tile)", + "[Event] 04.06/3 teach_mega_kick: done", + "[Event] 04.06/4 above_ledge: start", + "04.06/above_ledge: ok at Route4 (93, 8) facing south (tile)", + "[Event] 04.06/4 above_ledge: done", + "[Event] 04.06/5 ledge_hop: start", + "04.06/ledge_hop: ok at Route4 (93, 9) facing south (tile)", + "[Event] 04.06/5 ledge_hop: done", + "[Event] 04.06/6 cerulean_entry: start", + "04.06/cerulean_entry: ok at CeruleanCity (9, 20) facing east (tile)", + "[Event] 04.06/6 cerulean_entry: done", + "[Event] 04.06/7 above_city_ledge: start", + "04.06/above_city_ledge: ok at CeruleanCity (25, 17) facing west (tile)", + "[Event] 04.06/7 above_city_ledge: done", + "[Event] 04.06/8 city_ledge_hop: start", + "04.06/city_ledge_hop: ok at CeruleanCity (25, 18) facing south (tile)", + "[Event] 04.06/8 city_ledge_hop: done", + "[Event] 04.06/9 cerulean_nurse: start", + "04.06/cerulean_nurse: ok at CeruleanCity_PokemonCenter_1F (7, 4) facing north (tile)", + "[Event] 04.06/9 cerulean_nurse: done", + "[Event] 04.06/10 heal_cerulean: start", + "04.06/heal_cerulean: ok at -", + "[Event] 04.06/10 heal_cerulean: done", "save at CeruleanCity_PokemonCenter_1F (7, 4) facing north (tile)", - "[Checkpoint] 00.14: done, 10 run, 0 skipped", - "[Checkpoint] 00.14: passed on attempt 1 (one-shot)", - "begin 00.14b", - "[Checkpoint] 00.14b: start, 10 events", - "[Event] 00.14b/1 from_save: start", - "[Event] 00.14b/1 from_save: done", - "[Event] 00.14b/2 mart_clerk: start", - "00.14b/mart_clerk: ok at CeruleanCity_Mart (4, 3) facing west (tile)", - "[Event] 00.14b/2 mart_clerk: done", - "[Event] 00.14b/3 buy_potions: start", - "00.14b/buy_potions: ok at CeruleanCity_Mart (4, 3) facing west (tile)", - "[Event] 00.14b/3 buy_potions: done", - "[Event] 00.14b/4 grind_patch: start", - "00.14b/grind_patch: ok at Route4 (86, 16) facing west (tile)", - "[Event] 00.14b/4 grind_patch: done", - "[Event] 00.14b/5 grind_to_lv23: start", - "00.14b/grind_to_lv23: ok at Route4 (86, 16) (85, 16) (set)", - "[Event] 00.14b/5 grind_to_lv23: done", - "[Event] 00.14b/6 cerulean_nurse: start", - "00.14b/cerulean_nurse: ok at CeruleanCity_PokemonCenter_1F (7, 4) facing north (tile)", - "[Event] 00.14b/6 cerulean_nurse: done", - "[Event] 00.14b/7 heal_cerulean: start", - "00.14b/heal_cerulean: ok at -", - "[Event] 00.14b/7 heal_cerulean: done", - "[Event] 00.14b/8 gym_below_luis: start", - "00.14b/gym_below_luis: ok at CeruleanCity_Gym (9, 13) facing north (tile)", - "[Event] 00.14b/8 gym_below_luis: done", - "[Event] 00.14b/9 gym_west_walkway: start", - "00.14b/gym_west_walkway: ok at CeruleanCity_Gym (4, 13) facing west (tile)", - "[Event] 00.14b/9 gym_west_walkway: done", - "[Event] 00.14b/10 below_misty_platform: start", - "00.14b/below_misty_platform: ok at CeruleanCity_Gym (9, 7) facing west (tile)", - "[Event] 00.14b/10 below_misty_platform: done", + "[Checkpoint] 04.06: done, 10 run, 0 skipped", + "[Checkpoint] 04.06: passed on attempt 1 (one-shot)", + "begin 05.01", + "[Checkpoint] 05.01: start, 10 events", + "[Event] 05.01/1 from_save: start", + "[Event] 05.01/1 from_save: done", + "[Event] 05.01/2 mart_clerk: start", + "05.01/mart_clerk: ok at CeruleanCity_Mart (4, 3) facing west (tile)", + "[Event] 05.01/2 mart_clerk: done", + "[Event] 05.01/3 buy_potions: start", + "05.01/buy_potions: ok at CeruleanCity_Mart (4, 3) facing west (tile)", + "[Event] 05.01/3 buy_potions: done", + "[Event] 05.01/4 grind_patch: start", + "05.01/grind_patch: ok at Route4 (86, 16) facing west (tile)", + "[Event] 05.01/4 grind_patch: done", + "[Event] 05.01/5 grind_to_lv23: start", + "05.01/grind_to_lv23: ok at Route4 (86, 16) (85, 16) (set)", + "[Event] 05.01/5 grind_to_lv23: done", + "[Event] 05.01/6 cerulean_nurse: start", + "05.01/cerulean_nurse: ok at CeruleanCity_PokemonCenter_1F (7, 4) facing north (tile)", + "[Event] 05.01/6 cerulean_nurse: done", + "[Event] 05.01/7 heal_cerulean: start", + "05.01/heal_cerulean: ok at -", + "[Event] 05.01/7 heal_cerulean: done", + "[Event] 05.01/8 gym_below_luis: start", + "05.01/gym_below_luis: ok at CeruleanCity_Gym (9, 13) facing north (tile)", + "[Event] 05.01/8 gym_below_luis: done", + "[Event] 05.01/9 gym_west_walkway: start", + "05.01/gym_west_walkway: ok at CeruleanCity_Gym (4, 13) facing west (tile)", + "[Event] 05.01/9 gym_west_walkway: done", + "[Event] 05.01/10 below_misty_platform: start", + "05.01/below_misty_platform: ok at CeruleanCity_Gym (9, 7) facing west (tile)", + "[Event] 05.01/10 below_misty_platform: done", "save at CeruleanCity_Gym (9, 7) facing west (tile)", - "[Checkpoint] 00.14b: done, 10 run, 0 skipped", - "[Checkpoint] 00.14b: passed on attempt 1 (one-shot)", - "begin 00.14c", - "[Checkpoint] 00.14c: start, 8 events", - "[Event] 00.14c/1 from_save: start", - "[Event] 00.14c/1 from_save: done", - "[Event] 00.14c/2 beside_misty: start", - "00.14c/beside_misty: ok at CeruleanCity_Gym (9, 6) facing west (tile)", - "[Event] 00.14c/2 beside_misty: done", - "[Event] 00.14c/3 challenge_misty: start", - "00.14c/challenge_misty: ok at -", - "[Event] 00.14c/3 challenge_misty: done", - "[Event] 00.14c/4 misty: start", - "00.14c/misty: ok at -", - "[Event] 00.14c/4 misty: done", - "[Event] 00.14c/5 gym_way_out: start", - "00.14c/gym_way_out: ok at CeruleanCity_Gym (9, 13) facing east (tile)", - "[Event] 00.14c/5 gym_way_out: done", - "[Event] 00.14c/6 cerulean_nurse: start", - "00.14c/cerulean_nurse: ok at CeruleanCity_PokemonCenter_1F (7, 4) facing north (tile)", - "[Event] 00.14c/6 cerulean_nurse: done", - "[Event] 00.14c/7 heal_cerulean: start", - "00.14c/heal_cerulean: ok at -", - "[Event] 00.14c/7 heal_cerulean: done", - "[Event] 00.14c/8 teach_water_pulse: start", - "00.14c/teach_water_pulse: ok at CeruleanCity_PokemonCenter_1F (7, 4) facing north (tile)", - "[Event] 00.14c/8 teach_water_pulse: done", + "[Checkpoint] 05.01: done, 10 run, 0 skipped", + "[Checkpoint] 05.01: passed on attempt 1 (one-shot)", + "begin 05.02", + "[Checkpoint] 05.02: start, 8 events", + "[Event] 05.02/1 from_save: start", + "[Event] 05.02/1 from_save: done", + "[Event] 05.02/2 beside_misty: start", + "05.02/beside_misty: ok at CeruleanCity_Gym (9, 6) facing west (tile)", + "[Event] 05.02/2 beside_misty: done", + "[Event] 05.02/3 challenge_misty: start", + "05.02/challenge_misty: ok at -", + "[Event] 05.02/3 challenge_misty: done", + "[Event] 05.02/4 misty: start", + "05.02/misty: ok at -", + "[Event] 05.02/4 misty: done", + "[Event] 05.02/5 gym_way_out: start", + "05.02/gym_way_out: ok at CeruleanCity_Gym (9, 13) facing east (tile)", + "[Event] 05.02/5 gym_way_out: done", + "[Event] 05.02/6 cerulean_nurse: start", + "05.02/cerulean_nurse: ok at CeruleanCity_PokemonCenter_1F (7, 4) facing north (tile)", + "[Event] 05.02/6 cerulean_nurse: done", + "[Event] 05.02/7 heal_cerulean: start", + "05.02/heal_cerulean: ok at -", + "[Event] 05.02/7 heal_cerulean: done", + "[Event] 05.02/8 teach_water_pulse: start", + "05.02/teach_water_pulse: ok at CeruleanCity_PokemonCenter_1F (7, 4) facing north (tile)", + "[Event] 05.02/8 teach_water_pulse: done", "save at CeruleanCity_PokemonCenter_1F (7, 4) facing north (tile)", - "[Checkpoint] 00.14c: done, 8 run, 0 skipped", - "[Checkpoint] 00.14c: passed on attempt 1 (one-shot)", - "begin 00.15", - "[Checkpoint] 00.15: start, 9 events", - "[Event] 00.15/1 from_save: start", - "[Event] 00.15/1 from_save: done", - "[Event] 00.15/2 teach_water_pulse: start", - "00.15/teach_water_pulse: ok at CeruleanCity_PokemonCenter_1F (7, 4) facing north (tile)", - "[Event] 00.15/2 teach_water_pulse: done", - "[Event] 00.15/3 mart_clerk: start", - "00.15/mart_clerk: ok at CeruleanCity_Mart (4, 3) facing west (tile)", - "[Event] 00.15/3 mart_clerk: done", - "[Event] 00.15/4 buy_potions: start", - "00.15/buy_potions: ok at CeruleanCity_Mart (4, 3) facing west (tile)", - "[Event] 00.15/4 buy_potions: done", - "[Event] 00.15/5 grind_patch: start", - "00.15/grind_patch: ok at Route4 (86, 16) facing west (tile)", - "[Event] 00.15/5 grind_patch: done", - "[Event] 00.15/6 grind_for_rival: start", - "00.15/grind_for_rival: ok at Route4 (86, 16) (85, 16) (set)", - "[Event] 00.15/6 grind_for_rival: done", - "[Event] 00.15/7 cerulean_nurse: start", - "00.15/cerulean_nurse: ok at CeruleanCity_PokemonCenter_1F (7, 4) facing north (tile)", - "[Event] 00.15/7 cerulean_nurse: done", - "[Event] 00.15/8 heal_cerulean: start", - "00.15/heal_cerulean: ok at -", - "[Event] 00.15/8 heal_cerulean: done", - "[Event] 00.15/9 below_rival_trigger: start", - "00.15/below_rival_trigger: ok at CeruleanCity (23, 7) facing north (tile)", - "[Event] 00.15/9 below_rival_trigger: done", + "[Checkpoint] 05.02: done, 8 run, 0 skipped", + "[Checkpoint] 05.02: passed on attempt 1 (one-shot)", + "begin 05.03", + "[Checkpoint] 05.03: start, 9 events", + "[Event] 05.03/1 from_save: start", + "[Event] 05.03/1 from_save: done", + "[Event] 05.03/2 teach_water_pulse: start", + "05.03/teach_water_pulse: ok at CeruleanCity_PokemonCenter_1F (7, 4) facing north (tile)", + "[Event] 05.03/2 teach_water_pulse: done", + "[Event] 05.03/3 mart_clerk: start", + "05.03/mart_clerk: ok at CeruleanCity_Mart (4, 3) facing west (tile)", + "[Event] 05.03/3 mart_clerk: done", + "[Event] 05.03/4 buy_potions: start", + "05.03/buy_potions: ok at CeruleanCity_Mart (4, 3) facing west (tile)", + "[Event] 05.03/4 buy_potions: done", + "[Event] 05.03/5 grind_patch: start", + "05.03/grind_patch: ok at Route4 (86, 16) facing west (tile)", + "[Event] 05.03/5 grind_patch: done", + "[Event] 05.03/6 grind_for_rival: start", + "05.03/grind_for_rival: ok at Route4 (86, 16) (85, 16) (set)", + "[Event] 05.03/6 grind_for_rival: done", + "[Event] 05.03/7 cerulean_nurse: start", + "05.03/cerulean_nurse: ok at CeruleanCity_PokemonCenter_1F (7, 4) facing north (tile)", + "[Event] 05.03/7 cerulean_nurse: done", + "[Event] 05.03/8 heal_cerulean: start", + "05.03/heal_cerulean: ok at -", + "[Event] 05.03/8 heal_cerulean: done", + "[Event] 05.03/9 below_rival_trigger: start", + "05.03/below_rival_trigger: ok at CeruleanCity (23, 7) facing north (tile)", + "[Event] 05.03/9 below_rival_trigger: done", "save at CeruleanCity (23, 7) facing north (tile)", - "[Checkpoint] 00.15: done, 9 run, 0 skipped", - "[Checkpoint] 00.15: passed on attempt 1 (one-shot)", - "begin 00.15b", - "[Checkpoint] 00.15b: start, 4 events", - "[Event] 00.15b/1 from_save: start", - "[Event] 00.15b/1 from_save: done", - "[Event] 00.15b/2 teach_water_pulse: start", - "00.15b/teach_water_pulse: ok at CeruleanCity (23, 7) facing north (tile)", - "[Event] 00.15b/2 teach_water_pulse: done", - "[Event] 00.15b/3 rival_trigger: start", - "00.15b/rival_trigger: ok at CeruleanCity (23, 6) facing north (tile)", - "[Event] 00.15b/3 rival_trigger: done", - "[Event] 00.15b/4 rival_cerulean: start", - "00.15b/rival_cerulean: ok at -", - "[Event] 00.15b/4 rival_cerulean: done", + "[Checkpoint] 05.03: done, 9 run, 0 skipped", + "[Checkpoint] 05.03: passed on attempt 1 (one-shot)", + "begin 05.04", + "[Checkpoint] 05.04: start, 4 events", + "[Event] 05.04/1 from_save: start", + "[Event] 05.04/1 from_save: done", + "[Event] 05.04/2 teach_water_pulse: start", + "05.04/teach_water_pulse: ok at CeruleanCity (23, 7) facing north (tile)", + "[Event] 05.04/2 teach_water_pulse: done", + "[Event] 05.04/3 rival_trigger: start", + "05.04/rival_trigger: ok at CeruleanCity (23, 6) facing north (tile)", + "[Event] 05.04/3 rival_trigger: done", + "[Event] 05.04/4 rival_cerulean: start", + "05.04/rival_cerulean: ok at -", + "[Event] 05.04/4 rival_cerulean: done", "save at CeruleanCity (23, 6) facing south (tile)", - "[Checkpoint] 00.15b: done, 4 run, 0 skipped", - "[Checkpoint] 00.15b: passed on attempt 1 (one-shot)", - "begin 00.16", - "[Checkpoint] 00.16: start, 22 events", - "[Event] 00.16/1 from_save: start", - "[Event] 00.16/1 from_save: done", - "[Event] 00.16/2 cerulean_nurse: start", - "00.16/cerulean_nurse: ok at CeruleanCity_PokemonCenter_1F (7, 4) facing north (tile)", - "[Event] 00.16/2 cerulean_nurse: done", - "[Event] 00.16/3 heal_cerulean: start", - "00.16/heal_cerulean: ok at -", - "[Event] 00.16/3 heal_cerulean: done", - "[Event] 00.16/4 below_cale_line: start", - "00.16/below_cale_line: ok at Route24 (11, 32) facing north (tile)", - "[Event] 00.16/4 below_cale_line: done", - "[Event] 00.16/5 cale_line: start", - "00.16/cale_line: ok at Route24 (11, 31) facing north (tile)", - "[Event] 00.16/5 cale_line: done", - "[Event] 00.16/6 bug_catcher_cale: start", - "00.16/bug_catcher_cale: ok at -", - "[Event] 00.16/6 bug_catcher_cale: done", - "[Event] 00.16/7 below_ali_line: start", - "00.16/below_ali_line: ok at Route24 (11, 29) facing north (tile)", - "[Event] 00.16/7 below_ali_line: done", - "[Event] 00.16/8 ali_line: start", - "00.16/ali_line: ok at Route24 (11, 28) facing north (tile)", - "[Event] 00.16/8 ali_line: done", - "[Event] 00.16/9 lass_ali: start", - "00.16/lass_ali: ok at -", - "[Event] 00.16/9 lass_ali: done", - "[Event] 00.16/10 below_timmy_line: start", - "00.16/below_timmy_line: ok at Route24 (11, 26) facing north (tile)", - "[Event] 00.16/10 below_timmy_line: done", - "[Event] 00.16/11 timmy_line: start", - "00.16/timmy_line: ok at Route24 (11, 25) facing north (tile)", - "[Event] 00.16/11 timmy_line: done", - "[Event] 00.16/12 youngster_timmy: start", - "00.16/youngster_timmy: ok at -", - "[Event] 00.16/12 youngster_timmy: done", - "[Event] 00.16/13 below_reli_line: start", - "00.16/below_reli_line: ok at Route24 (11, 23) facing north (tile)", - "[Event] 00.16/13 below_reli_line: done", - "[Event] 00.16/14 reli_line: start", - "00.16/reli_line: ok at Route24 (11, 22) facing north (tile)", - "[Event] 00.16/14 reli_line: done", - "[Event] 00.16/15 lass_reli: start", - "00.16/lass_reli: ok at -", - "[Event] 00.16/15 lass_reli: done", - "[Event] 00.16/16 below_ethan_line: start", - "00.16/below_ethan_line: ok at Route24 (11, 20) facing north (tile)", - "[Event] 00.16/16 below_ethan_line: done", - "[Event] 00.16/17 ethan_line: start", - "00.16/ethan_line: ok at Route24 (11, 19) facing north (tile)", - "[Event] 00.16/17 ethan_line: done", - "[Event] 00.16/18 camper_ethan: start", - "00.16/camper_ethan: ok at -", - "[Event] 00.16/18 camper_ethan: done", - "[Event] 00.16/19 ready_for_rocket: start", - "00.16/ready_for_rocket: ok at -", - "[Event] 00.16/19 ready_for_rocket: done", - "[Event] 00.16/20 below_rocket_trigger: start", - "00.16/below_rocket_trigger: ok at Route24 (11, 16) facing north (tile)", - "[Event] 00.16/20 below_rocket_trigger: done", - "[Event] 00.16/21 rocket_trigger: start", - "00.16/rocket_trigger: ok at Route24 (11, 15) facing north (tile)", - "[Event] 00.16/21 rocket_trigger: done", - "[Event] 00.16/22 rocket_grunt: start", - "00.16/rocket_grunt: ok at -", - "[Event] 00.16/22 rocket_grunt: done", + "[Checkpoint] 05.04: done, 4 run, 0 skipped", + "[Checkpoint] 05.04: passed on attempt 1 (one-shot)", + "begin 05.05", + "[Checkpoint] 05.05: start, 22 events", + "[Event] 05.05/1 from_save: start", + "[Event] 05.05/1 from_save: done", + "[Event] 05.05/2 cerulean_nurse: start", + "05.05/cerulean_nurse: ok at CeruleanCity_PokemonCenter_1F (7, 4) facing north (tile)", + "[Event] 05.05/2 cerulean_nurse: done", + "[Event] 05.05/3 heal_cerulean: start", + "05.05/heal_cerulean: ok at -", + "[Event] 05.05/3 heal_cerulean: done", + "[Event] 05.05/4 below_cale_line: start", + "05.05/below_cale_line: ok at Route24 (11, 32) facing north (tile)", + "[Event] 05.05/4 below_cale_line: done", + "[Event] 05.05/5 cale_line: start", + "05.05/cale_line: ok at Route24 (11, 31) facing north (tile)", + "[Event] 05.05/5 cale_line: done", + "[Event] 05.05/6 bug_catcher_cale: start", + "05.05/bug_catcher_cale: ok at -", + "[Event] 05.05/6 bug_catcher_cale: done", + "[Event] 05.05/7 below_ali_line: start", + "05.05/below_ali_line: ok at Route24 (11, 29) facing north (tile)", + "[Event] 05.05/7 below_ali_line: done", + "[Event] 05.05/8 ali_line: start", + "05.05/ali_line: ok at Route24 (11, 28) facing north (tile)", + "[Event] 05.05/8 ali_line: done", + "[Event] 05.05/9 lass_ali: start", + "05.05/lass_ali: ok at -", + "[Event] 05.05/9 lass_ali: done", + "[Event] 05.05/10 below_timmy_line: start", + "05.05/below_timmy_line: ok at Route24 (11, 26) facing north (tile)", + "[Event] 05.05/10 below_timmy_line: done", + "[Event] 05.05/11 timmy_line: start", + "05.05/timmy_line: ok at Route24 (11, 25) facing north (tile)", + "[Event] 05.05/11 timmy_line: done", + "[Event] 05.05/12 youngster_timmy: start", + "05.05/youngster_timmy: ok at -", + "[Event] 05.05/12 youngster_timmy: done", + "[Event] 05.05/13 below_reli_line: start", + "05.05/below_reli_line: ok at Route24 (11, 23) facing north (tile)", + "[Event] 05.05/13 below_reli_line: done", + "[Event] 05.05/14 reli_line: start", + "05.05/reli_line: ok at Route24 (11, 22) facing north (tile)", + "[Event] 05.05/14 reli_line: done", + "[Event] 05.05/15 lass_reli: start", + "05.05/lass_reli: ok at -", + "[Event] 05.05/15 lass_reli: done", + "[Event] 05.05/16 below_ethan_line: start", + "05.05/below_ethan_line: ok at Route24 (11, 20) facing north (tile)", + "[Event] 05.05/16 below_ethan_line: done", + "[Event] 05.05/17 ethan_line: start", + "05.05/ethan_line: ok at Route24 (11, 19) facing north (tile)", + "[Event] 05.05/17 ethan_line: done", + "[Event] 05.05/18 camper_ethan: start", + "05.05/camper_ethan: ok at -", + "[Event] 05.05/18 camper_ethan: done", + "[Event] 05.05/19 ready_for_rocket: start", + "05.05/ready_for_rocket: ok at -", + "[Event] 05.05/19 ready_for_rocket: done", + "[Event] 05.05/20 below_rocket_trigger: start", + "05.05/below_rocket_trigger: ok at Route24 (11, 16) facing north (tile)", + "[Event] 05.05/20 below_rocket_trigger: done", + "[Event] 05.05/21 rocket_trigger: start", + "05.05/rocket_trigger: ok at Route24 (11, 15) facing north (tile)", + "[Event] 05.05/21 rocket_trigger: done", + "[Event] 05.05/22 rocket_grunt: start", + "05.05/rocket_grunt: ok at -", + "[Event] 05.05/22 rocket_grunt: done", "save at Route24 (11, 15) facing east (tile)", - "[Checkpoint] 00.16: done, 22 run, 0 skipped", - "[Checkpoint] 00.16: passed on attempt 1 (one-shot)", - "begin 00.17", - "[Checkpoint] 00.17: start, 15 events", - "[Event] 00.17/1 from_save: start", - "[Event] 00.17/1 from_save: done", - "[Event] 00.17/2 below_franklin_line: start", - "00.17/below_franklin_line: ok at Route25 (15, 5) facing north (tile)", - "[Event] 00.17/2 below_franklin_line: done", - "[Event] 00.17/3 franklin_line: start", - "00.17/franklin_line: ok at Route25 (15, 4) facing north (tile)", - "[Event] 00.17/3 franklin_line: done", - "[Event] 00.17/4 hiker_franklin: start", - "00.17/hiker_franklin: ok at -", - "[Event] 00.17/4 hiker_franklin: done", - "[Event] 00.17/5 west_of_dan: start", - "00.17/west_of_dan: ok at Route25 (19, 4) facing north (tile)", - "[Event] 00.17/5 west_of_dan: done", - "[Event] 00.17/6 round_dan: start", - "00.17/round_dan: ok at Route25 (24, 7) facing south (tile)", - "[Event] 00.17/6 round_dan: done", - "[Event] 00.17/7 kelsey_line: start", - "00.17/kelsey_line: ok at Route25 (24, 8) facing south (tile)", - "[Event] 00.17/7 kelsey_line: done", - "[Event] 00.17/8 picnicker_kelsey: start", - "00.17/picnicker_kelsey: ok at -", - "[Event] 00.17/8 picnicker_kelsey: done", - "[Event] 00.17/9 west_of_nob_line: start", - "00.17/west_of_nob_line: ok at Route25 (26, 8) facing east (tile)", - "[Event] 00.17/9 west_of_nob_line: done", - "[Event] 00.17/10 nob_line: start", - "00.17/nob_line: ok at Route25 (27, 8) facing east (tile)", - "[Event] 00.17/10 nob_line: done", - "[Event] 00.17/11 hiker_nob: start", - "00.17/hiker_nob: ok at -", - "[Event] 00.17/11 hiker_nob: done", - "[Event] 00.17/12 below_haley_line: start", - "00.17/below_haley_line: ok at Route25 (42, 9) facing east (tile)", - "[Event] 00.17/12 below_haley_line: done", - "[Event] 00.17/13 haley_line: start", - "00.17/haley_line: ok at Route25 (42, 8) facing north (tile)", - "[Event] 00.17/13 haley_line: done", - "[Event] 00.17/14 lass_haley: start", - "00.17/lass_haley: ok at -", - "[Event] 00.17/14 lass_haley: done", - "[Event] 00.17/15 sea_cottage: start", - "00.17/sea_cottage: ok at Route25_SeaCottage (7, 8) facing north (tile)", - "[Event] 00.17/15 sea_cottage: done", + "[Checkpoint] 05.05: done, 22 run, 0 skipped", + "[Checkpoint] 05.05: passed on attempt 1 (one-shot)", + "begin 05.06", + "[Checkpoint] 05.06: start, 15 events", + "[Event] 05.06/1 from_save: start", + "[Event] 05.06/1 from_save: done", + "[Event] 05.06/2 below_franklin_line: start", + "05.06/below_franklin_line: ok at Route25 (15, 5) facing north (tile)", + "[Event] 05.06/2 below_franklin_line: done", + "[Event] 05.06/3 franklin_line: start", + "05.06/franklin_line: ok at Route25 (15, 4) facing north (tile)", + "[Event] 05.06/3 franklin_line: done", + "[Event] 05.06/4 hiker_franklin: start", + "05.06/hiker_franklin: ok at -", + "[Event] 05.06/4 hiker_franklin: done", + "[Event] 05.06/5 west_of_dan: start", + "05.06/west_of_dan: ok at Route25 (19, 4) facing north (tile)", + "[Event] 05.06/5 west_of_dan: done", + "[Event] 05.06/6 round_dan: start", + "05.06/round_dan: ok at Route25 (24, 7) facing south (tile)", + "[Event] 05.06/6 round_dan: done", + "[Event] 05.06/7 kelsey_line: start", + "05.06/kelsey_line: ok at Route25 (24, 8) facing south (tile)", + "[Event] 05.06/7 kelsey_line: done", + "[Event] 05.06/8 picnicker_kelsey: start", + "05.06/picnicker_kelsey: ok at -", + "[Event] 05.06/8 picnicker_kelsey: done", + "[Event] 05.06/9 west_of_nob_line: start", + "05.06/west_of_nob_line: ok at Route25 (26, 8) facing east (tile)", + "[Event] 05.06/9 west_of_nob_line: done", + "[Event] 05.06/10 nob_line: start", + "05.06/nob_line: ok at Route25 (27, 8) facing east (tile)", + "[Event] 05.06/10 nob_line: done", + "[Event] 05.06/11 hiker_nob: start", + "05.06/hiker_nob: ok at -", + "[Event] 05.06/11 hiker_nob: done", + "[Event] 05.06/12 below_haley_line: start", + "05.06/below_haley_line: ok at Route25 (42, 9) facing east (tile)", + "[Event] 05.06/12 below_haley_line: done", + "[Event] 05.06/13 haley_line: start", + "05.06/haley_line: ok at Route25 (42, 8) facing north (tile)", + "[Event] 05.06/13 haley_line: done", + "[Event] 05.06/14 lass_haley: start", + "05.06/lass_haley: ok at -", + "[Event] 05.06/14 lass_haley: done", + "[Event] 05.06/15 sea_cottage: start", + "05.06/sea_cottage: ok at Route25_SeaCottage (7, 8) facing north (tile)", + "[Event] 05.06/15 sea_cottage: done", "save at Route25_SeaCottage (7, 8) facing north (tile)", - "[Checkpoint] 00.17: done, 15 run, 0 skipped", - "[Checkpoint] 00.17: passed on attempt 1 (one-shot)", - "begin 00.18", - "[Checkpoint] 00.18: start, 13 events", - "[Event] 00.18/1 from_save: start", - "[Event] 00.18/1 from_save: done", - "[Event] 00.18/2 below_bill_clefairy: start", - "00.18/below_bill_clefairy: ok at Route25_SeaCottage (10, 7) facing north (tile)", - "[Event] 00.18/2 below_bill_clefairy: done", - "[Event] 00.18/3 bill_clefairy: start", - "00.18/bill_clefairy: ok at -", - "[Event] 00.18/3 bill_clefairy: done", - "[Event] 00.18/4 help_bill: start", - "00.18/help_bill: ok at -", - "[Event] 00.18/4 help_bill: done", - "[Event] 00.18/5 bill_into_teleporter: start", - "00.18/bill_into_teleporter: ok at -", - "[Event] 00.18/5 bill_into_teleporter: done", - "[Event] 00.18/6 pc_front: start", - "00.18/pc_front: ok at Route25_SeaCottage (4, 6) facing north (tile)", - "[Event] 00.18/6 pc_front: done", - "[Event] 00.18/7 cell_separator: start", - "00.18/cell_separator: ok at -", - "[Event] 00.18/7 cell_separator: done", - "[Event] 00.18/8 bill_comes_out: start", - "00.18/bill_comes_out: ok at -", - "[Event] 00.18/8 bill_comes_out: done", - "[Event] 00.18/9 beside_bill: start", - "00.18/beside_bill: ok at Route25_SeaCottage (6, 6) facing east (tile)", - "[Event] 00.18/9 beside_bill: done", - "[Event] 00.18/10 thank_bill: start", - "00.18/thank_bill: ok at -", - "[Event] 00.18/10 thank_bill: done", - "[Event] 00.18/11 ss_ticket: start", - "00.18/ss_ticket: ok at -", - "[Event] 00.18/11 ss_ticket: done", - "[Event] 00.18/12 around_bill: start", - "00.18/around_bill: ok at Route25_SeaCottage (7, 8) facing east (tile)", - "[Event] 00.18/12 around_bill: done", - "[Event] 00.18/13 out_of_cottage: start", - "00.18/out_of_cottage: ok at Route25 (51, 5) facing south (tile)", - "[Event] 00.18/13 out_of_cottage: done", + "[Checkpoint] 05.06: done, 15 run, 0 skipped", + "[Checkpoint] 05.06: passed on attempt 1 (one-shot)", + "begin 05.07", + "[Checkpoint] 05.07: start, 13 events", + "[Event] 05.07/1 from_save: start", + "[Event] 05.07/1 from_save: done", + "[Event] 05.07/2 below_bill_clefairy: start", + "05.07/below_bill_clefairy: ok at Route25_SeaCottage (10, 7) facing north (tile)", + "[Event] 05.07/2 below_bill_clefairy: done", + "[Event] 05.07/3 bill_clefairy: start", + "05.07/bill_clefairy: ok at -", + "[Event] 05.07/3 bill_clefairy: done", + "[Event] 05.07/4 help_bill: start", + "05.07/help_bill: ok at -", + "[Event] 05.07/4 help_bill: done", + "[Event] 05.07/5 bill_into_teleporter: start", + "05.07/bill_into_teleporter: ok at -", + "[Event] 05.07/5 bill_into_teleporter: done", + "[Event] 05.07/6 pc_front: start", + "05.07/pc_front: ok at Route25_SeaCottage (4, 6) facing north (tile)", + "[Event] 05.07/6 pc_front: done", + "[Event] 05.07/7 cell_separator: start", + "05.07/cell_separator: ok at -", + "[Event] 05.07/7 cell_separator: done", + "[Event] 05.07/8 bill_comes_out: start", + "05.07/bill_comes_out: ok at -", + "[Event] 05.07/8 bill_comes_out: done", + "[Event] 05.07/9 beside_bill: start", + "05.07/beside_bill: ok at Route25_SeaCottage (6, 6) facing east (tile)", + "[Event] 05.07/9 beside_bill: done", + "[Event] 05.07/10 thank_bill: start", + "05.07/thank_bill: ok at -", + "[Event] 05.07/10 thank_bill: done", + "[Event] 05.07/11 ss_ticket: start", + "05.07/ss_ticket: ok at -", + "[Event] 05.07/11 ss_ticket: done", + "[Event] 05.07/12 around_bill: start", + "05.07/around_bill: ok at Route25_SeaCottage (7, 8) facing east (tile)", + "[Event] 05.07/12 around_bill: done", + "[Event] 05.07/13 out_of_cottage: start", + "05.07/out_of_cottage: ok at Route25 (51, 5) facing south (tile)", + "[Event] 05.07/13 out_of_cottage: done", "save at Route25 (51, 5) facing south (tile)", - "[Checkpoint] 00.18: done, 13 run, 0 skipped", - "[Checkpoint] 00.18: passed on attempt 1 (one-shot)", - "begin 00.19", - "[Checkpoint] 00.19: start, 5 events", - "[Event] 00.19/1 from_save: start", - "[Event] 00.19/1 from_save: done", - "[Event] 00.19/2 above_cerulean_ledge: start", - "00.19/above_cerulean_ledge: ok at CeruleanCity (27, 0) facing south (tile)", - "[Event] 00.19/2 above_cerulean_ledge: done", - "[Event] 00.19/3 cerulean_ledge_hop: start", - "00.19/cerulean_ledge_hop: ok at CeruleanCity (27, 1) facing south (tile)", - "[Event] 00.19/3 cerulean_ledge_hop: done", - "[Event] 00.19/4 cerulean_nurse: start", - "00.19/cerulean_nurse: ok at CeruleanCity_PokemonCenter_1F (7, 4) facing north (tile)", - "[Event] 00.19/4 cerulean_nurse: done", - "[Event] 00.19/5 heal_cerulean: start", - "00.19/heal_cerulean: ok at -", - "[Event] 00.19/5 heal_cerulean: done", + "[Checkpoint] 05.07: done, 13 run, 0 skipped", + "[Checkpoint] 05.07: passed on attempt 1 (one-shot)", + "begin 05.08", + "[Checkpoint] 05.08: start, 5 events", + "[Event] 05.08/1 from_save: start", + "[Event] 05.08/1 from_save: done", + "[Event] 05.08/2 above_cerulean_ledge: start", + "05.08/above_cerulean_ledge: ok at CeruleanCity (27, 0) facing south (tile)", + "[Event] 05.08/2 above_cerulean_ledge: done", + "[Event] 05.08/3 cerulean_ledge_hop: start", + "05.08/cerulean_ledge_hop: ok at CeruleanCity (27, 1) facing south (tile)", + "[Event] 05.08/3 cerulean_ledge_hop: done", + "[Event] 05.08/4 cerulean_nurse: start", + "05.08/cerulean_nurse: ok at CeruleanCity_PokemonCenter_1F (7, 4) facing north (tile)", + "[Event] 05.08/4 cerulean_nurse: done", + "[Event] 05.08/5 heal_cerulean: start", + "05.08/heal_cerulean: ok at -", + "[Event] 05.08/5 heal_cerulean: done", "save at CeruleanCity_PokemonCenter_1F (7, 4) facing north (tile)", - "[Checkpoint] 00.19: done, 5 run, 0 skipped", - "[Checkpoint] 00.19: passed on attempt 1 (one-shot)", - "begin 00.20", - "[Checkpoint] 00.20: start, 7 events", - "[Event] 00.20/1 from_save: start", - "[Event] 00.20/1 from_save: done", - "[Event] 00.20/2 mart_clerk: start", - "00.20/mart_clerk: ok at CeruleanCity_Mart (4, 3) facing west (tile)", - "[Event] 00.20/2 mart_clerk: done", - "[Event] 00.20/3 buy_poke_balls: start", - "00.20/buy_poke_balls: ok at CeruleanCity_Mart (4, 3) facing west (tile)", - "[Event] 00.20/3 buy_poke_balls: done", - "[Event] 00.20/4 oddish_patch: start", - "00.20/oddish_patch: ok at Route24 (3, 19) facing south (tile)", - "[Event] 00.20/4 oddish_patch: done", - "[Event] 00.20/5 catch_oddish: start", - "00.20/catch_oddish: ok at Route24 (3, 19) (4, 19) (set)", - "[Event] 00.20/5 catch_oddish: done", - "[Event] 00.20/6 cerulean_nurse: start", - "00.20/cerulean_nurse: ok at CeruleanCity_PokemonCenter_1F (7, 4) facing north (tile)", - "[Event] 00.20/6 cerulean_nurse: done", - "[Event] 00.20/7 heal_cerulean: start", - "00.20/heal_cerulean: ok at -", - "[Event] 00.20/7 heal_cerulean: done", + "[Checkpoint] 05.08: done, 5 run, 0 skipped", + "[Checkpoint] 05.08: passed on attempt 1 (one-shot)", + "begin 05.09", + "[Checkpoint] 05.09: start, 7 events", + "[Event] 05.09/1 from_save: start", + "[Event] 05.09/1 from_save: done", + "[Event] 05.09/2 mart_clerk: start", + "05.09/mart_clerk: ok at CeruleanCity_Mart (4, 3) facing west (tile)", + "[Event] 05.09/2 mart_clerk: done", + "[Event] 05.09/3 buy_poke_balls: start", + "05.09/buy_poke_balls: ok at CeruleanCity_Mart (4, 3) facing west (tile)", + "[Event] 05.09/3 buy_poke_balls: done", + "[Event] 05.09/4 oddish_patch: start", + "05.09/oddish_patch: ok at Route24 (3, 19) facing south (tile)", + "[Event] 05.09/4 oddish_patch: done", + "[Event] 05.09/5 catch_oddish: start", + "05.09/catch_oddish: ok at Route24 (3, 19) (4, 19) (set)", + "[Event] 05.09/5 catch_oddish: done", + "[Event] 05.09/6 cerulean_nurse: start", + "05.09/cerulean_nurse: ok at CeruleanCity_PokemonCenter_1F (7, 4) facing north (tile)", + "[Event] 05.09/6 cerulean_nurse: done", + "[Event] 05.09/7 heal_cerulean: start", + "05.09/heal_cerulean: ok at -", + "[Event] 05.09/7 heal_cerulean: done", "save at CeruleanCity_PokemonCenter_1F (7, 4) facing north (tile)", - "[Checkpoint] 00.20: done, 7 run, 0 skipped", - "[Checkpoint] 00.20: passed on attempt 1 (one-shot)", - "begin 00.21", - "[Checkpoint] 00.21: start, 10 events", - "[Event] 00.21/1 from_save: start", - "[Event] 00.21/1 from_save: done", - "[Event] 00.21/2 west_of_rocket: start", - "00.21/west_of_rocket: ok at CeruleanCity (32, 7) facing east (tile)", - "[Event] 00.21/2 west_of_rocket: done", - "[Event] 00.21/3 rocket_trigger: start", - "00.21/rocket_trigger: ok at CeruleanCity (33, 7) facing east (tile)", - "[Event] 00.21/3 rocket_trigger: done", - "[Event] 00.21/4 rocket_grunt: start", - "00.21/rocket_grunt: ok at -", - "[Event] 00.21/4 rocket_grunt: done", - "[Event] 00.21/5 route6_column15: start", - "00.21/route6_column15: ok at Route6 (15, 14) facing west (tile)", - "[Event] 00.21/5 route6_column15: done", - "[Event] 00.21/6 round_keigo_and_elijah: start", - "00.21/round_keigo_and_elijah: ok at Route6 (9, 33) facing east (tile)", - "[Event] 00.21/6 round_keigo_and_elijah: done", - "[Event] 00.21/7 jeff_line: start", - "00.21/jeff_line: ok at Route6 (10, 33) facing east (tile)", - "[Event] 00.21/7 jeff_line: done", - "[Event] 00.21/8 camper_jeff: start", - "00.21/camper_jeff: ok at -", - "[Event] 00.21/8 camper_jeff: done", - "[Event] 00.21/9 vermilion_nurse: start", - "00.21/vermilion_nurse: ok at VermilionCity_PokemonCenter_1F (7, 4) facing north (tile)", - "[Event] 00.21/9 vermilion_nurse: done", - "[Event] 00.21/10 heal_vermilion: start", - "00.21/heal_vermilion: ok at -", - "[Event] 00.21/10 heal_vermilion: done", + "[Checkpoint] 05.09: done, 7 run, 0 skipped", + "[Checkpoint] 05.09: passed on attempt 1 (one-shot)", + "begin 05.10", + "[Checkpoint] 05.10: start, 10 events", + "[Event] 05.10/1 from_save: start", + "[Event] 05.10/1 from_save: done", + "[Event] 05.10/2 west_of_rocket: start", + "05.10/west_of_rocket: ok at CeruleanCity (32, 7) facing east (tile)", + "[Event] 05.10/2 west_of_rocket: done", + "[Event] 05.10/3 rocket_trigger: start", + "05.10/rocket_trigger: ok at CeruleanCity (33, 7) facing east (tile)", + "[Event] 05.10/3 rocket_trigger: done", + "[Event] 05.10/4 rocket_grunt: start", + "05.10/rocket_grunt: ok at -", + "[Event] 05.10/4 rocket_grunt: done", + "[Event] 05.10/5 route6_column15: start", + "05.10/route6_column15: ok at Route6 (15, 14) facing west (tile)", + "[Event] 05.10/5 route6_column15: done", + "[Event] 05.10/6 round_keigo_and_elijah: start", + "05.10/round_keigo_and_elijah: ok at Route6 (9, 33) facing east (tile)", + "[Event] 05.10/6 round_keigo_and_elijah: done", + "[Event] 05.10/7 jeff_line: start", + "05.10/jeff_line: ok at Route6 (10, 33) facing east (tile)", + "[Event] 05.10/7 jeff_line: done", + "[Event] 05.10/8 camper_jeff: start", + "05.10/camper_jeff: ok at -", + "[Event] 05.10/8 camper_jeff: done", + "[Event] 05.10/9 vermilion_nurse: start", + "05.10/vermilion_nurse: ok at VermilionCity_PokemonCenter_1F (7, 4) facing north (tile)", + "[Event] 05.10/9 vermilion_nurse: done", + "[Event] 05.10/10 heal_vermilion: start", + "05.10/heal_vermilion: ok at -", + "[Event] 05.10/10 heal_vermilion: done", "save at VermilionCity_PokemonCenter_1F (7, 4) facing north (tile)", - "[Checkpoint] 00.21: done, 10 run, 0 skipped", - "[Checkpoint] 00.21: passed on attempt 1 (one-shot)", - "begin 00.22", - "[Checkpoint] 00.22: start, 19 events", - "[Event] 00.22/1 from_save: start", - "[Event] 00.22/1 from_save: done", - "[Event] 00.22/2 above_ticket_check: start", - "00.22/above_ticket_check: ok at VermilionCity (23, 32) facing south (tile)", - "[Event] 00.22/2 above_ticket_check: done", - "[Event] 00.22/3 ticket_check: start", - "00.22/ticket_check: ok at VermilionCity (23, 33) facing south (tile)", - "[Event] 00.22/3 ticket_check: done", - "[Event] 00.22/4 show_ss_ticket: start", - "00.22/show_ss_ticket: ok at -", - "[Event] 00.22/4 show_ss_ticket: done", - "[Event] 00.22/5 aboard: start", - "00.22/aboard: ok at SSAnne_1F_Corridor (19, 2) facing south (tile)", - "[Event] 00.22/5 aboard: done", - "[Event] 00.22/6 past_the_cabins: start", - "00.22/past_the_cabins: ok at SSAnne_1F_Corridor (13, 8) facing north (tile)", - "[Event] 00.22/6 past_the_cabins: done", - "[Event] 00.22/7 below_rival_trigger: start", - "00.22/below_rival_trigger: ok at SSAnne_2F_Corridor (30, 7) facing north (tile)", - "[Event] 00.22/7 below_rival_trigger: done", - "[Event] 00.22/8 rival_trigger: start", - "00.22/rival_trigger: ok at SSAnne_2F_Corridor (30, 6) facing north (tile)", - "[Event] 00.22/8 rival_trigger: done", - "[Event] 00.22/9 rival_ss_anne: start", - "00.22/rival_ss_anne: ok at -", - "[Event] 00.22/9 rival_ss_anne: done", - "[Event] 00.22/10 behind_captain: start", - "00.22/behind_captain: ok at SSAnne_CaptainsOffice (5, 5) facing north (tile)", - "[Event] 00.22/10 behind_captain: done", - "[Event] 00.22/11 captain: start", - "00.22/captain: ok at -", - "[Event] 00.22/11 captain: done", - "[Event] 00.22/12 hm01_cut: start", - "00.22/hm01_cut: ok at -", - "[Event] 00.22/12 hm01_cut: done", - "[Event] 00.22/13 off_2f: start", - "00.22/off_2f: ok at SSAnne_1F_Corridor (13, 8) facing east (tile)", - "[Event] 00.22/13 off_2f: done", - "[Event] 00.22/14 round_the_sailor: start", - "00.22/round_the_sailor: ok at SSAnne_1F_Corridor (19, 9) facing east (tile)", - "[Event] 00.22/14 round_the_sailor: done", - "[Event] 00.22/15 below_ship_door: start", - "00.22/below_ship_door: ok at SSAnne_1F_Corridor (19, 2) facing north (tile)", - "[Event] 00.22/15 below_ship_door: done", - "[Event] 00.22/16 off_the_ship: start", - "00.22/off_the_ship: ok at SSAnne_1F_Corridor (19, 1) facing north (tile)", - "[Event] 00.22/16 off_the_ship: done", - "[Event] 00.22/17 ss_anne_sails: start", - "00.22/ss_anne_sails: ok at -", - "[Event] 00.22/17 ss_anne_sails: done", - "[Event] 00.22/18 vermilion_nurse: start", - "00.22/vermilion_nurse: ok at VermilionCity_PokemonCenter_1F (7, 4) facing north (tile)", - "[Event] 00.22/18 vermilion_nurse: done", - "[Event] 00.22/19 heal_vermilion: start", - "00.22/heal_vermilion: ok at -", - "[Event] 00.22/19 heal_vermilion: done", + "[Checkpoint] 05.10: done, 10 run, 0 skipped", + "[Checkpoint] 05.10: passed on attempt 1 (one-shot)", + "begin 06.01", + "[Checkpoint] 06.01: start, 19 events", + "[Event] 06.01/1 from_save: start", + "[Event] 06.01/1 from_save: done", + "[Event] 06.01/2 above_ticket_check: start", + "06.01/above_ticket_check: ok at VermilionCity (23, 32) facing south (tile)", + "[Event] 06.01/2 above_ticket_check: done", + "[Event] 06.01/3 ticket_check: start", + "06.01/ticket_check: ok at VermilionCity (23, 33) facing south (tile)", + "[Event] 06.01/3 ticket_check: done", + "[Event] 06.01/4 show_ss_ticket: start", + "06.01/show_ss_ticket: ok at -", + "[Event] 06.01/4 show_ss_ticket: done", + "[Event] 06.01/5 aboard: start", + "06.01/aboard: ok at SSAnne_1F_Corridor (19, 2) facing south (tile)", + "[Event] 06.01/5 aboard: done", + "[Event] 06.01/6 past_the_cabins: start", + "06.01/past_the_cabins: ok at SSAnne_1F_Corridor (13, 8) facing north (tile)", + "[Event] 06.01/6 past_the_cabins: done", + "[Event] 06.01/7 below_rival_trigger: start", + "06.01/below_rival_trigger: ok at SSAnne_2F_Corridor (30, 7) facing north (tile)", + "[Event] 06.01/7 below_rival_trigger: done", + "[Event] 06.01/8 rival_trigger: start", + "06.01/rival_trigger: ok at SSAnne_2F_Corridor (30, 6) facing north (tile)", + "[Event] 06.01/8 rival_trigger: done", + "[Event] 06.01/9 rival_ss_anne: start", + "06.01/rival_ss_anne: ok at -", + "[Event] 06.01/9 rival_ss_anne: done", + "[Event] 06.01/10 behind_captain: start", + "06.01/behind_captain: ok at SSAnne_CaptainsOffice (5, 5) facing north (tile)", + "[Event] 06.01/10 behind_captain: done", + "[Event] 06.01/11 captain: start", + "06.01/captain: ok at -", + "[Event] 06.01/11 captain: done", + "[Event] 06.01/12 hm01_cut: start", + "06.01/hm01_cut: ok at -", + "[Event] 06.01/12 hm01_cut: done", + "[Event] 06.01/13 off_2f: start", + "06.01/off_2f: ok at SSAnne_1F_Corridor (13, 8) facing east (tile)", + "[Event] 06.01/13 off_2f: done", + "[Event] 06.01/14 round_the_sailor: start", + "06.01/round_the_sailor: ok at SSAnne_1F_Corridor (19, 9) facing east (tile)", + "[Event] 06.01/14 round_the_sailor: done", + "[Event] 06.01/15 below_ship_door: start", + "06.01/below_ship_door: ok at SSAnne_1F_Corridor (19, 2) facing north (tile)", + "[Event] 06.01/15 below_ship_door: done", + "[Event] 06.01/16 off_the_ship: start", + "06.01/off_the_ship: ok at SSAnne_1F_Corridor (19, 1) facing north (tile)", + "[Event] 06.01/16 off_the_ship: done", + "[Event] 06.01/17 ss_anne_sails: start", + "06.01/ss_anne_sails: ok at -", + "[Event] 06.01/17 ss_anne_sails: done", + "[Event] 06.01/18 vermilion_nurse: start", + "06.01/vermilion_nurse: ok at VermilionCity_PokemonCenter_1F (7, 4) facing north (tile)", + "[Event] 06.01/18 vermilion_nurse: done", + "[Event] 06.01/19 heal_vermilion: start", + "06.01/heal_vermilion: ok at -", + "[Event] 06.01/19 heal_vermilion: done", "save at VermilionCity_PokemonCenter_1F (7, 4) facing north (tile)", - "[Checkpoint] 00.22: done, 19 run, 0 skipped", - "[Checkpoint] 00.22: passed on attempt 1 (one-shot)", - "begin 00.23", - "[Checkpoint] 00.23: start, 20 events", - "[Event] 00.23/1 from_save: start", - "[Event] 00.23/1 from_save: done", - "[Event] 00.23/2 teach_cut: start", - "00.23/teach_cut: ok at VermilionCity_PokemonCenter_1F (7, 4) facing north (tile)", - "[Event] 00.23/2 teach_cut: done", - "[Event] 00.23/3 teach_dig: start", - "00.23/teach_dig: ok at VermilionCity_PokemonCenter_1F (7, 4) facing north (tile)", - "[Event] 00.23/3 teach_dig: done", - "[Event] 00.23/4 above_gym_tree: start", - "00.23/above_gym_tree: ok at VermilionCity (19, 23) facing south (tile)", - "[Event] 00.23/4 above_gym_tree: done", - "[Event] 00.23/5 cut_gym_tree: start", - "00.23/cut_gym_tree: ok at VermilionCity (19, 23) facing south (tile)", - "[Event] 00.23/5 cut_gym_tree: done", - "[Event] 00.23/6 gym_door: start", - "00.23/gym_door: ok at VermilionCity_Gym (5, 19) facing north (tile)", - "[Event] 00.23/6 gym_door: done", - "[Event] 00.23/7 west_of_dwayne_line: start", - "00.23/west_of_dwayne_line: ok at VermilionCity_Gym (7, 15) facing east (tile)", - "[Event] 00.23/7 west_of_dwayne_line: done", - "[Event] 00.23/8 dwayne_sight: start", - "00.23/dwayne_sight: ok at VermilionCity_Gym (8, 15) facing east (tile)", - "[Event] 00.23/8 dwayne_sight: done", - "[Event] 00.23/9 sailor_dwayne: start", - "00.23/sailor_dwayne: ok at -", - "[Event] 00.23/9 sailor_dwayne: done", - "[Event] 00.23/10 east_of_baily_line: start", - "00.23/east_of_baily_line: ok at VermilionCity_Gym (3, 13) facing west (tile)", - "[Event] 00.23/10 east_of_baily_line: done", - "[Event] 00.23/11 baily_sight: start", - "00.23/baily_sight: ok at VermilionCity_Gym (2, 13) facing west (tile)", - "[Event] 00.23/11 baily_sight: done", - "[Event] 00.23/12 engineer_baily: start", - "00.23/engineer_baily: ok at -", - "[Event] 00.23/12 engineer_baily: done", - "[Event] 00.23/13 below_tucker_line: start", - "00.23/below_tucker_line: ok at VermilionCity_Gym (5, 9) facing east (tile)", - "[Event] 00.23/13 below_tucker_line: done", - "[Event] 00.23/14 tucker_line: start", - "00.23/tucker_line: ok at VermilionCity_Gym (5, 8) facing north (tile)", - "[Event] 00.23/14 tucker_line: done", - "[Event] 00.23/15 gentleman_tucker: start", - "00.23/gentleman_tucker: ok at -", - "[Event] 00.23/15 gentleman_tucker: done", - "[Event] 00.23/16 trash_cans: start", - "00.23/trash_cans: ok at VermilionCity_Gym (5, 8) facing east (tile)", - "[Event] 00.23/16 trash_cans: done", - "[Event] 00.23/17 below_gym_tree: start", - "00.23/below_gym_tree: ok at VermilionCity (19, 25) facing north (tile)", - "[Event] 00.23/17 below_gym_tree: done", - "[Event] 00.23/18 cut_tree_out: start", - "00.23/cut_tree_out: ok at VermilionCity (19, 25) facing north (tile)", - "[Event] 00.23/18 cut_tree_out: done", - "[Event] 00.23/19 vermilion_nurse: start", - "00.23/vermilion_nurse: ok at VermilionCity_PokemonCenter_1F (7, 4) facing north (tile)", - "[Event] 00.23/19 vermilion_nurse: done", - "[Event] 00.23/20 heal_vermilion: start", - "00.23/heal_vermilion: ok at -", - "[Event] 00.23/20 heal_vermilion: done", + "[Checkpoint] 06.01: done, 19 run, 0 skipped", + "[Checkpoint] 06.01: passed on attempt 1 (one-shot)", + "begin 06.02", + "[Checkpoint] 06.02: start, 20 events", + "[Event] 06.02/1 from_save: start", + "[Event] 06.02/1 from_save: done", + "[Event] 06.02/2 teach_cut: start", + "06.02/teach_cut: ok at VermilionCity_PokemonCenter_1F (7, 4) facing north (tile)", + "[Event] 06.02/2 teach_cut: done", + "[Event] 06.02/3 teach_dig: start", + "06.02/teach_dig: ok at VermilionCity_PokemonCenter_1F (7, 4) facing north (tile)", + "[Event] 06.02/3 teach_dig: done", + "[Event] 06.02/4 above_gym_tree: start", + "06.02/above_gym_tree: ok at VermilionCity (19, 23) facing south (tile)", + "[Event] 06.02/4 above_gym_tree: done", + "[Event] 06.02/5 cut_gym_tree: start", + "06.02/cut_gym_tree: ok at VermilionCity (19, 23) facing south (tile)", + "[Event] 06.02/5 cut_gym_tree: done", + "[Event] 06.02/6 gym_door: start", + "06.02/gym_door: ok at VermilionCity_Gym (5, 19) facing north (tile)", + "[Event] 06.02/6 gym_door: done", + "[Event] 06.02/7 west_of_dwayne_line: start", + "06.02/west_of_dwayne_line: ok at VermilionCity_Gym (7, 15) facing east (tile)", + "[Event] 06.02/7 west_of_dwayne_line: done", + "[Event] 06.02/8 dwayne_sight: start", + "06.02/dwayne_sight: ok at VermilionCity_Gym (8, 15) facing east (tile)", + "[Event] 06.02/8 dwayne_sight: done", + "[Event] 06.02/9 sailor_dwayne: start", + "06.02/sailor_dwayne: ok at -", + "[Event] 06.02/9 sailor_dwayne: done", + "[Event] 06.02/10 east_of_baily_line: start", + "06.02/east_of_baily_line: ok at VermilionCity_Gym (3, 13) facing west (tile)", + "[Event] 06.02/10 east_of_baily_line: done", + "[Event] 06.02/11 baily_sight: start", + "06.02/baily_sight: ok at VermilionCity_Gym (2, 13) facing west (tile)", + "[Event] 06.02/11 baily_sight: done", + "[Event] 06.02/12 engineer_baily: start", + "06.02/engineer_baily: ok at -", + "[Event] 06.02/12 engineer_baily: done", + "[Event] 06.02/13 below_tucker_line: start", + "06.02/below_tucker_line: ok at VermilionCity_Gym (5, 9) facing east (tile)", + "[Event] 06.02/13 below_tucker_line: done", + "[Event] 06.02/14 tucker_line: start", + "06.02/tucker_line: ok at VermilionCity_Gym (5, 8) facing north (tile)", + "[Event] 06.02/14 tucker_line: done", + "[Event] 06.02/15 gentleman_tucker: start", + "06.02/gentleman_tucker: ok at -", + "[Event] 06.02/15 gentleman_tucker: done", + "[Event] 06.02/16 trash_cans: start", + "06.02/trash_cans: ok at VermilionCity_Gym (5, 8) facing east (tile)", + "[Event] 06.02/16 trash_cans: done", + "[Event] 06.02/17 below_gym_tree: start", + "06.02/below_gym_tree: ok at VermilionCity (19, 25) facing north (tile)", + "[Event] 06.02/17 below_gym_tree: done", + "[Event] 06.02/18 cut_tree_out: start", + "06.02/cut_tree_out: ok at VermilionCity (19, 25) facing north (tile)", + "[Event] 06.02/18 cut_tree_out: done", + "[Event] 06.02/19 vermilion_nurse: start", + "06.02/vermilion_nurse: ok at VermilionCity_PokemonCenter_1F (7, 4) facing north (tile)", + "[Event] 06.02/19 vermilion_nurse: done", + "[Event] 06.02/20 heal_vermilion: start", + "06.02/heal_vermilion: ok at -", + "[Event] 06.02/20 heal_vermilion: done", "save at VermilionCity_PokemonCenter_1F (7, 4) facing north (tile)", - "[Checkpoint] 00.23: done, 20 run, 0 skipped", - "[Checkpoint] 00.23: passed on attempt 1 (one-shot)", - "begin 00.24", - "[Checkpoint] 00.24: start, 12 events", - "[Event] 00.24/1 from_save: start", - "[Event] 00.24/1 from_save: done", - "[Event] 00.24/2 surge_winnable: start", - "00.24/surge_winnable: ok at VermilionCity_PokemonCenter_1F (7, 4) facing north (tile)", - "[Event] 00.24/2 surge_winnable: done", - "[Event] 00.24/3 route6_south_path: start", - "00.24/route6_south_path: ok at Route6 (11, 34) facing north (tile)", - "[Event] 00.24/3 route6_south_path: done", - "[Event] 00.24/4 round_isabelle_line: start", - "00.24/round_isabelle_line: ok at Route6 (13, 31) facing east (tile)", - "[Event] 00.24/4 round_isabelle_line: done", - "[Event] 00.24/5 grind_for_surge: start", - "00.24/grind_for_surge: ok at Route6 (13, 31) (14, 31) (set)", - "[Event] 00.24/5 grind_for_surge: done", - "[Event] 00.24/6 west_on_row_31: start", - "00.24/west_on_row_31: ok at Route6 (7, 31) facing west (tile)", - "[Event] 00.24/6 west_on_row_31: done", - "[Event] 00.24/7 down_to_jeff_row: start", - "00.24/down_to_jeff_row: ok at Route6 (11, 33) facing east (tile)", - "[Event] 00.24/7 down_to_jeff_row: done", - "[Event] 00.24/8 vermilion_nurse: start", - "00.24/vermilion_nurse: ok at VermilionCity_PokemonCenter_1F (7, 4) facing north (tile)", - "[Event] 00.24/8 vermilion_nurse: done", - "[Event] 00.24/9 heal_vermilion: start", - "00.24/heal_vermilion: ok at -", - "[Event] 00.24/9 heal_vermilion: done", - "[Event] 00.24/10 above_gym_tree: start", - "00.24/above_gym_tree: ok at VermilionCity (19, 23) facing south (tile)", - "[Event] 00.24/10 above_gym_tree: done", - "[Event] 00.24/11 cut_gym_tree: start", - "00.24/cut_gym_tree: ok at VermilionCity (19, 23) facing south (tile)", - "[Event] 00.24/11 cut_gym_tree: done", - "[Event] 00.24/12 below_lt_surge: start", - "00.24/below_lt_surge: ok at VermilionCity_Gym (5, 3) facing north (tile)", - "[Event] 00.24/12 below_lt_surge: done", + "[Checkpoint] 06.02: done, 20 run, 0 skipped", + "[Checkpoint] 06.02: passed on attempt 1 (one-shot)", + "begin 06.03", + "[Checkpoint] 06.03: start, 12 events", + "[Event] 06.03/1 from_save: start", + "[Event] 06.03/1 from_save: done", + "[Event] 06.03/2 surge_winnable: start", + "06.03/surge_winnable: ok at VermilionCity_PokemonCenter_1F (7, 4) facing north (tile)", + "[Event] 06.03/2 surge_winnable: done", + "[Event] 06.03/3 route6_south_path: start", + "06.03/route6_south_path: ok at Route6 (11, 34) facing north (tile)", + "[Event] 06.03/3 route6_south_path: done", + "[Event] 06.03/4 round_isabelle_line: start", + "06.03/round_isabelle_line: ok at Route6 (13, 31) facing east (tile)", + "[Event] 06.03/4 round_isabelle_line: done", + "[Event] 06.03/5 grind_for_surge: start", + "06.03/grind_for_surge: ok at Route6 (13, 31) (14, 31) (set)", + "[Event] 06.03/5 grind_for_surge: done", + "[Event] 06.03/6 west_on_row_31: start", + "06.03/west_on_row_31: ok at Route6 (7, 31) facing west (tile)", + "[Event] 06.03/6 west_on_row_31: done", + "[Event] 06.03/7 down_to_jeff_row: start", + "06.03/down_to_jeff_row: ok at Route6 (11, 33) facing east (tile)", + "[Event] 06.03/7 down_to_jeff_row: done", + "[Event] 06.03/8 vermilion_nurse: start", + "06.03/vermilion_nurse: ok at VermilionCity_PokemonCenter_1F (7, 4) facing north (tile)", + "[Event] 06.03/8 vermilion_nurse: done", + "[Event] 06.03/9 heal_vermilion: start", + "06.03/heal_vermilion: ok at -", + "[Event] 06.03/9 heal_vermilion: done", + "[Event] 06.03/10 above_gym_tree: start", + "06.03/above_gym_tree: ok at VermilionCity (19, 23) facing south (tile)", + "[Event] 06.03/10 above_gym_tree: done", + "[Event] 06.03/11 cut_gym_tree: start", + "06.03/cut_gym_tree: ok at VermilionCity (19, 23) facing south (tile)", + "[Event] 06.03/11 cut_gym_tree: done", + "[Event] 06.03/12 below_lt_surge: start", + "06.03/below_lt_surge: ok at VermilionCity_Gym (5, 3) facing north (tile)", + "[Event] 06.03/12 below_lt_surge: done", "save at VermilionCity_Gym (5, 3) facing north (tile)", - "[Checkpoint] 00.24: done, 12 run, 0 skipped", - "[Checkpoint] 00.24: passed on attempt 1 (one-shot)", - "begin 00.25", - "[Checkpoint] 00.25: start, 8 events", - "[Event] 00.25/1 from_save: start", - "[Event] 00.25/1 from_save: done", - "[Event] 00.25/2 challenge_lt_surge: start", - "00.25/challenge_lt_surge: ok at -", - "[Event] 00.25/2 challenge_lt_surge: done", - "[Event] 00.25/3 lt_surge: start", - "00.25/lt_surge: ok at -", - "[Event] 00.25/3 lt_surge: done", - "[Event] 00.25/4 below_gym_tree: start", - "00.25/below_gym_tree: ok at VermilionCity (19, 25) facing north (tile)", - "[Event] 00.25/4 below_gym_tree: done", - "[Event] 00.25/5 cut_tree_out: start", - "00.25/cut_tree_out: ok at VermilionCity (19, 25) facing north (tile)", - "[Event] 00.25/5 cut_tree_out: done", - "[Event] 00.25/6 below_oaks_aide: start", - "00.25/below_oaks_aide: ok at VermilionCity (14, 10) facing west (tile)", - "[Event] 00.25/6 below_oaks_aide: done", - "[Event] 00.25/7 vermilion_nurse: start", - "00.25/vermilion_nurse: ok at VermilionCity_PokemonCenter_1F (7, 4) facing north (tile)", - "[Event] 00.25/7 vermilion_nurse: done", - "[Event] 00.25/8 heal_vermilion: start", - "00.25/heal_vermilion: ok at -", - "[Event] 00.25/8 heal_vermilion: done", + "[Checkpoint] 06.03: done, 12 run, 0 skipped", + "[Checkpoint] 06.03: passed on attempt 1 (one-shot)", + "begin 06.04", + "[Checkpoint] 06.04: start, 8 events", + "[Event] 06.04/1 from_save: start", + "[Event] 06.04/1 from_save: done", + "[Event] 06.04/2 challenge_lt_surge: start", + "06.04/challenge_lt_surge: ok at -", + "[Event] 06.04/2 challenge_lt_surge: done", + "[Event] 06.04/3 lt_surge: start", + "06.04/lt_surge: ok at -", + "[Event] 06.04/3 lt_surge: done", + "[Event] 06.04/4 below_gym_tree: start", + "06.04/below_gym_tree: ok at VermilionCity (19, 25) facing north (tile)", + "[Event] 06.04/4 below_gym_tree: done", + "[Event] 06.04/5 cut_tree_out: start", + "06.04/cut_tree_out: ok at VermilionCity (19, 25) facing north (tile)", + "[Event] 06.04/5 cut_tree_out: done", + "[Event] 06.04/6 below_oaks_aide: start", + "06.04/below_oaks_aide: ok at VermilionCity (14, 10) facing west (tile)", + "[Event] 06.04/6 below_oaks_aide: done", + "[Event] 06.04/7 vermilion_nurse: start", + "06.04/vermilion_nurse: ok at VermilionCity_PokemonCenter_1F (7, 4) facing north (tile)", + "[Event] 06.04/7 vermilion_nurse: done", + "[Event] 06.04/8 heal_vermilion: start", + "06.04/heal_vermilion: ok at -", + "[Event] 06.04/8 heal_vermilion: done", "save at VermilionCity_PokemonCenter_1F (7, 4) facing north (tile)", - "[Checkpoint] 00.25: done, 8 run, 0 skipped", - "[Checkpoint] 00.25: passed on attempt 1 (one-shot)", - "begin 00.26", - "[Checkpoint] 00.26: start, 18 events", - "[Event] 00.26/1 from_save: start", - "[Event] 00.26/1 from_save: done", - "[Event] 00.26/2 below_center: start", - "00.26/below_center: ok at VermilionCity (14, 10) facing west (tile)", - "[Event] 00.26/2 below_center: done", - "[Event] 00.26/3 beside_chairman: start", - "00.26/beside_chairman: ok at VermilionCity_PokemonFanClub (4, 4) facing east (tile)", - "[Event] 00.26/3 beside_chairman: done", - "[Event] 00.26/4 chairman: start", - "00.26/chairman: ok at -", - "[Event] 00.26/4 chairman: done", - "[Event] 00.26/5 hear_story: start", - "00.26/hear_story: ok at -", - "[Event] 00.26/5 hear_story: done", - "[Event] 00.26/6 bike_voucher: start", - "00.26/bike_voucher: ok at -", - "[Event] 00.26/6 bike_voucher: done", - "[Event] 00.26/7 west_of_oaks_aide: start", - "00.26/west_of_oaks_aide: ok at VermilionCity (22, 10) facing west (tile)", - "[Event] 00.26/7 west_of_oaks_aide: done", - "[Event] 00.26/8 route6_south_path: start", - "00.26/route6_south_path: ok at Route6 (11, 34) facing north (tile)", - "[Event] 00.26/8 route6_south_path: done", - "[Event] 00.26/9 round_isabelle_and_elijah: start", - "00.26/round_isabelle_and_elijah: ok at Route6 (16, 12) facing north (tile)", - "[Event] 00.26/9 round_isabelle_and_elijah: done", - "[Event] 00.26/10 below_cerulean_tree: start", - "00.26/below_cerulean_tree: ok at CeruleanCity (26, 33) facing north (tile)", - "[Event] 00.26/10 below_cerulean_tree: done", - "[Event] 00.26/11 cut_cerulean_tree: start", - "00.26/cut_cerulean_tree: ok at CeruleanCity (26, 33) facing north (tile)", - "[Event] 00.26/11 cut_cerulean_tree: done", - "[Event] 00.26/12 bike_clerk: start", - "00.26/bike_clerk: ok at CeruleanCity_BikeShop (7, 3) facing east (tile)", - "[Event] 00.26/12 bike_clerk: done", - "[Event] 00.26/13 talk_bike_clerk: start", - "00.26/talk_bike_clerk: ok at -", - "[Event] 00.26/13 talk_bike_clerk: done", - "[Event] 00.26/14 bicycle: start", - "00.26/bicycle: ok at -", - "[Event] 00.26/14 bicycle: done", - "[Event] 00.26/15 mart_clerk: start", - "00.26/mart_clerk: ok at CeruleanCity_Mart (4, 3) facing west (tile)", - "[Event] 00.26/15 mart_clerk: done", - "[Event] 00.26/16 buy_repels: start", - "00.26/buy_repels: ok at CeruleanCity_Mart (4, 3) facing west (tile)", - "[Event] 00.26/16 buy_repels: done", - "[Event] 00.26/17 cerulean_nurse: start", - "00.26/cerulean_nurse: ok at CeruleanCity_PokemonCenter_1F (7, 4) facing north (tile)", - "[Event] 00.26/17 cerulean_nurse: done", - "[Event] 00.26/18 heal_cerulean: start", - "00.26/heal_cerulean: ok at -", - "[Event] 00.26/18 heal_cerulean: done", + "[Checkpoint] 06.04: done, 8 run, 0 skipped", + "[Checkpoint] 06.04: passed on attempt 1 (one-shot)", + "begin 07.01", + "[Checkpoint] 07.01: start, 18 events", + "[Event] 07.01/1 from_save: start", + "[Event] 07.01/1 from_save: done", + "[Event] 07.01/2 below_center: start", + "07.01/below_center: ok at VermilionCity (14, 10) facing west (tile)", + "[Event] 07.01/2 below_center: done", + "[Event] 07.01/3 beside_chairman: start", + "07.01/beside_chairman: ok at VermilionCity_PokemonFanClub (4, 4) facing east (tile)", + "[Event] 07.01/3 beside_chairman: done", + "[Event] 07.01/4 chairman: start", + "07.01/chairman: ok at -", + "[Event] 07.01/4 chairman: done", + "[Event] 07.01/5 hear_story: start", + "07.01/hear_story: ok at -", + "[Event] 07.01/5 hear_story: done", + "[Event] 07.01/6 bike_voucher: start", + "07.01/bike_voucher: ok at -", + "[Event] 07.01/6 bike_voucher: done", + "[Event] 07.01/7 west_of_oaks_aide: start", + "07.01/west_of_oaks_aide: ok at VermilionCity (22, 10) facing west (tile)", + "[Event] 07.01/7 west_of_oaks_aide: done", + "[Event] 07.01/8 route6_south_path: start", + "07.01/route6_south_path: ok at Route6 (11, 34) facing north (tile)", + "[Event] 07.01/8 route6_south_path: done", + "[Event] 07.01/9 round_isabelle_and_elijah: start", + "07.01/round_isabelle_and_elijah: ok at Route6 (16, 12) facing north (tile)", + "[Event] 07.01/9 round_isabelle_and_elijah: done", + "[Event] 07.01/10 below_cerulean_tree: start", + "07.01/below_cerulean_tree: ok at CeruleanCity (26, 33) facing north (tile)", + "[Event] 07.01/10 below_cerulean_tree: done", + "[Event] 07.01/11 cut_cerulean_tree: start", + "07.01/cut_cerulean_tree: ok at CeruleanCity (26, 33) facing north (tile)", + "[Event] 07.01/11 cut_cerulean_tree: done", + "[Event] 07.01/12 bike_clerk: start", + "07.01/bike_clerk: ok at CeruleanCity_BikeShop (7, 3) facing east (tile)", + "[Event] 07.01/12 bike_clerk: done", + "[Event] 07.01/13 talk_bike_clerk: start", + "07.01/talk_bike_clerk: ok at -", + "[Event] 07.01/13 talk_bike_clerk: done", + "[Event] 07.01/14 bicycle: start", + "07.01/bicycle: ok at -", + "[Event] 07.01/14 bicycle: done", + "[Event] 07.01/15 mart_clerk: start", + "07.01/mart_clerk: ok at CeruleanCity_Mart (4, 3) facing west (tile)", + "[Event] 07.01/15 mart_clerk: done", + "[Event] 07.01/16 buy_repels: start", + "07.01/buy_repels: ok at CeruleanCity_Mart (4, 3) facing west (tile)", + "[Event] 07.01/16 buy_repels: done", + "[Event] 07.01/17 cerulean_nurse: start", + "07.01/cerulean_nurse: ok at CeruleanCity_PokemonCenter_1F (7, 4) facing north (tile)", + "[Event] 07.01/17 cerulean_nurse: done", + "[Event] 07.01/18 heal_cerulean: start", + "07.01/heal_cerulean: ok at -", + "[Event] 07.01/18 heal_cerulean: done", "save at CeruleanCity_PokemonCenter_1F (7, 4) facing north (tile)", - "[Checkpoint] 00.26: done, 18 run, 0 skipped", - "[Checkpoint] 00.26: passed on attempt 1 (one-shot)", - "begin 00.27", - "[Checkpoint] 00.27: start, 23 events", - "[Event] 00.27/1 from_save: start", - "[Event] 00.27/1 from_save: done", - "[Event] 00.27/2 above_cerulean_tree: start", - "00.27/above_cerulean_tree: ok at CeruleanCity (26, 31) facing south (tile)", - "[Event] 00.27/2 above_cerulean_tree: done", - "[Event] 00.27/3 cut_cerulean_tree: start", - "00.27/cut_cerulean_tree: ok at CeruleanCity (26, 31) facing south (tile)", - "[Event] 00.27/3 cut_cerulean_tree: done", - "[Event] 00.27/4 west_of_route9_tree: start", - "00.27/west_of_route9_tree: ok at Route9 (1, 8) facing east (tile)", - "[Event] 00.27/4 west_of_route9_tree: done", - "[Event] 00.27/5 cut_route9_tree: start", - "00.27/cut_route9_tree: ok at Route9 (1, 8) facing east (tile)", - "[Event] 00.27/5 cut_route9_tree: done", - "[Event] 00.27/6 above_alicia_line: start", - "00.27/above_alicia_line: ok at Route9 (11, 9) facing south (tile)", - "[Event] 00.27/6 above_alicia_line: done", - "[Event] 00.27/7 alicia_line: start", - "00.27/alicia_line: ok at Route9 (11, 10) facing south (tile)", - "[Event] 00.27/7 alicia_line: done", - "[Event] 00.27/8 picnicker_alicia: start", - "00.27/picnicker_alicia: ok at -", - "[Event] 00.27/8 picnicker_alicia: done", - "[Event] 00.27/9 alicia_ledge_hop: start", - "00.27/alicia_ledge_hop: ok at Route9 (11, 11) facing south (tile)", - "[Event] 00.27/9 alicia_ledge_hop: done", - "[Event] 00.27/10 west_of_jeremy_sight: start", - "00.27/west_of_jeremy_sight: ok at Route9 (19, 13) facing east (tile)", - "[Event] 00.27/10 west_of_jeremy_sight: done", - "[Event] 00.27/11 jeremy_sight: start", - "00.27/jeremy_sight: ok at Route9 (20, 13) facing east (tile)", - "[Event] 00.27/11 jeremy_sight: done", - "[Event] 00.27/12 hiker_jeremy: start", - "00.27/hiker_jeremy: ok at -", - "[Event] 00.27/12 hiker_jeremy: done", - "[Event] 00.27/13 below_conner_line: start", - "00.27/below_conner_line: ok at Route9 (52, 8) facing north (tile)", - "[Event] 00.27/13 below_conner_line: done", - "[Event] 00.27/14 conner_line: start", - "00.27/conner_line: ok at Route9 (52, 7) facing north (tile)", - "[Event] 00.27/14 conner_line: done", - "[Event] 00.27/15 bug_catcher_conner: start", - "00.27/bug_catcher_conner: ok at -", - "[Event] 00.27/15 bug_catcher_conner: done", - "[Event] 00.27/16 round_brice: start", - "00.27/round_brice: ok at Route9 (64, 2) facing south (tile)", - "[Event] 00.27/16 round_brice: done", - "[Event] 00.27/17 above_east_ledge: start", - "00.27/above_east_ledge: ok at Route9 (64, 3) facing south (tile)", - "[Event] 00.27/17 above_east_ledge: done", - "[Event] 00.27/18 east_ledge_hop: start", - "00.27/east_ledge_hop: ok at Route9 (64, 4) facing south (tile)", - "[Event] 00.27/18 east_ledge_hop: done", - "[Event] 00.27/19 above_caitlin_line: start", - "00.27/above_caitlin_line: ok at Route9 (70, 8) facing east (tile)", - "[Event] 00.27/19 above_caitlin_line: done", - "[Event] 00.27/20 route10_ledge_end: start", - "00.27/route10_ledge_end: ok at Route10 (17, 11) facing east (tile)", - "[Event] 00.27/20 route10_ledge_end: done", - "[Event] 00.27/21 below_center_door: start", - "00.27/below_center_door: ok at Route10 (13, 21) facing east (tile)", - "[Event] 00.27/21 below_center_door: done", - "[Event] 00.27/22 route10_nurse: start", - "00.27/route10_nurse: ok at Route10_PokemonCenter_1F (7, 4) facing north (tile)", - "[Event] 00.27/22 route10_nurse: done", - "[Event] 00.27/23 heal_route10: start", - "00.27/heal_route10: ok at -", - "[Event] 00.27/23 heal_route10: done", + "[Checkpoint] 07.01: done, 18 run, 0 skipped", + "[Checkpoint] 07.01: passed on attempt 1 (one-shot)", + "begin 07.02", + "[Checkpoint] 07.02: start, 23 events", + "[Event] 07.02/1 from_save: start", + "[Event] 07.02/1 from_save: done", + "[Event] 07.02/2 above_cerulean_tree: start", + "07.02/above_cerulean_tree: ok at CeruleanCity (26, 31) facing south (tile)", + "[Event] 07.02/2 above_cerulean_tree: done", + "[Event] 07.02/3 cut_cerulean_tree: start", + "07.02/cut_cerulean_tree: ok at CeruleanCity (26, 31) facing south (tile)", + "[Event] 07.02/3 cut_cerulean_tree: done", + "[Event] 07.02/4 west_of_route9_tree: start", + "07.02/west_of_route9_tree: ok at Route9 (1, 8) facing east (tile)", + "[Event] 07.02/4 west_of_route9_tree: done", + "[Event] 07.02/5 cut_route9_tree: start", + "07.02/cut_route9_tree: ok at Route9 (1, 8) facing east (tile)", + "[Event] 07.02/5 cut_route9_tree: done", + "[Event] 07.02/6 above_alicia_line: start", + "07.02/above_alicia_line: ok at Route9 (11, 9) facing south (tile)", + "[Event] 07.02/6 above_alicia_line: done", + "[Event] 07.02/7 alicia_line: start", + "07.02/alicia_line: ok at Route9 (11, 10) facing south (tile)", + "[Event] 07.02/7 alicia_line: done", + "[Event] 07.02/8 picnicker_alicia: start", + "07.02/picnicker_alicia: ok at -", + "[Event] 07.02/8 picnicker_alicia: done", + "[Event] 07.02/9 alicia_ledge_hop: start", + "07.02/alicia_ledge_hop: ok at Route9 (11, 11) facing south (tile)", + "[Event] 07.02/9 alicia_ledge_hop: done", + "[Event] 07.02/10 west_of_jeremy_sight: start", + "07.02/west_of_jeremy_sight: ok at Route9 (19, 13) facing east (tile)", + "[Event] 07.02/10 west_of_jeremy_sight: done", + "[Event] 07.02/11 jeremy_sight: start", + "07.02/jeremy_sight: ok at Route9 (20, 13) facing east (tile)", + "[Event] 07.02/11 jeremy_sight: done", + "[Event] 07.02/12 hiker_jeremy: start", + "07.02/hiker_jeremy: ok at -", + "[Event] 07.02/12 hiker_jeremy: done", + "[Event] 07.02/13 below_conner_line: start", + "07.02/below_conner_line: ok at Route9 (52, 8) facing north (tile)", + "[Event] 07.02/13 below_conner_line: done", + "[Event] 07.02/14 conner_line: start", + "07.02/conner_line: ok at Route9 (52, 7) facing north (tile)", + "[Event] 07.02/14 conner_line: done", + "[Event] 07.02/15 bug_catcher_conner: start", + "07.02/bug_catcher_conner: ok at -", + "[Event] 07.02/15 bug_catcher_conner: done", + "[Event] 07.02/16 round_brice: start", + "07.02/round_brice: ok at Route9 (64, 2) facing south (tile)", + "[Event] 07.02/16 round_brice: done", + "[Event] 07.02/17 above_east_ledge: start", + "07.02/above_east_ledge: ok at Route9 (64, 3) facing south (tile)", + "[Event] 07.02/17 above_east_ledge: done", + "[Event] 07.02/18 east_ledge_hop: start", + "07.02/east_ledge_hop: ok at Route9 (64, 4) facing south (tile)", + "[Event] 07.02/18 east_ledge_hop: done", + "[Event] 07.02/19 above_caitlin_line: start", + "07.02/above_caitlin_line: ok at Route9 (70, 8) facing east (tile)", + "[Event] 07.02/19 above_caitlin_line: done", + "[Event] 07.02/20 route10_ledge_end: start", + "07.02/route10_ledge_end: ok at Route10 (17, 11) facing east (tile)", + "[Event] 07.02/20 route10_ledge_end: done", + "[Event] 07.02/21 below_center_door: start", + "07.02/below_center_door: ok at Route10 (13, 21) facing east (tile)", + "[Event] 07.02/21 below_center_door: done", + "[Event] 07.02/22 route10_nurse: start", + "07.02/route10_nurse: ok at Route10_PokemonCenter_1F (7, 4) facing north (tile)", + "[Event] 07.02/22 route10_nurse: done", + "[Event] 07.02/23 heal_route10: start", + "07.02/heal_route10: ok at -", + "[Event] 07.02/23 heal_route10: done", "save at Route10_PokemonCenter_1F (7, 4) facing north (tile)", - "[Checkpoint] 00.27: done, 23 run, 0 skipped", - "[Checkpoint] 00.27: passed on attempt 1 (one-shot)", - "begin 00.28", - "[Checkpoint] 00.28: start, 39 events", - "[Event] 00.28/1 from_save: start", - "[Event] 00.28/1 from_save: done", - "[Event] 00.28/2 below_route10_tree: start", - "00.28/below_route10_tree: ok at Route10 (10, 21) facing north (tile)", - "[Event] 00.28/2 below_route10_tree: done", - "[Event] 00.28/3 cut_route10_tree: start", - "00.28/cut_route10_tree: ok at Route10 (10, 21) facing north (tile)", - "[Event] 00.28/3 cut_route10_tree: done", - "[Event] 00.28/4 west_of_tree: start", - "00.28/west_of_tree: ok at Route10 (9, 20) facing west (tile)", - "[Event] 00.28/4 west_of_tree: done", - "[Event] 00.28/5 below_rock_tunnel: start", - "00.28/below_rock_tunnel: ok at Route10 (8, 20) facing west (tile)", - "[Event] 00.28/5 below_rock_tunnel: done", - "[Event] 00.28/6 rock_tunnel_1f: start", - "00.28/rock_tunnel_1f: ok at RockTunnel_1F (17, 2) facing north (tile)", - "[Event] 00.28/6 rock_tunnel_1f: done", - "[Event] 00.28/7 above_ashton_line: start", - "00.28/above_ashton_line: ok at RockTunnel_1F (24, 9) facing west (tile)", - "[Event] 00.28/7 above_ashton_line: done", - "[Event] 00.28/8 ashton_line: start", - "00.28/ashton_line: ok at RockTunnel_1F (24, 10) facing south (tile)", - "[Event] 00.28/8 ashton_line: done", - "[Event] 00.28/9 pokemaniac_ashton: start", - "00.28/pokemaniac_ashton: ok at -", - "[Event] 00.28/9 pokemaniac_ashton: done", - "[Event] 00.28/10 b1f_south_ladder: start", - "00.28/b1f_south_ladder: ok at RockTunnel_B1F (38, 28) facing north (tile)", - "[Event] 00.28/10 b1f_south_ladder: done", - "[Event] 00.28/11 winston_line_end: start", - "00.28/winston_line_end: ok at RockTunnel_B1F (32, 37) facing west (tile)", - "[Event] 00.28/11 winston_line_end: done", - "[Event] 00.28/12 winston_line: start", - "00.28/winston_line: ok at RockTunnel_B1F (29, 37) facing west (tile)", - "[Event] 00.28/12 winston_line: done", - "[Event] 00.28/13 pokemaniac_winston: start", - "00.28/pokemaniac_winston: ok at -", - "[Event] 00.28/13 pokemaniac_winston: done", - "[Event] 00.28/14 below_martha_line: start", - "00.28/below_martha_line: ok at RockTunnel_B1F (16, 35) facing east (tile)", - "[Event] 00.28/14 below_martha_line: done", - "[Event] 00.28/15 martha_line: start", - "00.28/martha_line: ok at RockTunnel_B1F (16, 33) facing north (tile)", - "[Event] 00.28/15 martha_line: done", - "[Event] 00.28/16 picnicker_martha: start", - "00.28/picnicker_martha: ok at -", - "[Event] 00.28/16 picnicker_martha: done", - "[Event] 00.28/17 below_allen_line: start", - "00.28/below_allen_line: ok at RockTunnel_B1F (38, 12) facing north (tile)", - "[Event] 00.28/17 below_allen_line: done", - "[Event] 00.28/18 allen_line: start", - "00.28/allen_line: ok at RockTunnel_B1F (36, 12) facing west (tile)", - "[Event] 00.28/18 allen_line: done", - "[Event] 00.28/19 hiker_allen: start", - "00.28/hiker_allen: ok at -", - "[Event] 00.28/19 hiker_allen: done", - "[Event] 00.28/20 west_of_b1f_ladder: start", - "00.28/west_of_b1f_ladder: ok at RockTunnel_B1F (32, 2) facing north (tile)", - "[Event] 00.28/20 west_of_b1f_ladder: done", - "[Event] 00.28/21 1f_west_ladder: start", - "00.28/1f_west_ladder: ok at RockTunnel_1F (4, 2) facing north (tile)", - "[Event] 00.28/21 1f_west_ladder: done", - "[Event] 00.28/22 above_lenny_line: start", - "00.28/above_lenny_line: ok at RockTunnel_1F (6, 9) facing south (tile)", - "[Event] 00.28/22 above_lenny_line: done", - "[Event] 00.28/23 lenny_line: start", - "00.28/lenny_line: ok at RockTunnel_1F (7, 9) facing east (tile)", - "[Event] 00.28/23 lenny_line: done", - "[Event] 00.28/24 hiker_lenny: start", - "00.28/hiker_lenny: ok at -", - "[Event] 00.28/24 hiker_lenny: done", - "[Event] 00.28/25 west_of_lucas_line: start", - "00.28/west_of_lucas_line: ok at RockTunnel_1F (20, 16) facing east (tile)", - "[Event] 00.28/25 west_of_lucas_line: done", - "[Event] 00.28/26 b1f_middle_ladder: start", - "00.28/b1f_middle_ladder: ok at RockTunnel_B1F (27, 12) facing north (tile)", - "[Event] 00.28/26 b1f_middle_ladder: done", - "[Event] 00.28/27 east_of_sofia_line: start", - "00.28/east_of_sofia_line: ok at RockTunnel_B1F (13, 16) facing west (tile)", - "[Event] 00.28/27 east_of_sofia_line: done", - "[Event] 00.28/28 sofia_line: start", - "00.28/sofia_line: ok at RockTunnel_B1F (11, 16) facing west (tile)", - "[Event] 00.28/28 sofia_line: done", - "[Event] 00.28/29 picnicker_sofia: start", - "00.28/picnicker_sofia: ok at -", - "[Event] 00.28/29 picnicker_sofia: done", - "[Event] 00.28/30 east_of_dudley_line: start", - "00.28/east_of_dudley_line: ok at RockTunnel_B1F (8, 15) facing north (tile)", - "[Event] 00.28/30 east_of_dudley_line: done", - "[Event] 00.28/31 dudley_line: start", - "00.28/dudley_line: ok at RockTunnel_B1F (5, 15) facing west (tile)", - "[Event] 00.28/31 dudley_line: done", - "[Event] 00.28/32 hiker_dudley: start", - "00.28/hiker_dudley: ok at -", - "[Event] 00.28/32 hiker_dudley: done", - "[Event] 00.28/33 past_cooper: start", - "00.28/past_cooper: ok at RockTunnel_B1F (1, 3) facing south (tile)", - "[Event] 00.28/33 past_cooper: done", - "[Event] 00.28/34 1f_east_ladder: start", - "00.28/1f_east_ladder: ok at RockTunnel_1F (45, 21) facing north (tile)", - "[Event] 00.28/34 1f_east_ladder: done", - "[Event] 00.28/35 above_dana_line: start", - "00.28/above_dana_line: ok at RockTunnel_1F (28, 31) facing south (tile)", - "[Event] 00.28/35 above_dana_line: done", - "[Event] 00.28/36 dana_line: start", - "00.28/dana_line: ok at RockTunnel_1F (26, 31) facing west (tile)", - "[Event] 00.28/36 dana_line: done", - "[Event] 00.28/37 picnicker_dana: start", - "00.28/picnicker_dana: ok at -", - "[Event] 00.28/37 picnicker_dana: done", - "[Event] 00.28/38 above_south_mouth: start", - "00.28/above_south_mouth: ok at RockTunnel_1F (18, 36) facing west (tile)", - "[Event] 00.28/38 above_south_mouth: done", - "[Event] 00.28/39 route10_south: start", - "00.28/route10_south: ok at Route10 (8, 58) facing south (tile)", - "[Event] 00.28/39 route10_south: done", + "[Checkpoint] 07.02: done, 23 run, 0 skipped", + "[Checkpoint] 07.02: passed on attempt 1 (one-shot)", + "begin 08.01", + "[Checkpoint] 08.01: start, 39 events", + "[Event] 08.01/1 from_save: start", + "[Event] 08.01/1 from_save: done", + "[Event] 08.01/2 below_route10_tree: start", + "08.01/below_route10_tree: ok at Route10 (10, 21) facing north (tile)", + "[Event] 08.01/2 below_route10_tree: done", + "[Event] 08.01/3 cut_route10_tree: start", + "08.01/cut_route10_tree: ok at Route10 (10, 21) facing north (tile)", + "[Event] 08.01/3 cut_route10_tree: done", + "[Event] 08.01/4 west_of_tree: start", + "08.01/west_of_tree: ok at Route10 (9, 20) facing west (tile)", + "[Event] 08.01/4 west_of_tree: done", + "[Event] 08.01/5 below_rock_tunnel: start", + "08.01/below_rock_tunnel: ok at Route10 (8, 20) facing west (tile)", + "[Event] 08.01/5 below_rock_tunnel: done", + "[Event] 08.01/6 rock_tunnel_1f: start", + "08.01/rock_tunnel_1f: ok at RockTunnel_1F (17, 2) facing north (tile)", + "[Event] 08.01/6 rock_tunnel_1f: done", + "[Event] 08.01/7 above_ashton_line: start", + "08.01/above_ashton_line: ok at RockTunnel_1F (24, 9) facing west (tile)", + "[Event] 08.01/7 above_ashton_line: done", + "[Event] 08.01/8 ashton_line: start", + "08.01/ashton_line: ok at RockTunnel_1F (24, 10) facing south (tile)", + "[Event] 08.01/8 ashton_line: done", + "[Event] 08.01/9 pokemaniac_ashton: start", + "08.01/pokemaniac_ashton: ok at -", + "[Event] 08.01/9 pokemaniac_ashton: done", + "[Event] 08.01/10 b1f_south_ladder: start", + "08.01/b1f_south_ladder: ok at RockTunnel_B1F (38, 28) facing north (tile)", + "[Event] 08.01/10 b1f_south_ladder: done", + "[Event] 08.01/11 winston_line_end: start", + "08.01/winston_line_end: ok at RockTunnel_B1F (32, 37) facing west (tile)", + "[Event] 08.01/11 winston_line_end: done", + "[Event] 08.01/12 winston_line: start", + "08.01/winston_line: ok at RockTunnel_B1F (29, 37) facing west (tile)", + "[Event] 08.01/12 winston_line: done", + "[Event] 08.01/13 pokemaniac_winston: start", + "08.01/pokemaniac_winston: ok at -", + "[Event] 08.01/13 pokemaniac_winston: done", + "[Event] 08.01/14 below_martha_line: start", + "08.01/below_martha_line: ok at RockTunnel_B1F (16, 35) facing east (tile)", + "[Event] 08.01/14 below_martha_line: done", + "[Event] 08.01/15 martha_line: start", + "08.01/martha_line: ok at RockTunnel_B1F (16, 33) facing north (tile)", + "[Event] 08.01/15 martha_line: done", + "[Event] 08.01/16 picnicker_martha: start", + "08.01/picnicker_martha: ok at -", + "[Event] 08.01/16 picnicker_martha: done", + "[Event] 08.01/17 below_allen_line: start", + "08.01/below_allen_line: ok at RockTunnel_B1F (38, 12) facing north (tile)", + "[Event] 08.01/17 below_allen_line: done", + "[Event] 08.01/18 allen_line: start", + "08.01/allen_line: ok at RockTunnel_B1F (36, 12) facing west (tile)", + "[Event] 08.01/18 allen_line: done", + "[Event] 08.01/19 hiker_allen: start", + "08.01/hiker_allen: ok at -", + "[Event] 08.01/19 hiker_allen: done", + "[Event] 08.01/20 west_of_b1f_ladder: start", + "08.01/west_of_b1f_ladder: ok at RockTunnel_B1F (32, 2) facing north (tile)", + "[Event] 08.01/20 west_of_b1f_ladder: done", + "[Event] 08.01/21 1f_west_ladder: start", + "08.01/1f_west_ladder: ok at RockTunnel_1F (4, 2) facing north (tile)", + "[Event] 08.01/21 1f_west_ladder: done", + "[Event] 08.01/22 above_lenny_line: start", + "08.01/above_lenny_line: ok at RockTunnel_1F (6, 9) facing south (tile)", + "[Event] 08.01/22 above_lenny_line: done", + "[Event] 08.01/23 lenny_line: start", + "08.01/lenny_line: ok at RockTunnel_1F (7, 9) facing east (tile)", + "[Event] 08.01/23 lenny_line: done", + "[Event] 08.01/24 hiker_lenny: start", + "08.01/hiker_lenny: ok at -", + "[Event] 08.01/24 hiker_lenny: done", + "[Event] 08.01/25 west_of_lucas_line: start", + "08.01/west_of_lucas_line: ok at RockTunnel_1F (20, 16) facing east (tile)", + "[Event] 08.01/25 west_of_lucas_line: done", + "[Event] 08.01/26 b1f_middle_ladder: start", + "08.01/b1f_middle_ladder: ok at RockTunnel_B1F (27, 12) facing north (tile)", + "[Event] 08.01/26 b1f_middle_ladder: done", + "[Event] 08.01/27 east_of_sofia_line: start", + "08.01/east_of_sofia_line: ok at RockTunnel_B1F (13, 16) facing west (tile)", + "[Event] 08.01/27 east_of_sofia_line: done", + "[Event] 08.01/28 sofia_line: start", + "08.01/sofia_line: ok at RockTunnel_B1F (11, 16) facing west (tile)", + "[Event] 08.01/28 sofia_line: done", + "[Event] 08.01/29 picnicker_sofia: start", + "08.01/picnicker_sofia: ok at -", + "[Event] 08.01/29 picnicker_sofia: done", + "[Event] 08.01/30 east_of_dudley_line: start", + "08.01/east_of_dudley_line: ok at RockTunnel_B1F (8, 15) facing north (tile)", + "[Event] 08.01/30 east_of_dudley_line: done", + "[Event] 08.01/31 dudley_line: start", + "08.01/dudley_line: ok at RockTunnel_B1F (5, 15) facing west (tile)", + "[Event] 08.01/31 dudley_line: done", + "[Event] 08.01/32 hiker_dudley: start", + "08.01/hiker_dudley: ok at -", + "[Event] 08.01/32 hiker_dudley: done", + "[Event] 08.01/33 past_cooper: start", + "08.01/past_cooper: ok at RockTunnel_B1F (1, 3) facing south (tile)", + "[Event] 08.01/33 past_cooper: done", + "[Event] 08.01/34 1f_east_ladder: start", + "08.01/1f_east_ladder: ok at RockTunnel_1F (45, 21) facing north (tile)", + "[Event] 08.01/34 1f_east_ladder: done", + "[Event] 08.01/35 above_dana_line: start", + "08.01/above_dana_line: ok at RockTunnel_1F (28, 31) facing south (tile)", + "[Event] 08.01/35 above_dana_line: done", + "[Event] 08.01/36 dana_line: start", + "08.01/dana_line: ok at RockTunnel_1F (26, 31) facing west (tile)", + "[Event] 08.01/36 dana_line: done", + "[Event] 08.01/37 picnicker_dana: start", + "08.01/picnicker_dana: ok at -", + "[Event] 08.01/37 picnicker_dana: done", + "[Event] 08.01/38 above_south_mouth: start", + "08.01/above_south_mouth: ok at RockTunnel_1F (18, 36) facing west (tile)", + "[Event] 08.01/38 above_south_mouth: done", + "[Event] 08.01/39 route10_south: start", + "08.01/route10_south: ok at Route10 (8, 58) facing south (tile)", + "[Event] 08.01/39 route10_south: done", "save at Route10 (8, 58) facing south (tile)", - "[Checkpoint] 00.28: done, 39 run, 0 skipped", - "[Checkpoint] 00.28: passed on attempt 1 (one-shot)", - "begin 00.29", - "[Checkpoint] 00.29: start, 7 events", - "[Event] 00.29/1 from_save: start", - "[Event] 00.29/1 from_save: done", - "[Event] 00.29/2 route10_east_side: start", - "00.29/route10_east_side: ok at Route10 (11, 73) facing west (tile)", - "[Event] 00.29/2 route10_east_side: done", - "[Event] 00.29/3 route10_ledge_hop: start", - "00.29/route10_ledge_hop: ok at Route10 (11, 74) facing south (tile)", - "[Event] 00.29/3 route10_ledge_hop: done", - "[Event] 00.29/4 lavender_north_wall: start", - "00.29/lavender_north_wall: ok at LavenderTown (11, 8) facing south (tile)", - "[Event] 00.29/4 lavender_north_wall: done", - "[Event] 00.29/5 below_center_door: start", - "00.29/below_center_door: ok at LavenderTown (6, 9) facing west (tile)", - "[Event] 00.29/5 below_center_door: done", - "[Event] 00.29/6 lavender_nurse: start", - "00.29/lavender_nurse: ok at LavenderTown_PokemonCenter_1F (7, 4) facing north (tile)", - "[Event] 00.29/6 lavender_nurse: done", - "[Event] 00.29/7 heal_lavender: start", - "00.29/heal_lavender: ok at -", - "[Event] 00.29/7 heal_lavender: done", + "[Checkpoint] 08.01: done, 39 run, 0 skipped", + "[Checkpoint] 08.01: passed on attempt 1 (one-shot)", + "begin 08.02", + "[Checkpoint] 08.02: start, 7 events", + "[Event] 08.02/1 from_save: start", + "[Event] 08.02/1 from_save: done", + "[Event] 08.02/2 route10_east_side: start", + "08.02/route10_east_side: ok at Route10 (11, 73) facing west (tile)", + "[Event] 08.02/2 route10_east_side: done", + "[Event] 08.02/3 route10_ledge_hop: start", + "08.02/route10_ledge_hop: ok at Route10 (11, 74) facing south (tile)", + "[Event] 08.02/3 route10_ledge_hop: done", + "[Event] 08.02/4 lavender_north_wall: start", + "08.02/lavender_north_wall: ok at LavenderTown (11, 8) facing south (tile)", + "[Event] 08.02/4 lavender_north_wall: done", + "[Event] 08.02/5 below_center_door: start", + "08.02/below_center_door: ok at LavenderTown (6, 9) facing west (tile)", + "[Event] 08.02/5 below_center_door: done", + "[Event] 08.02/6 lavender_nurse: start", + "08.02/lavender_nurse: ok at LavenderTown_PokemonCenter_1F (7, 4) facing north (tile)", + "[Event] 08.02/6 lavender_nurse: done", + "[Event] 08.02/7 heal_lavender: start", + "08.02/heal_lavender: ok at -", + "[Event] 08.02/7 heal_lavender: done", "save at LavenderTown_PokemonCenter_1F (7, 4) facing north (tile)", - "[Checkpoint] 00.29: done, 7 run, 0 skipped", - "[Checkpoint] 00.29: passed on attempt 1 (one-shot)", - "begin 00.30", - "[Checkpoint] 00.30: start, 24 events", - "[Event] 00.30/1 from_save: start", - "[Event] 00.30/1 from_save: done", - "[Event] 00.30/2 register_bike: start", - "00.30/register_bike: ok at LavenderTown_PokemonCenter_1F (7, 4) facing north (tile)", - "[Event] 00.30/2 register_bike: done", - "[Event] 00.30/3 east_of_mart_door: start", - "00.30/east_of_mart_door: ok at LavenderTown (21, 16) facing east (tile)", - "[Event] 00.30/3 east_of_mart_door: done", - "[Event] 00.30/4 into_lavender_mart: start", - "00.30/into_lavender_mart: ok at LavenderTown_Mart (4, 2) facing north (tile)", - "[Event] 00.30/4 into_lavender_mart: done", - "[Event] 00.30/5 lavender_mart_clerk: start", - "00.30/lavender_mart_clerk: ok at LavenderTown_Mart (4, 3) facing west (tile)", - "[Event] 00.30/5 lavender_mart_clerk: done", - "[Event] 00.30/6 buy_ropes_and_super_repels: start", - "00.30/buy_ropes_and_super_repels: ok at LavenderTown_Mart (4, 3) facing west (tile)", - "[Event] 00.30/6 buy_ropes_and_super_repels: done", - "[Event] 00.30/7 out_of_lavender_mart: start", - "00.30/out_of_lavender_mart: ok at LavenderTown (20, 16) facing south (tile)", - "[Event] 00.30/7 out_of_lavender_mart: done", - "[Event] 00.30/8 ride_bike: start", - "00.30/ride_bike: ok at LavenderTown (20, 16) facing south (tile)", - "[Event] 00.30/8 ride_bike: done", - "[Event] 00.30/9 lavender_west_edge: start", - "00.30/lavender_west_edge: ok at LavenderTown (1, 10) facing south (tile)", - "[Event] 00.30/9 lavender_west_edge: done", - "[Event] 00.30/10 route8_east_wall: start", - "00.30/route8_east_wall: ok at Route8 (62, 10) facing west (tile)", - "[Event] 00.30/10 route8_east_wall: done", - "[Event] 00.30/11 east_of_rich_line: start", - "00.30/east_of_rich_line: ok at Route8 (57, 18) facing west (tile)", - "[Event] 00.30/11 east_of_rich_line: done", - "[Event] 00.30/12 rich_line: start", - "00.30/rich_line: ok at Route8 (55, 18) facing west (tile)", - "[Event] 00.30/12 rich_line: done", - "[Event] 00.30/13 gamer_rich: start", - "00.30/gamer_rich: ok at -", - "[Event] 00.30/13 gamer_rich: done", - "[Event] 00.30/14 west_of_glenn_column: start", - "00.30/west_of_glenn_column: ok at Route8 (48, 7) facing north (tile)", - "[Event] 00.30/14 west_of_glenn_column: done", - "[Event] 00.30/15 route8_row7_west_wall: start", - "00.30/route8_row7_west_wall: ok at Route8 (26, 7) facing west (tile)", - "[Event] 00.30/15 route8_row7_west_wall: done", - "[Event] 00.30/16 route8_row14_west_wall: start", - "00.30/route8_row14_west_wall: ok at Route8 (12, 14) facing west (tile)", - "[Event] 00.30/16 route8_row14_west_wall: done", - "[Event] 00.30/17 east_of_underground_door: start", - "00.30/east_of_underground_door: ok at Route8 (14, 5) facing north (tile)", - "[Event] 00.30/17 east_of_underground_door: done", - "[Event] 00.30/18 below_underground_door: start", - "00.30/below_underground_door: ok at Route8 (13, 5) facing north (tile)", - "[Event] 00.30/18 below_underground_door: done", - "[Event] 00.30/19 route7_underground_exit: start", - "00.30/route7_underground_exit: ok at Route7 (7, 15) facing south (tile)", - "[Event] 00.30/19 route7_underground_exit: done", - "[Event] 00.30/20 pidgey_grass: start", - "00.30/pidgey_grass: ok at Route7 (14, 6) facing east (tile)", - "[Event] 00.30/20 pidgey_grass: done", - "[Event] 00.30/21 catch_pidgey: start", - "00.30/catch_pidgey: ok at Route7 (14, 6) (15, 6) (set)", - "[Event] 00.30/21 catch_pidgey: done", - "[Event] 00.30/22 celadon_below_center: start", - "00.30/celadon_below_center: ok at CeladonCity (48, 12) facing north (tile)", - "[Event] 00.30/22 celadon_below_center: done", - "[Event] 00.30/23 celadon_nurse: start", - "00.30/celadon_nurse: ok at CeladonCity (48, 12) facing north (tile)", - "[Event] 00.30/23 celadon_nurse: done", - "[Event] 00.30/24 heal_celadon: start", - "00.30/heal_celadon: ok at -", - "[Event] 00.30/24 heal_celadon: done", + "[Checkpoint] 08.02: done, 7 run, 0 skipped", + "[Checkpoint] 08.02: passed on attempt 1 (one-shot)", + "begin 08.03", + "[Checkpoint] 08.03: start, 24 events", + "[Event] 08.03/1 from_save: start", + "[Event] 08.03/1 from_save: done", + "[Event] 08.03/2 register_bike: start", + "08.03/register_bike: ok at LavenderTown_PokemonCenter_1F (7, 4) facing north (tile)", + "[Event] 08.03/2 register_bike: done", + "[Event] 08.03/3 east_of_mart_door: start", + "08.03/east_of_mart_door: ok at LavenderTown (21, 16) facing east (tile)", + "[Event] 08.03/3 east_of_mart_door: done", + "[Event] 08.03/4 into_lavender_mart: start", + "08.03/into_lavender_mart: ok at LavenderTown_Mart (4, 2) facing north (tile)", + "[Event] 08.03/4 into_lavender_mart: done", + "[Event] 08.03/5 lavender_mart_clerk: start", + "08.03/lavender_mart_clerk: ok at LavenderTown_Mart (4, 3) facing west (tile)", + "[Event] 08.03/5 lavender_mart_clerk: done", + "[Event] 08.03/6 buy_ropes_and_super_repels: start", + "08.03/buy_ropes_and_super_repels: ok at LavenderTown_Mart (4, 3) facing west (tile)", + "[Event] 08.03/6 buy_ropes_and_super_repels: done", + "[Event] 08.03/7 out_of_lavender_mart: start", + "08.03/out_of_lavender_mart: ok at LavenderTown (20, 16) facing south (tile)", + "[Event] 08.03/7 out_of_lavender_mart: done", + "[Event] 08.03/8 ride_bike: start", + "08.03/ride_bike: ok at LavenderTown (20, 16) facing south (tile)", + "[Event] 08.03/8 ride_bike: done", + "[Event] 08.03/9 lavender_west_edge: start", + "08.03/lavender_west_edge: ok at LavenderTown (1, 10) facing south (tile)", + "[Event] 08.03/9 lavender_west_edge: done", + "[Event] 08.03/10 route8_east_wall: start", + "08.03/route8_east_wall: ok at Route8 (62, 10) facing west (tile)", + "[Event] 08.03/10 route8_east_wall: done", + "[Event] 08.03/11 east_of_rich_line: start", + "08.03/east_of_rich_line: ok at Route8 (57, 18) facing west (tile)", + "[Event] 08.03/11 east_of_rich_line: done", + "[Event] 08.03/12 rich_line: start", + "08.03/rich_line: ok at Route8 (55, 18) facing west (tile)", + "[Event] 08.03/12 rich_line: done", + "[Event] 08.03/13 gamer_rich: start", + "08.03/gamer_rich: ok at -", + "[Event] 08.03/13 gamer_rich: done", + "[Event] 08.03/14 west_of_glenn_column: start", + "08.03/west_of_glenn_column: ok at Route8 (48, 7) facing north (tile)", + "[Event] 08.03/14 west_of_glenn_column: done", + "[Event] 08.03/15 route8_row7_west_wall: start", + "08.03/route8_row7_west_wall: ok at Route8 (26, 7) facing west (tile)", + "[Event] 08.03/15 route8_row7_west_wall: done", + "[Event] 08.03/16 route8_row14_west_wall: start", + "08.03/route8_row14_west_wall: ok at Route8 (12, 14) facing west (tile)", + "[Event] 08.03/16 route8_row14_west_wall: done", + "[Event] 08.03/17 east_of_underground_door: start", + "08.03/east_of_underground_door: ok at Route8 (14, 5) facing north (tile)", + "[Event] 08.03/17 east_of_underground_door: done", + "[Event] 08.03/18 below_underground_door: start", + "08.03/below_underground_door: ok at Route8 (13, 5) facing north (tile)", + "[Event] 08.03/18 below_underground_door: done", + "[Event] 08.03/19 route7_underground_exit: start", + "08.03/route7_underground_exit: ok at Route7 (7, 15) facing south (tile)", + "[Event] 08.03/19 route7_underground_exit: done", + "[Event] 08.03/20 pidgey_grass: start", + "08.03/pidgey_grass: ok at Route7 (14, 6) facing east (tile)", + "[Event] 08.03/20 pidgey_grass: done", + "[Event] 08.03/21 catch_pidgey: start", + "08.03/catch_pidgey: ok at Route7 (14, 6) (15, 6) (set)", + "[Event] 08.03/21 catch_pidgey: done", + "[Event] 08.03/22 celadon_below_center: start", + "08.03/celadon_below_center: ok at CeladonCity (48, 12) facing north (tile)", + "[Event] 08.03/22 celadon_below_center: done", + "[Event] 08.03/23 celadon_nurse: start", + "08.03/celadon_nurse: ok at CeladonCity (48, 12) facing north (tile)", + "[Event] 08.03/23 celadon_nurse: done", + "[Event] 08.03/24 heal_celadon: start", + "08.03/heal_celadon: ok at -", + "[Event] 08.03/24 heal_celadon: done", "save at CeladonCity_PokemonCenter_1F (7, 4) facing north (tile)", - "[Checkpoint] 00.30: done, 24 run, 0 skipped", - "[Checkpoint] 00.30: passed on attempt 1 (one-shot)", - "begin 00.31", - "[Checkpoint] 00.31: start, 22 events", - "[Event] 00.31/1 from_save: start", - "[Event] 00.31/1 from_save: done", - "[Event] 00.31/2 celadon_below_game_corner: start", - "00.31/celadon_below_game_corner: ok at CeladonCity (34, 22) facing north (tile)", - "[Event] 00.31/2 celadon_below_game_corner: done", - "[Event] 00.31/3 below_poster_guard: start", - "00.31/below_poster_guard: ok at CeladonCity_GameCorner (11, 3) facing north (tile)", - "[Event] 00.31/3 below_poster_guard: done", - "[Event] 00.31/4 talk_poster_guard: start", - "00.31/talk_poster_guard: ok at -", - "[Event] 00.31/4 talk_poster_guard: done", - "[Event] 00.31/5 rocket_grunt: start", - "00.31/rocket_grunt: ok at -", - "[Event] 00.31/5 rocket_grunt: done", - "[Event] 00.31/6 below_poster: start", - "00.31/below_poster: ok at CeladonCity_GameCorner (11, 2) facing north (tile)", - "[Event] 00.31/6 below_poster: done", - "[Event] 00.31/7 poster_switch: start", - "00.31/poster_switch: ok at CeladonCity_GameCorner (11, 2) facing north (tile)", - "[Event] 00.31/7 poster_switch: done", - "[Event] 00.31/8 b2f_east_of_grunt: start", - "00.31/b2f_east_of_grunt: ok at RocketHideout_B2F (23, 4) facing west (tile)", - "[Event] 00.31/8 b2f_east_of_grunt: done", - "[Event] 00.31/9 b2f_to_stairs: start", - "00.31/b2f_to_stairs: ok at RocketHideout_B2F (21, 2) facing north (tile)", - "[Event] 00.31/9 b2f_to_stairs: done", - "[Event] 00.31/10 b3f_off_stairs: start", - "00.31/b3f_off_stairs: ok at RocketHideout_B3F (18, 2) facing east (tile)", - "[Event] 00.31/10 b3f_off_stairs: done", - "[Event] 00.31/11 b3f_arrow_maze: start", - "00.31/b3f_arrow_maze: ok at RocketHideout_B3F (15, 19) facing north (tile)", - "[Event] 00.31/11 b3f_arrow_maze: done", - "[Event] 00.31/12 hideout_b4f_west: start", - "00.31/hideout_b4f_west: ok at RocketHideout_B4F (5, 3) facing west (tile)", - "[Event] 00.31/12 hideout_b4f_west: done", - "[Event] 00.31/13 key_grunt_line: start", - "00.31/key_grunt_line: ok at RocketHideout_B4F (4, 3) facing west (tile)", - "[Event] 00.31/13 key_grunt_line: done", - "[Event] 00.31/14 lift_key_grunt: start", - "00.31/lift_key_grunt: ok at -", - "[Event] 00.31/14 lift_key_grunt: done", - "[Event] 00.31/15 beside_lift_key: start", - "00.31/beside_lift_key: ok at RocketHideout_B4F (3, 3) facing west (tile)", - "[Event] 00.31/15 beside_lift_key: done", - "[Event] 00.31/16 below_lift_key: start", - "00.31/below_lift_key: ok at RocketHideout_B4F (3, 3) facing north (tile)", - "[Event] 00.31/16 below_lift_key: done", - "[Event] 00.31/17 lift_key: start", - "00.31/lift_key: ok at -", - "[Event] 00.31/17 lift_key: done", - "[Event] 00.31/18 b4f_to_stairs: start", - "00.31/b4f_to_stairs: ok at RocketHideout_B4F (11, 15) facing south (tile)", - "[Event] 00.31/18 b4f_to_stairs: done", - "[Event] 00.31/19 b3f_from_b4f: start", - "00.31/b3f_from_b4f: ok at RocketHideout_B3F (15, 18) facing west (tile)", - "[Event] 00.31/19 b3f_from_b4f: done", - "[Event] 00.31/20 b3f_back_to_candy_row: start", - "00.31/b3f_back_to_candy_row: ok at RocketHideout_B3F (10, 13) facing north (tile)", - "[Event] 00.31/20 b3f_back_to_candy_row: done", - "[Event] 00.31/21 beside_b3f_rare_candy: start", - "00.31/beside_b3f_rare_candy: ok at RocketHideout_B3F (12, 13) facing north (tile)", - "[Event] 00.31/21 beside_b3f_rare_candy: done", - "[Event] 00.31/22 b3f_rare_candy: start", - "00.31/b3f_rare_candy: ok at -", - "[Event] 00.31/22 b3f_rare_candy: done", + "[Checkpoint] 08.03: done, 24 run, 0 skipped", + "[Checkpoint] 08.03: passed on attempt 1 (one-shot)", + "begin 09.01", + "[Checkpoint] 09.01: start, 22 events", + "[Event] 09.01/1 from_save: start", + "[Event] 09.01/1 from_save: done", + "[Event] 09.01/2 celadon_below_game_corner: start", + "09.01/celadon_below_game_corner: ok at CeladonCity (34, 22) facing north (tile)", + "[Event] 09.01/2 celadon_below_game_corner: done", + "[Event] 09.01/3 below_poster_guard: start", + "09.01/below_poster_guard: ok at CeladonCity_GameCorner (11, 3) facing north (tile)", + "[Event] 09.01/3 below_poster_guard: done", + "[Event] 09.01/4 talk_poster_guard: start", + "09.01/talk_poster_guard: ok at -", + "[Event] 09.01/4 talk_poster_guard: done", + "[Event] 09.01/5 rocket_grunt: start", + "09.01/rocket_grunt: ok at -", + "[Event] 09.01/5 rocket_grunt: done", + "[Event] 09.01/6 below_poster: start", + "09.01/below_poster: ok at CeladonCity_GameCorner (11, 2) facing north (tile)", + "[Event] 09.01/6 below_poster: done", + "[Event] 09.01/7 poster_switch: start", + "09.01/poster_switch: ok at CeladonCity_GameCorner (11, 2) facing north (tile)", + "[Event] 09.01/7 poster_switch: done", + "[Event] 09.01/8 b2f_east_of_grunt: start", + "09.01/b2f_east_of_grunt: ok at RocketHideout_B2F (23, 4) facing west (tile)", + "[Event] 09.01/8 b2f_east_of_grunt: done", + "[Event] 09.01/9 b2f_to_stairs: start", + "09.01/b2f_to_stairs: ok at RocketHideout_B2F (21, 2) facing north (tile)", + "[Event] 09.01/9 b2f_to_stairs: done", + "[Event] 09.01/10 b3f_off_stairs: start", + "09.01/b3f_off_stairs: ok at RocketHideout_B3F (18, 2) facing east (tile)", + "[Event] 09.01/10 b3f_off_stairs: done", + "[Event] 09.01/11 b3f_arrow_maze: start", + "09.01/b3f_arrow_maze: ok at RocketHideout_B3F (15, 19) facing north (tile)", + "[Event] 09.01/11 b3f_arrow_maze: done", + "[Event] 09.01/12 hideout_b4f_west: start", + "09.01/hideout_b4f_west: ok at RocketHideout_B4F (5, 3) facing west (tile)", + "[Event] 09.01/12 hideout_b4f_west: done", + "[Event] 09.01/13 key_grunt_line: start", + "09.01/key_grunt_line: ok at RocketHideout_B4F (4, 3) facing west (tile)", + "[Event] 09.01/13 key_grunt_line: done", + "[Event] 09.01/14 lift_key_grunt: start", + "09.01/lift_key_grunt: ok at -", + "[Event] 09.01/14 lift_key_grunt: done", + "[Event] 09.01/15 beside_lift_key: start", + "09.01/beside_lift_key: ok at RocketHideout_B4F (3, 3) facing west (tile)", + "[Event] 09.01/15 beside_lift_key: done", + "[Event] 09.01/16 below_lift_key: start", + "09.01/below_lift_key: ok at RocketHideout_B4F (3, 3) facing north (tile)", + "[Event] 09.01/16 below_lift_key: done", + "[Event] 09.01/17 lift_key: start", + "09.01/lift_key: ok at -", + "[Event] 09.01/17 lift_key: done", + "[Event] 09.01/18 b4f_to_stairs: start", + "09.01/b4f_to_stairs: ok at RocketHideout_B4F (11, 15) facing south (tile)", + "[Event] 09.01/18 b4f_to_stairs: done", + "[Event] 09.01/19 b3f_from_b4f: start", + "09.01/b3f_from_b4f: ok at RocketHideout_B3F (15, 18) facing west (tile)", + "[Event] 09.01/19 b3f_from_b4f: done", + "[Event] 09.01/20 b3f_back_to_candy_row: start", + "09.01/b3f_back_to_candy_row: ok at RocketHideout_B3F (10, 13) facing north (tile)", + "[Event] 09.01/20 b3f_back_to_candy_row: done", + "[Event] 09.01/21 beside_b3f_rare_candy: start", + "09.01/beside_b3f_rare_candy: ok at RocketHideout_B3F (12, 13) facing north (tile)", + "[Event] 09.01/21 beside_b3f_rare_candy: done", + "[Event] 09.01/22 b3f_rare_candy: start", + "09.01/b3f_rare_candy: ok at -", + "[Event] 09.01/22 b3f_rare_candy: done", "save at RocketHideout_B3F (12, 13) facing north (tile)", - "[Checkpoint] 00.31: done, 22 run, 0 skipped", - "[Checkpoint] 00.31: passed on attempt 1 (one-shot)", - "begin 00.32", - "[Checkpoint] 00.32: start, 25 events", - "[Event] 00.32/1 from_save: start", - "[Event] 00.32/1 from_save: done", - "[Event] 00.32/2 b3f_to_top_corridor: start", - "00.32/b3f_to_top_corridor: ok at RocketHideout_B3F (12, 2) facing north (tile)", - "[Event] 00.32/2 b3f_to_top_corridor: done", - "[Event] 00.32/3 b2f_from_b3f: start", - "00.32/b2f_from_b3f: ok at RocketHideout_B2F (21, 2) facing east (tile)", - "[Event] 00.32/3 b2f_from_b3f: done", - "[Event] 00.32/4 b2f_arrows_to_moon_stone: start", - "00.32/b2f_arrows_to_moon_stone: ok at RocketHideout_B2F (1, 4) facing west (tile)", - "[Event] 00.32/4 b2f_arrows_to_moon_stone: done", - "[Event] 00.32/5 beside_moon_stone: start", - "00.32/beside_moon_stone: ok at RocketHideout_B2F (2, 4) facing east (tile)", - "[Event] 00.32/5 beside_moon_stone: done", - "[Event] 00.32/6 above_moon_stone: start", - "00.32/above_moon_stone: ok at RocketHideout_B2F (2, 4) facing south (tile)", - "[Event] 00.32/6 above_moon_stone: done", - "[Event] 00.32/7 moon_stone: start", - "00.32/moon_stone: ok at -", - "[Event] 00.32/7 moon_stone: done", - "[Event] 00.32/8 b2f_arrows_to_lift_room: start", - "00.32/b2f_arrows_to_lift_room: ok at RocketHideout_B2F (13, 20) facing east (tile)", - "[Event] 00.32/8 b2f_arrows_to_lift_room: done", - "[Event] 00.32/9 lift_room_to_row_17: start", - "00.32/lift_room_to_row_17: ok at RocketHideout_B2F (15, 17) facing north (tile)", - "[Event] 00.32/9 lift_room_to_row_17: done", - "[Event] 00.32/10 below_lift: start", - "00.32/below_lift: ok at RocketHideout_B2F (28, 17) facing north (tile)", - "[Event] 00.32/10 below_lift: done", - "[Event] 00.32/11 lift_to_b4f: start", - "00.32/lift_to_b4f: ok at RocketHideout_B2F (28, 17) facing north (tile)", - "[Event] 00.32/11 lift_to_b4f: done", - "[Event] 00.32/12 below_left_guard: start", - "00.32/below_left_guard: ok at RocketHideout_B4F (16, 15) facing north (tile)", - "[Event] 00.32/12 below_left_guard: done", - "[Event] 00.32/13 talk_left_guard: start", - "00.32/talk_left_guard: ok at -", - "[Event] 00.32/13 talk_left_guard: done", - "[Event] 00.32/14 left_guard: start", - "00.32/left_guard: ok at -", - "[Event] 00.32/14 left_guard: done", - "[Event] 00.32/15 below_right_guard: start", - "00.32/below_right_guard: ok at RocketHideout_B4F (19, 15) facing north (tile)", - "[Event] 00.32/15 below_right_guard: done", - "[Event] 00.32/16 talk_right_guard: start", - "00.32/talk_right_guard: ok at -", - "[Event] 00.32/16 talk_right_guard: done", - "[Event] 00.32/17 right_guard: start", - "00.32/right_guard: ok at -", - "[Event] 00.32/17 right_guard: done", - "[Event] 00.32/18 beside_giovanni: start", - "00.32/beside_giovanni: ok at RocketHideout_B4F (19, 5) facing east (tile)", - "[Event] 00.32/18 beside_giovanni: done", - "[Event] 00.32/19 below_giovanni: start", - "00.32/below_giovanni: ok at RocketHideout_B4F (19, 5) facing north (tile)", - "[Event] 00.32/19 below_giovanni: done", - "[Event] 00.32/20 talk_giovanni: start", - "00.32/talk_giovanni: ok at -", - "[Event] 00.32/20 talk_giovanni: done", - "[Event] 00.32/21 giovanni: start", - "00.32/giovanni: ok at -", - "[Event] 00.32/21 giovanni: done", - "[Event] 00.32/22 east_of_silph_scope: start", - "00.32/east_of_silph_scope: ok at RocketHideout_B4F (21, 5) facing north (tile)", - "[Event] 00.32/22 east_of_silph_scope: done", - "[Event] 00.32/23 beside_silph_scope: start", - "00.32/beside_silph_scope: ok at RocketHideout_B4F (21, 5) facing west (tile)", - "[Event] 00.32/23 beside_silph_scope: done", - "[Event] 00.32/24 silph_scope: start", - "00.32/silph_scope: ok at -", - "[Event] 00.32/24 silph_scope: done", - "[Event] 00.32/25 escape_rope_hideout: start", - "00.32/escape_rope_hideout: ok at RocketHideout_B4F (21, 5) facing west (tile)", - "[Event] 00.32/25 escape_rope_hideout: done", + "[Checkpoint] 09.01: done, 22 run, 0 skipped", + "[Checkpoint] 09.01: passed on attempt 1 (one-shot)", + "begin 09.02", + "[Checkpoint] 09.02: start, 25 events", + "[Event] 09.02/1 from_save: start", + "[Event] 09.02/1 from_save: done", + "[Event] 09.02/2 b3f_to_top_corridor: start", + "09.02/b3f_to_top_corridor: ok at RocketHideout_B3F (12, 2) facing north (tile)", + "[Event] 09.02/2 b3f_to_top_corridor: done", + "[Event] 09.02/3 b2f_from_b3f: start", + "09.02/b2f_from_b3f: ok at RocketHideout_B2F (21, 2) facing east (tile)", + "[Event] 09.02/3 b2f_from_b3f: done", + "[Event] 09.02/4 b2f_arrows_to_moon_stone: start", + "09.02/b2f_arrows_to_moon_stone: ok at RocketHideout_B2F (1, 4) facing west (tile)", + "[Event] 09.02/4 b2f_arrows_to_moon_stone: done", + "[Event] 09.02/5 beside_moon_stone: start", + "09.02/beside_moon_stone: ok at RocketHideout_B2F (2, 4) facing east (tile)", + "[Event] 09.02/5 beside_moon_stone: done", + "[Event] 09.02/6 above_moon_stone: start", + "09.02/above_moon_stone: ok at RocketHideout_B2F (2, 4) facing south (tile)", + "[Event] 09.02/6 above_moon_stone: done", + "[Event] 09.02/7 moon_stone: start", + "09.02/moon_stone: ok at -", + "[Event] 09.02/7 moon_stone: done", + "[Event] 09.02/8 b2f_arrows_to_lift_room: start", + "09.02/b2f_arrows_to_lift_room: ok at RocketHideout_B2F (13, 20) facing east (tile)", + "[Event] 09.02/8 b2f_arrows_to_lift_room: done", + "[Event] 09.02/9 lift_room_to_row_17: start", + "09.02/lift_room_to_row_17: ok at RocketHideout_B2F (15, 17) facing north (tile)", + "[Event] 09.02/9 lift_room_to_row_17: done", + "[Event] 09.02/10 below_lift: start", + "09.02/below_lift: ok at RocketHideout_B2F (28, 17) facing north (tile)", + "[Event] 09.02/10 below_lift: done", + "[Event] 09.02/11 lift_to_b4f: start", + "09.02/lift_to_b4f: ok at RocketHideout_B2F (28, 17) facing north (tile)", + "[Event] 09.02/11 lift_to_b4f: done", + "[Event] 09.02/12 below_left_guard: start", + "09.02/below_left_guard: ok at RocketHideout_B4F (16, 15) facing north (tile)", + "[Event] 09.02/12 below_left_guard: done", + "[Event] 09.02/13 talk_left_guard: start", + "09.02/talk_left_guard: ok at -", + "[Event] 09.02/13 talk_left_guard: done", + "[Event] 09.02/14 left_guard: start", + "09.02/left_guard: ok at -", + "[Event] 09.02/14 left_guard: done", + "[Event] 09.02/15 below_right_guard: start", + "09.02/below_right_guard: ok at RocketHideout_B4F (19, 15) facing north (tile)", + "[Event] 09.02/15 below_right_guard: done", + "[Event] 09.02/16 talk_right_guard: start", + "09.02/talk_right_guard: ok at -", + "[Event] 09.02/16 talk_right_guard: done", + "[Event] 09.02/17 right_guard: start", + "09.02/right_guard: ok at -", + "[Event] 09.02/17 right_guard: done", + "[Event] 09.02/18 beside_giovanni: start", + "09.02/beside_giovanni: ok at RocketHideout_B4F (19, 5) facing east (tile)", + "[Event] 09.02/18 beside_giovanni: done", + "[Event] 09.02/19 below_giovanni: start", + "09.02/below_giovanni: ok at RocketHideout_B4F (19, 5) facing north (tile)", + "[Event] 09.02/19 below_giovanni: done", + "[Event] 09.02/20 talk_giovanni: start", + "09.02/talk_giovanni: ok at -", + "[Event] 09.02/20 talk_giovanni: done", + "[Event] 09.02/21 giovanni: start", + "09.02/giovanni: ok at -", + "[Event] 09.02/21 giovanni: done", + "[Event] 09.02/22 east_of_silph_scope: start", + "09.02/east_of_silph_scope: ok at RocketHideout_B4F (21, 5) facing north (tile)", + "[Event] 09.02/22 east_of_silph_scope: done", + "[Event] 09.02/23 beside_silph_scope: start", + "09.02/beside_silph_scope: ok at RocketHideout_B4F (21, 5) facing west (tile)", + "[Event] 09.02/23 beside_silph_scope: done", + "[Event] 09.02/24 silph_scope: start", + "09.02/silph_scope: ok at -", + "[Event] 09.02/24 silph_scope: done", + "[Event] 09.02/25 escape_rope_hideout: start", + "09.02/escape_rope_hideout: ok at RocketHideout_B4F (21, 5) facing west (tile)", + "[Event] 09.02/25 escape_rope_hideout: done", "save at CeladonCity (34, 22) facing south (tile)", - "[Checkpoint] 00.32: done, 25 run, 0 skipped", - "[Checkpoint] 00.32: passed on attempt 1 (one-shot)", + "[Checkpoint] 09.02: done, 25 run, 0 skipped", + "[Checkpoint] 09.02: passed on attempt 1 (one-shot)", "[Segment] 00: 36 of 36 checkpoints one-shot", "[Segment] 00: done, 36 checkpoints", "completed", - "00.01: 2 stubbed: intro, options\n00.02: 0 stubbed\n00.03: 1 stubbed: to_the_lab\n00.04: 5 stubbed: squirtle_ball, choose_squirtle, no_nickname, rival_takes_bulbasaur, rival_battle\n00.05: 1 stubbed: parcel_from_clerk\n00.06: 2 stubbed: give_parcel, pokedex_scene\n00.07: 2 stubbed: heal_viridian, old_man_tutorial\n00.08: 1 stubbed: heal_pewter\n00.09: 3 stubbed: camper_liam, challenge_brock, brock\n00.10: 1 stubbed: shoes_from_aide\n00.11: 4 stubbed: heal_pewter, bug_catcher_colton, bug_catcher_greg, bug_catcher_james\n00.12: 1 stubbed: heal_route4\n00.12c: 1 stubbed: magikarp_to_box\n00.13: 6 stubbed: heal_route4, moon_stone_ball, found_moon_stone, rocket_grunt, super_nerd_miguel, helix_fossil\n00.14: 2 stubbed: teach_mega_kick, heal_cerulean\n00.14b: 3 stubbed: buy_potions, grind_to_lv23, heal_cerulean\n00.14c: 4 stubbed: challenge_misty, misty, heal_cerulean, teach_water_pulse\n00.15: 4 stubbed: teach_water_pulse, buy_potions, grind_for_rival, heal_cerulean\n00.15b: 2 stubbed: teach_water_pulse, rival_cerulean\n00.16: 7 stubbed: heal_cerulean, bug_catcher_cale, lass_ali, youngster_timmy, lass_reli, camper_ethan, rocket_grunt\n00.17: 4 stubbed: hiker_franklin, picnicker_kelsey, hiker_nob, lass_haley\n00.18: 7 stubbed: bill_clefairy, help_bill, bill_into_teleporter, cell_separator, bill_comes_out, thank_bill, ss_ticket\n00.19: 1 stubbed: heal_cerulean\n00.20: 3 stubbed: buy_poke_balls, catch_oddish, heal_cerulean\n00.21: 3 stubbed: rocket_grunt, camper_jeff, heal_vermilion\n00.22: 6 stubbed: show_ss_ticket, rival_ss_anne, captain, hm01_cut, ss_anne_sails, heal_vermilion\n00.23: 9 stubbed: teach_cut, teach_dig, cut_gym_tree, sailor_dwayne, engineer_baily, gentleman_tucker, trash_cans, cut_tree_out, heal_vermilion\n00.24: 4 stubbed: surge_winnable, grind_for_surge, heal_vermilion, cut_gym_tree\n00.25: 4 stubbed: challenge_lt_surge, lt_surge, cut_tree_out, heal_vermilion\n00.26: 8 stubbed: chairman, hear_story, bike_voucher, cut_cerulean_tree, talk_bike_clerk, bicycle, buy_repels, heal_cerulean\n00.27: 6 stubbed: cut_cerulean_tree, cut_route9_tree, picnicker_alicia, hiker_jeremy, bug_catcher_conner, heal_route10\n00.28: 9 stubbed: cut_route10_tree, pokemaniac_ashton, pokemaniac_winston, picnicker_martha, hiker_allen, hiker_lenny, picnicker_sofia, hiker_dudley, picnicker_dana\n00.29: 1 stubbed: heal_lavender\n00.30: 7 stubbed: register_bike, buy_ropes_and_super_repels, ride_bike, gamer_rich, catch_pidgey, celadon_nurse, heal_celadon\n00.31: 6 stubbed: talk_poster_guard, rocket_grunt, poster_switch, lift_key_grunt, lift_key, b3f_rare_candy\n00.32: 10 stubbed: moon_stone, lift_to_b4f, talk_left_guard, left_guard, talk_right_guard, right_guard, talk_giovanni, giovanni, silph_scope, escape_rope_hideout\n" + "01.01: 2 stubbed: intro, options\n01.03: 0 stubbed\n01.04: 1 stubbed: to_the_lab\n01.05: 5 stubbed: squirtle_ball, choose_squirtle, no_nickname, rival_takes_bulbasaur, rival_battle\n02.01: 1 stubbed: parcel_from_clerk\n02.02: 2 stubbed: give_parcel, pokedex_scene\n02.03: 2 stubbed: heal_viridian, old_man_tutorial\n03.01: 1 stubbed: heal_pewter\n03.02: 3 stubbed: camper_liam, challenge_brock, brock\n03.03: 1 stubbed: shoes_from_aide\n04.01: 4 stubbed: heal_pewter, bug_catcher_colton, bug_catcher_greg, bug_catcher_james\n04.02: 1 stubbed: heal_route4\n04.04: 1 stubbed: magikarp_to_box\n04.05: 6 stubbed: heal_route4, moon_stone_ball, found_moon_stone, rocket_grunt, super_nerd_miguel, helix_fossil\n04.06: 2 stubbed: teach_mega_kick, heal_cerulean\n05.01: 3 stubbed: buy_potions, grind_to_lv23, heal_cerulean\n05.02: 4 stubbed: challenge_misty, misty, heal_cerulean, teach_water_pulse\n05.03: 4 stubbed: teach_water_pulse, buy_potions, grind_for_rival, heal_cerulean\n05.04: 2 stubbed: teach_water_pulse, rival_cerulean\n05.05: 7 stubbed: heal_cerulean, bug_catcher_cale, lass_ali, youngster_timmy, lass_reli, camper_ethan, rocket_grunt\n05.06: 4 stubbed: hiker_franklin, picnicker_kelsey, hiker_nob, lass_haley\n05.07: 7 stubbed: bill_clefairy, help_bill, bill_into_teleporter, cell_separator, bill_comes_out, thank_bill, ss_ticket\n05.08: 1 stubbed: heal_cerulean\n05.09: 3 stubbed: buy_poke_balls, catch_oddish, heal_cerulean\n05.10: 3 stubbed: rocket_grunt, camper_jeff, heal_vermilion\n06.01: 6 stubbed: show_ss_ticket, rival_ss_anne, captain, hm01_cut, ss_anne_sails, heal_vermilion\n06.02: 9 stubbed: teach_cut, teach_dig, cut_gym_tree, sailor_dwayne, engineer_baily, gentleman_tucker, trash_cans, cut_tree_out, heal_vermilion\n06.03: 4 stubbed: surge_winnable, grind_for_surge, heal_vermilion, cut_gym_tree\n06.04: 4 stubbed: challenge_lt_surge, lt_surge, cut_tree_out, heal_vermilion\n07.01: 8 stubbed: chairman, hear_story, bike_voucher, cut_cerulean_tree, talk_bike_clerk, bicycle, buy_repels, heal_cerulean\n07.02: 6 stubbed: cut_cerulean_tree, cut_route9_tree, picnicker_alicia, hiker_jeremy, bug_catcher_conner, heal_route10\n08.01: 9 stubbed: cut_route10_tree, pokemaniac_ashton, pokemaniac_winston, picnicker_martha, hiker_allen, hiker_lenny, picnicker_sofia, hiker_dudley, picnicker_dana\n08.02: 1 stubbed: heal_lavender\n08.03: 7 stubbed: register_bike, buy_ropes_and_super_repels, ride_bike, gamer_rich, catch_pidgey, celadon_nurse, heal_celadon\n09.01: 6 stubbed: talk_poster_guard, rocket_grunt, poster_switch, lift_key_grunt, lift_key, b3f_rare_candy\n09.02: 10 stubbed: moon_stone, lift_to_b4f, talk_left_guard, left_guard, talk_right_guard, right_guard, talk_giovanni, giovanni, silph_scope, escape_rope_hideout\n" ] } diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/README.md b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/README.md index f949570f6c..50d1bfa13a 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/README.md +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/README.md @@ -1,8 +1,8 @@ # FRLG authored checkpoints -Every story checkpoint is an authored plan here, one file per checkpoint: `frlg-.plan.json`, and `frlg-parcel-00.05.plan.json` for 00.05. `story_checkpoints()` is `load_authored_story()`: every embedded `*.plan` file, in order of id. There are no C++ row definitions; the files were exported once from the C++ table, and `ReplayData/frlg-story-sim-trace.json` keeps the whole story's sim trace from before that (`PokemonFRLG::AutoStory - Authored` tests it). +Every story checkpoint is an authored plan here, one file per checkpoint: `frlg-.plan.json`, and `frlg-parcel-02.01.plan.json` for 02.01. `story_checkpoints()` is `load_authored_story()`: every embedded `*.plan` file, in order of id. There are no C++ row definitions; the files were exported once from the C++ table, and `ReplayData/frlg-story-sim-trace.json` keeps the whole story's sim trace from before that (`PokemonFRLG::AutoStory - Authored` tests it). -- A checkpoint has `sections: [{id, title, notes?, events}]`, or plain `events` (one unnamed section, as 00.05 keeps so its bytes stay those PokemonSimulation pins). Events are numbered across the sections, and an event's log line names its section: `[Event] 00.28/12 [b1f_east] winston_line: start`. +- A checkpoint has `sections: [{id, title, notes?, events}]`, or plain `events` (one unnamed section, as 02.01 keeps so its bytes stay those PokemonSimulation pins). Events are numbered across the sections, and an event's log line names its section: `[Event] 08.01/12 [b1f_east] winston_line: start`. - `notes` (a list of paragraphs) on the checkpoint, a section or an event hold what the C++ table's comments said: the maps, trainers, numbers and console runs a step was planned from. No executor reads them. - `variant` says how FRLG does a step: `run` or `bike` on a route or legs, `trainer_line`/`trainer_wait` on a step, and on a `game_action` the action's name (`mart`, `teach`, `grind`, `grind_check`, `capture`, `pc`, `fossil`, `level`, `use_item`, `lift_floor`, or `cut_tree`, `trash_cans`, `close_trainer_card`, `leave_gift_summary`, `center_enter`, `center_exit`, `ride_bike` and the Rocket Hideout's other steps from `PokemonFRLG_AutoStoryHideout.h`). An unknown variant is rejected at load. - `args` holds what the action reads, e.g. a Mart's `{"map": "CeruleanCity_Mart", "budget": 1500, "floor": 1500}`, with what it buys in `items`. Each action declares its args in the action table (`PokemonFRLG_AutoStoryStepTable.cpp`); a step with an unknown, mistyped or missing one is rejected at load. @@ -12,16 +12,16 @@ Every story checkpoint is an authored plan here, one file per checkpoint: `frlg- ## The Parcel pilot -`frlg-parcel-00.05.plan.json` is the production definition of checkpoint `00.05`. The story table loads it with `load_authored_checkpoint()`: there is no second C++ Parcel event list. Its `pokesim-authored-checkpoint/1` contract contains the common checkpoint plus FRLG executor configuration (`execution.menu`). It has no export revision, bookkeeping snapshot, or claimed observation. +`frlg-parcel-02.01.plan.json` is the production definition of checkpoint `02.01`. The story table loads it with `load_authored_checkpoint()`: there is no second C++ Parcel event list. Its `pokesim-authored-checkpoint/1` contract contains the common checkpoint plus FRLG executor configuration (`execution.menu`). It has no export revision, bookkeeping snapshot, or claimed observation. -The same file is checked into PokemonSimulation at `data/story/parcel-pilot/frlg-parcel-00.05.plan.json`; the paired CI check compares its exact bytes and runs the existing seven replay scenarios there. The schema is `schemas/authored-checkpoint.schema.json`, referencing `story-checkpoint.schema.json`. +The same file is checked into PokemonSimulation at `data/story/parcel-pilot/frlg-parcel-02.01.plan.json`; the paired CI check compares its exact bytes and runs the existing seven replay scenarios there. The schema is `schemas/authored-checkpoint.schema.json`, referencing `story-checkpoint.schema.json`. ## The two gates 1. Native tests load the actual table entry through JSON, run the existing engine/fake-game simulator, and compare its events/trace/save pose with the captured pre-migration checkpoint. Existing full-story progression tests also use the JSON-backed table entry. Unsupported fields/menu values and malformed common actions are rejected. 2. PokemonSimulation loads the same authored file with explicit map/action bindings and scripted evidence, then asserts the seven scenarios, including the full successful semantic action sequence and interruption/failure cases. It does not import the native supplies snapshot as requirements. -`frlg-parcel-00.05.json` is the old table-export fixture used for migration regression checks only. Its provenance and snapshot fields are not part of the authored plan. It can be removed once the native expectations are independent of the capture. +`frlg-parcel-02.01.json` is the old table-export fixture used for migration regression checks only. Its provenance and snapshot fields are not part of the authored plan. It can be removed once the native expectations are independent of the capture. ## Semantics diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.01.plan.json b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-01.01.plan.json similarity index 98% rename from SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.01.plan.json rename to SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-01.01.plan.json index f265a765ba..601b98851e 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.01.plan.json +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-01.01.plan.json @@ -2,7 +2,7 @@ "format": "pokesim-authored-checkpoint/1", "game": "frlg", "checkpoint": { - "id": "00.01", + "id": "01.01", "title": "new game to the bedroom", "sections": [ { diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.01b.plan.json b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-01.02.plan.json similarity index 98% rename from SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.01b.plan.json rename to SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-01.02.plan.json index bbf99b42a9..4fd50db87f 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.01b.plan.json +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-01.02.plan.json @@ -2,7 +2,7 @@ "format": "pokesim-authored-checkpoint/1", "game": "frlg", "checkpoint": { - "id": "00.01b", + "id": "01.02", "title": "after SID Helper: close the Trainer Card, save in the bedroom", "notes": [ "SID Helper confirms the name, finishes the intro and reads the Trainer Card from the START menu, without moving the player or saving." diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.02.plan.json b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-01.03.plan.json similarity index 97% rename from SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.02.plan.json rename to SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-01.03.plan.json index 24d0869164..de84f54de0 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.02.plan.json +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-01.03.plan.json @@ -2,7 +2,7 @@ "format": "pokesim-authored-checkpoint/1", "game": "frlg", "checkpoint": { - "id": "00.02", + "id": "01.03", "title": "bedroom to Pallet Town", "start": {"certainty": "tile", "map": "PalletTown_PlayersHouse_2F", "where": {"facing": "north", "kind": "tiles", "tiles": [[6, 6]]}}, "sections": [ diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.03.plan.json b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-01.04.plan.json similarity index 98% rename from SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.03.plan.json rename to SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-01.04.plan.json index a357eec763..8b5d40ddf3 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.03.plan.json +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-01.04.plan.json @@ -2,7 +2,7 @@ "format": "pokesim-authored-checkpoint/1", "game": "frlg", "checkpoint": { - "id": "00.03", + "id": "01.04", "title": "Oak stops the player and walks them to the lab", "start": {"certainty": "tile", "map": "PalletTown", "where": {"facing": "south", "kind": "tiles", "tiles": [[6, 8]]}}, "sections": [ diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.04.plan.json b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-01.05.plan.json similarity index 97% rename from SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.04.plan.json rename to SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-01.05.plan.json index 59ff4431fa..a37a8abc52 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.04.plan.json +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-01.05.plan.json @@ -2,7 +2,7 @@ "format": "pokesim-authored-checkpoint/1", "game": "frlg", "checkpoint": { - "id": "00.04", + "id": "01.05", "title": "to Squirtle's ball, south of the table", "notes": [ "Starter RNG starts from a save south of the table, facing the ball." diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.04b.plan.json b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-01.06.plan.json similarity index 99% rename from SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.04b.plan.json rename to SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-01.06.plan.json index 84f39b5060..b4ae3e3dc8 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.04b.plan.json +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-01.06.plan.json @@ -2,7 +2,7 @@ "format": "pokesim-authored-checkpoint/1", "game": "frlg", "checkpoint": { - "id": "00.04b", + "id": "01.06", "title": "Squirtle, then the rival's battle", "start": {"certainty": "tile", "map": "PalletTown_ProfessorOaksLab", "where": {"facing": "north", "kind": "tiles", "tiles": [[9, 5]]}}, "sections": [ diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.06.plan.json b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-02.02.plan.json similarity index 98% rename from SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.06.plan.json rename to SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-02.02.plan.json index 7eac3e37a5..a53368db2e 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.06.plan.json +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-02.02.plan.json @@ -2,7 +2,7 @@ "format": "pokesim-authored-checkpoint/1", "game": "frlg", "checkpoint": { - "id": "00.06", + "id": "02.02", "title": "Oak's Parcel to the Pokedex", "start": {"certainty": "tile", "map": "ViridianCity_Mart", "where": {"facing": "west", "kind": "tiles", "tiles": [[4, 3]]}}, "sections": [ diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.07.plan.json b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-02.03.plan.json similarity index 99% rename from SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.07.plan.json rename to SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-02.03.plan.json index dd1d5f4047..8484c7cddf 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.07.plan.json +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-02.03.plan.json @@ -2,7 +2,7 @@ "format": "pokesim-authored-checkpoint/1", "game": "frlg", "checkpoint": { - "id": "00.07", + "id": "02.03", "title": "Viridian shopping, then into Viridian Forest", "start": {"certainty": "tile", "map": "PalletTown_ProfessorOaksLab", "where": {"facing": "south", "kind": "tiles", "tiles": [[6, 4]]}}, "sections": [ diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.08.plan.json b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-03.01.plan.json similarity index 98% rename from SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.08.plan.json rename to SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-03.01.plan.json index 3f348baaf4..d3315c2d85 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.08.plan.json +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-03.01.plan.json @@ -2,10 +2,10 @@ "format": "pokesim-authored-checkpoint/1", "game": "frlg", "checkpoint": { - "id": "00.08", + "id": "03.01", "title": "Viridian Forest to Pewter Center", "notes": [ - "The supplies bought in 00.07." + "The supplies bought in 02.03." ], "start": {"certainty": "tile", "map": "ViridianForest", "where": {"facing": "north", "kind": "tiles", "tiles": [[29, 62]]}}, "sections": [ diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.09.plan.json b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-03.02.plan.json similarity index 99% rename from SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.09.plan.json rename to SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-03.02.plan.json index bbd97680fe..de9aeec411 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.09.plan.json +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-03.02.plan.json @@ -2,7 +2,7 @@ "format": "pokesim-authored-checkpoint/1", "game": "frlg", "checkpoint": { - "id": "00.09", + "id": "03.02", "title": "Pewter Gym: Camper Liam, then Brock", "notes": [ "The by-hand save: 2 Potions and 1 Antidote left after the forest." diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.10.plan.json b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-03.03.plan.json similarity index 96% rename from SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.10.plan.json rename to SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-03.03.plan.json index 05fd3c2de9..8aeb008018 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.10.plan.json +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-03.03.plan.json @@ -2,7 +2,7 @@ "format": "pokesim-authored-checkpoint/1", "game": "frlg", "checkpoint": { - "id": "00.10", + "id": "03.03", "title": "Pewter: the Running Shoes from Oak's aide", "start": {"certainty": "tile", "map": "PewterCity_Gym", "where": {"facing": "north", "kind": "tiles", "tiles": [[6, 6]]}}, "sections": [ @@ -40,7 +40,7 @@ "target": {"certainty": "tile", "map": "PewterCity", "where": {"facing": "south", "kind": "tiles", "tiles": [[17, 26]]}}, "why": "west along row 21 and down to below the Pokemon Center's door (17, 25)", "notes": [ - "Where the by-hand walk stopped to start 00.11 (console B, 2026-11-02)." + "Where the by-hand walk stopped to start 04.01 (console B, 2026-11-02)." ] } ] diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.11.plan.json b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-04.01.plan.json similarity index 99% rename from SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.11.plan.json rename to SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-04.01.plan.json index e1a2022efd..a7ec694296 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.11.plan.json +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-04.01.plan.json @@ -2,7 +2,7 @@ "format": "pokesim-authored-checkpoint/1", "game": "frlg", "checkpoint": { - "id": "00.11", + "id": "04.01", "title": "Pewter Center, then Route 3's trainers", "notes": [ "Route 3's trainers (Route3 map.json): the way east meets three of them. Bug Catcher Colton (12, 6) faces east, sight 3: the only way north past the row 7 ledges is the gap at x 14..15, below his line. Youngster Ben (17, 4) faces south, sight 2, so the way east keeps to row 3 past him. Bug Catcher Greg (25, 4) faces south, sight 2, over the way east along row 5. Bug Catcher James (32, 6) faces east, sight 4, over the way down at x 35..36. The others are kept out of: Lass Janice (19, 9) sees west along row 9 to x 14, Lass Sally (30, 3) west along row 3 to x 25, and Youngster Calvin (29, 10) west along row 10. Each line is stepped into on its own, so no leg is cut; the trainer walks up to the player, who stays put facing the way they stepped." diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.12.plan.json b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-04.02.plan.json similarity index 99% rename from SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.12.plan.json rename to SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-04.02.plan.json index 48e1acbaaf..ff301c2fc2 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.12.plan.json +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-04.02.plan.json @@ -2,7 +2,7 @@ "format": "pokesim-authored-checkpoint/1", "game": "frlg", "checkpoint": { - "id": "00.12", + "id": "04.02", "title": "Route 3 and 4 to the Magikarp salesman", "notes": [ "Route 3's north exit (x 68..75) joins Route 4 (offset 60) at x 8..15, up which column 12 leads to the Pokemon Center's door (12, 5). Lass Robin (40, 11) wanders up and down at x 40, looking north and south, sight 3. Rock above (y <= 8) and grass below (y >= 12) leave every way east across her column at y 9..11, so whether she sees the player depends on her facing. The walk watches for her after the leg along row 9, which crosses her sight on (40, 9) only; if she saw the player, her message goes to story_interrupts(), which fight her, and the route goes on from (40, 9) (run_route(); console B, 2026-11-02, she stopped the player there and spoke after the leg's short watch)." diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.12b.plan.json b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-04.03.plan.json similarity index 87% rename from SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.12b.plan.json rename to SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-04.03.plan.json index 005365f269..b02d1e3024 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.12b.plan.json +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-04.03.plan.json @@ -2,10 +2,10 @@ "format": "pokesim-authored-checkpoint/1", "game": "frlg", "checkpoint": { - "id": "00.12b", + "id": "04.03", "title": "after Gift RNG: save with the Magikarp", "notes": [ - "Gift RNG buys the Magikarp (500 of the money 00.12 brings) without moving the player and leaves its summary open, or HOME. This saves the shiny where 00.12 ended. A run started here with Gift RNG's handoff on loads the save beside the salesman and runs Gift RNG first." + "Gift RNG buys the Magikarp (500 of the money 04.02 brings) without moving the player and leaves its summary open, or HOME. This saves the shiny where 04.02 ended. A run started here with Gift RNG's handoff on loads the save beside the salesman and runs Gift RNG first." ], "start": {"certainty": "tile", "map": "Route4_PokemonCenter_1F", "where": {"facing": "west", "kind": "tiles", "tiles": [[2, 3]]}}, "sections": [ diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.12c.plan.json b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-04.04.plan.json similarity index 98% rename from SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.12c.plan.json rename to SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-04.04.plan.json index 3dc4e28dcb..4bd48bde58 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.12c.plan.json +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-04.04.plan.json @@ -2,7 +2,7 @@ "format": "pokesim-authored-checkpoint/1", "game": "frlg", "checkpoint": { - "id": "00.12c", + "id": "04.04", "title": "Route 4 Center: the Magikarp into BOX 1", "notes": [ "The Magikarp goes to BOX 1 at the Center's PC (11, 1), so Mt. Moon is fought with the starter alone (console B, 2026-11-02: done by hand and saved at (11, 2), facing the PC, where this row ends). The wandering boy (4..6, 3..5) is walked around. The Magikarp comes from Gift RNG: with Gift RNG off the party is the starter alone, and the deposit is skipped." diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.13.plan.json b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-04.05.plan.json similarity index 99% rename from SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.13.plan.json rename to SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-04.05.plan.json index e4421f1376..172f9b9992 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.13.plan.json +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-04.05.plan.json @@ -2,7 +2,7 @@ "format": "pokesim-authored-checkpoint/1", "game": "frlg", "checkpoint": { - "id": "00.13", + "id": "04.05", "title": "Mt. Moon: a Moon Stone, a Rocket, Miguel and the Helix Fossil", "notes": [ "Mt. Moon (pokefirered data/maps/MtMoon_1F, _B1F, _B2F). Every floor tile of the cave has wild encounters, which are run from, so its legs end on walls, ladders or someone standing still, which the walker holds again after a battle; the few open ones are short. The way through: up 1F's middle and west side, its north-west ladder, B1F's west ladder down to B2F's south-east, round B2F's south edge to its west, north past Miguel and the fossils, and the ladder up to B1F's east end, which leads out to Route 4 east of the mountain.", diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.14.plan.json b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-04.06.plan.json similarity index 99% rename from SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.14.plan.json rename to SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-04.06.plan.json index efa26977d1..3df29b3867 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.14.plan.json +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-04.06.plan.json @@ -2,7 +2,7 @@ "format": "pokesim-authored-checkpoint/1", "game": "frlg", "checkpoint": { - "id": "00.14", + "id": "04.06", "title": "Route 4: Mega Kick from its tutor, then east to Cerulean's Pokemon Center", "notes": [ "Route 4 east of Mt. Moon (Route4 map.json) joins Cerulean City at its east end (x 107; Route 4's row 3 is the city's row 13). Its upper road (rows 2..8) reaches the city only by water: the way on by land is down the ledge row 9 at x 90..96 to the lower road (rows 10..12), which joins the city's rows 20..22. Lass Crissy (75, 3) faces east, sight 4, over row 3 from x 76 to 79; the way east keeps out of her line and off the grass south of the road (75..87, 11..17).", diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.14b.plan.json b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-05.01.plan.json similarity index 93% rename from SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.14b.plan.json rename to SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-05.01.plan.json index 886a21b4be..304a293454 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.14b.plan.json +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-05.01.plan.json @@ -2,12 +2,12 @@ "format": "pokesim-authored-checkpoint/1", "game": "frlg", "checkpoint": { - "id": "00.14b", + "id": "05.01", "title": "Cerulean: Potions, a GRIND to Lv23, then into the Gym, saved below Misty's platform", "notes": [ - "Cerulean Gym (pokefirered CeruleanCity_Gym map.json and scripts.inc): a pool with walkways. Misty (8, 6) stands on a platform (7..9, 6) above row 7. Picnicker Diana (4, 7) faces east, sight 4, over (5..8, 7), so misty_front (8, 7) is in her line; Swimmer Luis (10, 12) in the water faces west, sight 1, over (9, 12), on column 9 north of the door. No gym trainer has to be fought for Misty, so neither is: from the door up column 9 to row 13 (a route there, so the planner's walk to a wall doesn't run on past it through (9, 12)), west to (4, 13), and to walls round the pool's west and north sides, (4, 10), (12, 10), (12, 7), then west to (9, 7), the tile below the platform's east end, out of Diana's line. 00.14c steps up onto (9, 6) and talks to Misty from beside her.", - "Misty beat a Lv20 Wartortle (console B, run m51), so first a GRIND to Lv23 on 00.15's patch. Gen 3 numbers (pokefirered: her mons have IV 0; Wartortle taken at IV 15, no EVs): Starmie Lv21 has 56 HP, Atk 36, SpA 47, SpD 40. Bite is Dark, special in Gen 3, no STAB, x2 on Psychic: at Lv23 (SpA 39) it does 23..28, three hits (two on top rolls); at Lv20, 20..24. Her Swift (physical, 60) does 9..11 to a Lv23 Wartortle (about 67 HP, Def 45) and Water Pulse (STAB, resisted) 8..10: 6 or more hits, though m51 saw about 20 a turn. Her Recover (28) and Super Potion undo a Bite, so the margin is in Bite's damage.", - "The Mart comes before the GRIND: its wild battles are fought only with 2 or more Potions, and 00.14's save has none (m51 met Misty with only the 5 this row bought). 5 Potions (row 3, 300 each), then up to 3 Super Potions (row 2, 700), last so they take the Items pocket's last row; the battle doesn't use them yet. The money box can't be read, so the floor stands for it, and a floor above the money fails the step (the quantity box wraps). Prizes (pokefirered: 4 x last level x the class's factor) from a new game's 3000, less Viridian's 2000 and the Magikarp's 500: Liam 220, Brock 1400, Route 3's bug catchers 360, the Mt. Moon grunt 416 and Miguel 288 (the first rival's 80 only if won), at least 3184 here. Floor and budget 3000: 5 Potions and 2 Super Potions, 2900. Misty's 2100 (4 x 21 x 25) then leaves 00.15 its floor of 1500. Then the nurse, and the save before Misty, so her battle is its own checkpoint, 00.14c, verified and retried from it. 00.15's GRIND then fights until the sim beats the Cerulean rival often enough." + "Cerulean Gym (pokefirered CeruleanCity_Gym map.json and scripts.inc): a pool with walkways. Misty (8, 6) stands on a platform (7..9, 6) above row 7. Picnicker Diana (4, 7) faces east, sight 4, over (5..8, 7), so misty_front (8, 7) is in her line; Swimmer Luis (10, 12) in the water faces west, sight 1, over (9, 12), on column 9 north of the door. No gym trainer has to be fought for Misty, so neither is: from the door up column 9 to row 13 (a route there, so the planner's walk to a wall doesn't run on past it through (9, 12)), west to (4, 13), and to walls round the pool's west and north sides, (4, 10), (12, 10), (12, 7), then west to (9, 7), the tile below the platform's east end, out of Diana's line. 05.02 steps up onto (9, 6) and talks to Misty from beside her.", + "Misty beat a Lv20 Wartortle (console B, run m51), so first a GRIND to Lv23 on 05.03's patch. Gen 3 numbers (pokefirered: her mons have IV 0; Wartortle taken at IV 15, no EVs): Starmie Lv21 has 56 HP, Atk 36, SpA 47, SpD 40. Bite is Dark, special in Gen 3, no STAB, x2 on Psychic: at Lv23 (SpA 39) it does 23..28, three hits (two on top rolls); at Lv20, 20..24. Her Swift (physical, 60) does 9..11 to a Lv23 Wartortle (about 67 HP, Def 45) and Water Pulse (STAB, resisted) 8..10: 6 or more hits, though m51 saw about 20 a turn. Her Recover (28) and Super Potion undo a Bite, so the margin is in Bite's damage.", + "The Mart comes before the GRIND: its wild battles are fought only with 2 or more Potions, and 04.06's save has none (m51 met Misty with only the 5 this row bought). 5 Potions (row 3, 300 each), then up to 3 Super Potions (row 2, 700), last so they take the Items pocket's last row; the battle doesn't use them yet. The money box can't be read, so the floor stands for it, and a floor above the money fails the step (the quantity box wraps). Prizes (pokefirered: 4 x last level x the class's factor) from a new game's 3000, less Viridian's 2000 and the Magikarp's 500: Liam 220, Brock 1400, Route 3's bug catchers 360, the Mt. Moon grunt 416 and Miguel 288 (the first rival's 80 only if won), at least 3184 here. Floor and budget 3000: 5 Potions and 2 Super Potions, 2900. Misty's 2100 (4 x 21 x 25) then leaves 05.03 its floor of 1500. Then the nurse, and the save before Misty, so her battle is its own checkpoint, 05.02, verified and retried from it. 05.03's GRIND then fights until the sim beats the Cerulean rival often enough." ], "start": {"certainty": "tile", "map": "CeruleanCity_PokemonCenter_1F", "where": {"facing": "north", "kind": "tiles", "tiles": [[7, 4]]}}, "sections": [ diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.14c.plan.json b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-05.02.plan.json similarity index 98% rename from SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.14c.plan.json rename to SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-05.02.plan.json index 3e0b63c4bc..da3eabd3e4 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.14c.plan.json +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-05.02.plan.json @@ -2,10 +2,10 @@ "format": "pokesim-authored-checkpoint/1", "game": "frlg", "checkpoint": { - "id": "00.14c", + "id": "05.02", "title": "Cerulean Gym: Misty, then Water Pulse", "notes": [ - "Misty (TRAINER_LEADER_MISTY: Staryu Lv18, Starmie Lv21), talked to from (9, 6), beside her on the platform. Her win text runs on to the CASCADE BADGE, TM03 (Water Pulse) and its explanation, all read with the battle's. Bite is chosen against her party (Starmie is Water/Psychic). Back to the nurse round the pool's west side, out of Luis's line; then Water Pulse in place of Tail Whip, last, at the Center, from the bag's TM CASE. Ends where 00.15 starts." + "Misty (TRAINER_LEADER_MISTY: Staryu Lv18, Starmie Lv21), talked to from (9, 6), beside her on the platform. Her win text runs on to the CASCADE BADGE, TM03 (Water Pulse) and its explanation, all read with the battle's. Bite is chosen against her party (Starmie is Water/Psychic). Back to the nurse round the pool's west side, out of Luis's line; then Water Pulse in place of Tail Whip, last, at the Center, from the bag's TM CASE. Ends where 05.03 starts." ], "start": {"certainty": "tile", "map": "CeruleanCity_Gym", "where": {"facing": "west", "kind": "tiles", "tiles": [[9, 7]]}}, "sections": [ diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.15.plan.json b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-05.03.plan.json similarity index 91% rename from SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.15.plan.json rename to SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-05.03.plan.json index d6f298d308..2d4bb3a8c8 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.15.plan.json +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-05.03.plan.json @@ -2,10 +2,10 @@ "format": "pokesim-authored-checkpoint/1", "game": "frlg", "checkpoint": { - "id": "00.15", + "id": "05.03", "title": "Cerulean: Water Pulse, Potions, a GRIND until the rival is winnable, then saved below his trigger", "notes": [ - "Before the rival north of Cerulean (cerulean_rival()), from the Center: first TM03 Water Pulse over Tail Whip, if the lead doesn't know it yet, so the GRIND's sim plays it (a run without TM03 from Misty skips the step). Then 3 Potions at the Mart (CeruleanCity_Mart_Items: POTION is row 3, 300 each; Mt. Moon's trainers leave well over the floor) and 2 Awakenings (row 6, 250 each; pokefirered items.json) for the rival's Bulbasaur's Sleep Powder (console B, m56: asleep at 34/65 HP, it fainted two turns later with 15 Potions), 1400 of the floor's 1500. Then a GRIND on Route 4's grass east of Mt. Moon (75..86, 11..17; Spearow, Rattata, Ekans and Mankey around Lv10, about 80 EXP each), healing at the Center, until the battle sim beats the rival 00.15b fights 50% or more: the win chance his battle refuses below. Console B's Wartortle (Lv22, 65 HP, Water Pulse) is about 42% there and 62% at Lv23; Lv28 (about 88%, some 120 battles from Lv22) is the cap. Then the nurse, and the save on (23, 7), the tile below his trigger: his battle is its own checkpoint, 00.15b, verified and retried from this save." + "Before the rival north of Cerulean (cerulean_rival()), from the Center: first TM03 Water Pulse over Tail Whip, if the lead doesn't know it yet, so the GRIND's sim plays it (a run without TM03 from Misty skips the step). Then 3 Potions at the Mart (CeruleanCity_Mart_Items: POTION is row 3, 300 each; Mt. Moon's trainers leave well over the floor) and 2 Awakenings (row 6, 250 each; pokefirered items.json) for the rival's Bulbasaur's Sleep Powder (console B, m56: asleep at 34/65 HP, it fainted two turns later with 15 Potions), 1400 of the floor's 1500. Then a GRIND on Route 4's grass east of Mt. Moon (75..86, 11..17; Spearow, Rattata, Ekans and Mankey around Lv10, about 80 EXP each), healing at the Center, until the battle sim beats the rival 05.04 fights 50% or more: the win chance his battle refuses below. Console B's Wartortle (Lv22, 65 HP, Water Pulse) is about 42% there and 62% at Lv23; Lv28 (about 88%, some 120 battles from Lv22) is the cap. Then the nurse, and the save on (23, 7), the tile below his trigger: his battle is its own checkpoint, 05.04, verified and retried from this save." ], "start": {"certainty": "tile", "map": "CeruleanCity_PokemonCenter_1F", "where": {"facing": "north", "kind": "tiles", "tiles": [[7, 4]]}}, "sections": [ diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.15b.plan.json b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-05.04.plan.json similarity index 96% rename from SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.15b.plan.json rename to SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-05.04.plan.json index 0fdff3f869..5f2dc109f9 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.15b.plan.json +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-05.04.plan.json @@ -2,10 +2,10 @@ "format": "pokesim-authored-checkpoint/1", "game": "frlg", "checkpoint": { - "id": "00.15b", + "id": "05.04", "title": "Cerulean: Water Pulse if not known, then the rival north of the city", "notes": [ - "The rival north of Cerulean (CeruleanCity scripts.inc): the only way north to Nugget Bridge is columns 22..24, and a step onto row 6 there (CeruleanCity_EventScript_RivalTrigger*, VAR_MAP_SCENE_CERULEAN_CITY_RIVAL 0) brings him down to the player. From the middle, (23, 6), he stops at (23, 5); after the battle he walks round the player and off south, and the player, turning to watch him, ends facing south. His FAME CHECKER's text is read to the overworld with the battle's. For a player who took Squirtle he has Pidgeotto Lv17, Abra Lv16, Rattata Lv15 and Bulbasaur Lv18 (sParty_RivalCeruleanBulbasaur), whose Vine Whip and Sleep Powder are the danger. The row starts from 00.15's save below the trigger, and saves after him. First TM03 Water Pulse over Tail Whip (from the bag, where the player stands), if the lead doesn't know it yet: console B's save (2026-11-03) is past Misty's TEACH, which failed there. Where she taught it, the step reads the moves and does nothing." + "The rival north of Cerulean (CeruleanCity scripts.inc): the only way north to Nugget Bridge is columns 22..24, and a step onto row 6 there (CeruleanCity_EventScript_RivalTrigger*, VAR_MAP_SCENE_CERULEAN_CITY_RIVAL 0) brings him down to the player. From the middle, (23, 6), he stops at (23, 5); after the battle he walks round the player and off south, and the player, turning to watch him, ends facing south. His FAME CHECKER's text is read to the overworld with the battle's. For a player who took Squirtle he has Pidgeotto Lv17, Abra Lv16, Rattata Lv15 and Bulbasaur Lv18 (sParty_RivalCeruleanBulbasaur), whose Vine Whip and Sleep Powder are the danger. The row starts from 05.03's save below the trigger, and saves after him. First TM03 Water Pulse over Tail Whip (from the bag, where the player stands), if the lead doesn't know it yet: console B's save (2026-11-03) is past Misty's TEACH, which failed there. Where she taught it, the step reads the moves and does nothing." ], "start": {"certainty": "tile", "map": "CeruleanCity", "where": {"facing": "north", "kind": "tiles", "tiles": [[23, 7]]}}, "sections": [ diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.16.plan.json b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-05.05.plan.json similarity index 99% rename from SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.16.plan.json rename to SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-05.05.plan.json index aa4749e3d6..428c6eff6e 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.16.plan.json +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-05.05.plan.json @@ -2,7 +2,7 @@ "format": "pokesim-authored-checkpoint/1", "game": "frlg", "checkpoint": { - "id": "00.16", + "id": "05.05", "title": "Nugget Bridge: the nurse, five trainers and the Rocket", "notes": [ "Nugget Bridge (Route24 map.json) is x 10..12 from row 32 north to row 16, the city's columns 22..24 (offset 12). Its five trainers stand on it facing across, sight 2, so each line crosses the middle column 11 on the trainer's row: Bug Catcher Cale (12, 31), Lass Ali (10, 28), Youngster Timmy (12, 25), Lass Reli (10, 22) and Camper Ethan (12, 19). Each is fought on the step onto their row, beside them: they don't walk, and the player keeps facing north. Two tiles separate the rows, walked as one short leg; the step onto a row goes on a tile at a time until the trainer sees the player (into_line()), as the open leg onto the bridge ended a tile short twice on console B (2026-11-03), on (11, 33), and one step left the player out of Cale's sight. Then the Rocket (12, 15): the step onto (11, 15) (Route24_EventScript_RocketTriggerRight, VAR_MAP_SCENE_ROUTE24 0) gives the NUGGET, \"join Team Rocket\", and his battle; he only turns, and the player turns east to him. Camper Shane (5, 21) looks north from the west bank, off the way." diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.17.plan.json b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-05.06.plan.json similarity index 99% rename from SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.17.plan.json rename to SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-05.06.plan.json index d3e074547a..7480ec38cd 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.17.plan.json +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-05.06.plan.json @@ -2,7 +2,7 @@ "format": "pokesim-authored-checkpoint/1", "game": "frlg", "checkpoint": { - "id": "00.17", + "id": "05.06", "title": "Route 24 and 25 to Bill's Sea Cottage: Franklin, Kelsey, Nob and Haley", "notes": [ "Route 24 north of Nugget Bridge (Route24 map.json) joins Route 25 by its rows 7..9; the ledges on Route 25's row 6 (x 0..9) leave the way north at x 12..13. Route 25 (Route25 map.json, scripts.inc) to Bill's Sea Cottage door (51, 4): of its nine trainers, four can't be walked around.", diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.18.plan.json b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-05.07.plan.json similarity index 99% rename from SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.18.plan.json rename to SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-05.07.plan.json index 6f0cc4d022..add986ba9b 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.18.plan.json +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-05.07.plan.json @@ -2,7 +2,7 @@ "format": "pokesim-authored-checkpoint/1", "game": "frlg", "checkpoint": { - "id": "00.18", + "id": "05.07", "title": "Bill's Sea Cottage: the Cell Separator and the S.S. Ticket", "notes": [ "Bill's Sea Cottage (Route25_SeaCottage scripts.inc). Bill is the Clefairy at (10, 6) (FLAG_HELPED_BILL_IN_SEA_COTTAGE unset): talked to from (10, 7), below him, he asks \"Help me out!\" (YES/NO; NO goes on the same), says to run the Cell Separation on the PC, and walks up into the right teleporter (10, 3); with the player facing north he walks straight up. The PC (4, 5) answers only from the south, (4, 6). Its scene: the teleporters run, Bill comes out of the left one (3, 3) and walks to (7, 6) (BillWalkToMiddleOfRoom); the player isn't moved. Talked to from (6, 6), Bill gives the S.S. TICKET, no YES/NO, and goes on about the S.S. ANNE (FLAG_GOT_SS_TICKET, which also hides Nugget Bridge's Rocket). Out by the mat (7, 9); the door puts the player on (51, 5), facing south. The maps keep Bill at (7, 5), but after his scene he stands on (7, 6), in the way from (6, 6) to the mat (console B, 2026-11-03), so the walk out goes around him to (7, 8) first." diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.19.plan.json b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-05.08.plan.json similarity index 99% rename from SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.19.plan.json rename to SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-05.08.plan.json index 0e74ab339c..188a5fa1f6 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.19.plan.json +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-05.08.plan.json @@ -2,7 +2,7 @@ "format": "pokesim-authored-checkpoint/1", "game": "frlg", "checkpoint": { - "id": "00.19", + "id": "05.08", "title": "Route 25's south path back to Cerulean's Pokemon Center", "notes": [ "Back to Cerulean by Route 25's south path (Route25 map.json): from below the cottage down column 51 to row 12, west along row 12 and row 11 into Route 24 (x 14..23, row 11), and down its column 14..16 east of Nugget Bridge to Cerulean's north edge (x 26..28, offset 12). No trainer stands on it. Cerulean's row 1 there is a ledge (26..28, 1), hopped south from (27, 0); then on into the city to the Pokemon Center." diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.20.plan.json b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-05.09.plan.json similarity index 96% rename from SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.20.plan.json rename to SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-05.09.plan.json index 5cd12caf93..7659941f31 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.20.plan.json +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-05.09.plan.json @@ -2,12 +2,12 @@ "format": "pokesim-authored-checkpoint/1", "game": "frlg", "checkpoint": { - "id": "00.20", + "id": "05.09", "title": "Route 24's grass: an Oddish for Cut, then the Center", "notes": [ "Stopgap for console B's save, which caught nothing on Route 1. A new playthrough should instead catch a Rattata on Route 1 or 22 early, as its Cut user and spare member, and drop this row (and its walk over Nugget Bridge and back).", - "An Oddish for HM01 Cut, and a second member behind the lead (docs/design/AutoStory-FRLG-FutureEvents.md, \"Console B run choices\"). Route 24's grass (Route24 map.json: x 3..5, rows 19..31, west of Nugget Bridge) is the nearest to the Center with Oddish: FireRed's sRoute24_FireRed (pokefirered wild_encounters.json) has it in 25% of battles, Lv12..14, as Route 25's grass; Routes 5 and 6 aren't on the story's maps yet. Up the bridge, whose trainers 00.16 beat, west along rows 10..15 to the cliff (3, 15) and down column 3 to the grass's first row, (3, 19); the step paces east to (4, 19) and back. Camper Shane (5, 21) faces north, sight 5, over (5, 16..20): column 5 is kept off. The leg west ends on the cliff, not open: on console B (m63) an open leg west to (4, 15) ended a tile short, and the walk down column 5 came into Shane's sight.", - "First 7 Poke Balls at the Mart (row 1, 200 each; the bag isn't read, so the step buys them whatever the bag holds). The floor, from 00.15's 1500 less its 1400: the rival's 288 (4 x 18 x 4), the Rocket's 480 (4 x 15 x 8), Franklin's 540 and Nob's 468 (hikers, 9) alone make 1876 (pokefirered gTrainerMoneyTable). An Oddish at full HP (catch rate 255) stays in a Poke Ball about 1 time in 3 (Gen 3: a = 85, four shakes of 0.76), so 7 balls catch it about 94% of the time; the step throws 7 at most, in 30 battles (none an Oddish: 0.02%). Nothing weakens it: the HP bar isn't read on the console yet.", + "An Oddish for HM01 Cut, and a second member behind the lead (docs/design/AutoStory-FRLG-FutureEvents.md, \"Console B run choices\"). Route 24's grass (Route24 map.json: x 3..5, rows 19..31, west of Nugget Bridge) is the nearest to the Center with Oddish: FireRed's sRoute24_FireRed (pokefirered wild_encounters.json) has it in 25% of battles, Lv12..14, as Route 25's grass; Routes 5 and 6 aren't on the story's maps yet. Up the bridge, whose trainers 05.05 beat, west along rows 10..15 to the cliff (3, 15) and down column 3 to the grass's first row, (3, 19); the step paces east to (4, 19) and back. Camper Shane (5, 21) faces north, sight 5, over (5, 16..20): column 5 is kept off. The leg west ends on the cliff, not open: on console B (m63) an open leg west to (4, 15) ended a tile short, and the walk down column 5 came into Shane's sight.", + "First 7 Poke Balls at the Mart (row 1, 200 each; the bag isn't read, so the step buys them whatever the bag holds). The floor, from 05.03's 1500 less its 1400: the rival's 288 (4 x 18 x 4), the Rocket's 480 (4 x 15 x 8), Franklin's 540 and Nob's 468 (hikers, 9) alone make 1876 (pokefirered gTrainerMoneyTable). An Oddish at full HP (catch rate 255) stays in a Poke Ball about 1 time in 3 (Gen 3: a = 85, four shakes of 0.76), so 7 balls catch it about 94% of the time; the step throws 7 at most, in 30 battles (none an Oddish: 0.02%). Nothing weakens it: the HP bar isn't read on the console yet.", "The Oddish joins the party second. Battles keep the lead in (PokemonFRLG_AutoStoryBattleDecisions.h): the Oddish is sent only when the lead faints in a trainer's battle, which counts as lost. Back to the nurse, and the save in the Center." ], "start": {"certainty": "tile", "map": "CeruleanCity_PokemonCenter_1F", "where": {"facing": "north", "kind": "tiles", "tiles": [[7, 4]]}}, diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.21.plan.json b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-05.10.plan.json similarity index 99% rename from SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.21.plan.json rename to SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-05.10.plan.json index 464619c714..ccb4749775 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.21.plan.json +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-05.10.plan.json @@ -2,7 +2,7 @@ "format": "pokesim-authored-checkpoint/1", "game": "frlg", "checkpoint": { - "id": "00.21", + "id": "05.10", "title": "The Cerulean Rocket, Route 5, the Underground Path and Route 6 to Vermilion's Pokemon Center: Jeff", "notes": [ "Cerulean's only way south without Cut (CeruleanCity map.json, scripts.inc) is through the burgled house (30, 11), whose door the policeman leaves once the S.S. TICKET is had, out of the hole in its back wall into the yard (31, 8). The Rocket there (33, 6) stops the player on (33, 5) or (33, 7) (CeruleanCity_EventScript_GruntTrigger*): from (32, 7), the step east onto (33, 7) turns the player to him; Machop and Drowzee, Lv17, then TM28 Dig, and he is gone. Then east round the yard, down to the city's south edge by the path along its east side (39..40, 20..31), down Route 5's east side to the Underground Path's north house (31, 31), through its tunnel and out of the south house onto Route 6, below its door (19, 14). Route 6:", diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.22.plan.json b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-06.01.plan.json similarity index 98% rename from SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.22.plan.json rename to SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-06.01.plan.json index b932951dda..7b58867ed5 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.22.plan.json +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-06.01.plan.json @@ -2,10 +2,10 @@ "format": "pokesim-authored-checkpoint/1", "game": "frlg", "checkpoint": { - "id": "00.22", + "id": "06.01", "title": "The S.S. Anne: the rival, HM01 Cut from the Captain, back to Vermilion's Pokemon Center", "notes": [ - "The S.S. Anne (VermilionCity, SSAnne_* scripts.inc). The step onto (23, 33) (VermilionCity_EventScript_CheckTicket) has the sailor (24, 33) ask for a ticket; the S.S. TICKET (00.18) is shown and the player turns east to him. Then onto the pier (23, 34), along the gangway, through 1F, by legs off its cabins' doormats on row 10, which planned routes cross, and up its stairs (3, 8) to 2F. The step onto (30, 6), below the Captain's door (30, 2) (SSAnne_2F_Corridor_EventScript_RivalTriggerLeft), brings the rival out and down to (30, 5); the player keeps facing north, and after the battle he walks round the player and off. For a player who took Squirtle: Pidgeotto Lv19, Raticate Lv16, Kadabra Lv18, Ivysaur Lv20. The ship's trainers are in its cabins and on its deck, off the way. The Captain (5, 4) faces up; talked to from (5, 5) he is rubbed on the back and gives HM01 (VAR_MAP_SCENE_VERMILION_CITY 1). Back out through 1F's door (19, 1): on the gangway the ship sails (SSAnne_Exterior_ExitSSAnne), the player is put on (23, 34) and walked up to (23, 32) (VermilionCity_EventScript_ExitSSAnne). Cut is taught later, to the Oddish." + "The S.S. Anne (VermilionCity, SSAnne_* scripts.inc). The step onto (23, 33) (VermilionCity_EventScript_CheckTicket) has the sailor (24, 33) ask for a ticket; the S.S. TICKET (05.07) is shown and the player turns east to him. Then onto the pier (23, 34), along the gangway, through 1F, by legs off its cabins' doormats on row 10, which planned routes cross, and up its stairs (3, 8) to 2F. The step onto (30, 6), below the Captain's door (30, 2) (SSAnne_2F_Corridor_EventScript_RivalTriggerLeft), brings the rival out and down to (30, 5); the player keeps facing north, and after the battle he walks round the player and off. For a player who took Squirtle: Pidgeotto Lv19, Raticate Lv16, Kadabra Lv18, Ivysaur Lv20. The ship's trainers are in its cabins and on its deck, off the way. The Captain (5, 4) faces up; talked to from (5, 5) he is rubbed on the back and gives HM01 (VAR_MAP_SCENE_VERMILION_CITY 1). Back out through 1F's door (19, 1): on the gangway the ship sails (SSAnne_Exterior_ExitSSAnne), the player is put on (23, 34) and walked up to (23, 32) (VermilionCity_EventScript_ExitSSAnne). Cut is taught later, to the Oddish." ], "start": {"certainty": "tile", "map": "VermilionCity_PokemonCenter_1F", "where": {"facing": "north", "kind": "tiles", "tiles": [[7, 4]]}}, "sections": [ diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.23.plan.json b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-06.02.plan.json similarity index 96% rename from SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.23.plan.json rename to SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-06.02.plan.json index 1406e832dd..415704a898 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.23.plan.json +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-06.02.plan.json @@ -2,14 +2,14 @@ "format": "pokesim-authored-checkpoint/1", "game": "frlg", "checkpoint": { - "id": "00.23", + "id": "06.02", "title": "Vermilion Gym: Cut and Dig, the tree, Dwayne, Baily and Tucker, the trash cans", "notes": [ - "Rows 00.23 to 00.25: HM01 Cut to the Oddish, the tree before Vermilion Gym, its three trainers and its trash cans, then Lt. Surge from a save in front of him.", + "Rows 06.02 to 06.04: HM01 Cut to the Oddish, the tree before Vermilion Gym, its three trainers and its trash cans, then Lt. Surge from a save in front of him.", "The gym (VermilionCity_Gym map.json, scripts.inc), 11 x 20, entered on (5, 19): the cans on rows 10, 12 and 14 at x 1, 3, 5, 7, 9 (PokemonFRLG_AutoStoryTrashCans.h), the beams across rows 6 and 7 that the two switches turn off, Lt. Surge (5, 2) facing down above them. Its trainers, sight 3:", "- Sailor Dwayne (8, 13) and Engineer Baily (2, 11) look around (MOVEMENT_TYPE_LOOK_AROUND): between them they see across rows 11 and 13 and down columns 2 and 8, so no way from the door to the cans keeps out of their sight. Each is fought from the second tile of his line, stepped onto from beside it, out of sight, and waited on there until he turns to the player (TRAINER_WAIT_VARIANT): Dwayne from (8, 15), stepped onto from (7, 15), Baily from (2, 13), from (3, 13). Each walks up a tile, Dwayne to (8, 14), Baily to (2, 12), and stays there while the player is in the gym.", "- Gentleman Tucker (7, 8) faces west over (4..6, 8): fought on the step up from (5, 9) onto (5, 8); he walks up to (6, 8). The cans' stands, on rows 9, 11 and 13 above each, are clear of where the three stand after their battles. Leaving the gym puts them back where the map has them, beaten, and grows the tree back.", - "HM01 Cut, from the S.S. Anne (00.22), to the Oddish (00.20), second in the party: a wild Oddish of Lv12 to 14 knows 2 or 3 moves (Absorb, Sweet Scent, Poison Powder at 14), so it has room. TM28 Dig, from the Cerulean Rocket (00.21), to the lead in place of Withdraw: Ground, twice as strong on Lt. Surge's three, it takes the sim's chance against him for a Lv28 Wartortle with 14 Potions from 6% to 47%. Vermilion's tree (19, 24) (EventScript_CutTree) is the only way into the gym's yard, row 24 being walls but for it; the gym's door is (14, 25). In the gym, the trainers as above, then the trash cans until the door opens; out, the tree cut again from below, and back to the nurse." + "HM01 Cut, from the S.S. Anne (06.01), to the Oddish (05.09), second in the party: a wild Oddish of Lv12 to 14 knows 2 or 3 moves (Absorb, Sweet Scent, Poison Powder at 14), so it has room. TM28 Dig, from the Cerulean Rocket (05.10), to the lead in place of Withdraw: Ground, twice as strong on Lt. Surge's three, it takes the sim's chance against him for a Lv28 Wartortle with 14 Potions from 6% to 47%. Vermilion's tree (19, 24) (EventScript_CutTree) is the only way into the gym's yard, row 24 being walls but for it; the gym's door is (14, 25). In the gym, the trainers as above, then the trash cans until the door opens; out, the tree cut again from below, and back to the nurse." ], "start": {"certainty": "tile", "map": "VermilionCity_PokemonCenter_1F", "where": {"facing": "north", "kind": "tiles", "tiles": [[7, 4]]}}, "sections": [ diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.24.plan.json b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-06.03.plan.json similarity index 99% rename from SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.24.plan.json rename to SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-06.03.plan.json index 9a72ee5c5e..33cd6b7d3a 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.24.plan.json +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-06.03.plan.json @@ -2,7 +2,7 @@ "format": "pokesim-authored-checkpoint/1", "game": "frlg", "checkpoint": { - "id": "00.24", + "id": "06.03", "title": "Route 6's grass until Lt. Surge is winnable, then through the open beams to him", "notes": [ "Wild battles on Route 6 until the sim beats Lt. Surge half the time: with Dig, 47% at Lv28 and 51% at Lv29, so a lead the gym's trainers have brought to Lv29 passes at once, and a Lv28 one after a level. The grass nearest the city is Route 6's south patch (13..16, 30..33); Picnicker Isabelle (13, 32) faces west over (10..12, 32), on the way north from the city, so the walk goes along Jeff's row 33 (he is beaten) to the wall (7, 33), up to row 31 and east along it onto the patch's west edge, (13, 31), above Isabelle, out of her line. Back to the nurse the same way. All that is skipped when the lead, read in the Center, passes already. Then the tree, the gym, whose trainers stand where the map has them, beaten, and whose beams stay off (FLAG_FOUND_BOTH_VERMILION_GYM_SWITCHES): up column 5 to below Lt. Surge, and saved there." diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.25.plan.json b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-06.04.plan.json similarity index 99% rename from SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.25.plan.json rename to SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-06.04.plan.json index 179b116978..5a70f90e8e 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.25.plan.json +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-06.04.plan.json @@ -2,7 +2,7 @@ "format": "pokesim-authored-checkpoint/1", "game": "frlg", "checkpoint": { - "id": "00.25", + "id": "06.04", "title": "Vermilion Gym: Lt. Surge, the THUNDERBADGE, then the Center", "notes": [ "Lt. Surge (5, 2), talked to from below, from the save in front of him: Voltorb Lv21, Pikachu Lv18 and Raichu Lv24, Shock Wave and Thunder Wave, a Super Potion and a Full Heal (sParty_LeaderLtSurge); then the THUNDERBADGE and TM34, read to the overworld with the battle's text. Out, the tree, and the nurse. Surge's win also puts Oak's aide on Vermilion City's (25, 7) (VermilionCity_Gym_EventScript_ShowOaksAide), where he stays until talked to; the story's maps don't have him. The way to the nurse along row 7 runs into him (console B, 2026-11-03: the leg west stopped beside him and the step into the Center's door went into a house), so it goes along row 10 to the water instead, clear of him, and up column 14 from there." diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.26.plan.json b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-07.01.plan.json similarity index 95% rename from SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.26.plan.json rename to SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-07.01.plan.json index 5a49347c84..c9de8a36b8 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.26.plan.json +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-07.01.plan.json @@ -2,13 +2,13 @@ "format": "pokesim-authored-checkpoint/1", "game": "frlg", "checkpoint": { - "id": "00.26", + "id": "07.01", "title": "The BIKE VOUCHER from the Fan Club, back north to Cerulean, the BICYCLE, Repels and Escape Ropes", "notes": [ - "Rows from 00.26 on, after the THUNDERBADGE: the BICYCLE, and the way east and south to Celadon City.", + "Rows from 07.01 on, after the THUNDERBADGE: the BICYCLE, and the way east and south to Celadon City.", "The BIKE VOUCHER and the BICYCLE, from Vermilion's Center to Cerulean's (pokeguy 43:50 to 45:00).", - "- The Pokemon Fan Club (VermilionCity_PokemonFanClub map.json, scripts.inc), in by Vermilion's (12, 17): the chairman (5, 4) sits above a table (5..6, 5..6) with the worker (6, 4) east of him, so he is talked to from (4, 4), west of him. \"Did you come to hear about my POKEMON?\" YES: his story, then the BIKE VOUCHER (FLAG_GOT_BIKE_VOUCHER). Oak's aide stands on Vermilion's (25, 7) since Lt. Surge, where the story's maps don't have him: the way planned from the Center's door goes east along his row 7, so the walk goes down to the water (14, 10) first, as 00.25 came up from it. From the Fan Club, up to (22, 10) first, so that the way on to Route 6 goes up column 22, west of him, not round by column 27.", - "- Route 6 north, the trainers as 00.21 left them: Jeff (13, 33) beaten, Isabelle (13, 32) and Elijah (20, 25) not. As in 00.24, onto Jeff's row, west to the wall (7, 33) and up to row 31, above Isabelle's line; then east along row 31 to the wall (17, 31) and up column 16, west of Elijah's line (17..19, 25) and east of Keigo's (4..8, 16), to the ledge (16, 11). The first three legs are 00.24's, walked on console B; the two after end on walls, which the walker holds again after a wild battle in the grass.", + "- The Pokemon Fan Club (VermilionCity_PokemonFanClub map.json, scripts.inc), in by Vermilion's (12, 17): the chairman (5, 4) sits above a table (5..6, 5..6) with the worker (6, 4) east of him, so he is talked to from (4, 4), west of him. \"Did you come to hear about my POKEMON?\" YES: his story, then the BIKE VOUCHER (FLAG_GOT_BIKE_VOUCHER). Oak's aide stands on Vermilion's (25, 7) since Lt. Surge, where the story's maps don't have him: the way planned from the Center's door goes east along his row 7, so the walk goes down to the water (14, 10) first, as 06.04 came up from it. From the Fan Club, up to (22, 10) first, so that the way on to Route 6 goes up column 22, west of him, not round by column 27.", + "- Route 6 north, the trainers as 05.10 left them: Jeff (13, 33) beaten, Isabelle (13, 32) and Elijah (20, 25) not. As in 06.03, onto Jeff's row, west to the wall (7, 33) and up to row 31, above Isabelle's line; then east along row 31 to the wall (17, 31) and up column 16, west of Elijah's line (17..19, 25) and east of Keigo's (4..8, 16), to the ledge (16, 11). The first three legs are 06.03's, walked on console B; the two after end on walls, which the walker holds again after a wild battle in the grass.", "- The Underground Path north, Route 5's sides, which have no trainer, and Cerulean's south edge, whose way into the city without the burgled house is the tree (26, 32) (pokeguy 44:42).", "- The Bike Shop (CeruleanCity_BikeShop), in by (13, 28): the clerk (9, 3) is across the counter (8, 3), talked to from (7, 3). With the voucher he gives the BICYCLE (FLAG_GOT_BICYCLE) with no YES/NO; it isn't registered or ridden yet.", "- The Mart: 5 Repels (row 9, 350 each) and 2 Escape Ropes (row 8, 550 each; pokefirered items.json), 2850 in all. Console B had about 9000 after Lt. Surge (2026-11-03); the floor of 6000 leaves 3000 or more after them.", diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.27.plan.json b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-07.02.plan.json similarity index 99% rename from SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.27.plan.json rename to SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-07.02.plan.json index e95427ff8e..2d0c075fb6 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.27.plan.json +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-07.02.plan.json @@ -2,11 +2,11 @@ "format": "pokesim-authored-checkpoint/1", "game": "frlg", "checkpoint": { - "id": "00.27", + "id": "07.02", "title": "East over Route 9 to Route 10's Pokemon Center: the two trees, Alicia, Jeremy and Conner", "notes": [ "East out of Cerulean over Route 9 to Route 10's Pokemon Center (pokeguy 45:12 to 47:27), on foot: the Bicycle isn't registered yet.", - "- Cerulean (CeruleanCity map.json): the way east, column 39..40 up from row 33 to rows 18..19 and out of the city's east edge, is reached from the city only through the tree (26, 32), grown back since 00.26 (its flag is a FLAG_TEMP), or the burgled house. Cut from above. Route 9 joins the city's rows 18..19 by its rows 8..9 (offset -10); its tree (2, 8) (FLAG_TEMP_12) closes them, (2, 9) being rock: cut from (1, 8), west of it.", + "- Cerulean (CeruleanCity map.json): the way east, column 39..40 up from row 33 to rows 18..19 and out of the city's east edge, is reached from the city only through the tree (26, 32), grown back since 07.01 (its flag is a FLAG_TEMP), or the burgled house. Cut from above. Route 9 joins the city's rows 18..19 by its rows 8..9 (offset -10); its tree (2, 8) (FLAG_TEMP_12) closes them, (2, 9) being rock: cut from (1, 8), west of it.", "- Route 9 (Route9 map.json, scripts.inc), its ledges all facing south. Of its nine trainers, three can't be walked around, as in pokeguy's run, where Jeremy happened to look away:", " - Picnicker Alicia (14, 10) faces west, sight 3, over (11..13, 10), the only tiles above the ledge row 11 the way west goes down by: fought on the step onto (11, 10); she walks up to (12, 10). Then down the ledge (11, 11).", " - Hiker Jeremy (20, 17) looks north and west (FACE_UP_AND_LEFT), sight 4: north over (20, 13..16), every way east of column 19 below the rocks of row 12. Fought on (20, 13), waiting for him to look north (TRAINER_WAIT_VARIANT); he walks up to (20, 14).", diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.28.plan.json b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-08.01.plan.json similarity index 99% rename from SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.28.plan.json rename to SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-08.01.plan.json index 1ff6a8a7b6..bca6f1ce5e 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.28.plan.json +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-08.01.plan.json @@ -2,10 +2,10 @@ "format": "pokesim-authored-checkpoint/1", "game": "frlg", "checkpoint": { - "id": "00.28", + "id": "08.01", "title": "Through Rock Tunnel: Ashton, Winston, Martha, Allen, Lenny, Sofia, Dudley, Cooper and Dana", "notes": [ - "Rows from 00.28 on: through Rock Tunnel, without Flash, and down Route 10 to Lavender Town's Pokemon Center.", + "Rows from 08.01 on: through Rock Tunnel, without Flash, and down Route 10 to Lavender Town's Pokemon Center.", "From Route 10's Pokemon Center through Rock Tunnel (pokefirered RockTunnel_1F, RockTunnel_B1F map.json and scripts.inc) to Route 10 south of it. The save is on Route 10 by the tunnel's south mouth: the save card's places don't include Rock Tunnel.", "- Every floor tile of the tunnel has wild encounters, which are run from (the table has no step that uses a Repel), so the legs end on walls, ladders or someone standing still, which the walker holds again after a battle. An open leg (two tiles or more, not to a wall) is followed only by legs a tile of error in it can't send astray.", "- Nine trainers stand where the way can't go round them. The others (1F Lucas, Oliver, Ariana, Leah; B1F Eric, Steve) are walked round.", @@ -234,7 +234,7 @@ "notes": [ "- B1F Sofia (11, 15) looks south over (11, 16..19), the way west: stepped into along row 16 from (12..14, 16).", "- B1F Dudley (5, 11) looks south over (5, 12..15): stepped into from (8, 15) along row 15.", - "- B1F Cooper (2, 6) looks around (sight 2) by the ladder (2, 3): the leg up column 1 to the wall (1, 2) passes him on (1, 6); if he looks west, story_interrupts() fights him and the leg is held on to its wall, as Mt. Moon's Grunt in 00.13." + "- B1F Cooper (2, 6) looks around (sight 2) by the ladder (2, 3): the leg up column 1 to the wall (1, 2) passes him on (1, 6); if he looks west, story_interrupts() fights him and the leg is held on to its wall, as Mt. Moon's Grunt in 04.05." ], "events": [ { diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.29.plan.json b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-08.02.plan.json similarity index 99% rename from SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.29.plan.json rename to SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-08.02.plan.json index afebebf900..bc3850b07a 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.29.plan.json +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-08.02.plan.json @@ -2,7 +2,7 @@ "format": "pokesim-authored-checkpoint/1", "game": "frlg", "checkpoint": { - "id": "00.29", + "id": "08.02", "title": "Route 10 south to Lavender Town's Pokemon Center", "notes": [ "Route 10 south of Rock Tunnel (Route10 map.json) to Lavender Town's Pokemon Center. It has no grass. Carol (7, 60) and Clark (4, 62) look around, Trent (4, 68) looks west and Herman wanders row 70 (13..17), looking west and east (sight 2, to x 19): the way keeps to the east side, columns 17..21, and crosses row 70 on column 21. The ledges of row 62 leave a gap at (18, 62); row 66's leaves (21, 66). Row 74's ledge (11, 74) is hopped, and the hold south goes on over the connection into Lavender Town to the wall (11, 9). West of the Center's building, the wall (8, 9) sets the door's column." diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.30.plan.json b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-08.03.plan.json similarity index 97% rename from SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.30.plan.json rename to SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-08.03.plan.json index 1f5f7e7850..967da61f1c 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.30.plan.json +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-08.03.plan.json @@ -2,10 +2,10 @@ "format": "pokesim-authored-checkpoint/1", "game": "frlg", "checkpoint": { - "id": "00.30", + "id": "08.03", "title": "Lavender Mart, then west over Route 8 on the Bicycle, the Underground Path, a Pidgey on Route 7, Celadon's Pokemon Center", "notes": [ - "PokeGuy's way from Lavender Town to Celadon City (pokeguy 54:18 on): the Lavender Mart, Route 8 west on the BICYCLE (00.26), Gamer Rich, the Underground Path's east-west tunnel to Route 7, a Pidgey from Route 7's grass to carry HM02 Fly later, and Celadon's Pokemon Center.", + "PokeGuy's way from Lavender Town to Celadon City (pokeguy 54:18 on): the Lavender Mart, Route 8 west on the BICYCLE (07.01), Gamer Rich, the Underground Path's east-west tunnel to Route 7, a Pidgey from Route 7's grass to carry HM02 Fly later, and Celadon's Pokemon Center.", "No Repel: the way keeps off grass. Route 8's grass (34..46, 9..18) is penned in by the Cut trees (47, 12) and (33, 15); Route 7's (11..18, 2..6) is east of the way north from the Underground Path's door (7, 14). The Underground Path has no wild Pokemon (pokefirered wild_encounters.json lists none), and the Pidgey is caught where Route 7's grass is walked on purpose.", "Route 8's trainers (Route8 map.json): Julia (62, 14) looks west 6, Rich (55, 15) south 3, Glenn (51, 6) all ways 4, Paige (29, 3) and Andrea (29, 5) west 3, Leslie (29, 4) and Megan (29, 6) east 6, Stan (21, 3) all ways 1, Eli and Anne (40, 3), (41, 3) south 1, Ricardo (14, 16) and Jaren (24, 17) all ways 1, Aidan (9, 6) east 4. Below the wall (56..61, 6..13) the only ways west are row 14, Julia's line, and rows 15..18, which cross Rich's column: his line (55, 16..18) is the one taken." ], @@ -20,7 +20,7 @@ "kind": "game_action", "variant": "register_bike", "once_per_save": true, - "why": "the BICYCLE (00.26) registered for SELECT, which gets on and off in about 1 s (console B, 2026-11-09); here until 00.26's plan (frlg/stage7-celadon, #224) takes it right after the Bicycle" + "why": "the BICYCLE (07.01) registered for SELECT, which gets on and off in about 1 s (console B, 2026-11-09); here until 07.01's plan (frlg/stage7-celadon, #224) takes it right after the Bicycle" }, { "id": "east_of_mart_door", @@ -50,7 +50,7 @@ "args": {"map": "LavenderTown_Mart", "budget": 5700, "floor": 9000}, "items": [{"item": "escape-rope", "quantity": 4}, {"item": "super-repel", "quantity": 7}], "once_per_save": true, - "why": "pokeguy 54:18: 4 Escape Ropes (the Rocket Hideout, 00.31) and 7 Super Repels (Pokemon Tower)" + "why": "pokeguy 54:18: 4 Escape Ropes (the Rocket Hideout, 09.01) and 7 Super Repels (Pokemon Tower)" }, { "id": "out_of_lavender_mart", diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.31.plan.json b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-09.01.plan.json similarity index 99% rename from SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.31.plan.json rename to SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-09.01.plan.json index 1fe0937b9e..a5c90b006f 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.31.plan.json +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-09.01.plan.json @@ -2,7 +2,7 @@ "format": "pokesim-authored-checkpoint/1", "game": "frlg", "checkpoint": { - "id": "00.31", + "id": "09.01", "title": "Celadon Game Corner and the Rocket Hideout down to B4F: the poster guard, the Lift Key Grunt, the LIFT KEY and B3F's Rare Candy", "start": {"certainty": "tile", "map": "CeladonCity_PokemonCenter_1F", "where": {"facing": "north", "kind": "tiles", "tiles": [[7, 4]]}}, "events": [ diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.32.plan.json b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-09.02.plan.json similarity index 99% rename from SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.32.plan.json rename to SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-09.02.plan.json index cd618a06ba..6aca0d5537 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.32.plan.json +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-09.02.plan.json @@ -2,7 +2,7 @@ "format": "pokesim-authored-checkpoint/1", "game": "frlg", "checkpoint": { - "id": "00.32", + "id": "09.02", "title": "Rocket Hideout: B2F's arrows and the MOON STONE, the lift to B4F, the two door guards, Giovanni, the SILPH SCOPE and an Escape Rope out", "start": { "certainty": "tile", diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-parcel-00.05.json b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-parcel-02.01.json similarity index 99% rename from SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-parcel-00.05.json rename to SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-parcel-02.01.json index 2090ba206e..7310babb8e 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-parcel-00.05.json +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-parcel-02.01.json @@ -2,7 +2,7 @@ "format": "pokesim-native-checkpoint-export/1", "game": "frlg", "checkpoint": { - "id": "00.05", + "id": "02.01", "title": "Route 1 to Viridian Mart: Oak's Parcel", "start": { "certainty": "tile", diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-parcel-00.05.plan.json b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-parcel-02.01.plan.json similarity index 98% rename from SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-parcel-00.05.plan.json rename to SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-parcel-02.01.plan.json index 6df2d7a0d2..f956ca09e8 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-parcel-00.05.plan.json +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-parcel-02.01.plan.json @@ -2,7 +2,7 @@ "format": "pokesim-authored-checkpoint/1", "game": "frlg", "checkpoint": { - "id": "00.05", + "id": "02.01", "title": "Route 1 to Viridian Mart: Oak's Parcel", "start": { "certainty": "tile", diff --git a/devtools/story-export/README.md b/devtools/story-export/README.md index 8195c7b3fe..ff99152e34 100644 --- a/devtools/story-export/README.md +++ b/devtools/story-export/README.md @@ -10,7 +10,7 @@ From a clean committed checkout with the usual native build dependencies: ```sh cmake -S SerialPrograms -B build -DPA_FRLG_STORY_EXPORT=ON cmake --build build --target StoryCheckpointExport -j4 -build/StoryCheckpointExport 00.05 > frlg-parcel.native.json +build/StoryCheckpointExport 02.01 > frlg-parcel.native.json ``` On multi-configuration generators add `--config RelWithDebInfo`, then run diff --git a/devtools/story-export/frlg_main.cpp b/devtools/story-export/frlg_main.cpp index 72d3a0bbcf..c6a60ac12c 100644 --- a/devtools/story-export/frlg_main.cpp +++ b/devtools/story-export/frlg_main.cpp @@ -1,7 +1,7 @@ /* Offline evaluated FRLG table export. No console or profile initialization. * cmake -S SerialPrograms -B build -DPA_FRLG_STORY_EXPORT=ON * cmake --build build --target StoryCheckpointExport -j4 - * build/StoryCheckpointExport 00.05 > frlg-parcel.native.json + * build/StoryCheckpointExport 02.01 > frlg-parcel.native.json * Format the captured JSON with PokemonSimulation's contract formatter. */ #include diff --git a/devtools/story-replay/README.md b/devtools/story-replay/README.md index 810ee222aa..f39eceb5ac 100644 --- a/devtools/story-replay/README.md +++ b/devtools/story-replay/README.md @@ -23,7 +23,7 @@ GitHub CI builds/tests on the fork; Ubuntu additionally uploads `Programs/AutoStory/ReplayData/` contains exact `binding.json` / `cases.json` copies from the immutable PokemonSimulation revision in `pin.json`. The capture -itself is the existing `StoryData/frlg-parcel-00.05.json`. These are **PR #73 +itself is the existing `StoryData/frlg-parcel-02.01.json`. These are **PR #73 preview test fixtures**, not an approved resource/production-plan adoption. The 53-map production resource pin is unchanged. Every selected native embedded map must match its Python fixture's exact raw-byte SHA-256 before execution. diff --git a/docs/design/AutoStory-FRLG-Sizing.md b/docs/design/AutoStory-FRLG-Sizing.md index 38c25aa5e8..7110e9c708 100644 --- a/docs/design/AutoStory-FRLG-Sizing.md +++ b/docs/design/AutoStory-FRLG-Sizing.md @@ -155,7 +155,7 @@ A seeded fake game with odds from the decomp. Not written yet. Doesn't block M2 | E5 | Starter-RNG entry point for GiftRng | new | ~300 | | main; testable from a manual save | | M12 | RNG routines made callable, then AutoStory hand-offs | new | not sized | | refactors: main; hand-offs: B15 | -AutoStory joins this track only at the hand-off: names at 00.01 and the starter after 00.03/00.04, both after B15. +AutoStory joins this track only at the hand-off: names at 01.01 and the starter after 01.04/01.05, both after B15. ## 5. Lab tooling and run records (M4, [#138](https://github.com/dayfine/Arduino-Source/issues/138)) diff --git a/docs/design/AutoStory.md b/docs/design/AutoStory.md index 4e5d1eb607..74d4fc8f29 100644 --- a/docs/design/AutoStory.md +++ b/docs/design/AutoStory.md @@ -925,8 +925,8 @@ later change): | `capture` | `species` word, `catches`, `encounters`, `balls` numbers, all required; `pace` word | | | `level` | `slot`, `min` numbers, required | Built in C++, not in a plan. | | `fossil` | `fossil` word (`helix`, `dome`), required | | -| `use_item` | `item` word, required; `slot` number | 00.30 onwards. | -| `lift_floor` | `from`, `to` words, required | 00.30 onwards. | +| `use_item` | `item` word, required; `slot` number | 08.03 onwards. | +| `lift_floor` | `from`, `to` words, required | 08.03 onwards. | Plain names such as `run`, `trainer_line`, `cut_tree` and `bike` take no arguments and stay as they are. From 87fac08408e290a19c332061f860dfa791aa6ae5 Mon Sep 17 00:00:00 2001 From: dayfine Date: Tue, 10 Nov 2026 23:45:12 -0800 Subject: [PATCH 75/79] FRLG replay fixtures: re-hash binding and route candidate for 02.01 Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss --- .../PokemonFRLG/Programs/AutoStory/ReplayData/binding.json | 2 +- .../Programs/AutoStory/ReplayData/route-candidate.json | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/ReplayData/binding.json b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/ReplayData/binding.json index 067fa631d3..51ffba8f62 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/ReplayData/binding.json +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/ReplayData/binding.json @@ -2,7 +2,7 @@ "format": "pokesim-story-replay-binding/1", "capture": { "file": "data/story/native/frlg-parcel-00.05.json", - "sha256": "8b0c04f2e1507aee0f0927a8d022b8b431036431e95f8893aa7a2383360f8504", + "sha256": "793abfef624f690c73cd0bb2e2a149da5f4c8654b50ffbd5905e27d88e1b0c04", "source_revision": "b170b7d2103e887ded825c37fdbdc19fd654fca8" }, "map_revision": "e52be04ed7bb007c7219c7d2c96963cf053e0000", diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/ReplayData/route-candidate.json b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/ReplayData/route-candidate.json index 2ce8d3ce63..75f6a179c9 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/ReplayData/route-candidate.json +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/ReplayData/route-candidate.json @@ -1,7 +1,7 @@ { "format": "pokesim-route-candidate/1", - "binding_sha256": "ce91aba96599f443910dc76a985b97a45b8a76bcbbb1c9824cd247a627d946f4", - "checkpoint": "00.05", + "binding_sha256": "32408e4af4744bb52ca691ccef93a075d5c82dd3472753be3ebc9354412f6d32", + "checkpoint": "02.01", "routes": { "below_mart_door": [ { From 5f15ed26717205d4d799a2be43118a7ed38d789a Mon Sep 17 00:00:00 2001 From: dayfine Date: Tue, 10 Nov 2026 23:48:49 -0800 Subject: [PATCH 76/79] FRLG Vermilion Gym tests: string_view ids Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss --- .../AutoStory/PokemonFRLG_AutoStoryVermilionGym_Tests.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryVermilionGym_Tests.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryVermilionGym_Tests.cpp index 72ff452180..b572bf7e8f 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryVermilionGym_Tests.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryVermilionGym_Tests.cpp @@ -340,7 +340,7 @@ UnitTestResult test_tree_shuts_the_yard(){ // grass round Isabelle's line and back, to below Surge through the beams, // and from him back out past the tree to the nurse, meeting no one. UnitTestResult test_to_surge_and_out(){ - for (const char* id : {"06.03", "06.04"}){ + for (std::string_view id : {"06.03", "06.04"}){ const StoryCheckpoint& row = checkpoint(id); StoryPose at = *story_pose(*row.start); OverworldSim sim(maps_after_gym(), MapPosition{at.map, at.tile}, *at.facing); @@ -352,7 +352,7 @@ UnitTestResult test_to_surge_and_out(){ if (!sim.state().trainers_beaten.empty() || !sim.state().violations.empty()){ return std::string(id) + ": a battle or a violation on the way."; } - const MapPosition end = std::string(id) == "06.03" ? MapPosition{GYM, {5, 3}} : MapPosition{StoryTable::VERMILION_CENTER, {7, 4}}; + const MapPosition end = id == "06.03" ? MapPosition{GYM, {5, 3}} : MapPosition{StoryTable::VERMILION_CENTER, {7, 4}}; if (!(sim.state().position == end)){ return std::string(id) + ": ended on " + to_string(sim.state().position) + ", not " + to_string(end) + "."; } From b9dde10c3f53f51f4a202cf12bc527f8ad46e88a Mon Sep 17 00:00:00 2001 From: dayfine Date: Tue, 10 Nov 2026 23:57:58 -0800 Subject: [PATCH 77/79] FRLG AutoStory: pin PokemonSimulation d3eea1b with Parcel as 02.01 Simulation #87 renames the Parcel capture and plan to 02.01. Point the replay pin, the copied binding, the route candidate's binding hash and both CI checkouts at that revision. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss --- .github/workflows/cpp-ci-serial-programs-base.yml | 6 +++--- .../Programs/AutoStory/ReplayData/binding.json | 2 +- .../PokemonFRLG/Programs/AutoStory/ReplayData/pin.json | 10 +++++----- .../Programs/AutoStory/ReplayData/route-candidate.json | 2 +- .../Programs/AutoStory/StoryData/Draft/README.md | 2 +- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/workflows/cpp-ci-serial-programs-base.yml b/.github/workflows/cpp-ci-serial-programs-base.yml index 6b7514886a..d6c809fac5 100644 --- a/.github/workflows/cpp-ci-serial-programs-base.yml +++ b/.github/workflows/cpp-ci-serial-programs-base.yml @@ -106,7 +106,7 @@ jobs: uses: actions/checkout@v7 with: repository: dayfine/PokemonSimulation - ref: bdca47c5045797be1d2a1f0931ad6a8f15ab3225 + ref: d3eea1b5c04180f8b60eb98b0d65f70aca6b1abb path: StoryReplaySource - name: Verify replay preview bytes and independently regenerate its route input @@ -150,7 +150,7 @@ jobs: uses: actions/checkout@v7 with: repository: dayfine/PokemonSimulation - ref: 8cb831caf8bfe1f06b1aec9a4a7e55e6e09b0604 + ref: d3eea1b5c04180f8b60eb98b0d65f70aca6b1abb path: AuthoredStorySource - name: Check identical authored Parcel JSON and replay its scenarios @@ -166,7 +166,7 @@ jobs: source = Path('AuthoredStorySource') folder = source / 'data/story/parcel-pilot' native = Path('Arduino-Source/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData') - assert (native / 'frlg-parcel-02.01.plan.json').read_bytes() == (folder / 'frlg-parcel-00.05.plan.json').read_bytes() + assert (native / 'frlg-parcel-02.01.plan.json').read_bytes() == (folder / 'frlg-parcel-02.01.plan.json').read_bytes() binding = load_binding(folder / 'authored-binding.json', source) cases = read_cases(folder / 'cases.json') for case in cases: diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/ReplayData/binding.json b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/ReplayData/binding.json index 51ffba8f62..3eb131a68e 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/ReplayData/binding.json +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/ReplayData/binding.json @@ -1,7 +1,7 @@ { "format": "pokesim-story-replay-binding/1", "capture": { - "file": "data/story/native/frlg-parcel-00.05.json", + "file": "data/story/native/frlg-parcel-02.01.json", "sha256": "793abfef624f690c73cd0bb2e2a149da5f4c8654b50ffbd5905e27d88e1b0c04", "source_revision": "b170b7d2103e887ded825c37fdbdc19fd654fca8" }, diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/ReplayData/pin.json b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/ReplayData/pin.json index 1289d24a91..165ee3d668 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/ReplayData/pin.json +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/ReplayData/pin.json @@ -1,24 +1,24 @@ { "format": "pokesim-native-replay-preview/1", "repository": "dayfine/PokemonSimulation", - "revision": "bdca47c5045797be1d2a1f0931ad6a8f15ab3225", + "revision": "d3eea1b5c04180f8b60eb98b0d65f70aca6b1abb", "status": "preview-unmerged-PR-73", "files": { "binding": { "path": "data/story/parcel-pilot/binding.json", - "sha256": "ce91aba96599f443910dc76a985b97a45b8a76bcbbb1c9824cd247a627d946f4" + "sha256": "a29dd87a33c56dd108956d3a691646dbed850b376df6b9f019977dac979a5ed2" }, "cases": { "path": "data/story/parcel-pilot/cases.json", "sha256": "0dee2991120d12f01e67f6e97a4fb815b4d2f54a423739bc1a6aa4f2509f599e" }, "capture": { - "path": "data/story/native/frlg-parcel-00.05.json", - "sha256": "8b0c04f2e1507aee0f0927a8d022b8b431036431e95f8893aa7a2383360f8504" + "path": "data/story/native/frlg-parcel-02.01.json", + "sha256": "793abfef624f690c73cd0bb2e2a149da5f4c8654b50ffbd5905e27d88e1b0c04" } }, "candidate": { - "sha256": "78219878fedc2c531a4b0faabbe215193ebc7e842dee0237ff52d296a6d614ac", + "sha256": "019e0d77f4f2c15a295e6ac2cfdf31ad836255acdc40a54fee042fddc96373fb", "producer": "checkpoint_replay.run actual route actions; expectations are not read" } } diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/ReplayData/route-candidate.json b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/ReplayData/route-candidate.json index 75f6a179c9..c2f0cb0214 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/ReplayData/route-candidate.json +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/ReplayData/route-candidate.json @@ -1,6 +1,6 @@ { "format": "pokesim-route-candidate/1", - "binding_sha256": "32408e4af4744bb52ca691ccef93a075d5c82dd3472753be3ebc9354412f6d32", + "binding_sha256": "a29dd87a33c56dd108956d3a691646dbed850b376df6b9f019977dac979a5ed2", "checkpoint": "02.01", "routes": { "below_mart_door": [ diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/Draft/README.md b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/Draft/README.md index 4b7fb31107..605d8c8d24 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/Draft/README.md +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/Draft/README.md @@ -6,7 +6,7 @@ story table doesn't load them: `pa_embed_text_files()` embeds only so this README is where they are marked unverified. Each file is a `pokesim-authored-checkpoint/1` plan in the same format as -`../frlg-parcel-00.05.plan.json`. The order and the item stops follow PokeGuy's +`../frlg-parcel-02.01.plan.json`. The order and the item stops follow PokeGuy's LeafGreen run (PokemonSimulation `data/runs/pokeguy-leafgreen-15934/events.json` and `external/pokeguy-notes.md`). 00.28 and 00.29 are table rows on `frlg/stage8-rocktunnel` (#293); 00.29 ends at Lavender's nurse, where 00.30 From 220a483f89e829f1eebf67e692c32635d254247a Mon Sep 17 00:00:00 2001 From: dayfine Date: Wed, 11 Nov 2026 01:19:42 -0800 Subject: [PATCH 78/79] FRLG AutoStory: number checkpoints by Bulbapedia walkthrough part Redo of #363's renumbering on stage8: 00.01-00.32 become 01.01-09.02 (00.05 becomes 02.01). Story files, ids, tests, docs and replay fixtures renamed; fixtures re-hashed and PokemonSimulation pinned at d3eea1b. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss --- .../workflows/cpp-ci-serial-programs-base.yml | 8 +- .../Menus/PokemonFRLG_TeachScreenReader.cpp | 2 +- .../Overworld/PokemonFRLG_BikeSpinMechanics.h | 2 +- .../Overworld/PokemonFRLG_MovementMechanics.h | 4 +- .../Overworld/PokemonFRLG_OverworldBikeTaps.h | 2 +- .../PokemonFRLG_OverworldBike_Tests.cpp | 2 +- .../Overworld/PokemonFRLG_OverworldFacing.h | 2 +- .../PokemonFRLG_OverworldLateBattle_Tests.cpp | 4 +- .../PokemonFRLG_OverworldMaps_Tests.cpp | 4 +- .../PokemonFRLG_OverworldRecovery.cpp | 4 +- .../PokemonFRLG_OverworldRecoveryWalk.h | 2 +- .../PokemonFRLG_OverworldRouteSteps.h | 6 +- .../Overworld/PokemonFRLG_OverworldSim.cpp | 2 +- .../Overworld/PokemonFRLG_OverworldSim.h | 22 +- .../Overworld/PokemonFRLG_OverworldSimState.h | 12 +- .../PokemonFRLG_OverworldSim_Tests.cpp | 28 +-- .../PokemonFRLG_OverworldSpin_Tests.cpp | 4 +- .../Overworld/PokemonFRLG_OverworldWalk.cpp | 4 +- .../PokemonFRLG_OverworldWalkBattles.h | 4 +- .../PokemonFRLG_OverworldWalkWatches.h | 2 +- .../PokemonFRLG_OverworldWalk_Tests.cpp | 4 +- .../PokemonFRLG_OverworldWalkedTiles.h | 4 +- .../PokemonFRLG_OverworldWarpFade_Tests.cpp | 4 +- .../Programs/AutoStory/Data/Json_Tests.cpp | 4 +- .../AutoStory/PokemonFRLG_AutoStory.cpp | 52 ++--- .../AutoStory/PokemonFRLG_AutoStory.h | 8 +- .../PokemonFRLG_AutoStoryBattleDecisions.h | 2 +- .../PokemonFRLG_AutoStoryCeladon_Tests.cpp | 90 ++++---- .../PokemonFRLG_AutoStoryCheckpoints.h | 4 +- .../PokemonFRLG_AutoStoryChoice_Tests.cpp | 2 +- .../AutoStory/PokemonFRLG_AutoStoryEvents.cpp | 4 +- .../PokemonFRLG_AutoStoryFaultSweep_Tests.cpp | 12 +- .../AutoStory/PokemonFRLG_AutoStoryGrind.h | 2 +- .../PokemonFRLG_AutoStoryGrind_Tests.cpp | 2 +- .../PokemonFRLG_AutoStoryHideout_Tests.cpp | 10 +- .../PokemonFRLG_AutoStoryLavender_Tests.cpp | 146 ++++++------- .../PokemonFRLG_AutoStoryPaceSim_Tests.cpp | 4 +- .../AutoStory/PokemonFRLG_AutoStoryPacing.h | 2 +- .../AutoStory/PokemonFRLG_AutoStoryParty.cpp | 4 +- .../PokemonFRLG_AutoStoryParty_Tests.cpp | 2 +- .../AutoStory/PokemonFRLG_AutoStoryPoses.h | 2 +- .../PokemonFRLG_AutoStoryRngLoop.cpp | 18 +- .../AutoStory/PokemonFRLG_AutoStoryRngLoop.h | 4 +- .../PokemonFRLG_AutoStoryRngLoop_Tests.cpp | 42 ++-- .../AutoStory/PokemonFRLG_AutoStoryRowSim.cpp | 4 +- .../AutoStory/PokemonFRLG_AutoStoryRowSim.h | 2 +- .../PokemonFRLG_AutoStoryRowSimStubs.h | 2 +- .../PokemonFRLG_AutoStoryRows_Tests.h | 8 +- .../PokemonFRLG_AutoStoryRunPlan_Tests.cpp | 202 +++++++++--------- ...okemonFRLG_AutoStoryScreenEvents_Tests.cpp | 2 +- .../PokemonFRLG_AutoStorySimulation_Tests.cpp | 152 ++++++------- ...PokemonFRLG_AutoStoryStartFrames_Tests.cpp | 24 +-- .../AutoStory/PokemonFRLG_AutoStoryTable.h | 22 +- .../PokemonFRLG_AutoStoryTeachScreens.h | 2 +- ...okemonFRLG_AutoStoryTeachScreens_Tests.cpp | 6 +- .../PokemonFRLG_AutoStoryTrainerMessage.h | 2 +- .../PokemonFRLG_AutoStoryTrashCanLayout.h | 2 +- ...okemonFRLG_AutoStoryVermilionGym_Tests.cpp | 56 ++--- .../PokemonFRLG_AutoStoryVermilion_Tests.cpp | 36 ++-- .../AutoStory/PokemonFRLG_AutoStory_Tests.cpp | 56 ++--- .../AutoStory/ReplayData/binding.json | 4 +- .../AutoStory/ReplayData/capture.json | 2 +- .../Programs/AutoStory/ReplayData/pin.json | 10 +- .../AutoStory/ReplayData/route-candidate.json | 4 +- ...g-00.01.plan.json => frlg-01.01.plan.json} | 2 +- ...-00.01b.plan.json => frlg-01.02.plan.json} | 2 +- ...g-00.02.plan.json => frlg-01.03.plan.json} | 2 +- ...g-00.03.plan.json => frlg-01.04.plan.json} | 2 +- ...g-00.04.plan.json => frlg-01.05.plan.json} | 2 +- ...-00.04b.plan.json => frlg-01.06.plan.json} | 2 +- ...g-00.05.plan.json => frlg-02.01.plan.json} | 2 +- ...g-00.06.plan.json => frlg-02.02.plan.json} | 2 +- ...g-00.07.plan.json => frlg-02.03.plan.json} | 2 +- ...g-00.08.plan.json => frlg-03.01.plan.json} | 4 +- ...g-00.09.plan.json => frlg-03.02.plan.json} | 2 +- ...g-00.10.plan.json => frlg-03.03.plan.json} | 4 +- ...g-00.11.plan.json => frlg-04.01.plan.json} | 2 +- ...g-00.12.plan.json => frlg-04.02.plan.json} | 2 +- ...-00.12b.plan.json => frlg-04.03.plan.json} | 4 +- ...-00.12c.plan.json => frlg-04.04.plan.json} | 2 +- ...g-00.13.plan.json => frlg-04.05.plan.json} | 2 +- ...g-00.14.plan.json => frlg-04.06.plan.json} | 2 +- ...-00.14b.plan.json => frlg-05.01.plan.json} | 8 +- ...-00.14c.plan.json => frlg-05.02.plan.json} | 4 +- ...g-00.15.plan.json => frlg-05.03.plan.json} | 4 +- ...-00.15b.plan.json => frlg-05.04.plan.json} | 4 +- ...g-00.16.plan.json => frlg-05.05.plan.json} | 2 +- ...g-00.17.plan.json => frlg-05.06.plan.json} | 2 +- ...g-00.18.plan.json => frlg-05.07.plan.json} | 2 +- ...g-00.19.plan.json => frlg-05.08.plan.json} | 2 +- ...g-00.20.plan.json => frlg-05.09.plan.json} | 6 +- ...g-00.21.plan.json => frlg-05.10.plan.json} | 2 +- ...g-00.22.plan.json => frlg-06.01.plan.json} | 4 +- ...g-00.23.plan.json => frlg-06.02.plan.json} | 4 +- ...g-00.24.plan.json => frlg-06.03.plan.json} | 2 +- ...g-00.25.plan.json => frlg-06.04.plan.json} | 2 +- ...g-00.26.plan.json => frlg-07.01.plan.json} | 6 +- ...g-00.27.plan.json => frlg-07.02.plan.json} | 4 +- ...g-00.28.plan.json => frlg-08.01.plan.json} | 4 +- ...g-00.29.plan.json => frlg-08.02.plan.json} | 2 +- ...g-00.30.plan.json => frlg-08.03.plan.json} | 8 +- ...g-00.31.plan.json => frlg-09.01.plan.json} | 2 +- ...g-00.32.plan.json => frlg-09.02.plan.json} | 2 +- devtools/story-export/README.md | 2 +- devtools/story-export/frlg_main.cpp | 2 +- devtools/story-replay/README.md | 2 +- docs/design/AutoStory-FRLG-Sizing.md | 2 +- docs/design/AutoStory.md | 4 +- 108 files changed, 641 insertions(+), 635 deletions(-) rename SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/{frlg-00.01.plan.json => frlg-01.01.plan.json} (94%) rename SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/{frlg-00.01b.plan.json => frlg-01.02.plan.json} (95%) rename SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/{frlg-00.02.plan.json => frlg-01.03.plan.json} (93%) rename SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/{frlg-00.03.plan.json => frlg-01.04.plan.json} (95%) rename SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/{frlg-00.04.plan.json => frlg-01.05.plan.json} (94%) rename SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/{frlg-00.04b.plan.json => frlg-01.06.plan.json} (95%) rename SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/{frlg-00.05.plan.json => frlg-02.01.plan.json} (95%) rename SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/{frlg-00.06.plan.json => frlg-02.02.plan.json} (94%) rename SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/{frlg-00.07.plan.json => frlg-02.03.plan.json} (96%) rename SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/{frlg-00.08.plan.json => frlg-03.01.plan.json} (96%) rename SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/{frlg-00.09.plan.json => frlg-03.02.plan.json} (96%) rename SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/{frlg-00.10.plan.json => frlg-03.03.plan.json} (94%) rename SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/{frlg-00.11.plan.json => frlg-04.01.plan.json} (97%) rename SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/{frlg-00.12.plan.json => frlg-04.02.plan.json} (97%) rename SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/{frlg-00.12b.plan.json => frlg-04.03.plan.json} (83%) rename SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/{frlg-00.12c.plan.json => frlg-04.04.plan.json} (96%) rename SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/{frlg-00.13.plan.json => frlg-04.05.plan.json} (97%) rename SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/{frlg-00.14.plan.json => frlg-04.06.plan.json} (97%) rename SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/{frlg-00.14b.plan.json => frlg-05.01.plan.json} (90%) rename SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/{frlg-00.14c.plan.json => frlg-05.02.plan.json} (96%) rename SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/{frlg-00.15.plan.json => frlg-05.03.plan.json} (71%) rename SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/{frlg-00.15b.plan.json => frlg-05.04.plan.json} (94%) rename SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/{frlg-00.16.plan.json => frlg-05.05.plan.json} (96%) rename SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/{frlg-00.17.plan.json => frlg-05.06.plan.json} (97%) rename SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/{frlg-00.18.plan.json => frlg-05.07.plan.json} (97%) rename SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/{frlg-00.19.plan.json => frlg-05.08.plan.json} (96%) rename SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/{frlg-00.20.plan.json => frlg-05.09.plan.json} (94%) rename SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/{frlg-00.21.plan.json => frlg-05.10.plan.json} (97%) rename SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/{frlg-00.22.plan.json => frlg-06.01.plan.json} (96%) rename SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/{frlg-00.23.plan.json => frlg-06.02.plan.json} (95%) rename SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/{frlg-00.24.plan.json => frlg-06.03.plan.json} (97%) rename SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/{frlg-00.25.plan.json => frlg-06.04.plan.json} (97%) rename SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/{frlg-00.26.plan.json => frlg-07.01.plan.json} (94%) rename SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/{frlg-00.27.plan.json => frlg-07.02.plan.json} (97%) rename SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/{frlg-00.28.plan.json => frlg-08.01.plan.json} (97%) rename SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/{frlg-00.29.plan.json => frlg-08.02.plan.json} (97%) rename SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/{frlg-00.30.plan.json => frlg-08.03.plan.json} (94%) rename SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/{frlg-00.31.plan.json => frlg-09.01.plan.json} (97%) rename SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/{frlg-00.32.plan.json => frlg-09.02.plan.json} (97%) diff --git a/.github/workflows/cpp-ci-serial-programs-base.yml b/.github/workflows/cpp-ci-serial-programs-base.yml index d5bd315a6a..1b53424775 100644 --- a/.github/workflows/cpp-ci-serial-programs-base.yml +++ b/.github/workflows/cpp-ci-serial-programs-base.yml @@ -106,7 +106,7 @@ jobs: uses: actions/checkout@v7 with: repository: dayfine/PokemonSimulation - ref: bdca47c5045797be1d2a1f0931ad6a8f15ab3225 + ref: d3eea1b5c04180f8b60eb98b0d65f70aca6b1abb path: StoryReplaySource - name: Verify replay preview bytes and independently regenerate its route input @@ -127,7 +127,7 @@ jobs: assert pin['status'] == 'preview-unmerged-PR-73' and revision == pin['revision'] for name, entry in pin['files'].items(): published = (source / entry['path']).read_bytes() - copied = (native / 'StoryData/frlg-parcel-00.05.json' if name == 'capture' else folder / (name + '.json')).read_bytes() + copied = (native / 'StoryData/frlg-parcel-02.01.json' if name == 'capture' else folder / (name + '.json')).read_bytes() assert hashlib.sha256(published).hexdigest() == entry['sha256'], name assert copied == published, name binding = load_binding(source / pin['files']['binding']['path'], source) @@ -277,12 +277,12 @@ jobs: if: startsWith(inputs.os, 'ubuntu') && inputs.run-tests run: | cd Arduino-Source/SerialPrograms/bin - ./StoryCheckpointExport 00.05 > frlg-parcel.native.json + ./StoryCheckpointExport 02.01 > frlg-parcel.native.json python3 - <<'PYTHON' import json from pathlib import Path data = json.loads(Path('frlg-parcel.native.json').read_text()) - assert data['game'] == 'frlg' and data['checkpoint']['id'] == '00.05' + assert data['game'] == 'frlg' and data['checkpoint']['id'] == '02.01' assert len(data['checkpoint']['events']) == 3 PYTHON diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Inference/Menus/PokemonFRLG_TeachScreenReader.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Inference/Menus/PokemonFRLG_TeachScreenReader.cpp index d898916ba1..c49410faf8 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Inference/Menus/PokemonFRLG_TeachScreenReader.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Inference/Menus/PokemonFRLG_TeachScreenReader.cpp @@ -541,7 +541,7 @@ void add_tests_TeachScreenReader(UnitTestDatabase& database){ "KnownMoves_eng.png", "StopQuestion_eng.png", "DidNotLearn_eng.png", - // HM01 to an Oddish with two free slots (00.23, console B). + // HM01 to an Oddish with two free slots (06.02, console B). "MachineSet_eng.png", }){ database.add(std::format("PokemonFRLG/TeachScreenReader/{}", image)); diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_BikeSpinMechanics.h b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_BikeSpinMechanics.h index ae9283b104..b610810a8c 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_BikeSpinMechanics.h +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_BikeSpinMechanics.h @@ -26,7 +26,7 @@ namespace MovementMechanics{ // tiles, the same each time: a tile per 100ms, so an open leg's hold of // (n - 1) tiles and a half moves n. 112ms a tile (a wall-to-wall time // of the motion on screen) held "west 16 (open)" for 17 or 18 tiles on -// Route 8 (00.30 run 2). Not the decompilation's 4 frames a tile (67ms): +// Route 8 (08.03 run 2). Not the decompilation's 4 frames a tile (67ms): // the bike speeds up from rest. inline constexpr Milliseconds BIKE_TILE_TIME(100); diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_MovementMechanics.h b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_MovementMechanics.h index 8c186fd894..a89674104d 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_MovementMechanics.h +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_MovementMechanics.h @@ -21,7 +21,7 @@ * tap's start is ignored. * - Taps with no release between them are one hold: after a turn, 3 of * them took 0 or 1 steps. - * After a battle (console B, 2026-11-09 15:50, 00.28 winston_line): a + * After a battle (console B, 2026-11-09 15:50, 08.01 winston_line): a * step tap sent as flee_battle() returned, on the black's end, was lost; * one more tap by hand stepped. * @@ -46,7 +46,7 @@ namespace MovementMechanics{ // Walking: a tile per 16 frames at 60 fps (console B, 2026-11-09). inline constexpr Milliseconds TILE_TIME(267); // Running with B held: a tile per 8 frames (console B, 2026-11-02, video -// of run 00.11). +// of run 04.01). inline constexpr Milliseconds RUN_TILE_TIME(133); // Surfing: a tile per 8 frames. inline constexpr Milliseconds SURF_TILE_TIME(133); diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldBikeTaps.h b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldBikeTaps.h index fb5bb67188..7721f8c09d 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldBikeTaps.h +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldBikeTaps.h @@ -48,7 +48,7 @@ struct BikeTapCalls{ // game may miss a turn tap (MovementMechanics::MAX_TURN_TAPS). constexpr int STEP_TAP_TRIES = 3; // How far a sure start may be off before a blocked tap finds the player: -// three runs of 00.30 stood 3 tiles off (console B, 2026-11-09). +// three runs of 08.03 stood 3 tiles off (console B, 2026-11-09). constexpr int BLOCKED_TAP_SLACK = 3; // Walks the open leg `step` a tap at a time: on the Bicycle each tap is diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldBike_Tests.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldBike_Tests.cpp index 8fc91a73c5..701d7faf3a 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldBike_Tests.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldBike_Tests.cpp @@ -234,7 +234,7 @@ ImageRGB32 periodic_floor(size_t scroll){ return image; } -// Rocket Hideout B3F (00.32 run 1): a tap east over a floor that repeats +// Rocket Hideout B3F (09.02 run 1): a tap east over a floor that repeats // every tile left the top band the same, so the tap read as a turn. UnitTestResult test_scroll_over_periodic_floor(){ const ImageFloatBox game(0, 0, 1, 1); diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldFacing.h b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldFacing.h index 191d96f375..4468966f13 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldFacing.h +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldFacing.h @@ -28,7 +28,7 @@ std::optional read_facing(ConsoleHandle& console, ProControllerContex // old way, and a leg's hold then spends its first 8 frames turning // (pokefirered PlayerTurnInPlace(), a fast walk in place): a one-tile // hold only turns the player, with nothing to show it (console B, -// 2026-11-09, 00.28 run 2: the step north onto Rock Tunnel B1F row 34). +// 2026-11-09, 08.01 run 2: the step north onto Rock Tunnel B1F row 34). // A facing that can't be read is taken as turned: a tap while facing the // way already would take a step. void turn_to(ConsoleHandle& console, ProControllerContext& context, Direction direction); diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldLateBattle_Tests.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldLateBattle_Tests.cpp index d6b6b4e46b..895d809f79 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldLateBattle_Tests.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldLateBattle_Tests.cpp @@ -112,7 +112,7 @@ std::string bound_text(const std::optional& bound){ return bound ? std::format("{} to {}", bound->min, bound->max) : std::string("no bound"); } -// Console B, FRLG 00.27 run 2, 2026-11-09 (~/FRLGLab/captures/ +// Console B, FRLG 07.02 run 2, 2026-11-09 (~/FRLGLab/captures/ // 2026-11-09-0027-route10-legs.log): on the open leg "east 11" across // Route 10, wild battles (Voltorb) showed only after the hold. The walker // took the player to be anywhere on the leg ("stopped 0 to 11 tiles in") @@ -120,7 +120,7 @@ std::string bound_text(const std::optional& bound){ // the leg crosses Route 10's grass on row 10, the battle's flashes are // missed, its text box ("Wild appeared!") shows // LATE_WILD_BATTLE_DELAY after its step and its HP boxes 800 ms after -// that, as in Mt. Moon (console B, 2026-11-03, row 00.13). After running, +// that, as in Mt. Moon (console B, 2026-11-03, row 04.05). After running, // the walker must bound the player to a few tiles around the battle's. class Test_OverworldLateBattle : public UnitTest{ public: diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldMaps_Tests.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldMaps_Tests.cpp index 07970fdc8b..cbd71d09a3 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldMaps_Tests.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldMaps_Tests.cpp @@ -592,7 +592,7 @@ UnitTestResult check_found_again(const std::vector& maps, const MapPosi return true; } -// 00.11's way from Pewter into Route 3 and 00.12's over Route 3 and 4. +// 04.01's way from Pewter into Route 3 and 04.02's over Route 3 and 4. UnitTestResult test_found_again_route3_route4(){ const std::vector maps = overworld_maps(); const UnitTestResult into_route3 = check_found_again(maps, {"PewterCity", {17, 26}}, {"Route3", {13, 8}}); @@ -618,7 +618,7 @@ UnitTestResult test_trainer_stops(){ }; const Case cases[] = { { - .name = "Route 3, Lass Robin, east along row 9 (00.12)", + .name = "Route 3, Lass Robin, east along row 9 (04.02)", .start = {"Route3", {36, 9}}, .direction = Direction::EAST, .tiles = 11, .to_wall = true, .player = {"Route3", {40, 9}}, .trainer = {"Route3", {40, 10}}, }, diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldRecovery.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldRecovery.cpp index a9fbb05920..b4b0b362d3 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldRecovery.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldRecovery.cpp @@ -63,7 +63,7 @@ int sight_onto(const std::vector& maps, const MapPosition& tile){ // How far the holds that find the player after an open leg, and the way // back, may walk, per tile of the leg. 2 left Rocket Hideout B3F's "west // 7" off the stairs unchecked: the hold to its west wall and back walk up -// to 18, and the leg ended short (00.31 r1, console B, 2026-11-10). Route +// to 18, and the leg ended short (09.01 r1, console B, 2026-11-10). Route // 1's "west 4", whose holds walk 30, stays unchecked. constexpr int OPEN_LEG_CHECK_TILES_PER_TILE = 3; @@ -87,7 +87,7 @@ bool is_wall_hold(const RouteStep& next){ // misses the arrow, or walks onto another, and ends elsewhere in the maze: // "south 2" before Rocket Hideout B3F's "east 2" onto the arrow (3, 16) // ended a tile short, the east leg walked into a wall, and the walk after -// it slid up to (10, 13) (00.31 r1 run 3, console B, 2026-11-10). +// it slid up to (10, 13) (09.01 r1 run 3, console B, 2026-11-10). bool is_slide(const RouteStep& next){ return next.action == RouteAction::WALK && next.spin_tiles && !next.warps; } diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldRecoveryWalk.h b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldRecoveryWalk.h index a65eca8c20..f119a51436 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldRecoveryWalk.h +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldRecoveryWalk.h @@ -38,7 +38,7 @@ constexpr double WALL_TAP_MOVED_RMSD = 20.0; // How much a counted tap scrolled the map: the largest RMSD between `before` // and `after` over the four edge quarters (top, bottom, left, right) of // `game`, all clear of the player in the middle. One band alone misses a -// step over a floor that repeats every tile (Rocket Hideout B3F, 00.32): a +// step over a floor that repeats every tile (Rocket Hideout B3F, 09.02): a // one-tile scroll leaves the band nearly the same. double tap_scroll_change(const ImageViewRGB32& before, const ImageViewRGB32& after, const ImageFloatBox& game); diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldRouteSteps.h b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldRouteSteps.h index 7bff035849..bb82a42efd 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldRouteSteps.h +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldRouteSteps.h @@ -63,7 +63,7 @@ struct RouteStep{ // WALK on foot: walked a tap at a time, each a tile, and each checked // to have moved (count_step_taps()), as through the hideout's arrow // floors, where a hold that ends a tile off slides the player - // elsewhere (console B, 2026-11-10, 00.31 r1). + // elsewhere (console B, 2026-11-10, 09.01 r1). bool tapped = false; // WALK, SURF: a wild Pokemon can appear on the way: the step crosses // tall grass or water. Elsewhere (indoors, streets) no wild battle can @@ -72,13 +72,13 @@ struct RouteStep{ // WALK: the steps (from 1) onto a connected map. The game holds the // player up a tile before each while it loads the map: a hold timed // by the tiles alone ended a tile short (console B, 2026-11-03, rows - // 00.14, 00.16 and 00.20). + // 04.06, 05.05 and 05.09). std::vector connection_steps = {}; // WALK onto a warp: how many tiles further the player may stand from // it than planned, which the hold goes on for, stopping at the fade. // An open leg over a map connection before it may end a tile further // on, when the game doesn't hold the player up there (console B, - // 2026-11-03, row 00.24). Set by with_warp_slack() when a route runs. + // 2026-11-03, row 06.03). Set by with_warp_slack() when a route runs. int warp_slack = 0; // Which way the player faces after the step. Arriving at a door or a // cave mouth, the game walks the player a tile out, facing south. diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSim.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSim.cpp index 5641773380..ba2eca4850 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSim.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSim.cpp @@ -499,7 +499,7 @@ void OverworldSim::take_steps(Direction direction, Milliseconds pressed, Millise if (m_script.connections_stall && step->map != m_map && !step->warped){ // The step onto a connected map waits a tile while the game // loads it: a hold timed by its tiles alone ended a tile short - // (console B, 2026-11-03, rows 00.14, 00.16 and 00.20). + // (console B, 2026-11-03, rows 04.06, 05.05 and 05.09). pressed += tile; if (pressed >= end){ return; diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSim.h b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSim.h index 4946e27117..a088708313 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSim.h +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSim.h @@ -251,20 +251,20 @@ struct SimWalkerRules{ // A leg onto a warp whose fade was a wild battle's (its wipe passes for // the fade) stops before the warp, and the player is found again on it. // Without it the walker stopped as off the route (console B, - // 2026-11-03, Mt. Moon 1F, row 00.13). + // 2026-11-03, Mt. Moon 1F, row 04.05). bool find_player_after_warp_battle = true; // After a leg's watch saw nothing, a battle's text box on screen (its // HP boxes still to come) is watched on for, and the leg taken as // stopped part-way. Without it the walker took "south 15 (to wall)" // as walked and the next leg into the battle (console B, 2026-11-03, - // Mt. Moon B1F, row 00.13). + // Mt. Moon B1F, row 04.05). bool watch_on_for_unseen_battle = true; // The same after a leg the maps see no wild tiles on (RouteStep::wild), // which the leg and its watch don't watch for battles: on Mt. Moon // B2F's tiles closed on one side, which the maps don't mark as wild, a // battle on "east 7 (to wall)" left black after the leg, the leg was // taken as walked and the next one held from where the battle was - // (console B, 2026-11-03, row 00.13). + // (console B, 2026-11-03, row 04.05). bool watch_on_after_unmarked_leg = true; // Before a step, a battle on its way (its text box or wipe) is watched // on for, and the step before it taken as stopped part-way, not the @@ -273,29 +273,29 @@ struct SimWalkerRules{ // A hold over a step onto a connected map is a tile longer for it // (RouteStep::connection_steps). Without it the open leg north from // Cerulean City onto Nugget Bridge ended a tile short (console B, - // 2026-11-03, rows 00.16 and 00.20). + // 2026-11-03, rows 05.05 and 05.09). bool hold_over_connections = true; // An open leg after whose hold a wild battle was seen is placed by the // battle's first timed screen event (place_late_stop()). Without it the // player may be anywhere on the leg: on Route 10, "east 11" was found - // again from all 12 of its tiles (console B, 2026-11-09, 00.27 run 2). + // again from all 12 of its tiles (console B, 2026-11-09, 07.02 run 2). bool place_late_battle = true; // The watch for a warp's fade starts with the hold onto the warp // (Pokemon::WatchAlong), not when it ends. Without it a fade over // before the hold ended was missed, and the walk stopped on "no fade in // and out after walking onto the warp" though it had warped (console B, - // 2026-11-09 01:41, 00.27, the warp to CeruleanCity: the watch started + // 2026-11-09 01:41, 07.02, the warp to CeruleanCity: the watch started // about 1.3 s into the hold). bool watch_fade_along_hold = true; // A warp's fade is taken as the warp only once the screen after it // shows the player off the map they held from (warp_left_scene()). // Without it a black that cleared with the player where they were was - // taken as the warp (console B, 2026-11-10 01:44, 00.31 run 4). + // taken as the warp (console B, 2026-11-10 01:44, 09.01 run 4). bool confirm_warp_destination = true; // A turn tap is checked by the facing on screen, and tapped again // while the player faces another way (OverworldWalkSteps::turn_to()). // Without it a dropped tap left a one-tile leg turning the player - // only, taken as walked (console B, 2026-11-09, 00.28 run 2). + // only, taken as walked (console B, 2026-11-09, 08.01 run 2). bool confirm_turn = true; // The speed the walker goes at: its turn taps // (OverworldWalkSteps::turns_first()) and its holds' tile time. @@ -304,7 +304,7 @@ struct SimWalkerRules{ // tile (count_bike_taps()), and one that doesn't move finds the player // ahead of a block. Without it the leg is one hold, and a start off // along the leg ends it off with nothing to show it (console B, - // 2026-11-09, 00.30: three runs 3 tiles east after Route 8's legs). + // 2026-11-09, 08.03: three runs 3 tiles east after Route 8's legs). bool count_bike_taps = true; // How far apart, start to start, the counted taps are // (MovementMechanics::BIKE_TAP_PERIOD). @@ -316,14 +316,14 @@ struct SimWalkerRules{ // A dark cave's overworld isn't a battle on its way // (OverworldWalkSteps::dark_cave_screen()). Without it the check // before each step watched for a battle on it (console B, 2026-11-09, - // 00.28: "running from a wild Pokemon", then "not a battle"). + // 08.01: "running from a wild Pokemon", then "not a battle"). bool dark_cave_not_battle = true; // A stop on an open leg that started in a dark cave may be anywhere on // the leg (whole_leg()). Without it the stop is placed by the dark // screen's black, read as the battle at the hold's start: a battle at // the end of "east 12" on Rock Tunnel B1F was placed 0 to 3 tiles in, // and the player was found again at a wall 5 tiles off (console B, - // 2026-11-09, 00.28). + // 2026-11-09, 08.01). bool whole_leg_in_dark = true; // The end of a trainer's battle the walker fought, as the story's // battle loop takes it on the screen the sim shows after it: its diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSimState.h b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSimState.h index 49a90add87..a12583e459 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSimState.h +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSimState.h @@ -40,8 +40,8 @@ struct SimScript{ std::set wild_floor_maps; // Whether the game holds the player up a tile on a step onto a // connected map. It did north onto Nugget Bridge (console B, - // 2026-11-03, rows 00.16 and 00.20), not south from Route 6 into - // Vermilion City (row 00.24). + // 2026-11-03, rows 05.05 and 05.09), not south from Route 6 into + // Vermilion City (row 06.03). bool connections_stall = true; // Wild battles at the game's own odds instead of `encounters`, on the // maps named here, with their land encounter rate (pokefirered @@ -52,18 +52,18 @@ struct SimScript{ // the game misses, by number from 1; the player goes on facing the old // way. The game drops none from a standstill (MovementMechanics: 70 of // 70 turned); these test the walker's check of the turn - // (SimWalkerRules::confirm_turn) after 00.28 run 2 (console B, + // (SimWalkerRules::confirm_turn) after 08.01 run 2 (console B, // 2026-11-09), where a one-tile leg only turned the player. std::set dropped_turn_taps; // Fault injection: steps onto a warp, by number from 1, that show the // fade's black and clear with the player where they were, not warped - // (console B, 2026-11-10 01:44, 00.31 run 4, "east 1 (warp)" on B4F). + // (console B, 2026-11-10 01:44, 09.01 run 4, "east 1 (warp)" on B4F). std::set black_without_warp; // The player rides the Bicycle: a tap facing another way takes a step // too, a hold through a turn loses no tile // (MovementMechanics::BIKE_TAP_ONLY_TURNS), and no step tap is // ignored: a 40ms turn tap and a 56ms hold 340ms after it took two - // tiles (console B, 2026-11-09, 00.30). At the start: SELECT gets on + // tiles (console B, 2026-11-09, 08.03). At the start: SELECT gets on // and off (OverworldSim::press_select()), a warp gets off. Each tap is // a tile; one in MovementMechanics::BIKE_FAST_TAP_DROP_EVERY of those // that start sooner than BIKE_TAP_DROP_PERIOD after the last is @@ -75,7 +75,7 @@ struct SimScript{ // Caves dark without Flash (Rock Tunnel): the overworld is black but // for a lit circle on the player, which the walker's battle text box // check and screen observer read as a battle on its way (console B, - // 2026-11-09, 00.28), unless SimWalkerRules::dark_cave_not_battle. + // 2026-11-09, 08.01), unless SimWalkerRules::dark_cave_not_battle. std::set dark_maps; // A lift's map, and where its door lets the player out for each floor // on its panel's menu, top first (pokefirered setdynamicwarp in diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSim_Tests.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSim_Tests.cpp index bcba68da11..07683de8c7 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSim_Tests.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSim_Tests.cpp @@ -292,7 +292,7 @@ UnitTestResult test_forest_north_gate(){ return true; } -// Console B, 2026-11-03, Mt. Moon 1F (row 00.13): a wild battle whose +// Console B, 2026-11-03, Mt. Moon 1F (row 04.05): a wild battle whose // flashes were missed started on the leg south onto the ladder; its wipe // passed for the ladder's fade, and the walker stopped as off the route, // on the leg a tile short of the ladder. Here on the leg through the @@ -521,7 +521,7 @@ UnitTestResult test_mart_exit(){ return true; } -// Mt. Moon (story row 00.13): every floor tile has wild encounters, and +// Mt. Moon (story row 04.05): every floor tile has wild encounters, and // the floors join by ladders taken on stepping onto them. From the Moon // Stone (3, 2) on 1F down to the foot of B2F's ladder: two ladders, each // a fade. @@ -535,7 +535,7 @@ UnitTestResult test_mt_moon_ladders(){ } // The Moon Stone's ball (3, 2) on Mt. Moon 1F is a short way off the way -// down: from (11, 3), where 00.13's walk up column 11 ends, to face it +// down: from (11, 3), where 04.05's walk up column 11 ends, to face it // and then on to B1F costs a few tiles more than going straight, and // both walks end where they were planned to. UnitTestResult test_moon_stone_detour(){ @@ -566,7 +566,7 @@ UnitTestResult test_moon_stone_detour(){ } // Mt. Moon B2F: the Grunt at (37, 21) looks around (sight 3) over the -// only way east. 00.13 crosses his room on legs to walls; the sim's +// only way east. 04.05 crosses his room on legs to walls; the sim's // trainers see every way they may look, so he sees the player on // (37, 22), is fought, and the leg is held on to its wall. UnitTestResult test_mt_moon_grunt_mid_leg(){ @@ -584,7 +584,7 @@ UnitTestResult test_mt_moon_grunt_mid_leg(){ return true; } -// Mt. Moon B2F: 00.13's open leg east along the bottom row, (8, 38) to +// Mt. Moon B2F: 04.05's open leg east along the bottom row, (8, 38) to // (11, 38), ends a tile short with nothing on screen. The hold north // after it would end on (10, 21), a column west of the Grunt's line the // table steps into from (11, 21): the walker finds the player at walls @@ -622,7 +622,7 @@ UnitTestResult test_mt_moon_late_battle(){ return true; } -// Console B, 2026-11-03 (row 00.13, b2f_ladder_foot): a wild battle whose +// Console B, 2026-11-03 (row 04.05, b2f_ladder_foot): a wild battle whose // flashes were missed started on "south 3 (warp)" from (5, 3) to 1F's // ladder; its wipe passed for the ladder's fade, and the walker stopped as // off the route, with the player on (5, 5). A battle on the leg's first or @@ -650,7 +650,7 @@ UnitTestResult test_mt_moon_battle_on_ladder_leg(){ return true; } -// Console B, 2026-11-03 (row 00.13, b2f_ladder_foot): on B1F a wild +// Console B, 2026-11-03 (row 04.05, b2f_ladder_foot): on B1F a wild // battle started part-way down "south 15 (to wall)" from (3, 3), with its // flashes missed. Its HP boxes came over 5 s after the step, after the // leg's watch had ended on the battle's empty text box: the leg was taken @@ -689,7 +689,7 @@ UnitTestResult test_mt_moon_battle_seen_after_wall_leg(){ return true; } -// Console B, 2026-11-03 (row 00.13, b2f_south): on Mt. Moon B2F a wild +// Console B, 2026-11-03 (row 04.05, b2f_south): on Mt. Moon B2F a wild // battle started on the first step of "east 7 (to wall)" from (39, 14), // along tiles closed on their north side, which the maps didn't mark as // wild then: the leg watched only for messages, and the screen was black @@ -791,7 +791,7 @@ UnitTestResult test_mt_moon_way_out(){ return true; } -// Story row 00.14: from Route 4 east of Mt. Moon along the upper road to +// Story row 04.06: from Route 4 east of Mt. Moon along the upper road to // above the ledge row 9, out of Lass Crissy's line (75, 3); one step // south hops the ledge onto the lower road two tiles down; from there // into Cerulean City and its Pokemon Center by one door. No route plans @@ -816,7 +816,7 @@ UnitTestResult test_route4_to_cerulean(){ return true; } -// Story rows 00.14b and 00.14c in Cerulean Gym (pokefirered map.json): +// Story rows 05.01 and 05.02 in Cerulean Gym (pokefirered map.json): // from the Center into the Gym, up column 9 to (9, 13), west to (4, 13), // then to walls round the pool's west and north sides and west to (9, 7) // below Misty's platform, meeting no one; and back from beside her (9, 6) @@ -865,7 +865,7 @@ UnitTestResult test_cerulean_gym_walks(){ return true; } -// The straight ways in Cerulean Gym that 00.14b and 00.14c keep off: the +// The straight ways in Cerulean Gym that 05.01 and 05.02 keep off: the // step onto (9, 12) meets Swimmer Luis, and the step onto (8, 7), // misty_front, Picnicker Diana. UnitTestResult test_cerulean_gym_lines(){ @@ -889,7 +889,7 @@ UnitTestResult test_cerulean_gym_lines(){ return true; } -// Story rows 00.15 and 00.16: out of Cerulean's Pokemon Center by its mat +// Story rows 05.03 and 05.05: out of Cerulean's Pokemon Center by its mat // to below the rival's trigger row, and on north across the city's edge // onto Nugget Bridge, below Cale's row, meeting no one. UnitTestResult test_cerulean_to_bridge(){ @@ -904,7 +904,7 @@ UnitTestResult test_cerulean_to_bridge(){ return true; } -// Story row 00.16 up Nugget Bridge: the short legs between the five +// Story row 05.05 up Nugget Bridge: the short legs between the five // trainers' rows meet no one; and the step from the tile below each row // onto it is in that trainer's sight, beside them, so they fight there // without walking: Cale, Ali, Timmy, Reli and Ethan. @@ -934,7 +934,7 @@ UnitTestResult test_nugget_bridge_legs(){ -// Story row 00.24 from Route 6 to Vermilion City's nurse: the open leg +// Story row 06.03 from Route 6 to Vermilion City's nurse: the open leg // south 14 crosses onto Vermilion City and is held a tile longer for the // game holding the player up there. It didn't: the player ended a tile // south of (23, 7), the leg west on (15, 8), and the north 1 onto the diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSpin_Tests.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSpin_Tests.cpp index 433eb39443..25e5fd55c5 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSpin_Tests.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldSpin_Tests.cpp @@ -193,7 +193,7 @@ UnitTestResult test_sim_walker_walks_slide(){ } -// 00.31 r1 (console B, 2026-11-10), Rocket Hideout B3F: off the stairs from +// 09.01 r1 (console B, 2026-11-10), Rocket Hideout B3F: off the stairs from // B2F, the open leg west along the top corridor ended short, so the hold // south to the wall stayed in the corridor, and the legs through the // spinners after it all ran there: the walk ended a few tiles west of the @@ -224,7 +224,7 @@ UnitTestResult test_short_leg_off_hideout_stairs(){ } -// 00.31 r1 run 3 (console B, 2026-11-10), Rocket Hideout B3F: "south 2" +// 09.01 r1 run 3 (console B, 2026-11-10), Rocket Hideout B3F: "south 2" // from (1, 14), at the wall, ended a tile short at (1, 15) with nothing // seen. "east 2", meant to step onto the arrow (3, 16), walked into the // wall east of (1, 15); the position check after the next leg took that diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldWalk.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldWalk.cpp index 9af689c1cd..e069a62f34 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldWalk.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldWalk.cpp @@ -385,7 +385,7 @@ void wait_out_fade(ConsoleHandle& console, ProControllerContext& context, const } // namespace // A black screen that clears with the player where they were is no warp -// (console B, 2026-11-10 01:44, 00.31 run 4: "east 1 (warp)" was taken as +// (console B, 2026-11-10 01:44, 09.01 run 4: "east 1 (warp)" was taken as // walked while the player stayed on B4F). void wait_out_warp( ConsoleHandle& console, ProControllerContext& context, const RouteStep& step, @@ -461,7 +461,7 @@ void clear_open_message( // the watch after "south 15 (to wall)" ended on the box still empty, the // leg was taken as walked to its wall, and the next leg was walked into // the battle, 5 tiles short of where it was planned from (console B, -// 2026-11-03, row 00.13). +// 2026-11-03, row 04.05). namespace{ // What on screen shows a wild battle on its way: its text box, or the diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldWalkBattles.h b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldWalkBattles.h index d870f6fa60..cd6ac0e11b 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldWalkBattles.h +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldWalkBattles.h @@ -31,7 +31,7 @@ namespace OverworldWalkSteps{ // the maps see no wild tiles (RouteStep::wild): they miss some. Mt. Moon // B2F's tiles closed on one side are cave floor too, and a battle on // "east 7 (to wall)" there left the screen black after the leg, which -// was taken as walked (console B, 2026-11-03, row 00.13). +// was taken as walked (console B, 2026-11-03, row 04.05). size_t clear_unseen_battle( ConsoleHandle& console, ProControllerContext& context, const OverworldInterrupts& wild, const RouteStep& step @@ -53,7 +53,7 @@ bool run_from_battle_after_warp(ConsoleHandle& console, ProControllerContext& co // Whether `screen` is the overworld of a cave dark without Flash (Rock // Tunnel): black around a lit circle on the player in the middle. The // battle text box detector and the black screen check read its black as -// a battle on its way (console B, 2026-11-09, 00.28: the check before +// a battle on its way (console B, 2026-11-09, 08.01: the check before // each step ran a 15 s battle loop on it, "not a battle", and an open // leg's stop was placed by it 0 to 3 tiles in, where the battle came at // the leg's end). A battle's wipe is black in the middle too; its text diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldWalkWatches.h b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldWalkWatches.h index bd3c02e119..876eefacd1 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldWalkWatches.h +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldWalkWatches.h @@ -47,7 +47,7 @@ inline constexpr Milliseconds AFTER_WILD_LEG_WATCH(3500); // After a leg's watch saw nothing, but the screen shows a battle on its // way: how long to watch on for its HP boxes. In Mt. Moon they came over // 5s after the step that set the battle off, after the watch had ended on -// the battle's empty text box (console B, 2026-11-03, row 00.13). +// the battle's empty text box (console B, 2026-11-03, row 04.05). inline constexpr Milliseconds UNSEEN_BATTLE_WATCH(5000); // How long clear_open_message() watches for the message it saw. inline constexpr Milliseconds OPEN_MESSAGE_WATCH(1000); diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldWalk_Tests.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldWalk_Tests.cpp index 16c66be336..a3b5748f51 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldWalk_Tests.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldWalk_Tests.cpp @@ -155,7 +155,7 @@ struct TurnTapCase{ const MapPosition TURN_START{"ViridianForest", {13, 28}}; const MapPosition TURN_END{"ViridianForest", {12, 28}}; -// Console B, 2026-11-09 (00.28 run 2): the game missed the turn tap before +// Console B, 2026-11-09 (08.01 run 2): the game missed the turn tap before // a one-tile open leg, the leg's hold only turned the player, and the leg // was taken as walked. On the sim, a leg west 1 for a player facing north. class Test_OverworldTurnTap : public UnitTest{ @@ -202,7 +202,7 @@ const TurnTapCase TURN_TAP_CASES[] = { {.input = {.name = "dropped, tapped again", .dropped_turn_taps = {1}}, .expectation = {.end = TURN_END}}, {.input = {.name = "dropped twice, tapped again", .dropped_turn_taps = {1, 2}}, .expectation = {.end = TURN_END}}, {.input = {.name = "dropped, not checked: the leg only turns", .dropped_turn_taps = {1}, .confirm_turn = false}, .expectation = {.end = TURN_START}}, - // Console B, 2026-11-09 (00.30): on the Bicycle the turn tap took a + // Console B, 2026-11-09 (08.03): on the Bicycle the turn tap took a // step, each one-tile leg went two, and the walk to Route 8 ended on // Route 12. {.input = {.name = "on the bike, no turn tap", .on_bike = true}, .expectation = {.end = TURN_END}}, diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldWalkedTiles.h b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldWalkedTiles.h index 0f4223164d..2c23ed7c0c 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldWalkedTiles.h +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldWalkedTiles.h @@ -43,7 +43,7 @@ WalkedTiles walked_near(const RouteStep& step, int estimate, Milliseconds tile_t // there, which it doesn't always do: south from Route 6 into Vermilion // City it didn't, the player ended a tile further south, and the north 1 // onto the Pokemon Center's door stopped below it (console B, 2026-11-03, -// row 00.24). Until a leg to a wall that way or a warp places the player +// row 06.03). Until a leg to a wall that way or a warp places the player // again, they may stand a tile further on; a warp walked back that way is // held a tile further for it. std::vector with_warp_slack(std::vector route); @@ -55,7 +55,7 @@ WalkedTiles whole_leg(const RouteStep& step); // cave's screen (OverworldWalkSteps::dark_cave_screen()). There the timing // has no basis: the screen is black before any battle's wipe, and a // battle at the end of "east 12" on Rock Tunnel B1F was placed 0 to 3 -// tiles in (console B, 2026-11-09, 00.28). The player, "found again" at +// tiles in (console B, 2026-11-09, 08.01). The player, "found again" at // a wall from those, was 5 tiles off. WalkedTiles stop_tiles(const RouteStep& step, WalkedTiles timed, bool dark); diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldWarpFade_Tests.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldWarpFade_Tests.cpp index dbaa49462c..30f666859b 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldWarpFade_Tests.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Overworld/PokemonFRLG_OverworldWarpFade_Tests.cpp @@ -57,7 +57,7 @@ const MapPosition MART{"ViridianCity_Mart", {4, 3}}; // Where the Mart's exit mat, (4, 7), puts the player. const MapPosition OUTSIDE{"ViridianCity", {36, 20}}; -// 00.27 (console B, 2026-11-09 01:41), the warp to CeruleanCity: "no fade +// 07.02 (console B, 2026-11-09 01:41), the warp to CeruleanCity: "no fade // in and out after walking onto the warp", the watch for the fade having // started about 1.3 s into the hold, after the fade was over. Here the // walk out of Viridian Mart, south 5 onto its mat, is held as to a wall, @@ -126,7 +126,7 @@ const WarpFadeCase WARP_FADE_CASES[] = { .expectation = {.failure = "the warp to ViridianCity not confirmed", .warps = 0}, }, { - // 00.31 run 4 (console B, 2026-11-10 01:44): taken as walked. + // 09.01 run 4 (console B, 2026-11-10 01:44): taken as walked. .input = {.name = "black without a warp, any black taken as the warp", .fade = 1000ms, .black_without_warp = {1}, .confirm_destination = false}, .expectation = {.failure = "", .warps = 0}, }, diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/Data/Json_Tests.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/Data/Json_Tests.cpp index d8badf0286..d8a3bccffc 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/Data/Json_Tests.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/Data/Json_Tests.cpp @@ -32,8 +32,8 @@ struct ExportCase{ }; const ExportCase CASES[] = { - {.input = {.id = "00.05"}, .expectation = {.menu = "before_pokedex"}}, - {.input = {.id = "00.05", .custom = true}, .expectation = { + {.input = {.id = "02.01"}, .expectation = {.menu = "before_pokedex"}}, + {.input = {.id = "02.01", .custom = true}, .expectation = { .menu = "full", .native_json = R"({"menu":"full","supplies":{"potions":2,"antidotes":3,"parlyz_heals":4,"pocket":["antidote",""],"status":"PSN","hurt":true,"hp_red":true,"hp_fill":0.25,"lead":{"species":"wartortle","moves":[{"move":"bite","pp":0}],"moves_through_level":18,"moves_read":true,"level":19,"stats":{"hp":50,"attack":20,"defense":30,"sp_attack":40,"sp_defense":35,"speed":25}},"protected_slots":[0,2],"foes":["staryu"],"trainer":"misty","risk":"high","foe_out":"staryu","wild_foes":["pidgey"]}})" }}, diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStory.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStory.cpp index 58f0cef9cd..0e68163a75 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStory.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStory.cpp @@ -58,8 +58,8 @@ std::unique_ptr AutoStory_Descriptor::make_stats() const{ namespace{ -// The start and end dropdowns' entries: the table's checkpoints, 00.01 to -// 00.12b. The options hold a reference to it. +// The start and end dropdowns' entries: the table's checkpoints, 01.01 to +// 04.03. The options hold a reference to it. const StringSelectDatabase& checkpoint_database(){ static const std::vector labels = []{ std::vector result; @@ -82,37 +82,37 @@ const std::string KEEP_START_FRAME_TEXT = const std::string RUN_STARTER_RNG_TEXT = "Run Starter RNG in AutoStory:
Off by default. Instead of stopping for them, run SID Helper's steps on the " "new game's keyboard when the RNG plan has no SID, and Starter RNG's attempts from a save south of the table at the " - "end of 00.04, as the RNG plan lists them. A shiny Squirtle goes on to the rival's battle, saves after it and the run " + "end of 01.05, as the RNG plan lists them. A shiny Squirtle goes on to the rival's battle, saves after it and the run " "goes on; otherwise the run stops with the save south of the table.
" "SID Helper's timing needs the text speed and button settings already saved, as with Stop for SID Helper."; const std::string RUN_GIFT_RNG_TEXT = - "Run Gift RNG in AutoStory:
Off by default. After 00.12 saves beside the Magikarp salesman in Route 4's " + "Run Gift RNG in AutoStory:
Off by default. After 04.02 saves beside the Magikarp salesman in Route 4's " "Pokemon Center, run Gift RNG's attempts for the Magikarp from that save, as the RNG plan lists them for its TID and " - "SID (set by Run Starter RNG in AutoStory, or typed in). A shiny Magikarp is saved there (00.12b) and the run goes " + "SID (set by Run Starter RNG in AutoStory, or typed in). A shiny Magikarp is saved there (04.03) and the run goes " "on; otherwise the run stops with the save beside the salesman.
" - "To try again from that save, start at 00.12b with this on: it loads the save and runs the attempts first. " - "After Gift RNG run by hand, start at 00.12b with this off.
" + "To try again from that save, start at 04.03 with this on: it loads the save and runs the attempts first. " + "After Gift RNG run by hand, start at 04.03 with this off.
" "English only. The Magikarp costs 500 and needs a free party slot; AutoStory's options leave the text fast."; AutoStory::AutoStory() : RUN(checkpoint_database(), Pokemon::FireRedLeafGreenLanguages_Database()) , NEW_GAME_FROM_TITLE( "New game from the title screen:
The game is on its title screen with no save data. " - "Needed to start at 00.01. Otherwise the program loads the save, which must be the one the start checkpoint begins from.", + "Needed to start at 01.01. Otherwise the program loads the save, which must be the one the start checkpoint begins from.", LockMode::LOCK_WHILE_RUNNING, true ) , PLAYER_NAME( false, - "Player name:
Typed on the new game's keyboard (00.01). Empty keeps the game's default name. " + "Player name:
Typed on the new game's keyboard (01.01). Empty keeps the game's default name. " "The rival always keeps the default name.", LockMode::LOCK_WHILE_RUNNING, "Kosmos", "" ) , STOP_FOR_SID_HELPER( - "Stop for SID Helper:
Off by default. At 00.01, stop on the player's keyboard with the name typed and OK not pressed, " - "where the SID Helper program starts. After SID Helper, start AutoStory at 00.01b, with the game as SID Helper left it " + "Stop for SID Helper:
Off by default. At 01.01, stop on the player's keyboard with the name typed and OK not pressed, " + "where the SID Helper program starts. After SID Helper, start AutoStory at 01.02, with the game as SID Helper left it " "(the Trainer Card, or HOME): it closes the card, sets the options and saves in the bedroom.
" "SID Helper needs the text speed and button settings already saved. On a cartridge with that save, choose NEW GAME " "by hand and start AutoStory on the first message.", @@ -120,10 +120,10 @@ AutoStory::AutoStory() false ) , STOP_FOR_STARTER_RNG( - "Stop for Starter RNG:
Off by default. At the end of 00.04, save south of the table facing Squirtle's ball " + "Stop for Starter RNG:
Off by default. At the end of 01.05, save south of the table facing Squirtle's ball " "and stop, where the Starter RNG program starts. After Starter RNG, save right after the rival's battle without moving " - "and start AutoStory at 00.05, listing the targets to try from the RNG plan.
" - "With this off, 00.04 and 00.04b run as one checkpoint, as before.", + "and start AutoStory at 02.01, listing the targets to try from the RNG plan.
" + "With this off, 01.05 and 01.06 run as one checkpoint, as before.", LockMode::LOCK_WHILE_RUNNING, false ) @@ -149,7 +149,7 @@ AutoStory::AutoStory() // The save loaded must be the one checkpoint `first` starts from: one left // by an earlier checkpoint (a run that failed before saving) would start -// it in the wrong place (console B, 2026-11-01: 00.09 on the forest's +// it in the wrong place (console B, 2026-11-01: 03.02 on the forest's // save). Checked on the SAVE card; a card that can't be read is let pass. static void check_start_save( SingleSwitchProgramEnvironment& env, StoryEnv& story, const StoryCheckpoint& checkpoint @@ -199,7 +199,7 @@ Pokemon::SegmentHooks story_hooks(SingleSwitchProgramEnvironment& env, StoryEnv& } // The save reloaded must be where the checkpoint starts: a save // that didn't happen leaves an older one (console B, 2026-11-02: - // 00.02 walked the bedroom's route in Pewter City). + // 01.03 walked the bedroom's route in Pewter City). try{ soft_reset(story.console, story.context); const std::string error = check_save_place(story, story.start_map); @@ -292,7 +292,7 @@ static void check_setup( throw UserSetupError(console, "The start checkpoint must not come after the end checkpoint."); } if (first == 0 && !new_game_from_title){ - throw UserSetupError(console, "Checkpoint 00.01 starts a new game: start on the title screen with no save."); + throw UserSetupError(console, "Checkpoint 01.01 starts a new game: start on the title screen with no save."); } if (first == 0){ check_player_name(console, player_name); @@ -361,7 +361,7 @@ static void stop_for_sid_helper( play_new_game_to_player_name(env.console, context, player_name); stop_for_handoff(env, notification, "Stopped for SID Helper: the player's name is typed and OK is not pressed. Run SID Helper now, " - "enter its Target Advances and # Candidate SIDs in the RNG plan, then start AutoStory at 00.01b." + "enter its Target Advances and # Candidate SIDs in the RNG plan, then start AutoStory at 01.02." ); } @@ -434,7 +434,7 @@ static void stop_for_starter_rng( "Run Starter RNG (Squirtle, FireRed, Sound " + sound + ") with attempt 1's Target Seed and Advances. " "If it hits the target and it isn't shiny, load this save and run the next attempt. If it is shiny, " "its SID is the one listed (or one of them): enter it as the RNG plan's SID. " - "Then save right after the rival's battle, without moving, and start AutoStory at 00.05.", + "Then save right after the rival's battle, without moving, and start AutoStory at 02.01.", attempts ); } @@ -472,7 +472,7 @@ static void run_story_rows( // SID Helper's steps in the program, from the player's keyboard: the name // typed, then the intro at SID Helper's timing into the bedroom, and the -// Trainer Card opened to read the TID. Ends on the card, where 00.01b +// Trainer Card opened to read the TID. Ends on the card, where 01.02 // starts. static void set_sid_in_program( SingleSwitchProgramEnvironment& env, ProControllerContext& context, @@ -491,7 +491,7 @@ static void set_sid_in_program( navigate_to_trainer_card(env.console, context); const std::optional tid = try_read_trainer_card_tid(env.console, context, language); if (!tid){ - env.console.log("Couldn't read the TID on the Trainer Card; 00.04 reads it again.", COLOR_ORANGE); + env.console.log("Couldn't read the TID on the Trainer Card; 01.05 reads it again.", COLOR_ORANGE); return; } env.console.log(rng_log_tid(*tid, true)); @@ -593,7 +593,7 @@ static bool run_gift_rng_in_program( } // After a shiny Squirtle: off its summary, and the rows to run next: the -// rival's battle, which saves (00.04b), and the rows after it to `last`. +// rival's battle, which saves (01.06), and the rows after it to `last`. // Until that save, a reload would load the save under the ball and lose // the shiny, so a failure stops the run instead. static StoryRunPlan after_shiny_starter( @@ -610,7 +610,7 @@ static StoryRunPlan after_shiny_starter( return plan; } -// After a shiny Magikarp: the rows to run next, from 00.12b, which leaves +// After a shiny Magikarp: the rows to run next, from 04.03, which leaves // its summary and saves, to `last`. Until that save, a failure stops the // run, as after a shiny Squirtle. static StoryRunPlan after_shiny_magikarp( @@ -638,8 +638,8 @@ static void send_story_finished( } StoryHandoffs AutoStory::story_handoffs() const{ - // Running Starter RNG here splits 00.04 at the ball as its stop does, - // and sets the SID at 00.01 when it isn't known. + // Running Starter RNG here splits 01.05 at the ball as its stop does, + // and sets the SID at 01.01 when it isn't known. return StoryHandoffs{ .sid_helper = RUN_STARTER_RNG ? static_cast(RNG_PLAN.SID).empty() : bool(STOP_FOR_SID_HELPER), .starter_rng = STOP_FOR_STARTER_RNG || RUN_STARTER_RNG, @@ -670,7 +670,7 @@ void AutoStory::program(SingleSwitchProgramEnvironment& env, ProControllerContex } if (plan.stop == StoryHandoff::SID_HELPER){ set_sid_in_program(env, context, player_name, RNG_PLAN, RUN.language()); - first = checkpoint_index(checkpoints, "00.01b"); + first = checkpoint_index(checkpoints, "01.02"); plan = plan_story_run(checkpoints, first, last, handoffs); } StoryEnv story = story_env(env, context, checkpoints[first], RUN.check_level(), KEEP_START_FRAME); diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStory.h b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStory.h index 03849904cc..b21f9ed433 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStory.h +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStory.h @@ -58,21 +58,21 @@ class AutoStory : public SingleSwitchProgramInstance{ SingleSwitchProgramEnvironment& env, ProControllerContext& context, StoryEnv& story, StoryExecutor& executor, StoryRunPlan plan ); - // After 00.04 saved under Squirtle's ball (row `ball_row`): the stop + // After 01.05 saved under Squirtle's ball (row `ball_row`): the stop // for Starter RNG, or its attempts run here. Returns the rows to run // after a shiny, or nothing once the run has stopped. std::optional after_starter_ball( SingleSwitchProgramEnvironment& env, ProControllerContext& context, StoryEnv& story, const StarterRngPlanned& planned, size_t ball_row ); - // Started at 00.12b (row `first`) with Run Gift RNG in AutoStory on, + // Started at 04.03 (row `first`) with Run Gift RNG in AutoStory on, // the save beside the salesman loaded: Gift RNG's attempts, then for a // shiny the rows after them. As run_story_plan() returns. std::optional run_from_gift_rng_save( SingleSwitchProgramEnvironment& env, ProControllerContext& context, StoryEnv& story, StoryExecutor& executor, size_t first ); - // After 00.12 saved beside the Magikarp salesman (row `salesman_row`): + // After 04.02 saved beside the Magikarp salesman (row `salesman_row`): // Gift RNG's attempts run here. Returns the rows to run after a shiny, // or nothing once the run has stopped. std::optional after_magikarp_salesman( @@ -91,7 +91,7 @@ class AutoStory : public SingleSwitchProgramInstance{ // Runs SID Helper's steps and Starter RNG's attempts in the program // instead of stopping for them. BooleanCheckBoxOption RUN_STARTER_RNG; - // Runs Gift RNG's attempts for the Magikarp in the program after 00.12. + // Runs Gift RNG's attempts for the Magikarp in the program after 04.02. BooleanCheckBoxOption RUN_GIFT_RNG; StarterRngPlanOptions RNG_PLAN; EventNotificationOption NOTIFICATION_SHINY; diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryBattleDecisions.h b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryBattleDecisions.h index ffb4ec5568..914d5cb826 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryBattleDecisions.h +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryBattleDecisions.h @@ -134,7 +134,7 @@ class EvolutionHold{ // safely!"), the text box with no HP box and no arrow or YES/NO, as // "What? is evolving!" shows through the animation; not a // dark cave's overworld, whose black reads as the text box (console B, - // 2026-11-09, 00.28 hiker_lenny: three holds, then a stop). Nothing + // 2026-11-09, 08.01 hiker_lenny: three holds, then a stop). Nothing // is pressed while it shows, for at most EVOLUTION_HOLDS in all in a // battle, in case it is something else. bool holds(const BattleTextScreen& screen) const; diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryCeladon_Tests.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryCeladon_Tests.cpp index c09b35a636..af222f36e8 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryCeladon_Tests.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryCeladon_Tests.cpp @@ -2,12 +2,12 @@ * * From: https://github.com/PokemonAutomation/ * - * Rows from 00.26 on (StoryData/frlg-00.26.plan.json and after) on the - * overworld sim: 00.26 from where 00.25 ends, to the Fan Club's chairman, + * Rows from 07.01 on (StoryData/frlg-07.01.plan.json and after) on the + * overworld sim: 07.01 from where 06.04 ends, to the Fan Club's chairman, * north past Route 6's trainers, through the tree into Cerulean, to the * Bike Shop's clerk, the Mart and the nurse, with Oak's aide on - * Vermilion's (25, 7); and what its Mart step buys. 00.27 from where - * 00.26 ends, east over Route 9 to Route 10's Pokemon Center. + * Vermilion's (25, 7); and what its Mart step buys. 07.02 from where + * 07.01 ends, east over Route 9 to Route 10's Pokemon Center. * */ @@ -100,9 +100,9 @@ MapData& map_named(std::vector& maps, const std::string& name){ throw InternalProgramError(nullptr, PA_CURRENT_FUNCTION, "No map " + name + "."); } -// The maps as 00.25 leaves them: story_maps() with Oak's aide on +// The maps as 06.04 leaves them: story_maps() with Oak's aide on // Vermilion's (25, 7), shown by Lt. Surge's win, and Route 6's Jeff -// beaten (00.21). Isabelle and Elijah are not. +// beaten (05.10). Isabelle and Elijah are not. std::vector maps_after_surge(){ const std::vector all = overworld_maps(); std::set flags = map_flag_set(all, "after_hall_of_fame"); @@ -157,23 +157,23 @@ UnitTestResult starts_where_ends(const std::string& previous, const std::string& return true; } -// 00.26 starts at Vermilion's nurse, where 00.25 ends. +// 07.01 starts at Vermilion's nurse, where 06.04 ends. UnitTestResult test_starts_where_lt_surge_ends(){ - return starts_where_ends("00.25", "00.26"); + return starts_where_ends("06.04", "07.01"); } -// 00.27 starts at Cerulean's nurse, where 00.26 ends. +// 07.02 starts at Cerulean's nurse, where 07.01 ends. UnitTestResult test_starts_where_bicycle_ends(){ - return starts_where_ends("00.26", "00.27"); + return starts_where_ends("07.01", "07.02"); } -// 00.26 on the sim from Vermilion's nurse to Cerulean's, the maps as -// 00.25 leaves them: no trainer meets the player (Isabelle and Elijah +// 07.01 on the sim from Vermilion's nurse to Cerulean's, the maps as +// 06.04 leaves them: no trainer meets the player (Isabelle and Elijah // stay unfought), no violation, each talk faces the one it's for (the // chairman beside the player, the Bike Shop's clerk across the counter), // and the walk ends at Cerulean's nurse. UnitTestResult test_bike_voucher_row(){ - const StoryCheckpoint& row = checkpoint("00.26"); + const StoryCheckpoint& row = checkpoint("07.01"); const std::vector maps = maps_after_surge(); const MapData& city = *std::find_if(maps.begin(), maps.end(), [](const MapData& map){ return map.name == VERMILION; }); if (object_at(city, {25, 7}) == nullptr){ @@ -188,7 +188,7 @@ UnitTestResult test_bike_voucher_row(){ const bool counter = here.map == BIKE_SHOP; const MapObject* person = object_ahead(maps, here, counter ? 2 : 1); if (person == nullptr || (counter && object_ahead(maps, here, 1) != nullptr)){ - return std::format("00.26/{}: no one to talk to from {}.", step.name, to_string(sim.state().position)); + return std::format("07.01/{}: no one to talk to from {}.", step.name, to_string(sim.state().position)); } talked_to.push_back(person->name); } @@ -198,43 +198,43 @@ UnitTestResult test_bike_voucher_row(){ // A walk the sim's player didn't finish, stopped by someone the // maps the program plans on don't have. if (!(sim.state().position == MapPosition{at.map, at.tile})){ - return std::format("00.26/{}: expected {}, on {}.", step.name, to_string(MapPosition{at.map, at.tile}), to_string(sim.state().position)); + return std::format("07.01/{}: expected {}, on {}.", step.name, to_string(MapPosition{at.map, at.tile}), to_string(sim.state().position)); } } if (talked_to != std::vector{"gentleman", "man"}){ - return "00.26: expected to talk to the chairman, then the Bike Shop's clerk."; + return "07.01: expected to talk to the chairman, then the Bike Shop's clerk."; } if (!sim.state().trainers_beaten.empty() || !sim.state().violations.empty()){ - return "00.26: a battle or a violation on the way" + (sim.state().violations.empty() ? std::string(".") : ": " + sim.state().violations.back()); + return "07.01: a battle or a violation on the way" + (sim.state().violations.empty() ? std::string(".") : ": " + sim.state().violations.back()); } const MapPosition nurse{CERULEAN_CENTER, {7, 4}}; if (!(sim.state().position == nurse)){ - return "00.26: ended on " + to_string(sim.state().position) + ", not Cerulean's nurse."; + return "07.01: ended on " + to_string(sim.state().position) + ", not Cerulean's nurse."; } return true; } -// 00.26's Mart step, at its money floor: 5 Repels and 2 Escape Ropes, +// 07.01's Mart step, at its money floor: 5 Repels and 2 Escape Ropes, // and 3000 or more left. UnitTestResult test_repels_and_escape_ropes(){ - const StoryCheckpoint& row = checkpoint("00.26"); + const StoryCheckpoint& row = checkpoint("07.01"); const auto step = std::find_if(row.steps.begin(), row.steps.end(), [](const StoryStep& data){ return data.action == MART_ACTION; }); if (step == row.steps.end()){ - return "00.26: expected a Mart step."; + return "07.01: expected a Mart step."; } const std::optional parsed = mart_plan_of(step->args); if (!parsed){ - return "00.26: expected a Mart plan."; + return "07.01: expected a Mart plan."; } const MartPlan& plan = *parsed; if (plan.map != CERULEAN_MART || !plan.money_floor){ - return "00.26: expected the Mart step at Cerulean's Mart, with a money floor."; + return "07.01: expected the Mart step at Cerulean's Mart, with a money floor."; } const std::optional> buys = plan_mart_buys(mart_stock(plan.map), plan, *plan.money_floor); if (!buys){ - return "00.26: the Mart step names an item Cerulean's Mart doesn't sell."; + return "07.01: the Mart step names an item Cerulean's Mart doesn't sell."; } size_t repels = 0; size_t escape_ropes = 0; @@ -245,18 +245,18 @@ UnitTestResult test_repels_and_escape_ropes(){ spent += buy.cost; } if (repels < 5 || escape_ropes != 2 || *plan.money_floor < spent + 3000){ - return std::format("00.26: bought {} Repels and {} Escape Ropes for {} from {}.", repels, escape_ropes, spent, *plan.money_floor); + return std::format("07.01: bought {} Repels and {} Escape Ropes for {} from {}.", repels, escape_ropes, spent, *plan.money_floor); } return true; } -// 00.27 on the sim from Cerulean's nurse to Route 10's, the maps as 00.26 +// 07.02 on the sim from Cerulean's nurse to Route 10's, the maps as 07.01 // leaves them, both trees grown back: the trees cut, Alicia, Jeremy and // Conner fought where the table steps into their lines and no one else // met (Brice, Caitlin and the rest unfought), no violation, each step // ending where the table says, and the walk ending at Route 10's nurse. UnitTestResult test_route10_row(){ - const StoryCheckpoint& row = checkpoint("00.27"); + const StoryCheckpoint& row = checkpoint("07.02"); const std::vector maps = maps_after_surge(); StoryPose at = *story_pose(Pokemon::pose_of(*row.start)); OverworldSim sim(maps, MapPosition{at.map, at.tile}, *at.facing); @@ -267,23 +267,23 @@ UnitTestResult test_route10_row(){ // A step into a trainer's line ends where the battle after it says. const bool into_line = step.kind == StoryStepKind::STEP && !step.action.empty(); if (!into_line && !(sim.state().position == MapPosition{at.map, at.tile})){ - return std::format("00.27/{}: expected {}, on {}.", step.name, to_string(MapPosition{at.map, at.tile}), to_string(sim.state().position)); + return std::format("07.02/{}: expected {}, on {}.", step.name, to_string(MapPosition{at.map, at.tile}), to_string(sim.state().position)); } } if (sim.state().trainers_beaten != std::vector{"picnicker", "hiker", "bug_catcher"}){ - return "00.27: expected to fight Alicia, Jeremy and Conner, no one else; fought " + std::to_string(sim.state().trainers_beaten.size()) + "."; + return "07.02: expected to fight Alicia, Jeremy and Conner, no one else; fought " + std::to_string(sim.state().trainers_beaten.size()) + "."; } if (!sim.state().violations.empty()){ - return "00.27: a violation on the way: " + sim.state().violations.back(); + return "07.02: a violation on the way: " + sim.state().violations.back(); } const MapPosition nurse{ROUTE10_CENTER, {7, 4}}; if (!(sim.state().position == nurse)){ - return "00.27: ended on " + to_string(sim.state().position) + ", not Route 10's nurse."; + return "07.02: ended on " + to_string(sim.state().position) + ", not Route 10's nurse."; } return true; } -// The next row starts from 00.27's save in Route 10's Center, whose save +// The next row starts from 07.02's save in Route 10's Center, whose save // card says ROUTE 10: a place of its own, not Route 1's. UnitTestResult test_route10_save_place(){ if (save_card_place(ROUTE10_CENTER) != "route-10" || save_card_place("Route1") == "route-10"){ @@ -292,7 +292,7 @@ UnitTestResult test_route10_save_place(){ return true; } -// 00.27's walk from Route 9 (70, 8) to Route 10's nurse: its steps from +// 07.02's walk from Route 9 (70, 8) to Route 10's nurse: its steps from // route10_ledge_end to route10_nurse. Console B, 2026-11-09, the walk // then planned in one ended its open legs a tile from a blocker, and both // runs ended "no fade in and out" at the Center's door (13, 20): @@ -303,14 +303,14 @@ UnitTestResult test_route10_save_place(){ // - run 2: the leg down column 16 ended a tile short, on (16, 20), west // 3 met the Center's east wall (15, 20) and north 1 ended on (16, 19). std::vector route10_walk(){ - const StoryCheckpoint& row = checkpoint("00.27"); + const StoryCheckpoint& row = checkpoint("07.02"); const auto named = [&row](std::string_view name){ return std::find_if(row.steps.begin(), row.steps.end(), [&](const StoryStep& data){ return data.name == name; }); }; const auto first = named("route10_ledge_end"); const auto last = named("route10_nurse"); if (first == row.steps.end() || last == row.steps.end() || last < first){ - throw InternalProgramError(nullptr, PA_CURRENT_FUNCTION, "00.27: no steps route10_ledge_end to route10_nurse."); + throw InternalProgramError(nullptr, PA_CURRENT_FUNCTION, "07.02: no steps route10_ledge_end to route10_nurse."); } return std::vector(first, last + 1); } @@ -322,7 +322,7 @@ const StoryPose ROUTE10_WALK_START{ROUTE9, {70, 8}, Direction::EAST}; std::string route10_walk_rest(OverworldSim& sim, StoryPose at, const std::vector& steps, size_t first){ std::string failure; for (size_t c = first; c < steps.size() && failure.empty(); c++){ - failure = row_step_on_sim(sim, at, steps[c], "00.27"); + failure = row_step_on_sim(sim, at, steps[c], "07.02"); } const MapPosition nurse{ROUTE10_CENTER, {7, 4}}; if (!failure.empty() || !(sim.state().position == nurse)){ @@ -407,39 +407,39 @@ UnitTestResult test_route10_tile_off_after_open_legs(){ const AutoStoryCeladonCase AUTO_STORY_CELADON_CASES[] = { { - .input = {"00.26 starts where 00.25 ends", test_starts_where_lt_surge_ends}, + .input = {"07.01 starts where 06.04 ends", test_starts_where_lt_surge_ends}, .expectation = {}, }, { - .input = {"00.26 the Fan Club, Route 6 and the Underground Path north, the Bike Shop, past Oak's aide", test_bike_voucher_row}, + .input = {"07.01 the Fan Club, Route 6 and the Underground Path north, the Bike Shop, past Oak's aide", test_bike_voucher_row}, .expectation = {}, }, { - .input = {"00.26 Repels and Escape Ropes, 3000 left", test_repels_and_escape_ropes}, + .input = {"07.01 Repels and Escape Ropes, 3000 left", test_repels_and_escape_ropes}, .expectation = {}, }, { - .input = {"00.27 starts where 00.26 ends", test_starts_where_bicycle_ends}, + .input = {"07.02 starts where 07.01 ends", test_starts_where_bicycle_ends}, .expectation = {}, }, { - .input = {"00.27 the two trees, Route 9's Alicia, Jeremy and Conner, to Route 10's Pokemon Center", test_route10_row}, + .input = {"07.02 the two trees, Route 9's Alicia, Jeremy and Conner, to Route 10's Pokemon Center", test_route10_row}, .expectation = {}, }, { - .input = {"00.27 saves in Route 10's Pokemon Center, ROUTE 10 on the save card", test_route10_save_place}, + .input = {"07.02 saves in Route 10's Pokemon Center, ROUTE 10 on the save card", test_route10_save_place}, .expectation = {}, }, { - .input = {"00.27 route10_nurse: the crossing onto Route 10 not held up", test_route10_crossing_not_held_up}, + .input = {"07.02 route10_nurse: the crossing onto Route 10 not held up", test_route10_crossing_not_held_up}, .expectation = {}, }, { - .input = {"00.27 route10_nurse: the leg down column 16 a tile short", test_route10_column_16_short}, + .input = {"07.02 route10_nurse: the leg down column 16 a tile short", test_route10_column_16_short}, .expectation = {}, }, { - .input = {"00.27 route10_nurse: a tile off after each open leg", test_route10_tile_off_after_open_legs}, + .input = {"07.02 route10_nurse: a tile off after each open leg", test_route10_tile_off_after_open_legs}, .expectation = {}, }, }; diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryCheckpoints.h b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryCheckpoints.h index 4c7861c8f1..5defa199a4 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryCheckpoints.h +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryCheckpoints.h @@ -80,14 +80,14 @@ struct StoryRunPlan{ // plays the new game to the player's keyboard and stops there. // STARTER_RNG: the run stops after `rows`, the last of which saves at // the starter's ball. GIFT_RNG: likewise, beside the Magikarp salesman; - // with `rows` empty, the run started at 00.12b and takes Gift RNG from + // with `rows` empty, the run started at 04.03 and takes Gift RNG from // the save beside the salesman, where the row before `first` ends. StoryHandoff stop = StoryHandoff::NONE; }; // The rows of `checkpoints` from `first` to `last`, both inclusive, as a // run with `handoffs` takes them: live-start rows only when the run -// starts there (00.12b with Gift RNG's handoff on starts at the handoff +// starts there (04.03 with Gift RNG's handoff on starts at the handoff // instead), a run that reaches a handoff that is on stops for it, and // a STARTER_RNG row whose handoff is off is joined with the row after it, // under its own id. diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryChoice_Tests.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryChoice_Tests.cpp index 9de1685ad4..1d6954bd38 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryChoice_Tests.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryChoice_Tests.cpp @@ -133,7 +133,7 @@ std::vector choice_cases(){ }, // The console has no reader for the prompt's text: the table has // walked the player to face the wanted fossil, so YES takes it - // (console B: answering NO and stopping left 00.13 stuck there). + // (console B: answering NO and stopping left 04.05 stuck there). { .name = "an unread prompt: YES, facing the wanted fossil", .setup = [](FakeFossilRoom& room){ room.offer_readable = false; }, diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryEvents.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryEvents.cpp index e84549216d..997160b306 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryEvents.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryEvents.cpp @@ -293,7 +293,7 @@ const std::vector& story_maps(){ std::set flags = map_flag_set(all, "after_hall_of_fame"); flags.merge(map_flag_set(all, "new_game")); // The one ball the story picks up in its way: B2F's MOON STONE - // blocks column 2 of the arrow floor (00.32's moon_stone). + // blocks column 2 of the arrow floor (09.02's moon_stone). flags.insert("FLAG_HIDE_ROCKET_HIDEOUT_B2F_MOON_STONE"); return overworld_maps(flags); }(); @@ -425,7 +425,7 @@ std::optional wall_beside(const MapData& map, const TilePos& tile){ namespace{ // A talk to a person or an item ball opens a message; an A that opens -// none faced nothing (00.31 b3f_rare_candy, console B, 2026-11-10: one A, +// none faced nothing (09.01 b3f_rare_candy, console B, 2026-11-10: one A, // "done", on the wrong floor). The message is left open for the next step. bool talk_opens_message(ConsoleHandle& console, ProControllerContext& context){ WhiteDialogWatcher opened(COLOR_RED); diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryFaultSweep_Tests.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryFaultSweep_Tests.cpp index e68ca120d1..bfef69ed47 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryFaultSweep_Tests.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryFaultSweep_Tests.cpp @@ -8,18 +8,18 @@ * - SCENE_END_POSE: a step the sim does not play (a scene, a talk, an * event) that moved the player leaves them on another walkable tile * within one of the table's pose, while the program goes on from the - * table's (BDSP 00.03, lab-B 2026-11-09). + * table's (BDSP 01.04, lab-B 2026-11-09). * - WILD_BATTLES: wild battles at the game's own odds on every map with - * land encounters, over GAME_ODDS_SEEDS seeds (00.28's Rock Tunnel). + * land encounters, over GAME_ODDS_SEEDS seeds (08.01's Rock Tunnel). * - LATE_FADE: every warp's fade ends LATE_FADE later than the sim's - * usual (00.27's warp to Cerulean City). + * usual (07.02's warp to Cerulean City). * - DARK_CAVE: the caves without Flash dark (DARK_MAPS), so each * battle there ends on the dark cave's overworld, with no wild - * battles and with them at the game's odds (00.28 hiker_lenny, lab-B + * battles and with them at the game's odds (08.01 hiker_lenny, lab-B * 2026-11-09). * - LOST_TAP: a wild battle on each tile of each step into a trainer's * line before its last, so the next tap comes as the overworld comes - * back, inside the lockout after a battle (00.28 winston_line, console + * back, inside the lockout after a battle (08.01 winston_line, console * B, 2026-11-09 15:50). The step alone, from where the clean run took * it, on its map made a wild floor. * @@ -91,7 +91,7 @@ std::string_view fault_class_name(FaultClass fault){ // Sweeps the program fails today, by test name, with the likely fix. const std::map KNOWN_FAILING{ - {"PokemonFRLG::AutoStory - Fault sweep: 00.06, wild battles at the game's odds", + {"PokemonFRLG::AutoStory - Fault sweep: 02.02, wild battles at the game's odds", "below_oak on Route 1 gives up after 9 stops part-way (seeds 16, 30): count stops that make no progress, not every battle"}, }; diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryGrind.h b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryGrind.h index 8cbbc577c4..8cc899f6a4 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryGrind.h +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryGrind.h @@ -55,7 +55,7 @@ namespace PokemonFRLG{ GrindResult run_grind(Logger& logger, GrindActions& actions, const MemberReader& reader, const GrindPlan& plan); // Before the walk out to the patch: whether the member `plan` grinds, as -// read, already has its level. Nothing is fought. 00.24 walked to Route +// read, already has its level. Nothing is fought. 06.03 walked to Route // 6's grass and back at Lv29 (console B, 2026-11-03). bool grind_reached_already(Logger& logger, GrindActions& actions, const MemberReader& reader, const GrindPlan& plan); diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryGrind_Tests.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryGrind_Tests.cpp index f240de6879..599c653db3 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryGrind_Tests.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryGrind_Tests.cpp @@ -303,7 +303,7 @@ UnitTestResult test_grind_args(){ } // The check in the Center before the walk out: a lead already at the -// plan's level needs no trip (00.24 walked to Route 6's grass and back at +// plan's level needs no trip (06.03 walked to Route 6's grass and back at // Lv29, console B, 2026-11-03); one short of it does. Nothing is fought // either way. UnitTestResult test_grind_reached_already(){ diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryHideout_Tests.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryHideout_Tests.cpp index a48c8ac4c4..a82b42bc24 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryHideout_Tests.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryHideout_Tests.cpp @@ -135,7 +135,7 @@ std::string poster_on_sim(){ const MapPosition below_poster{"CeladonCity_GameCorner", {GAME_CORNER_POSTER.x, GAME_CORNER_POSTER.y + 1}}; OverworldSim sim({room}, below_poster, Direction::NORTH); StoryPose at{below_poster.map, below_poster.point, Direction::NORTH}; - const std::string failure = row_step_on_sim(sim, at, poster_switch_step("poster_switch"), "00.31"); + const std::string failure = row_step_on_sim(sim, at, poster_switch_step("poster_switch"), "09.01"); if (!failure.empty()){ return failure; } @@ -179,7 +179,7 @@ std::string lift_on_sim(){ const MapPosition below_door{"RocketHideout_B2F", doors[1].point.next(Direction::SOUTH)}; OverworldSim sim(maps, below_door, Direction::NORTH, script); StoryPose at{below_door.map, below_door.point, Direction::NORTH}; - const std::string failure = row_step_on_sim(sim, at, lift_floor_step("lift_to_b4f", "B2F", "B4F"), "00.32"); + const std::string failure = row_step_on_sim(sim, at, lift_floor_step("lift_to_b4f", "B2F", "B4F"), "09.02"); if (!failure.empty()){ return failure; } @@ -267,7 +267,7 @@ std::string short_holds_on_sim(const MapPosition& start, Direction facing, const return ""; } -// 00.31's taps through B3F's arrow floor (frlg-00.31.plan.json's +// 09.01's taps through B3F's arrow floor (frlg-09.01.plan.json's // b3f_arrow_maze and b3f_back_to_candy_row, pokeguy's way): down from // the stairs (18, 2) to below the stairs to B4F (15, 19), and back from // them (15, 18) to the stop (10, 13). The routes planned after them, @@ -318,7 +318,7 @@ UnitTestResult test_b3f_maze_taps(){ return true; } -// 00.32's taps (frlg-00.32.plan.json): B3F from below its Rare Candy up +// 09.02's taps (frlg-09.02.plan.json): B3F from below its Rare Candy up // to the top corridor, and B2F's arrows to the MOON STONE's stop and on // to the lift room's stop (13, 20), up to row 17 and on to below the // lift, and B4F from the lift door to the guards, Giovanni and the @@ -418,7 +418,7 @@ const AutoStoryHideoutBodyCase HIDEOUT_BODY_CASES[] = { }, { .input = {.name = "B2F's arrow floor to the lift a tap at a time", .body = test_b2f_maze_taps}, - .expectation = {.description = "00.32's taps and the routes between them, any turn dropped or hold short"}, + .expectation = {.description = "09.02's taps and the routes between them, any turn dropped or hold short"}, }, }; diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryLavender_Tests.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryLavender_Tests.cpp index 63af2ab4a1..c91a638620 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryLavender_Tests.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryLavender_Tests.cpp @@ -2,10 +2,10 @@ * * From: https://github.com/PokemonAutomation/ * - * Rows from 00.28 on (PokemonFRLG_AutoStoryTableLavender.cpp) on the - * overworld sim: 00.28 from Route 10's Pokemon Center through Rock Tunnel - * to its south mouth, 00.29 down Route 10 to Lavender Town's Center, and - * 00.30 west over Route 8 and under Saffron to Celadon City. + * Rows from 08.01 on (PokemonFRLG_AutoStoryTableLavender.cpp) on the + * overworld sim: 08.01 from Route 10's Pokemon Center through Rock Tunnel + * to its south mouth, 08.02 down Route 10 to Lavender Town's Center, and + * 08.03 west over Route 8 and under Saffron to Celadon City. * Each row whole, each open leg a tile short or long, and a wild battle * on every open leg in the tunnel. * @@ -92,7 +92,7 @@ const StoryCheckpoint& checkpoint(std::string_view id){ return *row; } -// The maps as 00.27 leaves them: the story's flags, Rock Tunnel's and +// The maps as 07.02 leaves them: the story's flags, Rock Tunnel's and // Route 10's trainers unfought. std::vector maps_after_route10(){ const std::vector all = overworld_maps(); @@ -159,20 +159,20 @@ const std::vector ROCK_TUNNEL_TRAINERS{ "poke_maniac", "poke_maniac", "picnicker", "hiker", "hiker", "picnicker", "hiker", "poke_maniac", "picnicker", }; -// 00.28 on the sim: the tree cut, the nine trainers fought where the +// 08.01 on the sim: the tree cut, the nine trainers fought where the // table steps into their lines (Cooper by the walker, on the leg past // him), no one else met, and the walk out of the south mouth. UnitTestResult test_rock_tunnel_row(Logger&){ - return row_on_sim("00.28", SimScript{}, {ROCK_TUNNEL_TRAINERS}, MapPosition{ROUTE10, {8, 58}}); + return row_on_sim("08.01", SimScript{}, {ROCK_TUNNEL_TRAINERS}, MapPosition{ROUTE10, {8, 58}}); } -// 00.28 with a wild battle on the 3rd step on the tunnel's floor, mid-way +// 08.01 with a wild battle on the 3rd step on the tunnel's floor, mid-way // down the leg to the wall (17, 8): the walker runs, holds the leg to its // wall again, and nothing else changes. UnitTestResult test_rock_tunnel_wild_battles(Logger&){ SimScript script; script.encounters.push_back(SimEncounter{.grass_step = 3}); - return row_on_sim("00.28", script, {ROCK_TUNNEL_TRAINERS}, MapPosition{ROUTE10, {8, 58}}); + return row_on_sim("08.01", script, {ROCK_TUNNEL_TRAINERS}, MapPosition{ROUTE10, {8, 58}}); } // Wild battles on the tunnel's floor, `gaps` steps apart in turn, from the @@ -187,7 +187,7 @@ SimScript battles_every(const std::vector& gaps){ return script; } -// 00.28's step `name`: where it is in the row. +// 08.01's step `name`: where it is in the row. size_t step_index(const StoryCheckpoint& row, std::string_view name){ for (size_t c = 0; c < row.steps.size(); c++){ if (row.steps[c].name == name){ @@ -204,7 +204,7 @@ size_t step_index(const StoryCheckpoint& row, std::string_view name){ // ("stopped part-way 9 times"). From Winston's tile, with a battle every // 10 to 14 steps, the steps from below_martha_line on reach Martha's line. UnitTestResult test_b1f_row37_battles_every_12(Logger&){ - const StoryCheckpoint& row = checkpoint("00.28"); + const StoryCheckpoint& row = checkpoint("08.01"); const size_t first = step_index(row, "below_martha_line"); StoryPose at{ROCK_TUNNEL_B1F, {29, 37}, Direction::NORTH}; OverworldSim sim(maps_after_route10(), MapPosition{at.map, at.tile}, *at.facing, battles_every({12, 10, 14, 11, 13})); @@ -221,7 +221,7 @@ UnitTestResult test_b1f_row37_battles_every_12(Logger&){ // From Winston's tile, below_martha_line, martha_line and Martha's battle // on `sim`: the failure, or empty once Martha alone is fought. std::string winston_to_martha(OverworldSim& sim){ - const StoryCheckpoint& row = checkpoint("00.28"); + const StoryCheckpoint& row = checkpoint("08.01"); StoryPose at{ROCK_TUNNEL_B1F, {29, 37}, Direction::NORTH}; for (size_t c = step_index(row, "below_martha_line"); c <= step_index(row, "picnicker_martha"); c++){ if (const std::string failure = row_step_on_sim(sim, at, row.steps[c], row.id); !failure.empty()){ @@ -255,14 +255,14 @@ UnitTestResult test_b1f_martha_after_row38_battle(Logger&){ return true; } -// Regression: console B, 2026-11-09 15:50, 00.28 winston_line, dark: from +// Regression: console B, 2026-11-09 15:50, 08.01 winston_line, dark: from // (32, 37) west into Winston's line, a wild battle on the 2nd tap's tile // (30, 37), run from; the 3rd tap, sent as the battle's black ended, was // lost, and the step failed no_trainer. After the battle the next tap // waits for the overworld (wait_out_battle_exit()): Winston sees the // player on (29, 37). UnitTestResult test_winston_line_battle_on_tap_2(Logger&){ - const StoryCheckpoint& row = checkpoint("00.28"); + const StoryCheckpoint& row = checkpoint("08.01"); SimScript script; script.dark_maps = {ROCK_TUNNEL_1F, ROCK_TUNNEL_B1F}; script.wild_floor_maps = {ROCK_TUNNEL_B1F}; @@ -285,13 +285,13 @@ UnitTestResult test_winston_line_battle_on_tap_2(Logger&){ // Rock Tunnel has no Flash: both floors are dark. const std::set ROCK_TUNNEL_DARK{ROCK_TUNNEL_1F, ROCK_TUNNEL_B1F}; -// Regression: console B, 2026-11-09, 00.28 hiker_lenny: won, and the dark +// Regression: console B, 2026-11-09, 08.01 hiker_lenny: won, and the dark // overworld after it was taken for an evolution until fight_battle() gave -// up. 00.28 dark: every trainer's battle ends on the dark cave's overworld. +// up. 08.01 dark: every trainer's battle ends on the dark cave's overworld. UnitTestResult test_rock_tunnel_dark_battle_ends(Logger&){ SimScript script; script.dark_maps = ROCK_TUNNEL_DARK; - return row_on_sim("00.28", script, {ROCK_TUNNEL_TRAINERS}, MapPosition{ROUTE10, {8, 58}}); + return row_on_sim("08.01", script, {ROCK_TUNNEL_TRAINERS}, MapPosition{ROUTE10, {8, 58}}); } // below_martha_line as `legs` from Winston's tile (29, 37) on `sim`, by the @@ -373,7 +373,7 @@ UnitTestResult test_b1f_dark_martha_battle_anywhere(Logger&){ return true; } -// 00.28 whole with a wild battle every 7 to 25 steps on the tunnel's floor, +// 08.01 whole with a wild battle every 7 to 25 steps on the tunnel's floor, // the gaps drawn from each of these seeds: the row ends where it should. UnitTestResult test_rock_tunnel_frequent_battles(Logger&){ std::string failures; @@ -385,7 +385,7 @@ UnitTestResult test_rock_tunnel_frequent_battles(Logger&){ gaps.push_back(gap(random)); } const UnitTestResult result = row_on_sim( - "00.28", battles_every(gaps), {ROCK_TUNNEL_TRAINERS}, MapPosition{ROUTE10, {8, 58}} + "08.01", battles_every(gaps), {ROCK_TUNNEL_TRAINERS}, MapPosition{ROUTE10, {8, 58}} ); if (result.result != UnitTestResult::PASSED){ failures += std::format("{}Seed {}: {}", failures.empty() ? "" : " | ", seed, result.message); @@ -465,7 +465,7 @@ std::string numbers_summary(const std::vector& runs){ ); } -// The land encounter rates of the maps 00.28 and 00.29 walk (pokefirered +// The land encounter rates of the maps 08.01 and 08.02 walk (pokefirered // src/data/wild_encounters.json, FireRed). const std::map ROCK_TUNNEL_ENCOUNTER_RATES{ {ROCK_TUNNEL_1F, 7}, @@ -475,12 +475,12 @@ const std::map ROCK_TUNNEL_ENCOUNTER_RATES{ constexpr unsigned GAME_ODDS_SEEDS = 30; -// 00.28 whole, its wild battles at the game's own odds (OverworldSim:: +// 08.01 whole, its wild battles at the game's own odds (OverworldSim:: // rolls_encounter()), from each of these seeds: every run ends where it // should. Logs the runs' numbers and the step taps the game ignored. UnitTestResult test_rock_tunnel_game_odds(Logger& logger){ - OverworldSim clean_sim = row_start_sim("00.28", SimScript{}); - if (const UnitTestResult clean = row_checked(clean_sim, "00.28", {ROCK_TUNNEL_TRAINERS}, MapPosition{ROUTE10, {8, 58}}); clean.result != UnitTestResult::PASSED){ + OverworldSim clean_sim = row_start_sim("08.01", SimScript{}); + if (const UnitTestResult clean = row_checked(clean_sim, "08.01", {ROCK_TUNNEL_TRAINERS}, MapPosition{ROUTE10, {8, 58}}); clean.result != UnitTestResult::PASSED){ return clean; } std::vector runs; @@ -491,8 +491,8 @@ UnitTestResult test_rock_tunnel_game_odds(Logger& logger){ script.encounter_rates = ROCK_TUNNEL_ENCOUNTER_RATES; script.encounter_seed = seed; script.dark_maps = ROCK_TUNNEL_DARK; - OverworldSim sim = row_start_sim("00.28", script); - const UnitTestResult result = row_checked(sim, "00.28", {ROCK_TUNNEL_TRAINERS}, MapPosition{ROUTE10, {8, 58}}); + OverworldSim sim = row_start_sim("08.01", script); + const UnitTestResult result = row_checked(sim, "08.01", {ROCK_TUNNEL_TRAINERS}, MapPosition{ROUTE10, {8, 58}}); const bool passed = result.result == UnitTestResult::PASSED; runs.push_back(row_numbers(sim.state(), passed, clean_sim.state())); ignored += sim.state().step_taps_ignored; @@ -501,7 +501,7 @@ UnitTestResult test_rock_tunnel_game_odds(Logger& logger){ } } logger.log(std::format( - "00.28 at the game's encounter odds, {} step taps ignored: {}", ignored, numbers_summary(runs) + "08.01 at the game's encounter odds, {} step taps ignored: {}", ignored, numbers_summary(runs) )); if (!failures.empty()){ return failures; @@ -510,9 +510,9 @@ UnitTestResult test_rock_tunnel_game_odds(Logger& logger){ } -// 00.29 on the sim: no trainer met, the ledge hopped, Lavender's nurse. +// 08.02 on the sim: no trainer met, the ledge hopped, Lavender's nurse. UnitTestResult test_lavender_row(Logger&){ - return row_on_sim("00.29", SimScript{}, {{}}, MapPosition{LAVENDER_CENTER, {7, 4}}); + return row_on_sim("08.02", SimScript{}, {{}}, MapPosition{LAVENDER_CENTER, {7, 4}}); } // Where an open leg of two tiles or more ends a tile short or long, the @@ -570,15 +570,15 @@ UnitTestResult tile_off_after_open_legs(std::string_view id){ } UnitTestResult test_rock_tunnel_tile_off(Logger&){ - return tile_off_after_open_legs("00.28"); + return tile_off_after_open_legs("08.01"); } UnitTestResult test_lavender_tile_off(Logger&){ - return tile_off_after_open_legs("00.29"); + return tile_off_after_open_legs("08.02"); } -// 00.29 saves in Lavender Town's Pokemon Center, LAVENDER TOWN on the -// save card; 00.28 on Route 10. +// 08.02 saves in Lavender Town's Pokemon Center, LAVENDER TOWN on the +// save card; 08.01 on Route 10. UnitTestResult test_save_places(Logger&){ if (save_card_place(LAVENDER_CENTER) != "lavender-town" || save_card_place(ROUTE10) != "route-10"){ return "Wrong save card places for Lavender Town's Center or Route 10."; @@ -586,18 +586,18 @@ UnitTestResult test_save_places(Logger&){ return true; } -// 00.30 on the sim: the Mart, Route 8 with only Rich fought (the walker +// 08.03 on the sim: the Mart, Route 8 with only Rich fought (the walker // keeps out of the other trainers' lines), the Underground Path, the // Pidgey's grass and Celadon City, below its Center's door. The Center // has no map: its way in is stubbed. UnitTestResult test_celadon_way_row(Logger&){ - return row_on_sim("00.30", SimScript{}, {{"old_man_1"}}, MapPosition{"CeladonCity", {48, 12}}); + return row_on_sim("08.03", SimScript{}, {{"old_man_1"}}, MapPosition{"CeladonCity", {48, 12}}); } -// 00.30's walk into Route 7's grass with a wild battle on its one grass +// 08.03's walk into Route 7's grass with a wild battle on its one grass // step (Route 7's land rate is 21): it still ends on the Pidgey's tile. UnitTestResult test_route7_grass_battles(Logger&){ - const StoryCheckpoint& row = checkpoint("00.30"); + const StoryCheckpoint& row = checkpoint("08.03"); const size_t index = step_index(row, "pidgey_grass"); const MapPosition end{"Route7", {14, 6}}; SimScript script; @@ -631,7 +631,7 @@ std::vector maps_after_rich(){ return maps; } -// The walker believes the player stands on `believed`, a tile 00.30's +// The walker believes the player stands on `believed`, a tile 08.03's // steps from Rich's battle on pass through, while the player stands on // `actual`. struct OffStart{ @@ -650,7 +650,7 @@ const OffStart ROUTE8_OFF_STARTS[] = { {{26, 7}, {28, 10}}, }; -// 00.30's steps from `first` to `last`, as the table lays them out from +// 08.03's steps from `first` to `last`, as the table lays them out from // `at`: the first that starts on `tile`, and where the table says the // player stands then. Nothing if none does. std::optional> step_starting_on( @@ -669,7 +669,7 @@ std::optional> step_starting_on( return std::nullopt; } -// Console B, 2026-11-09 (00.30, three runs): after Route 8's open legs +// Console B, 2026-11-09 (08.03, three runs): after Route 8's open legs // the player stood 3 tiles east of where the walker believed, the hold // north to the Underground Path's door ran up column 17 to the cliff // (16, 2), and the step onto the door bumped the house: "no fade in and @@ -677,7 +677,7 @@ std::optional> step_starting_on( // steps on to Route 7 meet no trainer and come out of the Underground // Path where the table says. UnitTestResult test_route8_west_off_start(Logger&){ - const StoryCheckpoint& row = checkpoint("00.30"); + const StoryCheckpoint& row = checkpoint("08.03"); const size_t first = step_index(row, "west_of_glenn_column"); const size_t last = step_index(row, "route7_underground_exit"); const StoryPose after_rich{"Route8", {55, 18}, Direction::NORTH}; @@ -711,7 +711,7 @@ UnitTestResult test_route8_west_off_start(Logger&){ return true; } -// 00.30 saves in Celadon City's Pokemon Center: CELADON CITY on the save +// 08.03 saves in Celadon City's Pokemon Center: CELADON CITY on the save // card. UnitTestResult test_celadon_save_place(Logger&){ if (save_card_place("CeladonCity_PokemonCenter_1F") != "celadon-city"){ @@ -720,14 +720,14 @@ UnitTestResult test_celadon_save_place(Logger&){ return true; } -// 00.31 on the sim: out of Celadon's Center, the Game Corner's poster +// 09.01 on the sim: out of Celadon's Center, the Game Corner's poster // Grunt, the switch, the Rocket Hideout down to B4F's Lift Key Grunt, the // LIFT KEY, and back up to B3F below its Rare Candy. // A battle a talk starts (the poster Grunt's) is the sim's to skip: it // leaves the player where the plan says, and the trainer walks off // (talk_battle_hide_flag()). UnitTestResult test_hideout_row(Logger&){ - const StoryCheckpoint& row = checkpoint("00.31"); + const StoryCheckpoint& row = checkpoint("09.01"); StoryPose at = *story_pose(Pokemon::pose_of(*row.start)); std::vector maps = maps_after_route10(); auto sim = std::make_unique(maps, MapPosition{at.map, at.tile}, *at.facing); @@ -736,7 +736,7 @@ UnitTestResult test_hideout_row(Logger&){ const std::optional hidden = talk_battle_hide_flag(step); if (!hidden){ if (const std::string failure = row_step_on_sim(*sim, at, step, row.id); !failure.empty()){ - return "00.31: ended on " + to_string(sim->state().position) + "; " + failure; + return "09.01: ended on " + to_string(sim->state().position) + "; " + failure; } continue; } @@ -749,14 +749,14 @@ UnitTestResult test_hideout_row(Logger&){ } fought.insert(fought.end(), sim->state().trainers_beaten.begin(), sim->state().trainers_beaten.end()); if (fought != std::vector{"rocket_m"}){ - return std::format("00.31: fought {} trainers on the sim, not the Lift Key Grunt alone.", fought.size()); + return std::format("09.01: fought {} trainers on the sim, not the Lift Key Grunt alone.", fought.size()); } if (!sim->state().violations.empty()){ - return "00.31: a violation on the way: " + sim->state().violations.back(); + return "09.01: a violation on the way: " + sim->state().violations.back(); } const MapPosition end{"RocketHideout_B3F", {12, 13}}; if (!(sim->state().position == end)){ - return "00.31: ended on " + to_string(sim->state().position) + ", not " + to_string(end) + "."; + return "09.01: ended on " + to_string(sim->state().position) + ", not " + to_string(end) + "."; } return true; } @@ -764,13 +764,13 @@ UnitTestResult test_hideout_row(Logger&){ } // namespace -// 00.32 on the sim: from below B3F's Rare Candy back up to B2F, through +// 09.02 on the sim: from below B3F's Rare Candy back up to B2F, through // its arrows (the MOON STONE ball stands in the way and is picked up), // the lift to B4F, the two door guards, Giovanni, and beside the SILPH // SCOPE. The talk-started battles are the sim's to skip; the MOON // STONE's pickup hides its ball, as the game does. UnitTestResult test_hideout_giovanni_row(Logger&){ - const StoryCheckpoint& row = checkpoint("00.32"); + const StoryCheckpoint& row = checkpoint("09.02"); StoryPose at = *story_pose(Pokemon::pose_of(*row.start)); std::vector maps = maps_after_route10(); if (std::none_of(maps.begin(), maps.end(), [](const MapData& map){ return map.name == LIFT_MAP; })){ @@ -788,7 +788,7 @@ UnitTestResult test_hideout_giovanni_row(Logger&){ continue; } if (const std::string failure = row_step_on_sim(*sim, at, step, row.id); !failure.empty()){ - return "00.32: ended on " + to_string(sim->state().position) + "; " + failure; + return "09.02: ended on " + to_string(sim->state().position) + "; " + failure; } if (step.name == "moon_stone"){ for (MapData& map : maps){ @@ -798,39 +798,39 @@ UnitTestResult test_hideout_giovanni_row(Logger&){ } } if (!sim->state().trainers_beaten.empty()){ - return std::format("00.32: walked into {} trainers' lines on the sim.", sim->state().trainers_beaten.size()); + return std::format("09.02: walked into {} trainers' lines on the sim.", sim->state().trainers_beaten.size()); } if (!sim->state().violations.empty()){ - return "00.32: a violation on the way: " + sim->state().violations.back(); + return "09.02: a violation on the way: " + sim->state().violations.back(); } const MapPosition end{"RocketHideout_B4F", {21, 5}}; if (!(sim->state().position == end)){ - return "00.32: ended on " + to_string(sim->state().position) + ", not " + to_string(end) + "."; + return "09.02: ended on " + to_string(sim->state().position) + ", not " + to_string(end) + "."; } return true; } const AutoStoryLavenderCase AUTO_STORY_LAVENDER_CASES[] = { - {.input = {"00.28 the tree, Rock Tunnel's nine trainers, out of its south mouth", test_rock_tunnel_row}, .expectation = {}}, - {.input = {"00.28 a wild battle mid-leg in the tunnel", test_rock_tunnel_wild_battles}, .expectation = {}}, - {.input = {"00.28 dark: each trainer's battle ends on the dark cave's overworld", test_rock_tunnel_dark_battle_ends}, .expectation = {}}, - {.input = {"00.28 a tile off after each open leg", test_rock_tunnel_tile_off}, .expectation = {}}, - {.input = {"00.28 B1F row 37 with a wild battle every 10 to 14 steps", test_b1f_row37_battles_every_12}, .expectation = {}}, - {.input = {"00.28 a wild battle every 7 to 25 steps, 12 seeds", test_rock_tunnel_frequent_battles}, .expectation = {}}, - {.input = {"00.28 wild battles at the game's odds, 30 seeds", test_rock_tunnel_game_odds}, .expectation = {}}, - {.input = {"00.28 B1F a wild battle into row 38, then a step short: Martha still sees the player", test_b1f_martha_after_row38_battle}, .expectation = {}}, - {.input = {"00.28 B1F dark, the 13:35 legs: a battle at the end of the walk back along row 38", test_b1f_dark_row38_battle_old_legs}, .expectation = {}}, - {.input = {"00.28 B1F dark, a wild battle on any step to Martha's line", test_b1f_dark_martha_battle_anywhere}, .expectation = {}}, - {.input = {"00.28 B1F dark, winston_line: a wild battle on the 2nd tap, the 3rd after it", test_winston_line_battle_on_tap_2}, .expectation = {}}, - {.input = {"00.29 Route 10 south, the ledge, Lavender Town's Pokemon Center", test_lavender_row}, .expectation = {}}, - {.input = {"00.29 a tile off after each open leg", test_lavender_tile_off}, .expectation = {}}, - {.input = {"00.28 and 00.29 save on Route 10 and in Lavender Town", test_save_places}, .expectation = {}}, - {.input = {"00.30 Lavender's Mart, Route 8 past Rich alone, the Underground Path, Route 7 to Celadon City", test_celadon_way_row}, .expectation = {}}, - {.input = {"00.30 a wild battle on the step into Route 7's grass", test_route7_grass_battles}, .expectation = {}}, - {.input = {"00.30 Route 8 west from a start up to 3 tiles off", test_route8_west_off_start}, .expectation = {}}, - {.input = {"00.30 saves in Celadon City's Pokemon Center", test_celadon_save_place}, .expectation = {}}, - {.input = {"00.31 the Game Corner's poster, the Rocket Hideout to B4F's LIFT KEY and B3F's Rare Candy", test_hideout_row}, .expectation = {}}, - {.input = {"00.32 B2F's arrows, the lift, the door guards, Giovanni and the SILPH SCOPE", test_hideout_giovanni_row}, .expectation = {}}, + {.input = {"08.01 the tree, Rock Tunnel's nine trainers, out of its south mouth", test_rock_tunnel_row}, .expectation = {}}, + {.input = {"08.01 a wild battle mid-leg in the tunnel", test_rock_tunnel_wild_battles}, .expectation = {}}, + {.input = {"08.01 dark: each trainer's battle ends on the dark cave's overworld", test_rock_tunnel_dark_battle_ends}, .expectation = {}}, + {.input = {"08.01 a tile off after each open leg", test_rock_tunnel_tile_off}, .expectation = {}}, + {.input = {"08.01 B1F row 37 with a wild battle every 10 to 14 steps", test_b1f_row37_battles_every_12}, .expectation = {}}, + {.input = {"08.01 a wild battle every 7 to 25 steps, 12 seeds", test_rock_tunnel_frequent_battles}, .expectation = {}}, + {.input = {"08.01 wild battles at the game's odds, 30 seeds", test_rock_tunnel_game_odds}, .expectation = {}}, + {.input = {"08.01 B1F a wild battle into row 38, then a step short: Martha still sees the player", test_b1f_martha_after_row38_battle}, .expectation = {}}, + {.input = {"08.01 B1F dark, the 13:35 legs: a battle at the end of the walk back along row 38", test_b1f_dark_row38_battle_old_legs}, .expectation = {}}, + {.input = {"08.01 B1F dark, a wild battle on any step to Martha's line", test_b1f_dark_martha_battle_anywhere}, .expectation = {}}, + {.input = {"08.01 B1F dark, winston_line: a wild battle on the 2nd tap, the 3rd after it", test_winston_line_battle_on_tap_2}, .expectation = {}}, + {.input = {"08.02 Route 10 south, the ledge, Lavender Town's Pokemon Center", test_lavender_row}, .expectation = {}}, + {.input = {"08.02 a tile off after each open leg", test_lavender_tile_off}, .expectation = {}}, + {.input = {"08.01 and 08.02 save on Route 10 and in Lavender Town", test_save_places}, .expectation = {}}, + {.input = {"08.03 Lavender's Mart, Route 8 past Rich alone, the Underground Path, Route 7 to Celadon City", test_celadon_way_row}, .expectation = {}}, + {.input = {"08.03 a wild battle on the step into Route 7's grass", test_route7_grass_battles}, .expectation = {}}, + {.input = {"08.03 Route 8 west from a start up to 3 tiles off", test_route8_west_off_start}, .expectation = {}}, + {.input = {"08.03 saves in Celadon City's Pokemon Center", test_celadon_save_place}, .expectation = {}}, + {.input = {"09.01 the Game Corner's poster, the Rocket Hideout to B4F's LIFT KEY and B3F's Rare Candy", test_hideout_row}, .expectation = {}}, + {.input = {"09.02 B2F's arrows, the lift, the door guards, Giovanni and the SILPH SCOPE", test_hideout_giovanni_row}, .expectation = {}}, }; void add_tests_AutoStoryLavender(UnitTestDatabase& database){ diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryPaceSim_Tests.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryPaceSim_Tests.cpp index 79d8ae39e6..253c327744 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryPaceSim_Tests.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryPaceSim_Tests.cpp @@ -71,7 +71,7 @@ class SimCapture : public CaptureActions{ SimPatch& m_patch; }; -// Console B, 2026-11-03 (m63, 00.20 run 2): the capture paced on Route +// Console B, 2026-11-03 (m63, 05.09 run 2): the capture paced on Route // 24's (5, 19), in Camper Shane's sight; after the first wild battle he // walked up ("I saw your feat from the grass!"), and pacing ended // "no-battle-not-overworld" under his message. On the sim, a capture @@ -156,7 +156,7 @@ class SimConsoleCapture : public CaptureActions{ size_t m_read = 0; }; -// Console B, 2026-11-09 (00.30 run 5): catch_pidgey started on Route 7's +// Console B, 2026-11-09 (08.03 run 5): catch_pidgey started on Route 7's // (14, 6) on the Bicycle, ran from 4 wild battles and then paced 4 minutes // on the flowers east of the grass (11..18, 2..6). On the Bicycle a tap // facing another way steps too, so each turn of the pace took a tile, and diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryPacing.h b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryPacing.h index 7c36a7674a..6145e6a245 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryPacing.h +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryPacing.h @@ -24,7 +24,7 @@ namespace PokemonFRLG{ // Before pacing: gets the player off the Bicycle with SELECT, checked, // and once more if they still ride. On the Bicycle a tap facing another // way steps as well as turns, so pacing's turns walk it off the patch -// (console B, 2026-11-09, 00.30 run 5: Route 7's grass). Returns whether +// (console B, 2026-11-09, 08.03 run 5: Route 7's grass). Returns whether // the player is on foot. bool select_off_bike(const OverworldWalkSteps::BikeSelectCalls& calls); diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryParty.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryParty.cpp index c42f45ace3..c769fe016c 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryParty.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryParty.cpp @@ -94,8 +94,8 @@ constexpr Evolution EVOLUTIONS[] = { // other move offered over four is declined. Squirtle's is the speedrun's: // Water Gun where Bubble was (so the attack stays bottom left), Bite over // Tail Whip. TM and tutor moves are not level-up prompts and are not -// here; no rule replaces them, so Water Pulse (TM03, 00.14c) and Mega Kick -// (Route 4's tutor, 00.14) are kept over every later level-up move. +// here; no rule replaces them, so Water Pulse (TM03, 05.02) and Mega Kick +// (Route 4's tutor, 04.06) are kept over every later level-up move. struct LearnRule{ std::string_view line; std::string_view move; diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryParty_Tests.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryParty_Tests.cpp index b9a66c7e10..12fc97e335 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryParty_Tests.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryParty_Tests.cpp @@ -608,7 +608,7 @@ UnitTestResult test_run_then_overworld(Logger&){ return "START never looked for the overworld in the dark cave."; } -// Regression: console B, 2026-11-09, 00.28 hiker_lenny in Rock Tunnel +// Regression: console B, 2026-11-09, 08.01 hiker_lenny in Rock Tunnel // without Flash: the battle won with a move, then the dark cave's // overworld, black but for the lit circle on the player, read as the // text box with no HP box. The loop held B for an evolution three times diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryPoses.h b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryPoses.h index 90e5e66629..03700ed58e 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryPoses.h +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryPoses.h @@ -51,7 +51,7 @@ struct StoryPose{ }; // The variant of a ROUTE or LEGS step that runs, with B held: the player -// has the Running Shoes (00.10 on). +// has the Running Shoes (03.03 on). inline const std::string RUN_VARIANT = "run"; // The GAME step that closes the Trainer Card SID Helper leaves open. diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRngLoop.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRngLoop.cpp index 1b810ac2cd..17de77c1e1 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRngLoop.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRngLoop.cpp @@ -44,19 +44,19 @@ std::string starter_rng_loop_message(const StarterRngLoopResult& result){ ); case StarterRngLoopEnd::TARGET: return "Starter RNG hit the target (shiny not required). Nothing was saved after it: the game is where " - "Starter RNG's calibration left it. Play to the rival's battle and save by hand, then start AutoStory at 00.05."; + "Starter RNG's calibration left it. Play to the rival's battle and save by hand, then start AutoStory at 02.01."; case StarterRngLoopEnd::OUT_OF_ATTEMPTS: return std::format( "Starter RNG: every planned attempt hit its target and none was shiny. SIDs left: {}. " - "The save is still south of the table: raise the RNG plan's max attempts and start AutoStory at 00.04 again.", sids + "The save is still south of the table: raise the RNG plan's max attempts and start AutoStory at 01.05 again.", sids ); case StarterRngLoopEnd::MISSED_EVERY_ATTEMPT_LEFT: return "Starter RNG: every attempt left missed its target more often than the retries allow, or Starter RNG " "refused its timings (see the log). The save is still south of the table: check the RNG plan's sound setting " - "and start AutoStory at 00.04 again."; + "and start AutoStory at 01.05 again."; case StarterRngLoopEnd::OUT_OF_TIME: return std::format( - "Starter RNG: out of time after {} attempts. The save is still south of the table: start AutoStory at 00.04 again.", + "Starter RNG: out of time after {} attempts. The save is still south of the table: start AutoStory at 01.05 again.", result.attempts_run ); } @@ -65,16 +65,16 @@ std::string starter_rng_loop_message(const StarterRngLoopResult& result){ std::string gift_rng_loop_message(const StarterRngLoopResult& result){ - const std::string save = "The save is still beside the salesman, facing him: start AutoStory at 00.12b with Run Gift " + const std::string save = "The save is still beside the salesman, facing him: start AutoStory at 04.03 with Run Gift " "RNG in AutoStory on to try again, or run Gift RNG (Magikarp) from it by hand with an attempt from the log, then " - "start AutoStory at 00.12b with that option off."; + "start AutoStory at 04.03 with that option off."; switch (result.end){ case StarterRngLoopEnd::SHINY: - return "Gift RNG: shiny Magikarp, on the planned target. 00.12b saves it."; + return "Gift RNG: shiny Magikarp, on the planned target. 04.03 saves it."; case StarterRngLoopEnd::SHINY_OFF_TARGET: - return "Gift RNG: shiny Magikarp, but not the planned target. 00.12b saves it."; + return "Gift RNG: shiny Magikarp, but not the planned target. 04.03 saves it."; case StarterRngLoopEnd::TARGET: - return "Gift RNG hit the target (shiny not required). Nothing was saved after it: start AutoStory at 00.12b " + return "Gift RNG hit the target (shiny not required). Nothing was saved after it: start AutoStory at 04.03 " "to save the Magikarp where it stands."; case StarterRngLoopEnd::OUT_OF_ATTEMPTS: return std::format( diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRngLoop.h b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRngLoop.h index cdbb0c4591..46a8cb06e2 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRngLoop.h +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRngLoop.h @@ -58,7 +58,7 @@ class CalibrationSavingSteps : public StarterRngLoopSteps{ // The rows a run takes after a shiny from the loop, which leaves the player // under Squirtle's ball with the rival's ball taken: the row after -// `ball_row` (00.04b) from its step after "rival_takes_bulbasaur", then +// `ball_row` (01.06) from its step after "rival_takes_bulbasaur", then // the rows after it to `last` as plan_story_run() takes them with // `handoffs`, with the handoff they stop at. Throws InternalProgramError // for a table without that row or step. @@ -68,7 +68,7 @@ StoryRunPlan rows_after_starter_rng( // The rows a run takes after a shiny Magikarp from the loop, which leaves // its summary open beside the salesman: the row after `salesman_row` -// (00.12b), which leaves the summary and saves, then the rows after it to +// (04.03), which leaves the summary and saves, then the rows after it to // `last` as plan_story_run() takes them with `handoffs`. Throws // InternalProgramError for a table whose next row doesn't leave the // summary. diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRngLoop_Tests.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRngLoop_Tests.cpp index dda1d61eb1..03f6121ffc 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRngLoop_Tests.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRngLoop_Tests.cpp @@ -118,11 +118,11 @@ std::string first_step(const StoryRunPlan& plan){ return plan.rows.empty() || plan.rows.front().steps.empty() ? "" : plan.rows.front().steps.front().name; } -// After a shiny, 00.04b picks up at the rival's trigger and runs on, to +// After a shiny, 01.06 picks up at the rival's trigger and runs on, to // Gift RNG's stop when it is on. UnitTestResult test_rows_after_shiny(){ const std::vector& checkpoints = story_checkpoints(); - const size_t ball_row = row_index("00.04"); + const size_t ball_row = row_index("01.05"); struct Case{ std::string last; StoryHandoffs handoffs = {}; @@ -130,14 +130,14 @@ UnitTestResult test_rows_after_shiny(){ StoryHandoff stop = StoryHandoff::NONE; }; const std::vector cases = { - {.last = "00.04", .ids = "00.04b"}, - {.last = "00.04b", .ids = "00.04b"}, - {.last = "00.05", .ids = "00.04b,00.05"}, - {.last = "00.12b", .ids = "00.04b,00.05,00.06,00.07,00.08,00.09,00.10,00.11,00.12"}, + {.last = "01.05", .ids = "01.06"}, + {.last = "01.06", .ids = "01.06"}, + {.last = "02.01", .ids = "01.06,02.01"}, + {.last = "04.03", .ids = "01.06,02.01,02.02,02.03,03.01,03.02,03.03,04.01,04.02"}, { - .last = "00.12b", + .last = "04.03", .handoffs = {.starter_rng = true, .gift_rng = true}, - .ids = "00.04b,00.05,00.06,00.07,00.08,00.09,00.10,00.11,00.12", + .ids = "01.06,02.01,02.02,02.03,03.01,03.02,03.03,04.01,04.02", .stop = StoryHandoff::GIFT_RNG, }, }; @@ -154,24 +154,24 @@ UnitTestResult test_rows_after_shiny(){ } -// What the run says when Gift RNG's loop ends: a shiny goes on to 00.12b; +// What the run says when Gift RNG's loop ends: a shiny goes on to 04.03; // otherwise the save beside the salesman is where to go on from. UnitTestResult test_gift_messages(){ struct Case{ StarterRngLoopResult result; std::string expected; }; - const std::string save = "The save is still beside the salesman, facing him: start AutoStory at 00.12b with Run Gift " + const std::string save = "The save is still beside the salesman, facing him: start AutoStory at 04.03 with Run Gift " "RNG in AutoStory on to try again, or run Gift RNG (Magikarp) from it by hand with an attempt from the log, then " - "start AutoStory at 00.12b with that option off."; + "start AutoStory at 04.03 with that option off."; const std::vector cases = { { .result = {.end = StarterRngLoopEnd::SHINY, .attempts_run = 1, .remaining_sids = {300}, .sid = uint16_t(300)}, - .expected = "Gift RNG: shiny Magikarp, on the planned target. 00.12b saves it.", + .expected = "Gift RNG: shiny Magikarp, on the planned target. 04.03 saves it.", }, { .result = {.end = StarterRngLoopEnd::SHINY_OFF_TARGET, .attempts_run = 1, .remaining_sids = {300}, .sid = std::nullopt}, - .expected = "Gift RNG: shiny Magikarp, but not the planned target. 00.12b saves it.", + .expected = "Gift RNG: shiny Magikarp, but not the planned target. 04.03 saves it.", }, { .result = {.end = StarterRngLoopEnd::OUT_OF_ATTEMPTS, .attempts_run = 3, .remaining_sids = {}, .sid = std::nullopt}, @@ -192,24 +192,24 @@ UnitTestResult test_gift_messages(){ return true; } -// 00.12 saves facing the salesman for Gift RNG; after a shiny Magikarp, -// 00.12b leaves its summary and saves there, then the run goes on. +// 04.02 saves facing the salesman for Gift RNG; after a shiny Magikarp, +// 04.03 leaves its summary and saves there, then the run goes on. UnitTestResult test_rows_after_magikarp(){ const std::vector& checkpoints = story_checkpoints(); - const size_t salesman_row = row_index("00.12"); + const size_t salesman_row = row_index("04.02"); const StoryCheckpoint& salesman = checkpoints[salesman_row]; const StoryCheckpoint& after = checkpoints[salesman_row + 1]; const std::optional start = after.start ? story_pose(Pokemon::pose_of(*after.start)) : std::nullopt; if (salesman.handoff != StoryHandoff::GIFT_RNG || !after.live_start || !start || start->map != "Route4_PokemonCenter_1F" || !(start->tile == TilePos{2, 3}) || start->facing != Direction::WEST ){ - return "Expected 00.12 to be Gift RNG's handoff and 00.12b to start from the live game at (2, 3) facing west."; + return "Expected 04.02 to be Gift RNG's handoff and 04.03 to start from the live game at (2, 3) facing west."; } - for (std::string_view last : {"00.12", "00.12b"}){ + for (std::string_view last : {"04.02", "04.03"}){ const StoryRunPlan plan = rows_after_gift_rng(checkpoints, salesman_row, row_index(last), StoryHandoffs{.gift_rng = true}); - if (joined_ids(plan) != "00.12b" || first_step(plan) != LEAVE_GIFT_SUMMARY || plan.stop != StoryHandoff::NONE){ + if (joined_ids(plan) != "04.03" || first_step(plan) != LEAVE_GIFT_SUMMARY || plan.stop != StoryHandoff::NONE){ return std::format( - "To {}: expected 00.12b from {}; got {} from {}", last, LEAVE_GIFT_SUMMARY, joined_ids(plan), first_step(plan) + "To {}: expected 04.03 from {}; got {} from {}", last, LEAVE_GIFT_SUMMARY, joined_ids(plan), first_step(plan) ); } } @@ -356,7 +356,7 @@ const AutoStoryRngLoopTestCase AUTO_STORY_RNG_LOOP_CASES[] = { .expectation = {.description = "formats notifications for gift rng encounters"}, }, { - .input = {.name = "00.12 and 00.12b: rows after a shiny Magikarp", .body = test_rows_after_magikarp}, + .input = {.name = "04.02 and 04.03: rows after a shiny Magikarp", .body = test_rows_after_magikarp}, .expectation = {.description = "plans continuation rows following shiny magikarp"}, }, { diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRowSim.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRowSim.cpp index 744899b06e..397b96750d 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRowSim.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRowSim.cpp @@ -398,7 +398,7 @@ namespace{ // with a move: the battle loop's polls replayed through its EvolutionHold // and BattleEndWatch, as BattleLoop::step() takes them. The overworld of a // dark cave reads as the battle's text box with no HP box (console B, -// 2026-11-09, 00.28 hiker_lenny: three 20 s holds for an evolution, then +// 2026-11-09, 08.01 hiker_lenny: three 20 s holds for an evolution, then // "no battle screen and no START menu for 60 s after the battle"). Empty // once START would look for the overworld, else the loop's failure. std::string battle_end_on_sim(const OverworldSim& sim){ @@ -559,7 +559,7 @@ namespace{ // Whether the sim can walk a Pokemon Center's way in or out of `step`: // the map it ends on is built into the program. Celadon's Center has no -// map yet (00.30), so its way in is stubbed. +// map yet (08.03), so its way in is stubbed. bool center_walkable(const StoryStep& step){ if (!is_center_variant(step.action)){ return false; diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRowSim.h b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRowSim.h index e067d842fa..c151d60494 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRowSim.h +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRowSim.h @@ -72,7 +72,7 @@ class StoryMapsSim : public Pokemon::TableExecutor{ const std::map& bag() const{ return m_bag; } - // "00.03/oak: a dialog pops up before it.", and how it was cleared. + // "01.04/oak: a dialog pops up before it.", and how it was cleared. const std::vector& dialog_notes() const{ return m_dialog_notes; } diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRowSimStubs.h b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRowSimStubs.h index 922310049e..1d3fef33d1 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRowSimStubs.h +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRowSimStubs.h @@ -45,7 +45,7 @@ class SimStubs{ std::vector m_rows; }; -// Each attempt's stubs, a line a row: "00.03: 2 stubbed: oak, rival". +// Each attempt's stubs, a line a row: "01.04: 2 stubbed: oak, rival". std::string stub_report(const std::vector& rows); // A failed step fails the run as it threw: a simulation has no save to diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRows_Tests.h b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRows_Tests.h index 1f419186a1..6b15acaab2 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRows_Tests.h +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRows_Tests.h @@ -17,14 +17,14 @@ namespace NintendoSwitch{ namespace PokemonFRLG{ -// Rows 00.21 and 00.22 on the overworld sim (PokemonFRLG_AutoStoryVermilion_Tests.cpp). +// Rows 05.10 and 06.01 on the overworld sim (PokemonFRLG_AutoStoryVermilion_Tests.cpp). void add_tests_AutoStoryVermilion(UnitTestDatabase& database); -// Rows 00.23 to 00.25 on the overworld sim (PokemonFRLG_AutoStoryVermilionGym_Tests.cpp). +// Rows 06.02 to 06.04 on the overworld sim (PokemonFRLG_AutoStoryVermilionGym_Tests.cpp). void add_tests_AutoStoryVermilionGym(UnitTestDatabase& database); -// Rows from 00.26 on on the overworld sim (PokemonFRLG_AutoStoryCeladon_Tests.cpp), +// Rows from 07.01 on on the overworld sim (PokemonFRLG_AutoStoryCeladon_Tests.cpp), // with add_tests_AutoStoryLavender(). void add_tests_AutoStoryCeladon(UnitTestDatabase& database); -// Rows from 00.28 on on the overworld sim (PokemonFRLG_AutoStoryLavender_Tests.cpp). +// Rows from 08.01 on on the overworld sim (PokemonFRLG_AutoStoryLavender_Tests.cpp). void add_tests_AutoStoryLavender(UnitTestDatabase& database); diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRunPlan_Tests.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRunPlan_Tests.cpp index eaf483c8ce..1bfb846f94 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRunPlan_Tests.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryRunPlan_Tests.cpp @@ -4,7 +4,7 @@ * * Which rows of the story table a run takes (plan_story_run()) with the * RNG programs' handoffs on and off, the rows the handoffs split or - * join, Misty in Cerulean Gym, and what 00.15 runs before the rival. + * join, Misty in Cerulean Gym, and what 05.03 runs before the rival. * */ @@ -139,24 +139,24 @@ class Test_RunPlan : public UnitTest{ const RunPlanScenario m_scenario; }; -const std::string TODAY = "00.01 00.02 00.03 00.04 00.05 00.06 00.07 00.08 00.09 00.10 00.11 00.12 00.12c 00.13 00.14 00.14b 00.14c 00.15 00.15b 00.16 00.17 00.18 00.19 00.20 00.21 00.22 00.23 00.24 00.25 00.26 00.27 00.28 00.29 00.30 00.31 00.32"; +const std::string TODAY = "01.01 01.03 01.04 01.05 02.01 02.02 02.03 03.01 03.02 03.03 04.01 04.02 04.04 04.05 04.06 05.01 05.02 05.03 05.04 05.05 05.06 05.07 05.08 05.09 05.10 06.01 06.02 06.03 06.04 07.01 07.02 08.01 08.02 08.03 09.01 09.02"; const RunPlanScenario RUN_PLAN_CASES[] = { { - .input = {.name = "handoffs off: the story as before", .first = "00.01"}, + .input = {.name = "handoffs off: the story as before", .first = "01.01"}, .expectation = {.expected_ids = TODAY}, }, { - .input = {.name = "handoffs off: a range", .first = "00.02", .last = "00.04"}, - .expectation = {.expected_ids = "00.02 00.03 00.04"}, + .input = {.name = "handoffs off: a range", .first = "01.03", .last = "01.05"}, + .expectation = {.expected_ids = "01.03 01.04 01.05"}, }, { - .input = {.name = "handoffs off: Mt. Moon to Nugget Bridge", .first = "00.13", .last = "00.16"}, - .expectation = {.expected_ids = "00.13 00.14 00.14b 00.14c 00.15 00.15b 00.16"}, + .input = {.name = "handoffs off: Mt. Moon to Nugget Bridge", .first = "04.05", .last = "05.05"}, + .expectation = {.expected_ids = "04.05 04.06 05.01 05.02 05.03 05.04 05.05"}, }, { - .input = { .name = "SID Helper: 00.01 stops on the keyboard", - .first = "00.01", + .input = { .name = "SID Helper: 01.01 stops on the keyboard", + .first = "01.01", .handoffs = {.sid_helper = true}, }, .expectation = { @@ -166,79 +166,79 @@ const RunPlanScenario RUN_PLAN_CASES[] = { }, { .input = { - .name = "SID Helper: back in at 00.01b", - .first = "00.01b", - .last = "00.03", + .name = "SID Helper: back in at 01.02", + .first = "01.02", + .last = "01.04", .handoffs = {.sid_helper = true}, }, .expectation = { - .expected_ids = "00.01b 00.02 00.03", + .expected_ids = "01.02 01.03 01.04", }, }, { - .input = {.name = "00.01b runs when started at, option off", .first = "00.01b", .last = "00.02"}, - .expectation = {.expected_ids = "00.01b 00.02"}, + .input = {.name = "01.02 runs when started at, option off", .first = "01.02", .last = "01.03"}, + .expectation = {.expected_ids = "01.02 01.03"}, }, { - .input = {.name = "SID Helper: a later start passes over it", .first = "00.02", .last = "00.03", .handoffs = {.sid_helper = true}}, - .expectation = {.expected_ids = "00.02 00.03"}, + .input = {.name = "SID Helper: a later start passes over it", .first = "01.03", .last = "01.04", .handoffs = {.sid_helper = true}}, + .expectation = {.expected_ids = "01.03 01.04"}, }, { - .input = {.name = "handoffs off: an end at 00.04 still takes the rival's battle", .first = "00.03", .last = "00.04"}, - .expectation = {.expected_ids = "00.03 00.04"}, + .input = {.name = "handoffs off: an end at 01.05 still takes the rival's battle", .first = "01.04", .last = "01.05"}, + .expectation = {.expected_ids = "01.04 01.05"}, }, { .input = { - .name = "Starter RNG: stops after 00.04's save", - .first = "00.02", + .name = "Starter RNG: stops after 01.05's save", + .first = "01.03", .handoffs = {.starter_rng = true}, }, .expectation = { - .expected_ids = "00.02 00.03 00.04", + .expected_ids = "01.03 01.04 01.05", .expected_stop = StoryHandoff::STARTER_RNG, }, }, { - .input = {.name = "00.04b runs from its own save", .first = "00.04b", .last = "00.05"}, - .expectation = {.expected_ids = "00.04b 00.05"}, + .input = {.name = "01.06 runs from its own save", .first = "01.06", .last = "02.01"}, + .expectation = {.expected_ids = "01.06 02.01"}, }, { - .input = {.name = "Starter RNG: a later start doesn't stop", .first = "00.05", .last = "00.06", .handoffs = {.starter_rng = true}}, - .expectation = {.expected_ids = "00.05 00.06"}, + .input = {.name = "Starter RNG: a later start doesn't stop", .first = "02.01", .last = "02.02", .handoffs = {.starter_rng = true}}, + .expectation = {.expected_ids = "02.01 02.02"}, }, { .input = { .name = "both handoffs, back in after SID Helper", - .first = "00.01b", + .first = "01.02", .handoffs = {.sid_helper = true, .starter_rng = true}, }, .expectation = { - .expected_ids = "00.01b 00.02 00.03 00.04", + .expected_ids = "01.02 01.03 01.04 01.05", .expected_stop = StoryHandoff::STARTER_RNG, }, }, { .input = { - .name = "Gift RNG: stops after 00.12's save", - .first = "00.11", + .name = "Gift RNG: stops after 04.02's save", + .first = "04.01", .handoffs = {.gift_rng = true}, }, .expectation = { - .expected_ids = "00.11 00.12", + .expected_ids = "04.01 04.02", .expected_stop = StoryHandoff::GIFT_RNG, }, }, { - .input = {.name = "Gift RNG off: 00.12b is passed over", .first = "00.11"}, - .expectation = {.expected_ids = "00.11 00.12 00.12c 00.13 00.14 00.14b 00.14c 00.15 00.15b 00.16 00.17 00.18 00.19 00.20 00.21 00.22 00.23 00.24 00.25 00.26 00.27 00.28 00.29 00.30 00.31 00.32"}, + .input = {.name = "Gift RNG off: 04.03 is passed over", .first = "04.01"}, + .expectation = {.expected_ids = "04.01 04.02 04.04 04.05 04.06 05.01 05.02 05.03 05.04 05.05 05.06 05.07 05.08 05.09 05.10 06.01 06.02 06.03 06.04 07.01 07.02 08.01 08.02 08.03 09.01 09.02"}, }, { - .input = {.name = "Gift RNG off: 00.12b runs when started at", .first = "00.12b"}, - .expectation = {.expected_ids = "00.12b 00.12c 00.13 00.14 00.14b 00.14c 00.15 00.15b 00.16 00.17 00.18 00.19 00.20 00.21 00.22 00.23 00.24 00.25 00.26 00.27 00.28 00.29 00.30 00.31 00.32"}, + .input = {.name = "Gift RNG off: 04.03 runs when started at", .first = "04.03"}, + .expectation = {.expected_ids = "04.03 04.04 04.05 04.06 05.01 05.02 05.03 05.04 05.05 05.06 05.07 05.08 05.09 05.10 06.01 06.02 06.03 06.04 07.01 07.02 08.01 08.02 08.03 09.01 09.02"}, }, { - .input = { .name = "Gift RNG: started at 00.12b, from the save beside the salesman", - .first = "00.12b", + .input = { .name = "Gift RNG: started at 04.03, from the save beside the salesman", + .first = "04.03", .handoffs = {.gift_rng = true}, }, .expectation = { @@ -248,8 +248,8 @@ const RunPlanScenario RUN_PLAN_CASES[] = { }, { .input = { - .name = "Gift RNG: started at 00.12b with Starter RNG on too", - .first = "00.12b", + .name = "Gift RNG: started at 04.03 with Starter RNG on too", + .first = "04.03", .handoffs = {.sid_helper = true, .starter_rng = true, .gift_rng = true}, }, .expectation = { @@ -258,16 +258,16 @@ const RunPlanScenario RUN_PLAN_CASES[] = { }, }, { - .input = {.name = "Starter RNG alone: 00.12b runs when started at", .first = "00.12b", .handoffs = {.starter_rng = true}}, - .expectation = {.expected_ids = "00.12b 00.12c 00.13 00.14 00.14b 00.14c 00.15 00.15b 00.16 00.17 00.18 00.19 00.20 00.21 00.22 00.23 00.24 00.25 00.26 00.27 00.28 00.29 00.30 00.31 00.32"}, + .input = {.name = "Starter RNG alone: 04.03 runs when started at", .first = "04.03", .handoffs = {.starter_rng = true}}, + .expectation = {.expected_ids = "04.03 04.04 04.05 04.06 05.01 05.02 05.03 05.04 05.05 05.06 05.07 05.08 05.09 05.10 06.01 06.02 06.03 06.04 07.01 07.02 08.01 08.02 08.03 09.01 09.02"}, }, { .input = { .name = "Starter RNG first, with both on", - .first = "00.03", + .first = "01.04", .handoffs = {.starter_rng = true, .gift_rng = true}, }, .expectation = { - .expected_ids = "00.03 00.04", + .expected_ids = "01.04 01.05", .expected_stop = StoryHandoff::STARTER_RNG, }, }, @@ -287,48 +287,48 @@ std::string step_names(const StoryCheckpoint& checkpoint){ return text; } -// With Starter RNG's handoff off, 00.04 and 00.04b run as the one 00.04 +// With Starter RNG's handoff off, 01.05 and 01.06 run as the one 01.05 // the story had before the split: from the lab's table to the rival's // battle, saving once with the starter's START menu. UnitTestResult test_starter_rows_joined(){ const std::vector& checkpoints = story_checkpoints(); - const StoryRunPlan plan = plan_story_run(checkpoints, row_index("00.04"), row_index("00.04b"), StoryHandoffs{}); + const StoryRunPlan plan = plan_story_run(checkpoints, row_index("01.05"), row_index("01.06"), StoryHandoffs{}); const std::string expected_steps = "below_squirtle squirtle_ball choose_squirtle no_nickname rival_takes_bulbasaur above_rival_trigger rival_trigger rival_battle"; if (plan.rows.size() != 1){ return "Expected one checkpoint, got \"" + joined_ids(plan.rows) + "\"."; } const StoryCheckpoint& row = plan.rows[0]; - if (row.id != "00.04" || row.title != "Squirtle, then the rival's battle" || step_names(row) != expected_steps){ - return "Expected 00.04 \"Squirtle, then the rival's battle\": " + expected_steps + if (row.id != "01.05" || row.title != "Squirtle, then the rival's battle" || step_names(row) != expected_steps){ + return "Expected 01.05 \"Squirtle, then the rival's battle\": " + expected_steps + "; got " + row.id + " \"" + row.title + "\": " + step_names(row); } const std::optional start = story_pose(Pokemon::pose_of(*row.start)); if (!start || start->map != "PalletTown_ProfessorOaksLab" || !(start->tile == TilePos{6, 4}) || row.menu != StartMenu::BEFORE_POKEDEX){ - return "Expected the joined 00.04 to start at the table (6, 4) and save with the starter's START menu."; + return "Expected the joined 01.05 to start at the table (6, 4) and save with the starter's START menu."; } - // Split, 00.04 saves under the ball facing it, before the starter. - const StoryCheckpoint& to_ball = checkpoints[row_index("00.04")]; - const std::optional ball = story_pose(Pokemon::pose_of(*checkpoints[row_index("00.04b")].start)); + // Split, 01.05 saves under the ball facing it, before the starter. + const StoryCheckpoint& to_ball = checkpoints[row_index("01.05")]; + const std::optional ball = story_pose(Pokemon::pose_of(*checkpoints[row_index("01.06")].start)); if (to_ball.handoff != StoryHandoff::STARTER_RNG || to_ball.menu != StartMenu::BEFORE_POKEMON || !ball || !(ball->tile == TilePos{9, 5}) || ball->facing != Direction::NORTH ){ - return "Expected 00.04 to end under Squirtle's ball (9, 5) facing north, saving before the starter."; + return "Expected 01.05 to end under Squirtle's ball (9, 5) facing north, saving before the starter."; } return true; } // The ways back in after SID Helper and Gift RNG load no save and start -// where 00.01 and 00.12 leave the player, so the rows after them follow +// where 01.01 and 04.02 leave the player, so the rows after them follow // unchanged. UnitTestResult test_after_sid_helper_row(){ - const StoryCheckpoint& sid = story_checkpoints()[row_index("00.01b")]; + const StoryCheckpoint& sid = story_checkpoints()[row_index("01.02")]; if (!sid.live_start || story_checkpoints()[0].handoff != StoryHandoff::SID_HELPER){ - return "Expected 00.01 to be SID Helper's handoff and 00.01b to start from the live game."; + return "Expected 01.01 to be SID Helper's handoff and 01.02 to start from the live game."; } for (const StoryCheckpoint& checkpoint : story_checkpoints()){ - if (checkpoint.live_start != (checkpoint.id == "00.01b" || checkpoint.id == "00.12b")){ - return checkpoint.id + ": only 00.01b and 00.12b start from the live game."; + if (checkpoint.live_start != (checkpoint.id == "01.02" || checkpoint.id == "04.03")){ + return checkpoint.id + ": only 01.02 and 04.03 start from the live game."; } } return true; @@ -392,23 +392,23 @@ bool plans(const Pokemon::Pose& from, const Pokemon::Pose& to){ ).has_value(); } -// 00.15, before the rival, from the Center: first TM03 Water Pulse over +// 05.03, before the rival, from the Center: first TM03 Water Pulse over // Tail Whip if the lead doesn't know it, so the sim plays it in the // GRIND; Potions from Cerulean's Mart (a loaded save's bag may hold too // few for the wild battles a GRIND fights), and at its money floor 2 or // more Awakenings for the rival's Sleep Powder; then a GRIND on Route 4's // grass east of Mt. Moon to Lv22, where console B's lead beat the rival -// 00.15b fights, healing at Cerulean's Center; its trip there plans both ways. +// 05.04 fights, healing at Cerulean's Center; its trip there plans both ways. UnitTestResult test_cerulean_mart_and_grind(){ - const StoryCheckpoint& row = story_checkpoints()[row_index("00.15")]; + const StoryCheckpoint& row = story_checkpoints()[row_index("05.03")]; const std::vector& steps = row.steps; const std::optional start = row.start ? story_pose(Pokemon::pose_of(*row.start)) : std::nullopt; if (!start || start->map != "CeruleanCity_PokemonCenter_1F"){ - return "00.15: expected it to start in Cerulean's Center."; + return "05.03: expected it to start in Cerulean's Center."; } const std::optional teach = steps.empty() ? std::nullopt : teach_of(steps[0]); if (!teach || teach->item != "tm03" || teach->move != "water-pulse" || teach->member != 0 || teach->forget_move != "tail-whip"){ - return "00.15: expected it to start with TM03 Water Pulse over the lead's Tail Whip."; + return "05.03: expected it to start with TM03 Water Pulse over the lead's Tail Whip."; } const size_t mart = find_step(steps, 0, [](const StoryStep& step){ const std::optional plan = mart_of(step); @@ -419,7 +419,7 @@ UnitTestResult test_cerulean_mart_and_grind(){ return plan && plan->member == 0 && plan->level >= 22; }); if (mart == steps.size() || grind == steps.size()){ - return "00.15: expected a Cerulean Mart step buying Potions, then a GRIND of the lead to Lv22 or more."; + return "05.03: expected a Cerulean Mart step buying Potions, then a GRIND of the lead to Lv22 or more."; } const MartPlan plan = *mart_of(steps[mart]); const std::optional> buys = plan.money_floor @@ -429,64 +429,64 @@ UnitTestResult test_cerulean_mart_and_grind(){ return buy.item == "awakening" && buy.quantity >= 2; }); if (!awakenings){ - return "00.15: expected the Mart step to buy 2 or more Awakenings at its money floor."; + return "05.03: expected the Mart step to buy 2 or more Awakenings at its money floor."; } const std::optional clerk = mart > 0 ? story_pose_arg(steps[mart - 1], "target") : std::nullopt; if (!clerk || clerk->map != "CeruleanCity_Mart"){ - return "00.15: expected the Mart step right after a route to the clerk."; + return "05.03: expected the Mart step right after a route to the clerk."; } const auto trip = grind_trip(steps, grind); if (!trip){ - return "00.15: expected the GRIND right after a route to its patch, with the nurse as its target."; + return "05.03: expected the GRIND right after a route to its patch, with the nurse as its target."; } const auto& [patch, nurse] = *trip; const std::optional nurse_pose = story_pose(nurse); if (!nurse_pose || nurse_pose->map != "CeruleanCity_PokemonCenter_1F" || !plans(patch, nurse) || !plans(nurse, patch)){ - return "00.15: expected the GRIND's trips to Cerulean's nurse and back to plan."; + return "05.03: expected the GRIND's trips to Cerulean's nurse and back to plan."; } return true; } -// 00.15b, the rival's battle as its own checkpoint, as every battle lost -// twice or more gets: it starts from a save, 00.15's on (23, 7) below his +// 05.04, the rival's battle as its own checkpoint, as every battle lost +// twice or more gets: it starts from a save, 05.03's on (23, 7) below his // trigger with the nurse just before, so a verify run or a retry reloads // right before him; and his is its only battle. First Water Pulse over // Tail Whip if the lead doesn't know it: console B's save (2026-11-03) is // past the TEACH that failed there, which does nothing once it is known. UnitTestResult test_cerulean_rival_row(){ const std::vector& checkpoints = story_checkpoints(); - const size_t index = row_index("00.15b"); + const size_t index = row_index("05.04"); const StoryCheckpoint& rival = checkpoints[index]; const std::optional start = rival.start ? story_pose(Pokemon::pose_of(*rival.start)) : std::nullopt; if (!start || rival.live_start || start->map != "CeruleanCity" || !(start->tile == TilePos{23, 7}) || save_card_place(start->map).empty() ){ - return "00.15b: expected it to start from a save on (23, 7) in Cerulean City."; + return "05.04: expected it to start from a save on (23, 7) in Cerulean City."; } std::string battles; for (const StoryStep& step : rival.steps){ battles += step.kind == StoryStepKind::BATTLE ? " " + step.name : ""; } if (battles != " rival_cerulean" || rival.steps.size() != 3 || rival.steps[1].name != "rival_trigger"){ - return "00.15b: expected a TEACH, the step onto his trigger and his battle; its battles:" + battles; + return "05.04: expected a TEACH, the step onto his trigger and his battle; its battles:" + battles; } const std::optional teach = teach_of(rival.steps[0]); if (rival.steps[0].kind != StoryStepKind::GAME || !teach || teach->item != "tm03" || teach->move != "water-pulse" || teach->member != 0 || teach->forget_move != "tail-whip" ){ - return "00.15b: expected it to start with TM03 Water Pulse over the lead's Tail Whip."; + return "05.04: expected it to start with TM03 Water Pulse over the lead's Tail Whip."; } const StoryCheckpoint& before = checkpoints[index - 1]; const size_t n = before.steps.size(); const std::optional end = n > 0 ? story_pose_arg(before.steps[n - 1], "target") : std::nullopt; - if (before.id != "00.15" || n < 2 || before.steps[n - 2].kind != StoryStepKind::HEAL + if (before.id != "05.03" || n < 2 || before.steps[n - 2].kind != StoryStepKind::HEAL || !end || end->map != start->map || !(end->tile == start->tile) ){ - return "00.15: expected it to end with the nurse, then the walk to (23, 7) where 00.15b starts."; + return "05.03: expected it to end with the nurse, then the walk to (23, 7) where 05.04 starts."; } for (const StoryStep& step : before.steps){ if (step.kind == StoryStepKind::BATTLE){ - return "00.15: expected no trainer battle before its save; found " + step.name + "."; + return "05.03: expected no trainer battle before its save; found " + step.name + "."; } } return true; @@ -501,17 +501,17 @@ std::string battle_names(const StoryCheckpoint& row){ return battles; } -// 00.14b, before Misty: Potions at Cerulean's Mart, then into the Gym to -// a save on (9, 7), below her platform; no battle. 00.14c, Misty's battle +// 05.01, before Misty: Potions at Cerulean's Mart, then into the Gym to +// a save on (9, 7), below her platform; no battle. 05.02, Misty's battle // as its own checkpoint: it starts from that save, talks to her from // beside her, (9, 6), and hers is its only battle; then TM03 Water Pulse // in place of Tail Whip. UnitTestResult test_misty_rows(){ const std::vector& checkpoints = story_checkpoints(); - const StoryCheckpoint& gym = checkpoints[row_index("00.14b")]; - const StoryCheckpoint& misty = checkpoints[row_index("00.14c")]; - if (checkpoints[row_index("00.14b") - 1].id != "00.14" || checkpoints[row_index("00.14c") + 1].id != "00.15"){ - return "Expected 00.14b and 00.14c between 00.14 and 00.15."; + const StoryCheckpoint& gym = checkpoints[row_index("05.01")]; + const StoryCheckpoint& misty = checkpoints[row_index("05.02")]; + if (checkpoints[row_index("05.01") - 1].id != "04.06" || checkpoints[row_index("05.02") + 1].id != "05.03"){ + return "Expected 05.01 and 05.02 between 04.06 and 05.03."; } const std::vector& steps = gym.steps; const size_t mart = find_step(steps, 0, [](const StoryStep& step){ @@ -519,41 +519,41 @@ UnitTestResult test_misty_rows(){ return plan && plan->map == "CeruleanCity_Mart" && !plan->lines.empty() && plan->lines[0].item == "potion"; }); if (mart == steps.size() || !battle_names(gym).empty()){ - return "00.14b: expected a Cerulean Mart step buying Potions and no battle; its battles:" + battle_names(gym); + return "05.01: expected a Cerulean Mart step buying Potions and no battle; its battles:" + battle_names(gym); } const std::optional start = misty.start ? story_pose(Pokemon::pose_of(*misty.start)) : std::nullopt; if (!start || misty.live_start || start->map != "CeruleanCity_Gym" || !(start->tile == TilePos{9, 7}) || save_card_place(start->map).empty() ){ - return "00.14c: expected it to start from a save on (9, 7) in Cerulean Gym."; + return "05.02: expected it to start from a save on (9, 7) in Cerulean Gym."; } if (battle_names(misty) != " misty" || misty.steps.size() < 3 || misty.steps[1].kind != StoryStepKind::TALK || misty.steps[2].name != "misty" ){ - return "00.14c: expected a walk beside Misty, the talk and her battle, the only one; its battles:" + battle_names(misty); + return "05.02: expected a walk beside Misty, the talk and her battle, the only one; its battles:" + battle_names(misty); } const std::optional beside = story_pose_arg(misty.steps[0], "target"); if (!beside || !(beside->tile == TilePos{9, 6}) || beside->facing != Direction::WEST){ - return "00.14c: expected the talk from (9, 6), facing Misty (8, 6)."; + return "05.02: expected the talk from (9, 6), facing Misty (8, 6)."; } const size_t teach = find_step(misty.steps, 0, [](const StoryStep& step){ const std::optional plan = teach_of(step); return plan && plan->item == "tm03" && plan->move == "water-pulse" && plan->member == 0 && plan->forget_move == "tail-whip"; }); if (teach == misty.steps.size()){ - return "00.14c: expected TM03 Water Pulse taught to the lead in place of Tail Whip."; + return "05.02: expected TM03 Water Pulse taught to the lead in place of Tail Whip."; } return true; } -// 00.14b in order (Misty lost to at Lv20, console B, run m51): the Mart +// 05.01 in order (Misty lost to at Lv20, console B, run m51): the Mart // first, Potions then Super Potions, the Potions enough for the GRIND's // wild battles at the table's money floor and at least one Super Potion // after them; a GRIND of the lead to Lv23 on Route 4, from a route to its // patch, with Cerulean's nurse as its target; the nurse; then the walk // into the Gym, ending on (9, 7). UnitTestResult test_misty_grind_order(){ - const std::vector& steps = story_checkpoints()[row_index("00.14b")].steps; + const std::vector& steps = story_checkpoints()[row_index("05.01")].steps; std::optional plan; const size_t mart = find_step(steps, 0, [&](const StoryStep& step){ plan = mart_of(step); @@ -562,11 +562,11 @@ UnitTestResult test_misty_grind_order(){ if (mart == steps.size() || plan->lines.size() < 2 || plan->lines[0].item != "potion" || plan->lines[1].item != "super-potion" || !plan->money_floor ){ - return "00.14b: expected a Cerulean Mart step buying Potions, then Super Potions, with a money floor."; + return "05.01: expected a Cerulean Mart step buying Potions, then Super Potions, with a money floor."; } const std::optional> buys = plan_mart_buys(mart_stock(plan->map), *plan, *plan->money_floor); if (!buys || buys->size() < 2 || (*buys)[0].quantity < 2 || (*buys)[1].item != "super-potion"){ - return "00.14b: expected the money floor to buy 2 or more Potions and a Super Potion."; + return "05.01: expected the money floor to buy 2 or more Potions and a Super Potion."; } const size_t grind = find_step(steps, mart, [](const StoryStep& step){ const std::optional grind_plan = grind_of(step); @@ -574,13 +574,13 @@ UnitTestResult test_misty_grind_order(){ }); const auto trip = grind_trip(steps, grind); if (!trip){ - return "00.14b: expected a GRIND of the lead to Lv23 after the Mart, right after a route to its patch, the nurse its target."; + return "05.01: expected a GRIND of the lead to Lv23 after the Mart, right after a route to its patch, the nurse its target."; } const std::optional patch = story_pose(trip->first), nurse = story_pose(trip->second); if (!patch || patch->map != "Route4" || !nurse || nurse->map != "CeruleanCity_PokemonCenter_1F" || !plans(trip->first, trip->second) || !plans(trip->second, trip->first) ){ - return "00.14b: expected the GRIND on Route 4, its trips to Cerulean's nurse and back planning."; + return "05.01: expected the GRIND on Route 4, its trips to Cerulean's nurse and back planning."; } const size_t heal = find_step(steps, grind + 1, [](const StoryStep& step){ return step.name == "heal_cerulean"; @@ -590,7 +590,7 @@ UnitTestResult test_misty_grind_order(){ return pose && pose->map == "CeruleanCity_Gym"; }); if (heal == steps.size() || gym == steps.size() || heal > gym){ - return "00.14b: expected the nurse after the GRIND, then the walk into the Gym."; + return "05.01: expected the nurse after the GRIND, then the walk into the Gym."; } StoryPose end; for (const StoryStep& step : steps){ @@ -598,7 +598,7 @@ UnitTestResult test_misty_grind_order(){ end = pose ? *pose : end; } if (end.map != "CeruleanCity_Gym"){ - return "00.14b: expected the row to end in Cerulean Gym."; + return "05.01: expected the row to end in Cerulean Gym."; } return true; } @@ -608,27 +608,27 @@ UnitTestResult test_misty_grind_order(){ const AutoStoryCase AUTO_STORY_CASES[] = { { - .input = {"00.01b and 00.12b: back in after SID Helper and Gift RNG", test_after_sid_helper_row}, + .input = {"01.02 and 04.03: back in after SID Helper and Gift RNG", test_after_sid_helper_row}, .expectation = {}, }, { - .input = {"00.04 and 00.04b: one checkpoint with Starter RNG off", test_starter_rows_joined}, + .input = {"01.05 and 01.06: one checkpoint with Starter RNG off", test_starter_rows_joined}, .expectation = {}, }, { - .input = {"00.15: Potions at Cerulean's Mart and a GRIND before the rival", test_cerulean_mart_and_grind}, + .input = {"05.03: Potions at Cerulean's Mart and a GRIND before the rival", test_cerulean_mart_and_grind}, .expectation = {}, }, { - .input = {"00.15b: the rival's battle alone, from a save before him", test_cerulean_rival_row}, + .input = {"05.04: the rival's battle alone, from a save before him", test_cerulean_rival_row}, .expectation = {}, }, { - .input = {"00.14b and 00.14c: Cerulean Gym, then Misty alone from a save before her", test_misty_rows}, + .input = {"05.01 and 05.02: Cerulean Gym, then Misty alone from a save before her", test_misty_rows}, .expectation = {}, }, { - .input = {"00.14b: Potions and Super Potions, a GRIND to Lv23, the nurse, then the Gym", test_misty_grind_order}, + .input = {"05.01: Potions and Super Potions, a GRIND to Lv23, the nurse, then the Gym", test_misty_grind_order}, .expectation = {}, }, }; diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryScreenEvents_Tests.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryScreenEvents_Tests.cpp index 146e19cdcf..2871f561bf 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryScreenEvents_Tests.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryScreenEvents_Tests.cpp @@ -94,7 +94,7 @@ const ScreenEventsCase SCREEN_EVENTS_CASES[] = { .expectation = {{ScreenEvent::FADE_WHITE}}, }, { - // Rock Tunnel without Flash (console B, 2026-11-09, 00.28): its + // Rock Tunnel without Flash (console B, 2026-11-09, 08.01): its // black read as a battle's text box before each step. .input = {"a dark cave, black but for a lit middle, shows nothing", 0xff000000, 0xff8c7c64}, .expectation = {{}}, diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStorySimulation_Tests.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStorySimulation_Tests.cpp index 48145de2bc..6a3d5e0278 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStorySimulation_Tests.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStorySimulation_Tests.cpp @@ -239,7 +239,7 @@ UnitTestResult test_whole_story(){ if (report.one_shot_passes() != report.checkpoints_run){ return "Expected every checkpoint one-shot:" + joined(sim.lines); } - // 00.07's shopping, with the cursor staying on each row bought. + // 02.03's shopping, with the cursor staying on each row bought. const std::map bought{{"potion", 5}, {"antidote", 3}, {"parlyz_heal", 1}}; if (sim.game.bag() != bought){ std::string text; @@ -279,9 +279,9 @@ UnitTestResult test_stubbed_steps_need_the_console(Logger& logger){ UnitTestResult test_start_and_end(){ Simulation sim; - const Pokemon::SegmentReport report = sim.run({.from = "00.05", .to = "00.07"}); - if (!report.completed || sim.begun() != std::vector{"00.05", "00.06", "00.07"}){ - return "Expected 00.05 to 00.07 only:" + joined(sim.begun()); + const Pokemon::SegmentReport report = sim.run({.from = "02.01", .to = "02.03"}); + if (!report.completed || sim.begun() != std::vector{"02.01", "02.02", "02.03"}){ + return "Expected 02.01 to 02.03 only:" + joined(sim.begun()); } return true; } @@ -290,27 +290,27 @@ UnitTestResult test_start_and_end(){ // the checkpoint reloads its last save and runs again from its start. UnitTestResult test_retry_from_save(){ Simulation sim; - sim.game.failures["00.08/forest_north"] = {.failure = "operation_failed", .times = 1}; - const Pokemon::SegmentReport report = sim.run({.from = "00.08", .to = "00.09"}); - if (!report.completed || report.reloads != 1 || sim.begun() != std::vector{"00.08", "00.08", "00.09"} - || sim.count("00.08/forest_east") != 2 + sim.game.failures["03.01/forest_north"] = {.failure = "operation_failed", .times = 1}; + const Pokemon::SegmentReport report = sim.run({.from = "03.01", .to = "03.02"}); + if (!report.completed || report.reloads != 1 || sim.begun() != std::vector{"03.01", "03.01", "03.02"} + || sim.count("03.01/forest_east") != 2 ){ - return "Expected 00.08 reloaded once and run again from its start:" + joined(sim.game.trace); + return "Expected 03.01 reloaded once and run again from its start:" + joined(sim.game.trace); } - if (std::find(sim.lines.begin(), sim.lines.end(), "[Checkpoint] 00.08: passed on attempt 2 (1 reset)") == sim.lines.end()){ + if (std::find(sim.lines.begin(), sim.lines.end(), "[Checkpoint] 03.01: passed on attempt 2 (1 reset)") == sim.lines.end()){ return "Expected the retried pass logged:" + joined(sim.lines); } return true; } -// console B, FRLG 00.27, 2026-11-09: the save stood below Cerulean Center's -// door (22, 19), and the run walked as if from the counter where 00.27 -// starts. It, and 00.09 from below Pewter Center's door (17, 25), stop +// console B, FRLG 07.02, 2026-11-09: the save stood below Cerulean Center's +// door (22, 19), and the run walked as if from the counter where 07.02 +// starts. It, and 03.02 from below Pewter Center's door (17, 25), stop // before any step or save. UnitTestResult test_save_off_start_pose(){ const std::pair CASES[] = { - {"00.09", StoryPose{"PewterCity", TilePos{17, 26}, Direction::SOUTH}}, - {"00.27", StoryPose{"CeruleanCity", TilePos{22, 20}, Direction::SOUTH}}, + {"03.02", StoryPose{"PewterCity", TilePos{17, 26}, Direction::SOUTH}}, + {"07.02", StoryPose{"CeruleanCity", TilePos{22, 20}, Direction::SOUTH}}, }; for (const auto& [id, save] : CASES){ Simulation sim; @@ -330,21 +330,21 @@ UnitTestResult test_save_off_start_pose(){ // Brock's battle lost every time: three attempts, then the stop. UnitTestResult test_gives_up_after_attempts(){ Simulation sim; - sim.game.failures["00.09/brock"] = {.failure = "blackout", .times = 10}; - const Pokemon::SegmentReport report = sim.run({.from = "00.09", .to = std::nullopt}); - if (report.completed || report.reloads != 2 || report.failed_checkpoint != "00.09" || report.failed_event != "brock" - || report.failure.failure != "blackout" || sim.count("00.09/brock") != 3 || !sim.saves.empty() + sim.game.failures["03.02/brock"] = {.failure = "blackout", .times = 10}; + const Pokemon::SegmentReport report = sim.run({.from = "03.02", .to = std::nullopt}); + if (report.completed || report.reloads != 2 || report.failed_checkpoint != "03.02" || report.failed_event != "brock" + || report.failure.failure != "blackout" || sim.count("03.02/brock") != 3 || !sim.saves.empty() ){ - return "Expected 00.09 tried 3 times, then a stop on Brock:" + joined(sim.game.trace) + joined(sim.lines); + return "Expected 03.02 tried 3 times, then a stop on Brock:" + joined(sim.game.trace) + joined(sim.lines); } return true; } -// Walks `step` of 00.14 on `sim` from `at`, where the table says the +// Walks `step` of 04.06 on `sim` from `at`, where the table says the // player stands, and moves `at` to where it says the step ends. Returns // the failure, or empty. std::string walk_on_sim(OverworldSim& sim, StoryPose& at, const StoryStep& step){ - const std::string where = "00.14/" + step.name + ": "; + const std::string where = "04.06/" + step.name + ": "; // A walk that ends on an open leg may leave the player short of it. bool open_end = false; if (step.kind == StoryStepKind::ROUTE || step.kind == StoryStepKind::LEGS){ @@ -371,7 +371,7 @@ std::string walk_on_sim(OverworldSim& sim, StoryPose& at, const StoryStep& step) return ""; } -// Console B, 2026-11-03 (row 00.14): the open leg east from Route 4 +// Console B, 2026-11-03 (row 04.06): the open leg east from Route 4 // into Cerulean City ended a tile short, on (6, 20), with nothing on // screen. No hold to a wall finds the player there, and the walk went on // a column off, the hold south stopped by the fence on (6, 23), to a @@ -379,10 +379,10 @@ std::string walk_on_sim(OverworldSim& sim, StoryPose& at, const StoryStep& step) // foot of Route 4's ledge, the row's walks on the sim reach the nurse // with that leg whole or a tile short. UnitTestResult test_cerulean_entry_short(){ - const StoryCheckpoint* row = &checkpoint_row("00.14"); + const StoryCheckpoint* row = &checkpoint_row("04.06"); const auto hop = std::find_if(row->steps.begin(), row->steps.end(), [](const StoryStep& step){ return step.name == "ledge_hop"; }); if (hop == row->steps.end() || !hop->pose_after){ - return "00.14: no ledge_hop."; + return "04.06: no ledge_hop."; } for (int short_by : {0, 1}){ StoryPose at = *story_pose(Pokemon::pose_of(*hop->pose_after)); @@ -399,23 +399,23 @@ UnitTestResult test_cerulean_entry_short(){ return true; } -// Console B, 2026-11-03 (row 00.16), twice: the open leg north from +// Console B, 2026-11-03 (row 05.05), twice: the open leg north from // Cerulean City onto Nugget Bridge ended on (11, 33), a tile short of // (11, 32), and the one step onto Cale's row reached only (11, 32), out // of his sight: "bug_catcher_cale: failed: no_battle". From the walk's // end, whole or a tile short, the five trainers are met and beaten on // the sim, each battle on the trainer's row. UnitTestResult test_nugget_bridge_short(){ - const StoryCheckpoint* row = &checkpoint_row("00.16"); + const StoryCheckpoint* row = &checkpoint_row("05.05"); const auto walk = std::find_if(row->steps.begin(), row->steps.end(), [](const StoryStep& step){ return step.name == "below_cale_line"; }); if (walk == row->steps.end() || !walk->args.contains("target")){ - return "No step 00.16/below_cale_line."; + return "No step 05.05/below_cale_line."; } for (int short_by : {0, 1}){ StoryPose at = *story_pose(Pokemon::pose_of(Pokemon::story_arg(walk->args, "target"))); OverworldSim sim(story_maps(), MapPosition{at.map, {at.tile.x, at.tile.y + short_by}}, Direction::NORTH); for (auto step = walk + 1; step != row->steps.end() && step->kind != StoryStepKind::READY; ++step){ - const std::string failure = row_step_on_sim(sim, at, *step, "00.16"); + const std::string failure = row_step_on_sim(sim, at, *step, "05.05"); if (!failure.empty()){ return std::format("Walk {} tile(s) short: ", short_by) + failure; } @@ -427,17 +427,17 @@ UnitTestResult test_nugget_bridge_short(){ return true; } -// 00.17 on the sim, from its start on Route 24 to the Sea Cottage: +// 05.06 on the sim, from its start on Route 24 to the Sea Cottage: // Franklin, Kelsey, Nob and Haley are met on the steps into their lines // and beaten there. The sim's trainers who look around see every way // they may look, so Youngster Dan sees the player on (20, 4), walks up // to (21, 4) and is fought there, off the way on. UnitTestResult test_route25_trainers(){ - const StoryCheckpoint* row = &checkpoint_row("00.17"); + const StoryCheckpoint* row = &checkpoint_row("05.06"); StoryPose at = *story_pose(Pokemon::pose_of(*row->start)); OverworldSim sim(story_maps(), MapPosition{at.map, at.tile}, *at.facing); for (const StoryStep& step : row->steps){ - const std::string failure = row_step_on_sim(sim, at, step, "00.17"); + const std::string failure = row_step_on_sim(sim, at, step, "05.06"); if (!failure.empty()){ return failure; } @@ -448,23 +448,23 @@ UnitTestResult test_route25_trainers(){ for (const std::string& name : sim.state().trainers_beaten){ beaten += " " + name; } - return "00.17: expected Franklin, Dan, Kelsey, Nob and Haley beaten; beat" + beaten + "."; + return "05.06: expected Franklin, Dan, Kelsey, Nob and Haley beaten; beat" + beaten + "."; } if (!(sim.state().position == MapPosition{"Route25_SeaCottage", {7, 8}})){ - return "00.17: expected to end in the Sea Cottage on (7, 8), not " + to_string(sim.state().position) + "."; + return "05.06: expected to end in the Sea Cottage on (7, 8), not " + to_string(sim.state().position) + "."; } return true; } -// 00.20 on the sim, its walks from the Center: over Nugget Bridge, whose -// trainers 00.16 beat (they stand there, but don't battle), onto Route +// 05.09 on the sim, its walks from the Center: over Nugget Bridge, whose +// trainers 05.05 beat (they stand there, but don't battle), onto Route // 24's grass at (4, 19) out of Camper Shane's sight, and back to the // nurse. No trainer battles on the way. The open leg north from Cerulean // City onto the bridge crosses onto Route 24, where the game holds the // player up a tile: held for its tiles alone it ended on (11, 16), a tile // short, and the leg west bumped the bridge's posts (console B, -// 2026-11-03, row 00.20, twice). -// The story maps after 00.16: Nugget Bridge's trainers beaten, standing +// 2026-11-03, row 05.09, twice). +// The story maps after 05.05: Nugget Bridge's trainers beaten, standing // on columns 10 and 12 without battling. std::vector maps_bridge_beaten(){ std::vector maps = story_maps(); @@ -482,7 +482,7 @@ std::vector maps_bridge_beaten(){ } UnitTestResult test_oddish_walks(){ - const StoryCheckpoint* row = &checkpoint_row("00.20"); + const StoryCheckpoint* row = &checkpoint_row("05.09"); StoryPose at = *story_pose(Pokemon::pose_of(*row->start)); OverworldSim sim(maps_bridge_beaten(), MapPosition{at.map, at.tile}, *at.facing); const std::map ends{ @@ -495,17 +495,17 @@ UnitTestResult test_oddish_walks(){ if (step.kind != StoryStepKind::ROUTE && step.kind != StoryStepKind::LEGS){ continue; } - const std::string failure = row_step_on_sim(sim, at, step, "00.20"); + const std::string failure = row_step_on_sim(sim, at, step, "05.09"); if (!failure.empty()){ return failure; } const auto end = ends.find(step.name); if (end == ends.end() || !(sim.state().position == end->second)){ - return "00.20/" + step.name + ": ended on " + to_string(sim.state().position) + "."; + return "05.09/" + step.name + ": ended on " + to_string(sim.state().position) + "."; } } if (!sim.state().trainers_beaten.empty() || !sim.state().violations.empty()){ - return "00.20: a trainer's battle or a violation on the way."; + return "05.09: a trainer's battle or a violation on the way."; } return true; } @@ -531,7 +531,7 @@ std::optional target_of(const StoryStep& step){ return target == nullptr ? std::nullopt : std::optional(Pokemon::pose_of(*target)); } -// Console B, 2026-11-03 (row 00.20, run m61): the Oddish's battle came +// Console B, 2026-11-03 (row 05.09, run m61): the Oddish's battle came // on the pace's far step, so the capture left the player on (3, 19), not // the table's (4, 19). The walk back planned from (4, 19) went a column // west of its plan, down the bridge's column 10, not 11, and stopped @@ -539,18 +539,18 @@ std::optional target_of(const StoryStep& step){ // warp to the Center never came. On the sim, the battle on either step // of the pace, the row's later walks, from the capture's tiles, reach the // nurse. -// Console B, 2026-11-03 (m63, 00.20 verify run 2): the open leg west +// Console B, 2026-11-03 (m63, 05.09 verify run 2): the open leg west // from Nugget Bridge's head ended a tile short, so the walk down onto the // grass ended on (5, 19), in Camper Shane's sight; after the first wild // battle he walked up ("I saw your feat from the grass!") and the capture // stopped. From the Mart, the walk to the patch on the sim keeps out of // his sight with the leg west whole or a tile short. UnitTestResult test_oddish_patch_west_short(){ - const StoryCheckpoint* row = &checkpoint_row("00.20"); + const StoryCheckpoint* row = &checkpoint_row("05.09"); const auto mart = std::find_if(row->steps.begin(), row->steps.end(), [](const StoryStep& step){ return step.name == "mart_clerk"; }); const auto patch = std::find_if(row->steps.begin(), row->steps.end(), [](const StoryStep& step){ return step.name == "oddish_patch"; }); if (mart == row->steps.end() || patch == row->steps.end() || !target_of(*mart) || !target_of(*patch)){ - return "00.20: no mart_clerk or oddish_patch."; + return "05.09: no mart_clerk or oddish_patch."; } for (int short_by : {0, 1}){ StoryPose at = *story_pose(*target_of(*mart)); @@ -559,7 +559,7 @@ UnitTestResult test_oddish_patch_west_short(){ // over the bridge, then the 8th, west from the bridge's head. script.short_holds[8] = short_by; OverworldSim sim(maps_bridge_beaten(), MapPosition{at.map, at.tile}, *at.facing, script); - const std::string failure = row_step_on_sim(sim, at, *patch, "00.20"); + const std::string failure = row_step_on_sim(sim, at, *patch, "05.09"); const std::string label = std::format("West leg {} tile(s) short: ", short_by); if (!failure.empty()){ return label + failure; @@ -576,14 +576,14 @@ UnitTestResult test_oddish_patch_west_short(){ } UnitTestResult test_oddish_battle_on_far_step(){ - const StoryCheckpoint* row = &checkpoint_row("00.20"); + const StoryCheckpoint* row = &checkpoint_row("05.09"); const auto capture = std::find_if(row->steps.begin(), row->steps.end(), [](const StoryStep& step){ return step.name == "catch_oddish"; }); if (capture == row->steps.end() || capture + 1 == row->steps.end() || !target_of(*(capture + 1))){ - return "00.20: no catch_oddish with a route after it."; + return "05.09: no catch_oddish with a route after it."; } const auto patch = std::find_if(row->steps.begin(), capture, [](const StoryStep& step){ return step.name == "oddish_patch"; }); if (patch == capture || !target_of(*patch)){ - return "00.20: no oddish_patch before catch_oddish."; + return "05.09: no oddish_patch before catch_oddish."; } // The sim starts on the patch (3, 19): grass step 1 is the pace's far // step onto (4, 19), step 2 the one back. @@ -606,17 +606,17 @@ UnitTestResult test_oddish_battle_on_far_step(){ if (!route){ return label + "no route from the capture's tiles."; } - if (const std::string failure = walk_paced_route(sim, *route, "00.20/" + back.name); !failure.empty()){ + if (const std::string failure = walk_paced_route(sim, *route, "05.09/" + back.name); !failure.empty()){ return label + failure; } for (auto step = capture + 2; step != row->steps.end(); ++step){ - const std::string failure = row_step_on_sim(sim, at, *step, "00.20"); + const std::string failure = row_step_on_sim(sim, at, *step, "05.09"); if (!failure.empty()){ return label + failure; } } if (!(sim.state().position == MapPosition{"CeruleanCity_PokemonCenter_1F", {7, 4}})){ - return label + "00.20 ended on " + to_string(sim.state().position) + ", not the nurse."; + return label + "05.09 ended on " + to_string(sim.state().position) + ", not the nurse."; } } return true; @@ -671,20 +671,20 @@ UnitTestResult test_routes_after_pacing(){ } } if (checked < 3){ - return std::format("Expected the routes after 00.14b's and 00.15's GRINDs and 00.20's capture; checked {}.", checked); + return std::format("Expected the routes after 05.01's and 05.03's GRINDs and 05.09's capture; checked {}.", checked); } return true; } -// 00.14 on the sim, from Mt. Moon's exit (32, 6): east and up through +// 04.06 on the sim, from Mt. Moon's exit (32, 6): east and up through // (48, 5) into the tutors' pen on Route 4 to (50, 4), facing the Mega // Kick tutor (50, 3), then on to above the ledge (93, 8). Each walk ends // where the table says, and no trainer sees the player on the way. UnitTestResult test_mega_kick_tutor_walks(){ - const StoryCheckpoint* row = &checkpoint_row("00.14"); + const StoryCheckpoint* row = &checkpoint_row("04.06"); const auto ledge = std::find_if(row->steps.begin(), row->steps.end(), [](const StoryStep& step){ return step.name == "above_ledge"; }); if (ledge == row->steps.end()){ - return "00.14: no above_ledge."; + return "04.06: no above_ledge."; } StoryPose at = *story_pose(Pokemon::pose_of(*row->start)); OverworldSim sim(story_maps(), MapPosition{at.map, at.tile}, *at.facing); @@ -693,27 +693,27 @@ UnitTestResult test_mega_kick_tutor_walks(){ if (step->kind != StoryStepKind::ROUTE && step->kind != StoryStepKind::LEGS){ continue; } - const std::string failure = row_step_on_sim(sim, at, *step, "00.14"); + const std::string failure = row_step_on_sim(sim, at, *step, "04.06"); if (!failure.empty()){ return failure; } if (!(sim.state().position == MapPosition{at.map, at.tile})){ - return "00.14/" + step->name + ": expected " + to_string(MapPosition{at.map, at.tile}) + ", but on " + to_string(sim.state().position) + "."; + return "04.06/" + step->name + ": expected " + to_string(MapPosition{at.map, at.tile}) + ", but on " + to_string(sim.state().position) + "."; } if (sim.state().position == MapPosition{"Route4", {50, 4}} && sim.state().facing == Direction::NORTH){ at_tutor = true; } } if (!at_tutor){ - return "00.14: no walk ended on Route 4's (50, 4) facing the Mega Kick tutor (50, 3)."; + return "04.06: no walk ended on Route 4's (50, 4) facing the Mega Kick tutor (50, 3)."; } if (!sim.state().trainers_beaten.empty() || !sim.state().violations.empty()){ - return "00.14: a trainer's battle or a violation on the way."; + return "04.06: a trainer's battle or a violation on the way."; } return true; } -// Console B, 2026-11-03 (row 00.18): after his scene Bill stands on +// Console B, 2026-11-03 (row 05.07): after his scene Bill stands on // (7, 6), east of the player on (6, 6), not on the maps' (7, 5). The // walk out planned east onto (7, 6) and south to the mat (7, 9); the // east tap bumped Bill, and the hold south took the player down column 6 @@ -722,10 +722,10 @@ UnitTestResult test_mega_kick_tutor_walks(){ // didn't warp from (6, 9)), the row's walks after the ticket end each // where the table says and leave on Route 25's (51, 5). UnitTestResult test_out_of_bill_cottage(){ - const StoryCheckpoint* row = &checkpoint_row("00.18"); + const StoryCheckpoint* row = &checkpoint_row("05.07"); const auto ticket = std::find_if(row->steps.begin(), row->steps.end(), [](const StoryStep& step){ return step.name == "ss_ticket"; }); if (ticket == row->steps.end() || !ticket->pose_after){ - return "00.18: no ss_ticket."; + return "05.07: no ss_ticket."; } std::vector maps = story_maps(); for (MapData& map : maps){ @@ -746,19 +746,19 @@ UnitTestResult test_out_of_bill_cottage(){ if (step->kind != StoryStepKind::ROUTE && step->kind != StoryStepKind::LEGS){ continue; } - const std::string failure = row_step_on_sim(sim, at, *step, "00.18"); + const std::string failure = row_step_on_sim(sim, at, *step, "05.07"); if (!failure.empty()){ return failure; } if (!(sim.state().position == MapPosition{at.map, at.tile})){ - return "00.18/" + step->name + ": expected " + to_string(MapPosition{at.map, at.tile}) + ", but on " + to_string(sim.state().position) + "."; + return "05.07/" + step->name + ": expected " + to_string(MapPosition{at.map, at.tile}) + ", but on " + to_string(sim.state().position) + "."; } } if (!(sim.state().position == MapPosition{"Route25", {51, 5}})){ - return "00.18: expected to leave onto Route 25's (51, 5), not " + to_string(sim.state().position) + "."; + return "05.07: expected to leave onto Route 25's (51, 5), not " + to_string(sim.state().position) + "."; } if (!sim.state().violations.empty()){ - return "00.18: violations:" + joined(sim.state().violations); + return "05.07: violations:" + joined(sim.state().violations); } return true; } @@ -820,14 +820,14 @@ const AutoStorySimulationTestCase AUTO_STORY_SIMULATION_CASES[] = { {.input = {.name = "start and end checkpoints", .body = test_start_and_end}, .expectation = {.description = "executes segment bounded by start and end checkpoints"}}, {.input = {.name = "a failed walk reloads its checkpoint's save", .body = test_retry_from_save}, .expectation = {.description = "reloads checkpoint save state on simulated movement failure"}}, {.input = {.name = "a battle lost every time stops after 3 attempts", .body = test_gives_up_after_attempts}, .expectation = {.description = "aborts after three consecutive battle blackouts"}}, - {.input = {.name = "00.14 into Cerulean, the entry leg a tile short", .body = test_cerulean_entry_short}, .expectation = {.description = "recovers when entering Cerulean City if movement ends one tile short"}}, - {.input = {.name = "00.14 from Mt. Moon to the Mega Kick tutor, then above the ledge", .body = test_mega_kick_tutor_walks}, .expectation = {.description = "verifies route navigation from Mt. Moon to tutor and past ledge"}}, - {.input = {.name = "00.16 Nugget Bridge, the walk onto it a tile short", .body = test_nugget_bridge_short}, .expectation = {.description = "completes Nugget Bridge battles even if initial approach stops short"}}, - {.input = {.name = "00.17 Route 25, its four trainers and Dan", .body = test_route25_trainers}, .expectation = {.description = "simulates Route 25 trainer battles and Dan detour"}}, - {.input = {.name = "00.18 out of Bill's Sea Cottage, Bill on (7, 6)", .body = test_out_of_bill_cottage}, .expectation = {.description = "simulates exiting Bill sea cottage with Bill relocated"}}, - {.input = {.name = "00.20 to Route 24's grass and back, past Shane", .body = test_oddish_walks}, .expectation = {.description = "navigates to Route 24 grass avoiding trainer line of sight"}}, - {.input = {.name = "00.20 back to the Center, the Oddish's battle on the pace's far step", .body = test_oddish_battle_on_far_step}, .expectation = {.description = "handles Oddish capture encounter occurring on far pace step"}}, - {.input = {.name = "00.20 onto the grass out of Shane's sight, the leg west a tile short", .body = test_oddish_patch_west_short}, .expectation = {.description = "recovers when approaching grass patch with short western leg"}}, + {.input = {.name = "04.06 into Cerulean, the entry leg a tile short", .body = test_cerulean_entry_short}, .expectation = {.description = "recovers when entering Cerulean City if movement ends one tile short"}}, + {.input = {.name = "04.06 from Mt. Moon to the Mega Kick tutor, then above the ledge", .body = test_mega_kick_tutor_walks}, .expectation = {.description = "verifies route navigation from Mt. Moon to tutor and past ledge"}}, + {.input = {.name = "05.05 Nugget Bridge, the walk onto it a tile short", .body = test_nugget_bridge_short}, .expectation = {.description = "completes Nugget Bridge battles even if initial approach stops short"}}, + {.input = {.name = "05.06 Route 25, its four trainers and Dan", .body = test_route25_trainers}, .expectation = {.description = "simulates Route 25 trainer battles and Dan detour"}}, + {.input = {.name = "05.07 out of Bill's Sea Cottage, Bill on (7, 6)", .body = test_out_of_bill_cottage}, .expectation = {.description = "simulates exiting Bill sea cottage with Bill relocated"}}, + {.input = {.name = "05.09 to Route 24's grass and back, past Shane", .body = test_oddish_walks}, .expectation = {.description = "navigates to Route 24 grass avoiding trainer line of sight"}}, + {.input = {.name = "05.09 back to the Center, the Oddish's battle on the pace's far step", .body = test_oddish_battle_on_far_step}, .expectation = {.description = "handles Oddish capture encounter occurring on far pace step"}}, + {.input = {.name = "05.09 onto the grass out of Shane's sight, the leg west a tile short", .body = test_oddish_patch_west_short}, .expectation = {.description = "recovers when approaching grass patch with short western leg"}}, {.input = {.name = "the routes after pacing, from either of its tiles", .body = test_routes_after_pacing}, .expectation = {.description = "plans valid routes regardless of which pacing tile character ends on"}}, {.input = {.name = "a save off the start pose stops before any step", .body = test_save_off_start_pose}, .expectation = {.description = "fails the start check without walking or saving"}}, {.input = {.name = "a dialog pops up before every step", .body = test_dialog_before_every_step}, .expectation = {.description = "cleared between steps, the story passes; left up, a walk fails on it"}}, diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryStartFrames_Tests.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryStartFrames_Tests.cpp index f6a9cfb692..27ab064b24 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryStartFrames_Tests.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryStartFrames_Tests.cpp @@ -298,8 +298,8 @@ const ReadCase READ_CASES[] = { }; -// console B, FRLG 00.27, 2026-11-09: the save stood outside Cerulean -// Center's door, not at the counter where 00.27 starts, and the run walked +// console B, FRLG 07.02, 2026-11-09: the save stood outside Cerulean +// Center's door, not at the counter where 07.02 starts, and the run walked // off. A checkpoint of one walk with the console's start check on frames // (add_start_check(), as build_checkpoint() adds it): the walk runs only // when the screen after the save loads shows the kept frame's place, or @@ -353,7 +353,7 @@ class Test_StartFrameCheck : public UnitTest{ private: static Pokemon::Checkpoint one_walk(size_t& walks){ Pokemon::Checkpoint checkpoint; - checkpoint.id = "00.27"; + checkpoint.id = "07.02"; Pokemon::Event walk; walk.name = "to_the_door"; walk.act = [&walks](Pokemon::RunState&){ @@ -389,15 +389,15 @@ const StartCheckCase START_CHECK_CASES[] = { }; -// The store, given two frames for 00.28 (outside the door, then the -// counter): what it finds for 00.28 and 00.27. +// The store, given two frames for 08.01 (outside the door, then the +// counter): what it finds for 08.01 and 07.02. struct StoreInput{ std::string name; // A folder to keep them in; none for the simulation's store. bool has_folder; }; struct StoreExpectation{ - // 00.28's frame is found, and is the last one kept (the counter). + // 08.01's frame is found, and is the last one kept (the counter). bool finds_last; }; struct StoreCase{ @@ -424,17 +424,17 @@ class Test_StartFrameStore : public UnitTest{ private: UnitTestResult check(const StartFrameStore& store) const{ - if (store.load("00.28")){ + if (store.load("08.01")){ return "expected no frame before one is kept"; } - const bool kept = store.save("00.28", start_frame(outside_door()), "test") - && store.save("00.28", start_frame(at_counter()), "test"); - const std::optional found = store.load("00.28"); + const bool kept = store.save("08.01", start_frame(outside_door()), "test") + && store.save("08.01", start_frame(at_counter()), "test"); + const std::optional found = store.load("08.01"); const bool finds_last = kept && found && found->width() == 240 && found->height() == 160 && same_start_place(compare_start_frames(*found, at_counter())); - if (finds_last != m_case.expectation.finds_last || store.load("00.27")){ + if (finds_last != m_case.expectation.finds_last || store.load("07.02")){ return std::format( - "expected 00.28's last frame {}found and none for 00.27; kept: {}, found: {}", + "expected 08.01's last frame {}found and none for 07.02; kept: {}, found: {}", m_case.expectation.finds_last ? "" : "not ", kept, found.has_value() ); } diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryTable.h b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryTable.h index ec960d1f99..3c96de3850 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryTable.h +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryTable.h @@ -6,10 +6,16 @@ * 3 to the Magikarp salesman in Route 4's Pokemon Center, through Mt. * Moon to Route 4 east of it, and on to Cerulean City, Misty, its rival, * Nugget Bridge and Bill, then Route 6 to Vermilion City, the S.S. - * Anne's HM01 and Lt. Surge, as story checkpoints 00.01 to 00.25, each - * saved at its end. After 00.10 every route and leg runs. Taken from a by-hand run on + * Anne's HM01 and Lt. Surge, as story checkpoints 01.01 to 06.04, each + * saved at its end. After 03.03 every route and leg runs. Taken from a by-hand run on * console B (2026-11-01) and the pokefirered map scripts. * + * An id is part.NN, checkpoint NN of that part of Bulbapedia's FireRed + * and LeafGreen walkthrough (parts 1 to 9 here). The order follows our + * setup and can differ in other runs: the rival battles depend on the + * starter, Route 11 and Diglett's Cave are skipped, the Bike Voucher is + * fetched as a detour, and the Rocket Hideout comes before Celadon Gym. + * * Each checkpoint is an authored JSON file in StoryData/ * (frlg-.plan.json, format pokesim-authored-checkpoint/1): the shared * checkpoint, its steps each an action with args, read against FRLG's @@ -59,12 +65,12 @@ const std::vector>& autostory_checkpoint_jso // action args it doesn't take, or has notes for a step it doesn't have. StoryCheckpoint read_story_checkpoint_file(const JsonValue& value, std::string_view source); -// Checkpoints 00.01 to 00.27, in order: every file in StoryData/. With -// 00.01b, the way back in after SID Helper, after 00.01, 00.04 split in two at Squirtle's ball for -// Starter RNG: 00.04 and 00.04b, 00.12b, the way back in after Gift RNG, -// after 00.12, 00.12c, the Magikarp put in BOX 1, after it, 00.14b and -// 00.14c, Cerulean Gym to a save below Misty's platform and Misty alone -// from it, and 00.15b, the rival in Cerulean alone, from 00.15's save +// Checkpoints 01.01 to 07.02, in order: every file in StoryData/. With +// 01.02, the way back in after SID Helper, after 01.01, 01.05 split in two at Squirtle's ball for +// Starter RNG: 01.05 and 01.06, 04.03, the way back in after Gift RNG, +// after 04.02, 04.04, the Magikarp put in BOX 1, after it, 05.01 and +// 05.02, Cerulean Gym to a save below Misty's platform and Misty alone +// from it, and 05.04, the rival in Cerulean alone, from 05.03's save // below his trigger. const std::vector& story_checkpoints(); diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryTeachScreens.h b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryTeachScreens.h index 7ee8a1c5ce..571b170a30 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryTeachScreens.h +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryTeachScreens.h @@ -17,7 +17,7 @@ * pokemon_special_anim.c), the member on pale blue diamonds: "Machine * set!", which waits for A (B there cancels the teach), the disc's * wobble, " learned !", then the TM CASE's list (console B, - * 00.23: HM01 to an Oddish with two free slots). With four: " + * 06.02: HM01 to an Oddish with two free slots). With four: " * wants to learn the move .", "However, already knows four * moves.", "Should a move be deleted and replaced with ?" YES/NO * (YES on top), YES: "Which move should be forgotten?", then KNOWN diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryTeachScreens_Tests.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryTeachScreens_Tests.cpp index cad2d6d3eb..88445df489 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryTeachScreens_Tests.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryTeachScreens_Tests.cpp @@ -12,7 +12,7 @@ * pokemon_special_anim.c, Task_UseTM_NoForget / Task_ForgetMove, then * Task_MachineSet): "Machine set!" waits for A and B cancels the teach; * the wobble and " learned !" run on their own. Console B, - * 00.23 (2026-11-03): HM01 to an Oddish with two free slots stopped on + * 06.02 (2026-11-03): HM01 to an Oddish with two free slots stopped on * "Machine set!", read as "other", and gave up. * */ @@ -506,7 +506,7 @@ void three_moves_scene_unread(FakeTeachGame& game){ three_moves(game); game.scene_unread = true; } -// 00.23 on console B: HM01 to the Oddish (slot 2), ABSORB and SWEET +// 06.02 on console B: HM01 to the Oddish (slot 2), ABSORB and SWEET // SCENT. void oddish_cut(FakeTeachGame& game){ game.tms = {{"water-pulse", 1}, {"cut", 1}}; @@ -596,7 +596,7 @@ std::vector scene_screens_cases(){ .moves = {"bite", "bubble", "withdraw", "water-pulse"}, }, { - .name = "console B 00.23: HM01 to the Oddish, two free slots", + .name = "console B 06.02: HM01 to the Oddish, two free slots", .setup = oddish_cut, .plan = {.item = "hm01", .move = "cut", .member = 1}, .moves = {"absorb", "sweet-scent", "cut"}, diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryTrainerMessage.h b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryTrainerMessage.h index 97b53216a3..807afd4d62 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryTrainerMessage.h +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryTrainerMessage.h @@ -47,7 +47,7 @@ inline constexpr Milliseconds BATTLE_EXIT_TIMEOUT(10000); // nothing (wait_for_quiet_overworld()) for MovementMechanics:: // AFTER_BATTLE_QUIET, at most BATTLE_EXIT_TIMEOUT, and logs how the screen // ended. A tap sent as the battle's black ends is lost (console B, -// 2026-11-09, 00.28 winston_line). +// 2026-11-09, 08.01 winston_line). void wait_out_battle_exit(ConsoleHandle& console, ProControllerContext& context); diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryTrashCanLayout.h b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryTrashCanLayout.h index 55bae87db6..c3055a2a84 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryTrashCanLayout.h +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryTrashCanLayout.h @@ -44,7 +44,7 @@ struct TrashCanStand{ // Position and facing to inspect a trash can. TrashCanStand trash_can_stand(int can); -// `maps` with Vermilion Gym's trainers where their battles in 00.23 leave +// `maps` with Vermilion Gym's trainers where their battles in 06.02 leave // them, beaten (PokemonFRLG_AutoStoryTableVermilionGym.cpp): Sailor // Dwayne on (8, 14), Engineer Baily on (2, 12), Gentleman Tucker on // (6, 8). The search plans its walks between the cans on these, not on diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryVermilionGym_Tests.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryVermilionGym_Tests.cpp index 6553ad25e3..681eeb4852 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryVermilionGym_Tests.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryVermilionGym_Tests.cpp @@ -2,7 +2,7 @@ * * From: https://github.com/PokemonAutomation/ * - * Rows 00.23 to 00.25 (StoryData/frlg-00.23..25.plan.json) on the + * Rows 06.02 to 06.04 (StoryData/frlg-06.02..25.plan.json) on the * overworld sim: the tree cut on the way in and out, the gym's three * trainers fought where the table says, the trash can search walking * between the cans clear of where the trainers stand after their battles @@ -117,8 +117,8 @@ MapData& map_named(std::vector& maps, const std::string& name){ throw InternalProgramError(nullptr, PA_CURRENT_FUNCTION, "No map " + name + "."); } -// `maps` with the trainers beaten that rows before 00.24 fought: Route -// 6's Jeff (00.21) and Vermilion Gym's three (00.23). +// `maps` with the trainers beaten that rows before 06.03 fought: Route +// 6's Jeff (05.10) and Vermilion Gym's three (06.02). std::vector maps_after_gym(std::vector maps = story_maps()){ for (MapObject& object : map_named(maps, GYM).objects){ object.trainer.reset(); @@ -231,10 +231,10 @@ class SimGym{ bool m_first_found = false; }; -// Row 00.23 from steps `first` to `last` (exclusive) on `sim`, the trash +// Row 06.02 from steps `first` to `last` (exclusive) on `sim`, the trash // cans drawn as `draws` say. std::string run_gym_steps(OverworldSim& sim, StoryPose& at, size_t first, size_t last, const std::vector& draws){ - const StoryCheckpoint& row = checkpoint("00.23"); + const StoryCheckpoint& row = checkpoint("06.02"); for (size_t c = first; c < last; c++){ const StoryStep& step = row.steps[c]; if (step.action == TRASH_CANS_VARIANT){ @@ -242,7 +242,7 @@ std::string run_gym_steps(OverworldSim& sim, StoryPose& at, size_t first, size_t SimGym gym(sim, at, draws); const TrashCanResult result = run_trash_cans(logger, [&](int can){ return gym.check(can); }); if (result.end != TrashCanEnd::OPENED || !gym.open){ - return "00.23/trash_cans: " + std::string(trash_can_end_name(result.end)) + " " + gym.error; + return "06.02/trash_cans: " + std::string(trash_can_end_name(result.end)) + " " + gym.error; } continue; } @@ -253,13 +253,13 @@ std::string run_gym_steps(OverworldSim& sim, StoryPose& at, size_t first, size_t return ""; } -// 00.23 on the sim from the nurse to the nurse: the tree cut, Dwayne, +// 06.02 on the sim from the nurse to the nurse: the tree cut, Dwayne, // Baily and Tucker fought in that order where the table says and no one // else, the cans searched, out past the tree grown back. The switches // found at once (under 3 and 4), and after a wrong guess's reset (under // 3 and 8, then 13 and 14). UnitTestResult test_gym_row(){ - const StoryCheckpoint& row = checkpoint("00.23"); + const StoryCheckpoint& row = checkpoint("06.02"); for (const std::vector& draws : {std::vector{{3, 4}}, std::vector{{3, 8}, {13, 14}}}){ StoryPose at = *story_pose(Pokemon::pose_of(*row.start)); OverworldSim sim(story_maps(), MapPosition{at.map, at.tile}, *at.facing); @@ -268,10 +268,10 @@ UnitTestResult test_gym_row(){ } const std::vector expected{"sailor", "balding_man", "gentleman"}; if (sim.state().trainers_beaten != expected || !sim.state().violations.empty()){ - return "00.23: expected Dwayne, Baily and Tucker beaten and no violation; beat" + beaten_list(sim) + "."; + return "06.02: expected Dwayne, Baily and Tucker beaten and no violation; beat" + beaten_list(sim) + "."; } if (!(sim.state().position == MapPosition{VERMILION_CENTER, {7, 4}})){ - return "00.23: expected to end at Vermilion's nurse, not " + to_string(sim.state().position) + "."; + return "06.02: expected to end at Vermilion's nurse, not " + to_string(sim.state().position) + "."; } } return true; @@ -281,7 +281,7 @@ UnitTestResult test_gym_row(){ // their battles leave them: every can's stand reached from (5, 8) and from // every other stand, and the way out to the nurse from every stand. UnitTestResult test_cans_from_everywhere(){ - const StoryCheckpoint& row = checkpoint("00.23"); + const StoryCheckpoint& row = checkpoint("06.02"); StoryPose at = *story_pose(Pokemon::pose_of(*row.start)); OverworldSim sim(story_maps(), MapPosition{at.map, at.tile}, *at.facing); const size_t cans = step_index(row, "trash_cans"); @@ -337,11 +337,11 @@ UnitTestResult test_tree_shuts_the_yard(){ return true; } -// 00.24 and 00.25 on the sim, the gym as 00.23 leaves it: to Route 6's +// 06.03 and 06.04 on the sim, the gym as 06.02 leaves it: to Route 6's // grass round Isabelle's line and back, to below Surge through the beams, // and from him back out past the tree to the nurse, meeting no one. UnitTestResult test_to_surge_and_out(){ - for (std::string_view id : {"00.24", "00.25"}){ + for (std::string_view id : {"06.03", "06.04"}){ const StoryCheckpoint& row = checkpoint(id); StoryPose at = *story_pose(Pokemon::pose_of(*row.start)); OverworldSim sim(maps_after_gym(), MapPosition{at.map, at.tile}, *at.facing); @@ -353,25 +353,25 @@ UnitTestResult test_to_surge_and_out(){ if (!sim.state().trainers_beaten.empty() || !sim.state().violations.empty()){ return std::format("{}: a battle or a violation on the way.", id); } - const MapPosition end = id == "00.24" ? MapPosition{GYM, {5, 3}} : MapPosition{VERMILION_CENTER, {7, 4}}; + const MapPosition end = id == "06.03" ? MapPosition{GYM, {5, 3}} : MapPosition{VERMILION_CENTER, {7, 4}}; if (!(sim.state().position == end)){ return std::format("{}: ended on {}, not {}.", id, to_string(sim.state().position), to_string(end)); } } - const StoryPose next = *story_pose(Pokemon::pose_of(*checkpoint("00.25").start)); + const StoryPose next = *story_pose(Pokemon::pose_of(*checkpoint("06.04").start)); if (!(next.tile == TilePos{5, 3}) || next.map != GYM){ - return "00.25 doesn't start where 00.24 ends."; + return "06.04 doesn't start where 06.03 ends."; } return true; } -// Console B, 00.25 (2026-11-03 18:17): the walk to the nurse went up +// Console B, 06.04 (2026-11-03 18:17): the walk to the nurse went up // column 27 to row 7 and west along it, into Oak's aide on (25, 7), there // since Surge's win; the leg was taken as walked and the step into the -// Center's door went into a house's wall. 00.25 from Surge to the nurse +// Center's door went into a house's wall. 06.04 from Surge to the nurse // with the aide there, meeting no one. UnitTestResult test_out_past_oaks_aide(){ - const StoryCheckpoint& row = checkpoint("00.25"); + const StoryCheckpoint& row = checkpoint("06.04"); const std::vector maps = maps_after_surge(); const MapData& city = *std::find_if(maps.begin(), maps.end(), [](const MapData& map){ return map.name == VERMILION; }); if (object_at(city, {25, 7}) == nullptr){ @@ -391,16 +391,16 @@ UnitTestResult test_out_past_oaks_aide(){ return true; } -// 00.24 with a lead at the grind's level already: the check in the Center +// 06.03 with a lead at the grind's level already: the check in the Center // comes first, and with its flag set the walk to Route 6's grass, the // grind and the way back are skipped; the rest goes from the nurse to // below Surge on the sim. Console B walked out and back at Lv29 // (2026-11-03). UnitTestResult test_lead_ready_skips_grind(){ - const StoryCheckpoint& row = checkpoint("00.24"); + const StoryCheckpoint& row = checkpoint("06.03"); const StoryStep& check = row.steps.front(); if (check.action != GRIND_CHECK_ACTION || !grind_plan_of(check.args)){ - return "Expected 00.24 to start with the grind's check, not " + check.name + "."; + return "Expected 06.03 to start with the grind's check, not " + check.name + "."; } StoryPose at = *story_pose(Pokemon::pose_of(*row.start)); OverworldSim sim(maps_after_gym(), MapPosition{at.map, at.tile}, *at.facing); @@ -427,27 +427,27 @@ UnitTestResult test_lead_ready_skips_grind(){ const AutoStoryVermilionGymCase AUTO_STORY_VERMILION_GYM_CASES[] = { { - .input = {"00.23 the tree shuts the gym's yard until cut", test_tree_shuts_the_yard}, + .input = {"06.02 the tree shuts the gym's yard until cut", test_tree_shuts_the_yard}, .expectation = {}, }, { - .input = {"00.23 Vermilion Gym: Dwayne, Baily and Tucker, the cans at once or after a reset", test_gym_row}, + .input = {"06.02 Vermilion Gym: Dwayne, Baily and Tucker, the cans at once or after a reset", test_gym_row}, .expectation = {}, }, { - .input = {"00.23 every can's stand from Tucker's tile and from every other, and out", test_cans_from_everywhere}, + .input = {"06.02 every can's stand from Tucker's tile and from every other, and out", test_cans_from_everywhere}, .expectation = {}, }, { - .input = {"00.24 and 00.25 through the beams to Lt. Surge and out", test_to_surge_and_out}, + .input = {"06.03 and 06.04 through the beams to Lt. Surge and out", test_to_surge_and_out}, .expectation = {}, }, { - .input = {"00.25 out to the nurse past Oak's aide on (25, 7)", test_out_past_oaks_aide}, + .input = {"06.04 out to the nurse past Oak's aide on (25, 7)", test_out_past_oaks_aide}, .expectation = {}, }, { - .input = {"00.24 with the lead at its level already: no trip to Route 6", test_lead_ready_skips_grind}, + .input = {"06.03 with the lead at its level already: no trip to Route 6", test_lead_ready_skips_grind}, .expectation = {}, }, }; diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryVermilion_Tests.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryVermilion_Tests.cpp index d06dcbec85..36c4cf04d3 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryVermilion_Tests.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStoryVermilion_Tests.cpp @@ -2,7 +2,7 @@ * * From: https://github.com/PokemonAutomation/ * - * Rows 00.21 (Cerulean to Vermilion City) and 00.22 (the S.S. Anne) on + * Rows 05.10 (Cerulean to Vermilion City) and 06.01 (the S.S. Anne) on * the overworld sim: their walks reach their ends, and meet only the * trainers the table fights. * @@ -83,7 +83,7 @@ size_t step_index(const StoryCheckpoint& row, const std::string& name){ return step - row.steps.begin(); } -// Runs row 00.21's steps from `first` to its end on `sim` from `at`, and +// Runs row 05.10's steps from `first` to its end on `sim` from `at`, and // checks that only Jeff ("camper") was fought and the walk ended at // Vermilion's nurse. std::string run_to_vermilion(OverworldSim& sim, StoryPose at, const StoryCheckpoint& row, size_t first){ @@ -94,15 +94,15 @@ std::string run_to_vermilion(OverworldSim& sim, StoryPose at, const StoryCheckpo } } if (sim.state().trainers_beaten != std::vector{"camper"} || !sim.state().violations.empty()){ - return "00.21: expected Jeff alone beaten and no violation; beat" + beaten_list(sim) + "."; + return "05.10: expected Jeff alone beaten and no violation; beat" + beaten_list(sim) + "."; } if (!(sim.state().position == MapPosition{"VermilionCity_PokemonCenter_1F", {7, 4}})){ - return "00.21: expected to end at Vermilion's nurse, not " + to_string(sim.state().position) + "."; + return "05.10: expected to end at Vermilion's nurse, not " + to_string(sim.state().position) + "."; } return ""; } -// 00.21 on the sim, from Cerulean's Pokemon Center through the burgled +// 05.10 on the sim, from Cerulean's Pokemon Center through the burgled // house to (32, 7), west of the Rocket, meeting no one; his trigger and // battle aren't the sim's, so from where his battle leaves the player: // Route 5, the Underground Path and Route 6, down column 15 out of @@ -111,9 +111,9 @@ std::string run_to_vermilion(OverworldSim& sim, StoryPose at, const StoryCheckpo // walk onto Route 6's column 15 ended a tile short, on column 16: the // same. UnitTestResult test_route6_jeff_only(){ - const StoryCheckpoint* row = checkpoint("00.21"); + const StoryCheckpoint* row = checkpoint("05.10"); if (row == nullptr){ - return "No checkpoint 00.21."; + return "No checkpoint 05.10."; } StoryPose at = *story_pose(Pokemon::pose_of(*row->start)); OverworldSim house(story_maps(), MapPosition{at.map, at.tile}, *at.facing); @@ -124,7 +124,7 @@ UnitTestResult test_route6_jeff_only(){ } } if (!(house.state().position == MapPosition{"CeruleanCity", {32, 7}}) || !house.state().trainers_beaten.empty()){ - return std::format("00.21: expected to reach (32, 7) west of the Rocket, meeting no one, not {}.", to_string(house.state().position)); + return std::format("05.10: expected to reach (32, 7) west of the Rocket, meeting no one, not {}.", to_string(house.state().position)); } const size_t battle = step_index(*row, "rocket_grunt"); const StoryPose after_rocket = *story_pose(Pokemon::pose_of(*row->steps[battle].pose_after)); @@ -166,15 +166,15 @@ StoryPose pose_after(const StoryPose& at, const StoryStep& step){ return at; } -// 00.22's walks on the sim, each from where the table says it starts: to +// 06.01's walks on the sim, each from where the table says it starts: to // the harbor short of the ticket check, aboard and along 2F short of the // rival's trigger row (30..32, 6), into the Captain's office behind him, // back to 1F's door, and from the pier to the nurse. None meets a // trainer: the ship's are in its cabins and on its deck. UnitTestResult test_ss_anne_walks(){ - const StoryCheckpoint* row = checkpoint("00.22"); + const StoryCheckpoint* row = checkpoint("06.01"); if (row == nullptr){ - return "No checkpoint 00.22."; + return "No checkpoint 06.01."; } StoryPose at = *story_pose(Pokemon::pose_of(*row->start)); bool before_rival = true; @@ -186,27 +186,27 @@ UnitTestResult test_ss_anne_walks(){ } const std::optional> route = walked_route(at, step); if (!route || route->empty()){ - return "00.22/" + step.name + ": no route."; + return "06.01/" + step.name + ": no route."; } const MapPosition start{at.map, at.tile}; if (steps_onto(*route, start, "VermilionCity", {{22, 33}, {23, 33}}) || (before_rival && steps_onto(*route, start, "SSAnne_2F_Corridor", {{30, 6}, {31, 6}, {32, 6}})) ){ - return "00.22/" + step.name + ": crosses a trigger before its step."; + return "06.01/" + step.name + ": crosses a trigger before its step."; } OverworldSim sim(story_maps(), start, *at.facing); if (const std::string failure = row_step_on_sim(sim, at, step, row->id); !failure.empty()){ return failure; } if (!(sim.state().position == MapPosition{at.map, at.tile})){ - return "00.22/" + step.name + ": ended on " + to_string(sim.state().position) + ", not " + to_string(MapPosition{at.map, at.tile}) + "."; + return "06.01/" + step.name + ": ended on " + to_string(sim.state().position) + ", not " + to_string(MapPosition{at.map, at.tile}) + "."; } if (!sim.state().trainers_beaten.empty() || !sim.state().violations.empty()){ - return "00.22/" + step.name + ": a trainer's battle or a violation on the way."; + return "06.01/" + step.name + ": a trainer's battle or a violation on the way."; } } if (!(MapPosition{at.map, at.tile} == MapPosition{"VermilionCity_PokemonCenter_1F", {7, 4}})){ - return "00.22: expected to end at Vermilion's nurse."; + return "06.01: expected to end at Vermilion's nurse."; } return true; } @@ -216,11 +216,11 @@ UnitTestResult test_ss_anne_walks(){ const AutoStoryVermilionCase AUTO_STORY_VERMILION_CASES[] = { { - .input = {"00.21 to Vermilion, only Jeff on Route 6, the walk onto column 15 whole or a tile short", test_route6_jeff_only}, + .input = {"05.10 to Vermilion, only Jeff on Route 6, the walk onto column 15 whole or a tile short", test_route6_jeff_only}, .expectation = {}, }, { - .input = {"00.22 the S.S. Anne's walks, short of the ticket check and the rival's trigger", test_ss_anne_walks}, + .input = {"06.01 the S.S. Anne's walks, short of the ticket check and the rival's trigger", test_ss_anne_walks}, .expectation = {}, }, }; diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStory_Tests.cpp b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStory_Tests.cpp index 06e0ba6f5b..78fe116d7d 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStory_Tests.cpp +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/PokemonFRLG_AutoStory_Tests.cpp @@ -291,7 +291,7 @@ UnitTestResult check_legs_on( return true; } -// 00.09, each walk from where the one before leaves the player. +// 03.02, each walk from where the one before leaves the player. UnitTestResult test_pewter_gym_walks(){ const MapPosition nurse{"PewterCity_PokemonCenter_1F", {7, 4}}; // In by the door's mat (6, 14), straight up column 6 to below Liam's row. @@ -322,7 +322,7 @@ UnitTestResult test_pewter_gym_walks(){ ); } -// 00.10: out of the Gym to the aide's top trigger. The route keeps off his +// 03.03: out of the Gym to the aide's top trigger. The route keeps off his // three trigger tiles (46, 21..23), which would start the scene a step // early, and the step east from its end lands on (46, 21). UnitTestResult test_pewter_aide_walk(){ @@ -356,8 +356,8 @@ UnitTestResult test_pewter_aide_walk(){ return true; } -// Every ROUTE and LEGS after the Running Shoes (00.10) runs, or after the -// BICYCLE (00.26) may ride; none before. +// Every ROUTE and LEGS after the Running Shoes (03.03) runs, or after the +// BICYCLE (07.01) may ride; none before. UnitTestResult test_runs_after_shoes(){ bool has_shoes = false; bool has_bike = false; @@ -373,11 +373,11 @@ UnitTestResult test_runs_after_shoes(){ } runs += has_shoes ? 1 : 0; } - has_shoes = has_shoes || checkpoint.id == "00.10"; - has_bike = has_bike || checkpoint.id == "00.26"; + has_shoes = has_shoes || checkpoint.id == "03.03"; + has_bike = has_bike || checkpoint.id == "07.01"; } if (!has_shoes || runs == 0){ - return "No checkpoint 00.10, where the player gets the Running Shoes, or no route after it."; + return "No checkpoint 03.03, where the player gets the Running Shoes, or no route after it."; } return true; } @@ -622,7 +622,7 @@ UnitTestResult test_trainer_lines(){ return result; } } - has_shoes = has_shoes || checkpoint.id == "00.10"; + has_shoes = has_shoes || checkpoint.id == "03.03"; } if (beaten.size() != 30){ return "Expected to fight Colton, Greg and James on Route 3, the Grunt at (12, 20) in Mt. Moon, Nugget Bridge's five" @@ -633,22 +633,22 @@ UnitTestResult test_trainer_lines(){ return true; } -// 00.12's walk east over Route 3 crosses Lass Robin's sight (she wanders +// 04.02's walk east over Route 3 crosses Lass Robin's sight (she wanders // x 40, y 10..12, looking north and south, sight 3) on (40, 9) only: if // she sees the player, the walk goes on from there (console B, // 2026-11-02, she stopped "east 11 (to wall)" there). UnitTestResult test_robin_crossing(){ for (const StoryCheckpoint& checkpoint : story_checkpoints()){ - if (checkpoint.id != "00.12" || checkpoint.steps.empty() || checkpoint.steps[0].name != "route4_nurse"){ + if (checkpoint.id != "04.02" || checkpoint.steps.empty() || checkpoint.steps[0].name != "route4_nurse"){ continue; } const std::vector> expected{MapPosition{"Route3", {40, 9}}}; if (wanderer_stops(one_tile(Pokemon::grid_pose_of(*checkpoint.start)), checkpoint.steps[0]) != expected){ - return "Expected 00.12/route4_nurse to cross Lass Robin's sight once, the walk placing her stop on Route3 (40, 9)."; + return "Expected 04.02/route4_nurse to cross Lass Robin's sight once, the walk placing her stop on Route3 (40, 9)."; } return true; } - return "No step 00.12/route4_nurse."; + return "No step 04.02/route4_nurse."; } // A scene the table starts on a step onto its trigger, and the walks of @@ -704,14 +704,14 @@ UnitTestResult check_trigger(const TriggerCase& c){ return "No step " + c.checkpoint + "/" + c.step + "."; } -// 00.15b meets the rival on the middle of his three trigger tiles, row 6 +// 05.04 meets the rival on the middle of his three trigger tiles, row 6 // at x 22..24 north of Cerulean (VAR_MAP_SCENE_CERULEAN_CITY_RIVAL 0), -// and 00.16 the Rocket on the east one of his two, (10..11, 15) on Nugget +// and 05.05 the Rocket on the east one of his two, (10..11, 15) on Nugget // Bridge (VAR_MAP_SCENE_ROUTE24 0), each from the tile below. UnitTestResult test_cerulean_triggers(){ const TriggerCase CASES[] = { - {.checkpoint = "00.15b", .step = "rival_trigger", .map = "CeruleanCity", .y = 6, .x0 = 22, .x1 = 24, .onto_x = 23}, - {.checkpoint = "00.16", .step = "rocket_trigger", .map = "Route24", .y = 15, .x0 = 10, .x1 = 11, .onto_x = 11}, + {.checkpoint = "05.04", .step = "rival_trigger", .map = "CeruleanCity", .y = 6, .x0 = 22, .x1 = 24, .onto_x = 23}, + {.checkpoint = "05.05", .step = "rocket_trigger", .map = "Route24", .y = 15, .x0 = 10, .x1 = 11, .onto_x = 11}, }; for (const TriggerCase& c : CASES){ if (UnitTestResult result = check_trigger(c); result.result != UnitTestResult::PASSED){ @@ -721,13 +721,13 @@ UnitTestResult test_cerulean_triggers(){ return true; } -// 00.16 steps beside Nugget Bridge's five trainers from the south, one +// 05.05 steps beside Nugget Bridge's five trainers from the south, one // step at a time, each battle right after its step: Cale, Ali, Timmy, // Reli and Ethan, by where they stand. UnitTestResult test_nugget_bridge_order(){ - const StoryCheckpoint* checkpoint = find_checkpoint("00.16"); + const StoryCheckpoint* checkpoint = find_checkpoint("05.05"); if (checkpoint == nullptr){ - return "No checkpoint 00.16."; + return "No checkpoint 05.05."; } const std::vector& steps = checkpoint->steps; std::string met; @@ -736,16 +736,16 @@ UnitTestResult test_nugget_bridge_order(){ const MapData* map = find_map_named(pose.map); const MapObject* trainer = steps[c].kind == StoryStepKind::STEP && map ? trainer_seeing(*map, step_end(pose, steps[c], {}), {}, false) : nullptr; if (trainer != nullptr && (c + 1 == steps.size() || steps[c + 1].kind != StoryStepKind::BATTLE)){ - return "00.16/" + steps[c].name + ": no battle right after the step."; + return "05.05/" + steps[c].name + ": no battle right after the step."; } met += trainer ? " " + to_string(TilePos{trainer->x, trainer->y}) : ""; if (UnitTestResult result = advance(pose, steps[c]); result.result != UnitTestResult::PASSED){ - return "00.16 " + result.message; + return "05.05 " + result.message; } } const std::string expected = " (12, 31) (10, 28) (12, 25) (10, 22) (12, 19)"; if (met != expected){ - return "00.16: expected the five bridge trainers south to north," + expected + "; met" + met + "."; + return "05.05: expected the five bridge trainers south to north," + expected + "; met" + met + "."; } return true; } @@ -781,7 +781,7 @@ UnitTestResult test_save_places(){ } // A reload's save checked against the checkpoint's start: a save left in -// Pewter City (a new game whose save didn't happen) can't start 00.02 in +// Pewter City (a new game whose save didn't happen) can't start 01.03 in // the bedroom. The check takes no checks level: Fast runs it too. UnitTestResult test_save_place_error(){ struct Case{ @@ -946,11 +946,11 @@ UnitTestResult test_intro_names(){ return true; } -// 00.12c stores the Magikarp Gift RNG bought; with Gift RNG off there is +// 04.04 stores the Magikarp Gift RNG bought; with Gift RNG off there is // none, and the deposit is skipped instead of refused. UnitTestResult test_magikarp_deposit_skippable(){ for (const StoryCheckpoint& checkpoint : story_checkpoints()){ - if (checkpoint.id != "00.12c"){ + if (checkpoint.id != "04.04"){ continue; } for (const StoryStep& step : checkpoint.steps){ @@ -959,9 +959,9 @@ UnitTestResult test_magikarp_deposit_skippable(){ return true; } } - return "00.12c: expected a deposit of the second slot, skipped if the party hasn't got it."; + return "04.04: expected a deposit of the second slot, skipped if the party hasn't got it."; } - return "No checkpoint 00.12c."; + return "No checkpoint 04.04."; } // set_options()'s RIGHT presses from each value an old save can leave: @@ -1062,7 +1062,7 @@ const AutoStoryTestCase AUTO_STORY_CASES[] = { .expectation = {.description = "verifies trainer interruption on route 3"}, }, { - .input = {.name = "00.12c: the Magikarp's deposit is skipped without Gift RNG", .body = test_magikarp_deposit_skippable}, + .input = {.name = "04.04: the Magikarp's deposit is skipped without Gift RNG", .body = test_magikarp_deposit_skippable}, .expectation = {.description = "skips magikarp deposit when gift rng is disabled"}, }, { diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/ReplayData/binding.json b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/ReplayData/binding.json index 067fa631d3..3eb131a68e 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/ReplayData/binding.json +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/ReplayData/binding.json @@ -1,8 +1,8 @@ { "format": "pokesim-story-replay-binding/1", "capture": { - "file": "data/story/native/frlg-parcel-00.05.json", - "sha256": "8b0c04f2e1507aee0f0927a8d022b8b431036431e95f8893aa7a2383360f8504", + "file": "data/story/native/frlg-parcel-02.01.json", + "sha256": "793abfef624f690c73cd0bb2e2a149da5f4c8654b50ffbd5905e27d88e1b0c04", "source_revision": "b170b7d2103e887ded825c37fdbdc19fd654fca8" }, "map_revision": "e52be04ed7bb007c7219c7d2c96963cf053e0000", diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/ReplayData/capture.json b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/ReplayData/capture.json index 2090ba206e..7310babb8e 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/ReplayData/capture.json +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/ReplayData/capture.json @@ -2,7 +2,7 @@ "format": "pokesim-native-checkpoint-export/1", "game": "frlg", "checkpoint": { - "id": "00.05", + "id": "02.01", "title": "Route 1 to Viridian Mart: Oak's Parcel", "start": { "certainty": "tile", diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/ReplayData/pin.json b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/ReplayData/pin.json index 1289d24a91..165ee3d668 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/ReplayData/pin.json +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/ReplayData/pin.json @@ -1,24 +1,24 @@ { "format": "pokesim-native-replay-preview/1", "repository": "dayfine/PokemonSimulation", - "revision": "bdca47c5045797be1d2a1f0931ad6a8f15ab3225", + "revision": "d3eea1b5c04180f8b60eb98b0d65f70aca6b1abb", "status": "preview-unmerged-PR-73", "files": { "binding": { "path": "data/story/parcel-pilot/binding.json", - "sha256": "ce91aba96599f443910dc76a985b97a45b8a76bcbbb1c9824cd247a627d946f4" + "sha256": "a29dd87a33c56dd108956d3a691646dbed850b376df6b9f019977dac979a5ed2" }, "cases": { "path": "data/story/parcel-pilot/cases.json", "sha256": "0dee2991120d12f01e67f6e97a4fb815b4d2f54a423739bc1a6aa4f2509f599e" }, "capture": { - "path": "data/story/native/frlg-parcel-00.05.json", - "sha256": "8b0c04f2e1507aee0f0927a8d022b8b431036431e95f8893aa7a2383360f8504" + "path": "data/story/native/frlg-parcel-02.01.json", + "sha256": "793abfef624f690c73cd0bb2e2a149da5f4c8654b50ffbd5905e27d88e1b0c04" } }, "candidate": { - "sha256": "78219878fedc2c531a4b0faabbe215193ebc7e842dee0237ff52d296a6d614ac", + "sha256": "019e0d77f4f2c15a295e6ac2cfdf31ad836255acdc40a54fee042fddc96373fb", "producer": "checkpoint_replay.run actual route actions; expectations are not read" } } diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/ReplayData/route-candidate.json b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/ReplayData/route-candidate.json index 2ce8d3ce63..c2f0cb0214 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/ReplayData/route-candidate.json +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/ReplayData/route-candidate.json @@ -1,7 +1,7 @@ { "format": "pokesim-route-candidate/1", - "binding_sha256": "ce91aba96599f443910dc76a985b97a45b8a76bcbbb1c9824cd247a627d946f4", - "checkpoint": "00.05", + "binding_sha256": "a29dd87a33c56dd108956d3a691646dbed850b376df6b9f019977dac979a5ed2", + "checkpoint": "02.01", "routes": { "below_mart_door": [ { diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.01.plan.json b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-01.01.plan.json similarity index 94% rename from SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.01.plan.json rename to SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-01.01.plan.json index 4a051b5b16..96ddd874ef 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.01.plan.json +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-01.01.plan.json @@ -2,7 +2,7 @@ "format": "pokesim-authored-checkpoint/1", "game": "frlg", "checkpoint": { - "id": "00.01", + "id": "01.01", "title": "new game to the bedroom", "events": [ { diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.01b.plan.json b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-01.02.plan.json similarity index 95% rename from SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.01b.plan.json rename to SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-01.02.plan.json index e64cad0a98..ca06ea7176 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.01b.plan.json +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-01.02.plan.json @@ -2,7 +2,7 @@ "format": "pokesim-authored-checkpoint/1", "game": "frlg", "checkpoint": { - "id": "00.01b", + "id": "01.02", "title": "after SID Helper: close the Trainer Card, save in the bedroom", "start": {"map": "PalletTown_PlayersHouse_2F", "tiles": [[6, 6]], "facing": "north"}, "events": [ diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.02.plan.json b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-01.03.plan.json similarity index 93% rename from SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.02.plan.json rename to SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-01.03.plan.json index 06d522c23d..bd701d43ea 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.02.plan.json +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-01.03.plan.json @@ -2,7 +2,7 @@ "format": "pokesim-authored-checkpoint/1", "game": "frlg", "checkpoint": { - "id": "00.02", + "id": "01.03", "title": "bedroom to Pallet Town", "start": {"map": "PalletTown_PlayersHouse_2F", "tiles": [[6, 6]], "facing": "north"}, "events": [ diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.03.plan.json b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-01.04.plan.json similarity index 95% rename from SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.03.plan.json rename to SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-01.04.plan.json index 0a86b054dc..e3eabf0b0e 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.03.plan.json +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-01.04.plan.json @@ -2,7 +2,7 @@ "format": "pokesim-authored-checkpoint/1", "game": "frlg", "checkpoint": { - "id": "00.03", + "id": "01.04", "title": "Oak stops the player and walks them to the lab", "start": {"map": "PalletTown", "tiles": [[6, 8]], "facing": "south"}, "events": [ diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.04.plan.json b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-01.05.plan.json similarity index 94% rename from SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.04.plan.json rename to SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-01.05.plan.json index a49a93050b..094053bfaf 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.04.plan.json +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-01.05.plan.json @@ -2,7 +2,7 @@ "format": "pokesim-authored-checkpoint/1", "game": "frlg", "checkpoint": { - "id": "00.04", + "id": "01.05", "title": "to Squirtle's ball, south of the table", "start": {"map": "PalletTown_ProfessorOaksLab", "tiles": [[6, 4]], "facing": "north"}, "events": [ diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.04b.plan.json b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-01.06.plan.json similarity index 95% rename from SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.04b.plan.json rename to SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-01.06.plan.json index 9480ed6556..9c152675c8 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.04b.plan.json +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-01.06.plan.json @@ -2,7 +2,7 @@ "format": "pokesim-authored-checkpoint/1", "game": "frlg", "checkpoint": { - "id": "00.04b", + "id": "01.06", "title": "Squirtle, then the rival's battle", "start": {"map": "PalletTown_ProfessorOaksLab", "tiles": [[9, 5]], "facing": "north"}, "events": [ diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.05.plan.json b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-02.01.plan.json similarity index 95% rename from SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.05.plan.json rename to SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-02.01.plan.json index 19e8a2e15e..4e136e4488 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.05.plan.json +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-02.01.plan.json @@ -2,7 +2,7 @@ "format": "pokesim-authored-checkpoint/1", "game": "frlg", "checkpoint": { - "id": "00.05", + "id": "02.01", "title": "Route 1 to Viridian Mart: Oak's Parcel", "start": {"map": "PalletTown_ProfessorOaksLab", "tiles": [[7, 8]], "facing": "south"}, "events": [ diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.06.plan.json b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-02.02.plan.json similarity index 94% rename from SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.06.plan.json rename to SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-02.02.plan.json index f58aba06bb..f5e4fc8fe2 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.06.plan.json +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-02.02.plan.json @@ -2,7 +2,7 @@ "format": "pokesim-authored-checkpoint/1", "game": "frlg", "checkpoint": { - "id": "00.06", + "id": "02.02", "title": "Oak's Parcel to the Pokedex", "start": {"map": "ViridianCity_Mart", "tiles": [[4, 3]], "facing": "west"}, "events": [ diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.07.plan.json b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-02.03.plan.json similarity index 96% rename from SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.07.plan.json rename to SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-02.03.plan.json index 75e4db6a09..7d632b6e48 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.07.plan.json +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-02.03.plan.json @@ -2,7 +2,7 @@ "format": "pokesim-authored-checkpoint/1", "game": "frlg", "checkpoint": { - "id": "00.07", + "id": "02.03", "title": "Viridian shopping, then into Viridian Forest", "start": {"map": "PalletTown_ProfessorOaksLab", "tiles": [[6, 4]], "facing": "south"}, "events": [ diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.08.plan.json b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-03.01.plan.json similarity index 96% rename from SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.08.plan.json rename to SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-03.01.plan.json index ddb92f9f99..b843c73693 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.08.plan.json +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-03.01.plan.json @@ -2,7 +2,7 @@ "format": "pokesim-authored-checkpoint/1", "game": "frlg", "checkpoint": { - "id": "00.08", + "id": "03.01", "title": "Viridian Forest to Pewter Center", "start": {"map": "ViridianForest", "tiles": [[29, 62]], "facing": "north"}, "events": [ @@ -66,7 +66,7 @@ }, "notes": { "checkpoint": [ - "The supplies bought in 00.07." + "The supplies bought in 02.03." ], "forest_east": [ "Wild battles are fought for EXP. Straight up the east side from the entrance, each leg ending on a wall (the Boy at (45, 58) stops the east one). Rick (47, 45) sees (42..46, 45), so the last leg meets his battle and is held on to its wall after it. The by-hand run's detour west to (13, 46) and back is dropped." diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.09.plan.json b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-03.02.plan.json similarity index 96% rename from SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.09.plan.json rename to SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-03.02.plan.json index 103deb8066..daf8a7f291 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.09.plan.json +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-03.02.plan.json @@ -2,7 +2,7 @@ "format": "pokesim-authored-checkpoint/1", "game": "frlg", "checkpoint": { - "id": "00.09", + "id": "03.02", "title": "Pewter Gym: Camper Liam, then Brock", "start": {"map": "PewterCity_PokemonCenter_1F", "tiles": [[7, 4]], "facing": "north"}, "events": [ diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.10.plan.json b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-03.03.plan.json similarity index 94% rename from SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.10.plan.json rename to SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-03.03.plan.json index 8687203adb..c84b95c817 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.10.plan.json +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-03.03.plan.json @@ -2,7 +2,7 @@ "format": "pokesim-authored-checkpoint/1", "game": "frlg", "checkpoint": { - "id": "00.10", + "id": "03.03", "title": "Pewter: the Running Shoes from Oak's aide", "start": {"map": "PewterCity_Gym", "tiles": [[6, 6]], "facing": "north"}, "events": [ @@ -52,7 +52,7 @@ "RunningShoesAideTriggerTop: the aide talks from (46, 20), no YES/NO; the player only turns up. He walks off and is removed; FLAG_SYS_B_DASH is set (console B, 2026-11-02: about 20 B presses to the overworld)." ], "below_pewter_center": [ - "Where the by-hand walk stopped to start 00.11 (console B, 2026-11-02)." + "Where the by-hand walk stopped to start 04.01 (console B, 2026-11-02)." ] } }, diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.11.plan.json b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-04.01.plan.json similarity index 97% rename from SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.11.plan.json rename to SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-04.01.plan.json index b3346eafc5..6cbf4c0ea3 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.11.plan.json +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-04.01.plan.json @@ -2,7 +2,7 @@ "format": "pokesim-authored-checkpoint/1", "game": "frlg", "checkpoint": { - "id": "00.11", + "id": "04.01", "title": "Pewter Center, then Route 3's trainers", "start": {"map": "PewterCity", "tiles": [[17, 26]], "facing": "south"}, "events": [ diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.12.plan.json b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-04.02.plan.json similarity index 97% rename from SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.12.plan.json rename to SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-04.02.plan.json index de54d42cfa..6f1f39da72 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.12.plan.json +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-04.02.plan.json @@ -2,7 +2,7 @@ "format": "pokesim-authored-checkpoint/1", "game": "frlg", "checkpoint": { - "id": "00.12", + "id": "04.02", "title": "Route 3 and 4 to the Magikarp salesman", "start": {"map": "Route3", "tiles": [[36, 8]], "facing": "south"}, "events": [ diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.12b.plan.json b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-04.03.plan.json similarity index 83% rename from SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.12b.plan.json rename to SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-04.03.plan.json index f3150745d3..5d17946533 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.12b.plan.json +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-04.03.plan.json @@ -2,7 +2,7 @@ "format": "pokesim-authored-checkpoint/1", "game": "frlg", "checkpoint": { - "id": "00.12b", + "id": "04.03", "title": "after Gift RNG: save with the Magikarp", "start": {"map": "Route4_PokemonCenter_1F", "tiles": [[2, 3]], "facing": "west"}, "events": [ @@ -21,7 +21,7 @@ "live_start": true, "notes": { "checkpoint": [ - "Gift RNG buys the Magikarp (500 of the money 00.12 brings) without moving the player and leaves its summary open, or HOME. This saves the shiny where 00.12 ended. A run started here with Gift RNG's handoff on loads the save beside the salesman and runs Gift RNG first." + "Gift RNG buys the Magikarp (500 of the money 04.02 brings) without moving the player and leaves its summary open, or HOME. This saves the shiny where 04.02 ended. A run started here with Gift RNG's handoff on loads the save beside the salesman and runs Gift RNG first." ] } }, diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.12c.plan.json b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-04.04.plan.json similarity index 96% rename from SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.12c.plan.json rename to SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-04.04.plan.json index e6e3c76ae2..a7d36fefe4 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.12c.plan.json +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-04.04.plan.json @@ -2,7 +2,7 @@ "format": "pokesim-authored-checkpoint/1", "game": "frlg", "checkpoint": { - "id": "00.12c", + "id": "04.04", "title": "Route 4 Center: the Magikarp into BOX 1", "start": {"map": "Route4_PokemonCenter_1F", "tiles": [[2, 3]], "facing": "west"}, "events": [ diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.13.plan.json b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-04.05.plan.json similarity index 97% rename from SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.13.plan.json rename to SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-04.05.plan.json index 54ad67342e..37cb0a6ad4 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.13.plan.json +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-04.05.plan.json @@ -2,7 +2,7 @@ "format": "pokesim-authored-checkpoint/1", "game": "frlg", "checkpoint": { - "id": "00.13", + "id": "04.05", "title": "Mt. Moon: a Moon Stone, a Rocket, Miguel and the Helix Fossil", "start": {"map": "Route4_PokemonCenter_1F", "tiles": [[11, 2]], "facing": "north"}, "events": [ diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.14.plan.json b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-04.06.plan.json similarity index 97% rename from SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.14.plan.json rename to SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-04.06.plan.json index db055712e4..3d1ef9ad07 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.14.plan.json +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-04.06.plan.json @@ -2,7 +2,7 @@ "format": "pokesim-authored-checkpoint/1", "game": "frlg", "checkpoint": { - "id": "00.14", + "id": "04.06", "title": "Route 4: Mega Kick from its tutor, then east to Cerulean's Pokemon Center", "start": {"map": "Route4", "tiles": [[32, 6]], "facing": "south"}, "events": [ diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.14b.plan.json b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-05.01.plan.json similarity index 90% rename from SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.14b.plan.json rename to SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-05.01.plan.json index 40e06f9bf6..5aa99f1b54 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.14b.plan.json +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-05.01.plan.json @@ -2,7 +2,7 @@ "format": "pokesim-authored-checkpoint/1", "game": "frlg", "checkpoint": { - "id": "00.14b", + "id": "05.01", "title": "Cerulean: Potions, a GRIND to Lv23, then into the Gym, saved below Misty's platform", "start": {"map": "CeruleanCity_PokemonCenter_1F", "tiles": [[7, 4]], "facing": "north"}, "events": [ @@ -98,9 +98,9 @@ "lead": "after_brock", "notes": { "checkpoint": [ - "Cerulean Gym (pokefirered CeruleanCity_Gym map.json and scripts.inc): a pool with walkways. Misty (8, 6) stands on a platform (7..9, 6) above row 7. Picnicker Diana (4, 7) faces east, sight 4, over (5..8, 7), so misty_front (8, 7) is in her line; Swimmer Luis (10, 12) in the water faces west, sight 1, over (9, 12), on column 9 north of the door. No gym trainer has to be fought for Misty, so neither is: from the door up column 9 to row 13 (a route there, so the planner's walk to a wall doesn't run on past it through (9, 12)), west to (4, 13), and to walls round the pool's west and north sides, (4, 10), (12, 10), (12, 7), then west to (9, 7), the tile below the platform's east end, out of Diana's line. 00.14c steps up onto (9, 6) and talks to Misty from beside her.", - "Misty beat a Lv20 Wartortle (console B, run m51), so first a GRIND to Lv23 on 00.15's patch. Gen 3 numbers (pokefirered: her mons have IV 0; Wartortle taken at IV 15, no EVs): Starmie Lv21 has 56 HP, Atk 36, SpA 47, SpD 40. Bite is Dark, special in Gen 3, no STAB, x2 on Psychic: at Lv23 (SpA 39) it does 23..28, three hits (two on top rolls); at Lv20, 20..24. Her Swift (physical, 60) does 9..11 to a Lv23 Wartortle (about 67 HP, Def 45) and Water Pulse (STAB, resisted) 8..10: 6 or more hits, though m51 saw about 20 a turn. Her Recover (28) and Super Potion undo a Bite, so the margin is in Bite's damage.", - "The Mart comes before the GRIND: its wild battles are fought only with 2 or more Potions, and 00.14's save has none (m51 met Misty with only the 5 this row bought). 5 Potions (row 3, 300 each), then up to 3 Super Potions (row 2, 700), last so they take the Items pocket's last row; the battle doesn't use them yet. The money box can't be read, so the floor stands for it, and a floor above the money fails the step (the quantity box wraps). Prizes (pokefirered: 4 x last level x the class's factor) from a new game's 3000, less Viridian's 2000 and the Magikarp's 500: Liam 220, Brock 1400, Route 3's bug catchers 360, the Mt. Moon grunt 416 and Miguel 288 (the first rival's 80 only if won), at least 3184 here. Floor and budget 3000: 5 Potions and 2 Super Potions, 2900. Misty's 2100 (4 x 21 x 25) then leaves 00.15 its floor of 1500. Then the nurse, and the save before Misty, so her battle is its own checkpoint, 00.14c, verified and retried from it. 00.15's GRIND then fights until the sim beats the Cerulean rival often enough." + "Cerulean Gym (pokefirered CeruleanCity_Gym map.json and scripts.inc): a pool with walkways. Misty (8, 6) stands on a platform (7..9, 6) above row 7. Picnicker Diana (4, 7) faces east, sight 4, over (5..8, 7), so misty_front (8, 7) is in her line; Swimmer Luis (10, 12) in the water faces west, sight 1, over (9, 12), on column 9 north of the door. No gym trainer has to be fought for Misty, so neither is: from the door up column 9 to row 13 (a route there, so the planner's walk to a wall doesn't run on past it through (9, 12)), west to (4, 13), and to walls round the pool's west and north sides, (4, 10), (12, 10), (12, 7), then west to (9, 7), the tile below the platform's east end, out of Diana's line. 05.02 steps up onto (9, 6) and talks to Misty from beside her.", + "Misty beat a Lv20 Wartortle (console B, run m51), so first a GRIND to Lv23 on 05.03's patch. Gen 3 numbers (pokefirered: her mons have IV 0; Wartortle taken at IV 15, no EVs): Starmie Lv21 has 56 HP, Atk 36, SpA 47, SpD 40. Bite is Dark, special in Gen 3, no STAB, x2 on Psychic: at Lv23 (SpA 39) it does 23..28, three hits (two on top rolls); at Lv20, 20..24. Her Swift (physical, 60) does 9..11 to a Lv23 Wartortle (about 67 HP, Def 45) and Water Pulse (STAB, resisted) 8..10: 6 or more hits, though m51 saw about 20 a turn. Her Recover (28) and Super Potion undo a Bite, so the margin is in Bite's damage.", + "The Mart comes before the GRIND: its wild battles are fought only with 2 or more Potions, and 04.06's save has none (m51 met Misty with only the 5 this row bought). 5 Potions (row 3, 300 each), then up to 3 Super Potions (row 2, 700), last so they take the Items pocket's last row; the battle doesn't use them yet. The money box can't be read, so the floor stands for it, and a floor above the money fails the step (the quantity box wraps). Prizes (pokefirered: 4 x last level x the class's factor) from a new game's 3000, less Viridian's 2000 and the Magikarp's 500: Liam 220, Brock 1400, Route 3's bug catchers 360, the Mt. Moon grunt 416 and Miguel 288 (the first rival's 80 only if won), at least 3184 here. Floor and budget 3000: 5 Potions and 2 Super Potions, 2900. Misty's 2100 (4 x 21 x 25) then leaves 05.03 its floor of 1500. Then the nurse, and the save before Misty, so her battle is its own checkpoint, 05.02, verified and retried from it. 05.03's GRIND then fights until the sim beats the Cerulean rival often enough." ] } }, diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.14c.plan.json b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-05.02.plan.json similarity index 96% rename from SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.14c.plan.json rename to SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-05.02.plan.json index 9b82cdb2a4..e0430b4ebf 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.14c.plan.json +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-05.02.plan.json @@ -2,7 +2,7 @@ "format": "pokesim-authored-checkpoint/1", "game": "frlg", "checkpoint": { - "id": "00.14c", + "id": "05.02", "title": "Cerulean Gym: Misty, then Water Pulse", "start": {"map": "CeruleanCity_Gym", "tiles": [[9, 7]], "facing": "west"}, "events": [ @@ -72,7 +72,7 @@ "lead": "after_brock", "notes": { "checkpoint": [ - "Misty (TRAINER_LEADER_MISTY: Staryu Lv18, Starmie Lv21), talked to from (9, 6), beside her on the platform. Her win text runs on to the CASCADE BADGE, TM03 (Water Pulse) and its explanation, all read with the battle's. Bite is chosen against her party (Starmie is Water/Psychic). Back to the nurse round the pool's west side, out of Luis's line; then Water Pulse in place of Tail Whip, last, at the Center, from the bag's TM CASE. Ends where 00.15 starts." + "Misty (TRAINER_LEADER_MISTY: Staryu Lv18, Starmie Lv21), talked to from (9, 6), beside her on the platform. Her win text runs on to the CASCADE BADGE, TM03 (Water Pulse) and its explanation, all read with the battle's. Bite is chosen against her party (Starmie is Water/Psychic). Back to the nurse round the pool's west side, out of Luis's line; then Water Pulse in place of Tail Whip, last, at the Center, from the bag's TM CASE. Ends where 05.03 starts." ] } }, diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.15.plan.json b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-05.03.plan.json similarity index 71% rename from SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.15.plan.json rename to SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-05.03.plan.json index ac04f2b8e0..5ddbd5224f 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.15.plan.json +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-05.03.plan.json @@ -2,7 +2,7 @@ "format": "pokesim-authored-checkpoint/1", "game": "frlg", "checkpoint": { - "id": "00.15", + "id": "05.03", "title": "Cerulean: Water Pulse, Potions, a GRIND until the rival is winnable, then saved below his trigger", "start": {"map": "CeruleanCity_PokemonCenter_1F", "tiles": [[7, 4]], "facing": "north"}, "events": [ @@ -92,7 +92,7 @@ "lead": "after_brock", "notes": { "checkpoint": [ - "Before the rival north of Cerulean (00.15b), from the Center: first TM03 Water Pulse over Tail Whip, if the lead doesn't know it yet, so the GRIND's sim plays it (a run without TM03 from Misty skips the step). Then 3 Potions at the Mart (CeruleanCity_Mart_Items: POTION is row 3, 300 each; Mt. Moon's trainers leave well over the floor) and 2 Awakenings (row 6, 250 each; pokefirered items.json) for the rival's Bulbasaur's Sleep Powder (console B, m56: asleep at 34/65 HP, it fainted two turns later with 15 Potions), 1400 of the floor's 1500. Then a GRIND on Route 4's grass east of Mt. Moon (75..86, 11..17; Spearow, Rattata, Ekans and Mankey around Lv10, about 80 EXP each), healing at the Center, until the battle sim beats the rival 00.15b fights 50% or more: the win chance his battle refuses below. Console B's Wartortle (Lv22, 65 HP, Water Pulse) is about 42% there and 62% at Lv23; Lv28 (about 88%, some 120 battles from Lv22) is the cap. Then the nurse, and the save on (23, 7), the tile below his trigger: his battle is its own checkpoint, 00.15b, verified and retried from this save." + "Before the rival north of Cerulean (05.04), from the Center: first TM03 Water Pulse over Tail Whip, if the lead doesn't know it yet, so the GRIND's sim plays it (a run without TM03 from Misty skips the step). Then 3 Potions at the Mart (CeruleanCity_Mart_Items: POTION is row 3, 300 each; Mt. Moon's trainers leave well over the floor) and 2 Awakenings (row 6, 250 each; pokefirered items.json) for the rival's Bulbasaur's Sleep Powder (console B, m56: asleep at 34/65 HP, it fainted two turns later with 15 Potions), 1400 of the floor's 1500. Then a GRIND on Route 4's grass east of Mt. Moon (75..86, 11..17; Spearow, Rattata, Ekans and Mankey around Lv10, about 80 EXP each), healing at the Center, until the battle sim beats the rival 05.04 fights 50% or more: the win chance his battle refuses below. Console B's Wartortle (Lv22, 65 HP, Water Pulse) is about 42% there and 62% at Lv23; Lv28 (about 88%, some 120 battles from Lv22) is the cap. Then the nurse, and the save on (23, 7), the tile below his trigger: his battle is its own checkpoint, 05.04, verified and retried from this save." ] } }, diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.15b.plan.json b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-05.04.plan.json similarity index 94% rename from SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.15b.plan.json rename to SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-05.04.plan.json index 383136aa45..fbfa4e03fc 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.15b.plan.json +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-05.04.plan.json @@ -2,7 +2,7 @@ "format": "pokesim-authored-checkpoint/1", "game": "frlg", "checkpoint": { - "id": "00.15b", + "id": "05.04", "title": "Cerulean: Water Pulse if not known, then the rival north of the city", "start": {"map": "CeruleanCity", "tiles": [[23, 7]], "facing": "north"}, "events": [ @@ -43,7 +43,7 @@ "lead": "after_brock", "notes": { "checkpoint": [ - "The rival north of Cerulean (CeruleanCity scripts.inc): the only way north to Nugget Bridge is columns 22..24, and a step onto row 6 there (CeruleanCity_EventScript_RivalTrigger*, VAR_MAP_SCENE_CERULEAN_CITY_RIVAL 0) brings him down to the player. From the middle, (23, 6), he stops at (23, 5); after the battle he walks round the player and off south, and the player, turning to watch him, ends facing south. His FAME CHECKER's text is read to the overworld with the battle's. For a player who took Squirtle he has Pidgeotto Lv17, Abra Lv16, Rattata Lv15 and Bulbasaur Lv18 (sParty_RivalCeruleanBulbasaur), whose Vine Whip and Sleep Powder are the danger. The row starts from 00.15's save below the trigger, and saves after him. First TM03 Water Pulse over Tail Whip (from the bag, where the player stands), if the lead doesn't know it yet: console B's save (2026-11-03) is past Misty's TEACH, which failed there. Where she taught it, the step reads the moves and does nothing." + "The rival north of Cerulean (CeruleanCity scripts.inc): the only way north to Nugget Bridge is columns 22..24, and a step onto row 6 there (CeruleanCity_EventScript_RivalTrigger*, VAR_MAP_SCENE_CERULEAN_CITY_RIVAL 0) brings him down to the player. From the middle, (23, 6), he stops at (23, 5); after the battle he walks round the player and off south, and the player, turning to watch him, ends facing south. His FAME CHECKER's text is read to the overworld with the battle's. For a player who took Squirtle he has Pidgeotto Lv17, Abra Lv16, Rattata Lv15 and Bulbasaur Lv18 (sParty_RivalCeruleanBulbasaur), whose Vine Whip and Sleep Powder are the danger. The row starts from 05.03's save below the trigger, and saves after him. First TM03 Water Pulse over Tail Whip (from the bag, where the player stands), if the lead doesn't know it yet: console B's save (2026-11-03) is past Misty's TEACH, which failed there. Where she taught it, the step reads the moves and does nothing." ] } }, diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.16.plan.json b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-05.05.plan.json similarity index 96% rename from SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.16.plan.json rename to SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-05.05.plan.json index 0d19759910..9074306b2d 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.16.plan.json +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-05.05.plan.json @@ -2,7 +2,7 @@ "format": "pokesim-authored-checkpoint/1", "game": "frlg", "checkpoint": { - "id": "00.16", + "id": "05.05", "title": "Nugget Bridge: the nurse, five trainers and the Rocket", "start": {"map": "CeruleanCity", "tiles": [[23, 6]], "facing": "south"}, "events": [ diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.17.plan.json b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-05.06.plan.json similarity index 97% rename from SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.17.plan.json rename to SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-05.06.plan.json index 063c87c4b8..017b2262f4 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.17.plan.json +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-05.06.plan.json @@ -2,7 +2,7 @@ "format": "pokesim-authored-checkpoint/1", "game": "frlg", "checkpoint": { - "id": "00.17", + "id": "05.06", "title": "Route 24 and 25 to Bill's Sea Cottage: Franklin, Kelsey, Nob and Haley", "start": {"map": "Route24", "tiles": [[11, 15]], "facing": "east"}, "events": [ diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.18.plan.json b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-05.07.plan.json similarity index 97% rename from SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.18.plan.json rename to SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-05.07.plan.json index ce6a0dcb99..6c35572170 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.18.plan.json +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-05.07.plan.json @@ -2,7 +2,7 @@ "format": "pokesim-authored-checkpoint/1", "game": "frlg", "checkpoint": { - "id": "00.18", + "id": "05.07", "title": "Bill's Sea Cottage: the Cell Separator and the S.S. Ticket", "start": {"map": "Route25_SeaCottage", "tiles": [[7, 8]], "facing": "north"}, "events": [ diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.19.plan.json b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-05.08.plan.json similarity index 96% rename from SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.19.plan.json rename to SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-05.08.plan.json index aec59c3685..80199af3df 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.19.plan.json +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-05.08.plan.json @@ -2,7 +2,7 @@ "format": "pokesim-authored-checkpoint/1", "game": "frlg", "checkpoint": { - "id": "00.19", + "id": "05.08", "title": "Route 25's south path back to Cerulean's Pokemon Center", "start": {"map": "Route25", "tiles": [[51, 5]], "facing": "south"}, "events": [ diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.20.plan.json b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-05.09.plan.json similarity index 94% rename from SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.20.plan.json rename to SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-05.09.plan.json index 6dba500518..31dbcdb16a 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.20.plan.json +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-05.09.plan.json @@ -2,7 +2,7 @@ "format": "pokesim-authored-checkpoint/1", "game": "frlg", "checkpoint": { - "id": "00.20", + "id": "05.09", "title": "Route 24's grass: an Oddish for Cut, then the Center", "start": {"map": "CeruleanCity_PokemonCenter_1F", "tiles": [[7, 4]], "facing": "north"}, "events": [ @@ -72,8 +72,8 @@ "notes": { "checkpoint": [ "Stopgap for console B's save, which caught nothing on Route 1. A new playthrough should instead catch a Rattata on Route 1 or 22 early, as its Cut user and spare member, and drop this row (and its walk over Nugget Bridge and back).", - "An Oddish for HM01 Cut, and a second member behind the lead (docs/design/AutoStory-FRLG-FutureEvents.md, \"Console B run choices\"). Route 24's grass (Route24 map.json: x 3..5, rows 19..31, west of Nugget Bridge) is the nearest to the Center with Oddish: FireRed's sRoute24_FireRed (pokefirered wild_encounters.json) has it in 25% of battles, Lv12..14, as Route 25's grass; Routes 5 and 6 aren't on the story's maps yet. Up the bridge, whose trainers 00.16 beat, west along rows 10..15 to the cliff (3, 15) and down column 3 to the grass's first row, (3, 19); the step paces east to (4, 19) and back. Camper Shane (5, 21) faces north, sight 5, over (5, 16..20): column 5 is kept off. The leg west ends on the cliff, not open: on console B (m63) an open leg west to (4, 15) ended a tile short, and the walk down column 5 came into Shane's sight.", - "First 7 Poke Balls at the Mart (row 1, 200 each; the bag isn't read, so the step buys them whatever the bag holds). The floor, from 00.15's 1500 less its 1400: the rival's 288 (4 x 18 x 4), the Rocket's 480 (4 x 15 x 8), Franklin's 540 and Nob's 468 (hikers, 9) alone make 1876 (pokefirered gTrainerMoneyTable). An Oddish at full HP (catch rate 255) stays in a Poke Ball about 1 time in 3 (Gen 3: a = 85, four shakes of 0.76), so 7 balls catch it about 94% of the time; the step throws 7 at most, in 30 battles (none an Oddish: 0.02%). Nothing weakens it: the HP bar isn't read on the console yet.", + "An Oddish for HM01 Cut, and a second member behind the lead (docs/design/AutoStory-FRLG-FutureEvents.md, \"Console B run choices\"). Route 24's grass (Route24 map.json: x 3..5, rows 19..31, west of Nugget Bridge) is the nearest to the Center with Oddish: FireRed's sRoute24_FireRed (pokefirered wild_encounters.json) has it in 25% of battles, Lv12..14, as Route 25's grass; Routes 5 and 6 aren't on the story's maps yet. Up the bridge, whose trainers 05.05 beat, west along rows 10..15 to the cliff (3, 15) and down column 3 to the grass's first row, (3, 19); the step paces east to (4, 19) and back. Camper Shane (5, 21) faces north, sight 5, over (5, 16..20): column 5 is kept off. The leg west ends on the cliff, not open: on console B (m63) an open leg west to (4, 15) ended a tile short, and the walk down column 5 came into Shane's sight.", + "First 7 Poke Balls at the Mart (row 1, 200 each; the bag isn't read, so the step buys them whatever the bag holds). The floor, from 05.03's 1500 less its 1400: the rival's 288 (4 x 18 x 4), the Rocket's 480 (4 x 15 x 8), Franklin's 540 and Nob's 468 (hikers, 9) alone make 1876 (pokefirered gTrainerMoneyTable). An Oddish at full HP (catch rate 255) stays in a Poke Ball about 1 time in 3 (Gen 3: a = 85, four shakes of 0.76), so 7 balls catch it about 94% of the time; the step throws 7 at most, in 30 battles (none an Oddish: 0.02%). Nothing weakens it: the HP bar isn't read on the console yet.", "The Oddish joins the party second. Battles keep the lead in (PokemonFRLG_AutoStoryBattleDecisions.h): the Oddish is sent only when the lead faints in a trainer's battle, which counts as lost. Back to the nurse, and the save in the Center." ] } diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.21.plan.json b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-05.10.plan.json similarity index 97% rename from SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.21.plan.json rename to SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-05.10.plan.json index 39da1ef70b..25570a94ab 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.21.plan.json +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-05.10.plan.json @@ -2,7 +2,7 @@ "format": "pokesim-authored-checkpoint/1", "game": "frlg", "checkpoint": { - "id": "00.21", + "id": "05.10", "title": "The Cerulean Rocket, Route 5, the Underground Path and Route 6 to Vermilion's Pokemon Center: Jeff", "start": {"map": "CeruleanCity_PokemonCenter_1F", "tiles": [[7, 4]], "facing": "north"}, "events": [ diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.22.plan.json b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-06.01.plan.json similarity index 96% rename from SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.22.plan.json rename to SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-06.01.plan.json index 172506f15d..adb340a9da 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.22.plan.json +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-06.01.plan.json @@ -2,7 +2,7 @@ "format": "pokesim-authored-checkpoint/1", "game": "frlg", "checkpoint": { - "id": "00.22", + "id": "06.01", "title": "The S.S. Anne: the rival, HM01 Cut from the Captain, back to Vermilion's Pokemon Center", "start": {"map": "VermilionCity_PokemonCenter_1F", "tiles": [[7, 4]], "facing": "north"}, "events": [ @@ -156,7 +156,7 @@ "lead": "after_brock", "notes": { "checkpoint": [ - "The S.S. Anne (VermilionCity, SSAnne_* scripts.inc). The step onto (23, 33) (VermilionCity_EventScript_CheckTicket) has the sailor (24, 33) ask for a ticket; the S.S. TICKET (00.18) is shown and the player turns east to him. Then onto the pier (23, 34), along the gangway, through 1F, by legs off its cabins' doormats on row 10, which planned routes cross, and up its stairs (3, 8) to 2F. The step onto (30, 6), below the Captain's door (30, 2) (SSAnne_2F_Corridor_EventScript_RivalTriggerLeft), brings the rival out and down to (30, 5); the player keeps facing north, and after the battle he walks round the player and off. For a player who took Squirtle: Pidgeotto Lv19, Raticate Lv16, Kadabra Lv18, Ivysaur Lv20. The ship's trainers are in its cabins and on its deck, off the way. The Captain (5, 4) faces up; talked to from (5, 5) he is rubbed on the back and gives HM01 (VAR_MAP_SCENE_VERMILION_CITY 1). Back out through 1F's door (19, 1): on the gangway the ship sails (SSAnne_Exterior_ExitSSAnne), the player is put on (23, 34) and walked up to (23, 32) (VermilionCity_EventScript_ExitSSAnne). Cut is taught later, to the Oddish." + "The S.S. Anne (VermilionCity, SSAnne_* scripts.inc). The step onto (23, 33) (VermilionCity_EventScript_CheckTicket) has the sailor (24, 33) ask for a ticket; the S.S. TICKET (05.07) is shown and the player turns east to him. Then onto the pier (23, 34), along the gangway, through 1F, by legs off its cabins' doormats on row 10, which planned routes cross, and up its stairs (3, 8) to 2F. The step onto (30, 6), below the Captain's door (30, 2) (SSAnne_2F_Corridor_EventScript_RivalTriggerLeft), brings the rival out and down to (30, 5); the player keeps facing north, and after the battle he walks round the player and off. For a player who took Squirtle: Pidgeotto Lv19, Raticate Lv16, Kadabra Lv18, Ivysaur Lv20. The ship's trainers are in its cabins and on its deck, off the way. The Captain (5, 4) faces up; talked to from (5, 5) he is rubbed on the back and gives HM01 (VAR_MAP_SCENE_VERMILION_CITY 1). Back out through 1F's door (19, 1): on the gangway the ship sails (SSAnne_Exterior_ExitSSAnne), the player is put on (23, 34) and walked up to (23, 32) (VermilionCity_EventScript_ExitSSAnne). Cut is taught later, to the Oddish." ] } }, diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.23.plan.json b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-06.02.plan.json similarity index 95% rename from SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.23.plan.json rename to SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-06.02.plan.json index 0077160402..cefb1b1ba6 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.23.plan.json +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-06.02.plan.json @@ -2,7 +2,7 @@ "format": "pokesim-authored-checkpoint/1", "game": "frlg", "checkpoint": { - "id": "00.23", + "id": "06.02", "title": "Vermilion Gym: Cut and Dig, the tree, Dwayne, Baily and Tucker, the trash cans", "start": {"map": "VermilionCity_PokemonCenter_1F", "tiles": [[7, 4]], "facing": "north"}, "events": [ @@ -187,7 +187,7 @@ "lead": "after_brock", "notes": { "checkpoint": [ - "HM01 Cut, from the S.S. Anne (00.22), to the Oddish (00.20), second in the party: a wild Oddish of Lv12 to 14 knows 2 or 3 moves (Absorb, Sweet Scent, Poison Powder at 14), so it has room. TM28 Dig, from the Cerulean Rocket (00.21), to the lead in place of Withdraw: Ground, twice as strong on Lt. Surge's three, it is the lead's best move against him. Vermilion's tree (19, 24) (EventScript_CutTree) is the only way into the gym's yard, row 24 being walls but for it; the gym's door is (14, 25). In the gym, the trainers as below, then the trash cans until the door opens; out, the tree cut again from below, and back to the nurse.", + "HM01 Cut, from the S.S. Anne (06.01), to the Oddish (05.09), second in the party: a wild Oddish of Lv12 to 14 knows 2 or 3 moves (Absorb, Sweet Scent, Poison Powder at 14), so it has room. TM28 Dig, from the Cerulean Rocket (05.10), to the lead in place of Withdraw: Ground, twice as strong on Lt. Surge's three, it is the lead's best move against him. Vermilion's tree (19, 24) (EventScript_CutTree) is the only way into the gym's yard, row 24 being walls but for it; the gym's door is (14, 25). In the gym, the trainers as below, then the trash cans until the door opens; out, the tree cut again from below, and back to the nurse.", "The gym (VermilionCity_Gym map.json, scripts.inc), 11 x 20, entered on (5, 19): the cans on rows 10, 12 and 14 at x 1, 3, 5, 7, 9 (PokemonFRLG_AutoStoryTrashCans.h), the beams across rows 6 and 7 that the two switches turn off, Lt. Surge (5, 2) facing down above them. Its trainers, sight 3:", "Sailor Dwayne (8, 13) and Engineer Baily (2, 11) look around (MOVEMENT_TYPE_LOOK_AROUND): between them they see across rows 11 and 13 and down columns 2 and 8, so no way from the door to the cans keeps out of their sight. Each is fought from the second tile of his line, stepped onto from beside it, out of sight, and waited on there until he turns to the player (\"trainer_wait\"): Dwayne from (8, 15), stepped onto from (7, 15), Baily from (2, 13), from (3, 13). Each walks up a tile, Dwayne to (8, 14), Baily to (2, 12), and stays there while the player is in the gym.", "Gentleman Tucker (7, 8) faces west over (4..6, 8): fought on the step up from (5, 9) onto (5, 8); he walks up to (6, 8).", diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.24.plan.json b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-06.03.plan.json similarity index 97% rename from SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.24.plan.json rename to SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-06.03.plan.json index 577e9c68a8..ba1f5e5dfd 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.24.plan.json +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-06.03.plan.json @@ -2,7 +2,7 @@ "format": "pokesim-authored-checkpoint/1", "game": "frlg", "checkpoint": { - "id": "00.24", + "id": "06.03", "title": "Route 6's grass until the lead is Lv31, then through the open beams to Lt. Surge", "start": {"map": "VermilionCity_PokemonCenter_1F", "tiles": [[7, 4]], "facing": "north"}, "events": [ diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.25.plan.json b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-06.04.plan.json similarity index 97% rename from SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.25.plan.json rename to SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-06.04.plan.json index 7d72d919f0..26cdd3319d 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.25.plan.json +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-06.04.plan.json @@ -2,7 +2,7 @@ "format": "pokesim-authored-checkpoint/1", "game": "frlg", "checkpoint": { - "id": "00.25", + "id": "06.04", "title": "Vermilion Gym: Lt. Surge, the THUNDERBADGE, then the Center", "start": {"map": "VermilionCity_Gym", "tiles": [[5, 3]], "facing": "north"}, "events": [ diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.26.plan.json b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-07.01.plan.json similarity index 94% rename from SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.26.plan.json rename to SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-07.01.plan.json index 1ee5abc86d..28e446f227 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.26.plan.json +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-07.01.plan.json @@ -2,7 +2,7 @@ "format": "pokesim-authored-checkpoint/1", "game": "frlg", "checkpoint": { - "id": "00.26", + "id": "07.01", "title": "The BIKE VOUCHER from the Fan Club, back north to Cerulean, the BICYCLE, Repels and Escape Ropes", "start": {"map": "VermilionCity_PokemonCenter_1F", "tiles": [[7, 4]], "facing": "north"}, "events": [ @@ -149,8 +149,8 @@ "notes": { "checkpoint": [ "The BIKE VOUCHER and the BICYCLE, from Vermilion's Center to Cerulean's (pokeguy 43:50 to 45:00).", - "The Pokemon Fan Club (VermilionCity_PokemonFanClub map.json, scripts.inc), in by Vermilion's (12, 17): the chairman (5, 4) sits above a table (5..6, 5..6) with the worker (6, 4) east of him, so he is talked to from (4, 4), west of him. \"Did you come to hear about my POKEMON?\" YES: his story, then the BIKE VOUCHER (FLAG_GOT_BIKE_VOUCHER). Oak's aide stands on Vermilion's (25, 7) since Lt. Surge, where the story's maps don't have him: the way planned from the Center's door goes east along his row 7, so the walk goes down to the water (14, 10) first, as 00.25 came up from it. From the Fan Club, up to (22, 10) first, so that the way on to Route 6 goes up column 22, west of him, not round by column 27.", - "Route 6 north, the trainers as 00.21 left them: Jeff (13, 33) beaten, Isabelle (13, 32) and Elijah (20, 25) not. As in 00.24, onto Jeff's row, west to the wall (7, 33) and up to row 31, above Isabelle's line; then east along row 31 to the wall (17, 31) and up column 16, west of Elijah's line (17..19, 25) and east of Keigo's (4..8, 16), to the ledge (16, 11). The first three legs are 00.24's, walked on console B; the two after end on walls, which the walker holds again after a wild battle in the grass.", + "The Pokemon Fan Club (VermilionCity_PokemonFanClub map.json, scripts.inc), in by Vermilion's (12, 17): the chairman (5, 4) sits above a table (5..6, 5..6) with the worker (6, 4) east of him, so he is talked to from (4, 4), west of him. \"Did you come to hear about my POKEMON?\" YES: his story, then the BIKE VOUCHER (FLAG_GOT_BIKE_VOUCHER). Oak's aide stands on Vermilion's (25, 7) since Lt. Surge, where the story's maps don't have him: the way planned from the Center's door goes east along his row 7, so the walk goes down to the water (14, 10) first, as 06.04 came up from it. From the Fan Club, up to (22, 10) first, so that the way on to Route 6 goes up column 22, west of him, not round by column 27.", + "Route 6 north, the trainers as 05.10 left them: Jeff (13, 33) beaten, Isabelle (13, 32) and Elijah (20, 25) not. As in 06.03, onto Jeff's row, west to the wall (7, 33) and up to row 31, above Isabelle's line; then east along row 31 to the wall (17, 31) and up column 16, west of Elijah's line (17..19, 25) and east of Keigo's (4..8, 16), to the ledge (16, 11). The first three legs are 06.03's, walked on console B; the two after end on walls, which the walker holds again after a wild battle in the grass.", "The Underground Path north, Route 5's sides, which have no trainer, and Cerulean's south edge, whose way into the city without the burgled house is the tree (26, 32) (pokeguy 44:42).", "The Bike Shop (CeruleanCity_BikeShop), in by (13, 28): the clerk (9, 3) is across the counter (8, 3), talked to from (7, 3). With the voucher he gives the BICYCLE (FLAG_GOT_BICYCLE) with no YES/NO; it isn't registered or ridden yet.", "The Mart: 5 Repels (row 9, 350 each) and 2 Escape Ropes (row 8, 550 each; pokefirered items.json), 2850 in all. Console B had about 9000 after Lt. Surge (2026-11-03); the floor of 6000 leaves 3000 or more after them.", diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.27.plan.json b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-07.02.plan.json similarity index 97% rename from SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.27.plan.json rename to SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-07.02.plan.json index c42beb62ef..ee98e4edab 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.27.plan.json +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-07.02.plan.json @@ -2,7 +2,7 @@ "format": "pokesim-authored-checkpoint/1", "game": "frlg", "checkpoint": { - "id": "00.27", + "id": "07.02", "title": "East over Route 9 to Route 10's Pokemon Center: the two trees, Alicia, Jeremy and Conner", "start": {"map": "CeruleanCity_PokemonCenter_1F", "tiles": [[7, 4]], "facing": "north"}, "events": [ @@ -213,7 +213,7 @@ "notes": { "checkpoint": [ "East out of Cerulean over Route 9 to Route 10's Pokemon Center (pokeguy 45:12 to 47:27), on foot: the Bicycle isn't registered yet.", - "Cerulean (CeruleanCity map.json): the way east, column 39..40 up from row 33 to rows 18..19 and out of the city's east edge, is reached from the city only through the tree (26, 32), grown back since 00.26 (its flag is a FLAG_TEMP), or the burgled house. Cut from above. Route 9 joins the city's rows 18..19 by its rows 8..9 (offset -10); its tree (2, 8) (FLAG_TEMP_12) closes them, (2, 9) being rock: cut from (1, 8), west of it.", + "Cerulean (CeruleanCity map.json): the way east, column 39..40 up from row 33 to rows 18..19 and out of the city's east edge, is reached from the city only through the tree (26, 32), grown back since 07.01 (its flag is a FLAG_TEMP), or the burgled house. Cut from above. Route 9 joins the city's rows 18..19 by its rows 8..9 (offset -10); its tree (2, 8) (FLAG_TEMP_12) closes them, (2, 9) being rock: cut from (1, 8), west of it.", "Route 9 (Route9 map.json, scripts.inc), its ledges all facing south. Of its nine trainers, three can't be walked around, as in pokeguy's run, where Jeremy happened to look away:", "Picnicker Alicia (14, 10) faces west, sight 3, over (11..13, 10), the only tiles above the ledge row 11 the way west goes down by: fought on the step onto (11, 10); she walks up to (12, 10). Then down the ledge (11, 11).", "Hiker Jeremy (20, 17) looks north and west (FACE_UP_AND_LEFT), sight 4: north over (20, 13..16), every way east of column 19 below the rocks of row 12. Fought on (20, 13), waiting for him to look north (trainer_wait); he walks up to (20, 14).", diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.28.plan.json b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-08.01.plan.json similarity index 97% rename from SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.28.plan.json rename to SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-08.01.plan.json index 9e552b3016..a132e16b38 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.28.plan.json +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-08.01.plan.json @@ -2,7 +2,7 @@ "format": "pokesim-authored-checkpoint/1", "game": "frlg", "checkpoint": { - "id": "00.28", + "id": "08.01", "title": "Through Rock Tunnel: Ashton, Winston, Martha, Allen, Lenny, Sofia, Dudley, Cooper and Dana", "start": {"map": "Route10_PokemonCenter_1F", "tiles": [[7, 4]], "facing": "north"}, "events": [ @@ -375,7 +375,7 @@ "1F Lenny (7, 5) looks south over (7, 6..9), the way east from the ladder (4, 2): stepped into from (6, 9), the end of column 6. The way on to the ladder (20, 13) keeps west of Lucas's line (16..19, 17): down column 11, up column 14 to row 16.", "B1F Sofia (11, 15) looks south over (11, 16..19), the way west: stepped into along row 16 from (12..14, 16).", "B1F Dudley (5, 11) looks south over (5, 12..15): stepped into from (8, 15) along row 15.", - "B1F Cooper (2, 6) looks around (sight 2) by the ladder (2, 3): the leg up column 1 to the wall (1, 2) passes him on (1, 6); if he looks west, story_interrupts() fights him and the leg is held on to its wall, as Mt. Moon's Grunt in 00.13.", + "B1F Cooper (2, 6) looks around (sight 2) by the ladder (2, 3): the leg up column 1 to the wall (1, 2) passes him on (1, 6); if he looks west, story_interrupts() fights him and the leg is held on to its wall, as Mt. Moon's Grunt in 04.05.", "1F Dana (26, 28) looks south over (26, 29..31), the only way west to the south mouth: stepped into along row 31 from (27..29, 31).", "Unverified on the console: Rock Tunnel is dark without Flash, and the overworld, fade, dialog and battle detectors haven't been measured under its darkness (~/FRLGLab/notes/2026-11-09-0028-dark-measure.md). Every step from rock_tunnel_1f to route10_south depends on them.", "The corner (11, 35), wall north and rock west, finds the player from any of (11..14, 35) after a battle; east to the wall (19, 35) did not (console B, 2026-11-09 13:35: found 5 tiles off)." diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.29.plan.json b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-08.02.plan.json similarity index 97% rename from SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.29.plan.json rename to SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-08.02.plan.json index 33b988b0e5..413c4562bb 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.29.plan.json +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-08.02.plan.json @@ -2,7 +2,7 @@ "format": "pokesim-authored-checkpoint/1", "game": "frlg", "checkpoint": { - "id": "00.29", + "id": "08.02", "title": "Route 10 south to Lavender Town's Pokemon Center", "start": {"map": "Route10", "tiles": [[8, 58]], "facing": "south"}, "events": [ diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.30.plan.json b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-08.03.plan.json similarity index 94% rename from SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.30.plan.json rename to SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-08.03.plan.json index 2314bc6445..a85c5e67c7 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.30.plan.json +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-08.03.plan.json @@ -2,7 +2,7 @@ "format": "pokesim-authored-checkpoint/1", "game": "frlg", "checkpoint": { - "id": "00.30", + "id": "08.03", "title": "Lavender Mart, then west over Route 8 on the Bicycle, the Underground Path, a Pidgey on Route 7, Celadon's Pokemon Center", "start": {"map": "LavenderTown_PokemonCenter_1F", "tiles": [[7, 4]], "facing": "north"}, "events": [ @@ -10,7 +10,7 @@ "id": "register_bike", "kind": "game_action", "action": "register_bike", - "why": "the BICYCLE (00.26) registered for SELECT, which gets on and off in about 1 s (console B, 2026-11-09); here until 00.26's plan (frlg/stage7-celadon, #224) takes it right after the Bicycle" + "why": "the BICYCLE (07.01) registered for SELECT, which gets on and off in about 1 s (console B, 2026-11-09); here until 07.01's plan (frlg/stage7-celadon, #224) takes it right after the Bicycle" }, { "id": "east_of_mart_door", @@ -49,7 +49,7 @@ "floor": 9000, "items": [{"item": "escape-rope", "quantity": 4}, {"item": "super-repel", "quantity": 7}] }, - "why": "pokeguy 54:18: 4 Escape Ropes (the Rocket Hideout, 00.31) and 7 Super Repels (Pokemon Tower)" + "why": "pokeguy 54:18: 4 Escape Ropes (the Rocket Hideout, 09.01) and 7 Super Repels (Pokemon Tower)" }, { "id": "out_of_lavender_mart", @@ -216,7 +216,7 @@ "lead": "after_brock", "notes": { "checkpoint": [ - "PokeGuy's way from Lavender Town to Celadon City (pokeguy 54:18 on): the Lavender Mart, Route 8 west on the BICYCLE (00.26), Gamer Rich, the Underground Path's east-west tunnel to Route 7, a Pidgey from Route 7's grass to carry HM02 Fly later, and Celadon's Pokemon Center.", + "PokeGuy's way from Lavender Town to Celadon City (pokeguy 54:18 on): the Lavender Mart, Route 8 west on the BICYCLE (07.01), Gamer Rich, the Underground Path's east-west tunnel to Route 7, a Pidgey from Route 7's grass to carry HM02 Fly later, and Celadon's Pokemon Center.", "No Repel: the way keeps off grass. Route 8's grass (34..46, 9..18) is penned in by the Cut trees (47, 12) and (33, 15); Route 7's (11..18, 2..6) is east of the way north from the Underground Path's door (7, 14). The Underground Path has no wild Pokemon (pokefirered wild_encounters.json lists none), and the Pidgey is caught where Route 7's grass is walked on purpose.", "Route 8's trainers (Route8 map.json): Julia (62, 14) looks west 6, Rich (55, 15) south 3, Glenn (51, 6) all ways 4, Paige (29, 3) and Andrea (29, 5) west 3, Leslie (29, 4) and Megan (29, 6) east 6, Stan (21, 3) all ways 1, Eli and Anne (40, 3), (41, 3) south 1, Ricardo (14, 16) and Jaren (24, 17) all ways 1, Aidan (9, 6) east 4. Below the wall (56..61, 6..13) the only ways west are row 14, Julia's line, and rows 15..18, which cross Rich's column: his line (55, 16..18) is the one taken." ], diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.31.plan.json b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-09.01.plan.json similarity index 97% rename from SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.31.plan.json rename to SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-09.01.plan.json index 3be1225000..84e8890023 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.31.plan.json +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-09.01.plan.json @@ -2,7 +2,7 @@ "format": "pokesim-authored-checkpoint/1", "game": "frlg", "checkpoint": { - "id": "00.31", + "id": "09.01", "title": "Celadon Game Corner and the Rocket Hideout down to B4F: the poster guard, the Lift Key Grunt, the LIFT KEY and B3F's Rare Candy", "start": {"map": "CeladonCity_PokemonCenter_1F", "tiles": [[7, 4]], "facing": "north"}, "events": [ diff --git a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.32.plan.json b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-09.02.plan.json similarity index 97% rename from SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.32.plan.json rename to SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-09.02.plan.json index ddb53088c5..7bfde57be6 100644 --- a/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-00.32.plan.json +++ b/SerialPrograms/Source/VideoGames/PokemonFRLG/Programs/AutoStory/StoryData/frlg-09.02.plan.json @@ -2,7 +2,7 @@ "format": "pokesim-authored-checkpoint/1", "game": "frlg", "checkpoint": { - "id": "00.32", + "id": "09.02", "title": "Rocket Hideout: B2F's arrows and the MOON STONE, the lift to B4F, the two door guards, Giovanni, the SILPH SCOPE and an Escape Rope out", "start": {"map": "RocketHideout_B3F", "tiles": [[12, 13]], "facing": "north"}, "events": [ diff --git a/devtools/story-export/README.md b/devtools/story-export/README.md index 8195c7b3fe..ff99152e34 100644 --- a/devtools/story-export/README.md +++ b/devtools/story-export/README.md @@ -10,7 +10,7 @@ From a clean committed checkout with the usual native build dependencies: ```sh cmake -S SerialPrograms -B build -DPA_FRLG_STORY_EXPORT=ON cmake --build build --target StoryCheckpointExport -j4 -build/StoryCheckpointExport 00.05 > frlg-parcel.native.json +build/StoryCheckpointExport 02.01 > frlg-parcel.native.json ``` On multi-configuration generators add `--config RelWithDebInfo`, then run diff --git a/devtools/story-export/frlg_main.cpp b/devtools/story-export/frlg_main.cpp index 72d3a0bbcf..c6a60ac12c 100644 --- a/devtools/story-export/frlg_main.cpp +++ b/devtools/story-export/frlg_main.cpp @@ -1,7 +1,7 @@ /* Offline evaluated FRLG table export. No console or profile initialization. * cmake -S SerialPrograms -B build -DPA_FRLG_STORY_EXPORT=ON * cmake --build build --target StoryCheckpointExport -j4 - * build/StoryCheckpointExport 00.05 > frlg-parcel.native.json + * build/StoryCheckpointExport 02.01 > frlg-parcel.native.json * Format the captured JSON with PokemonSimulation's contract formatter. */ #include diff --git a/devtools/story-replay/README.md b/devtools/story-replay/README.md index 7610fb6eac..b909290552 100644 --- a/devtools/story-replay/README.md +++ b/devtools/story-replay/README.md @@ -23,7 +23,7 @@ GitHub CI builds/tests on the fork; Ubuntu additionally uploads `Programs/AutoStory/ReplayData/` contains exact `binding.json` / `cases.json` copies from the immutable PokemonSimulation revision in `pin.json`. The capture -is `capture.json` there, the bytes of the old table export of 00.05 that +is `capture.json` there, the bytes of the old table export of 02.01 that `binding.json` pins; the replay reads its checkpoint in the #312 step format (a route's target and a step's direction as args). These are **PR #73 preview test fixtures**, not an approved resource/production-plan adoption. diff --git a/docs/design/AutoStory-FRLG-Sizing.md b/docs/design/AutoStory-FRLG-Sizing.md index 38c25aa5e8..7110e9c708 100644 --- a/docs/design/AutoStory-FRLG-Sizing.md +++ b/docs/design/AutoStory-FRLG-Sizing.md @@ -155,7 +155,7 @@ A seeded fake game with odds from the decomp. Not written yet. Doesn't block M2 | E5 | Starter-RNG entry point for GiftRng | new | ~300 | | main; testable from a manual save | | M12 | RNG routines made callable, then AutoStory hand-offs | new | not sized | | refactors: main; hand-offs: B15 | -AutoStory joins this track only at the hand-off: names at 00.01 and the starter after 00.03/00.04, both after B15. +AutoStory joins this track only at the hand-off: names at 01.01 and the starter after 01.04/01.05, both after B15. ## 5. Lab tooling and run records (M4, [#138](https://github.com/dayfine/Arduino-Source/issues/138)) diff --git a/docs/design/AutoStory.md b/docs/design/AutoStory.md index 1534c01d57..0b225f704e 100644 --- a/docs/design/AutoStory.md +++ b/docs/design/AutoStory.md @@ -925,8 +925,8 @@ later change): | `capture` | `species` word, `catches`, `encounters`, `balls` numbers, all required; `pace` word | | | `level` | `slot`, `min` numbers, required | Built in C++, not in a plan. | | `fossil` | `fossil` word (`helix`, `dome`), required | | -| `use_item` | `item` word, required; `slot` number | 00.30 onwards. | -| `lift_floor` | `from`, `to` words, required | 00.30 onwards. | +| `use_item` | `item` word, required; `slot` number | 08.03 onwards. | +| `lift_floor` | `from`, `to` words, required | 08.03 onwards. | Plain names such as `run`, `trainer_line`, `cut_tree` and `bike` take no arguments and stay as they are. From 5a6529d15a02ca4e1dcbbd2280143215a1080943 Mon Sep 17 00:00:00 2001 From: dayfine Date: Wed, 11 Nov 2026 02:54:27 -0800 Subject: [PATCH 79/79] CI: restore part-ids workflow hunks lost in the stage8 merge (replay ref, 02.01 id) Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss --- .github/workflows/cpp-ci-serial-programs-base.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cpp-ci-serial-programs-base.yml b/.github/workflows/cpp-ci-serial-programs-base.yml index c749a0b43f..e052e8e948 100644 --- a/.github/workflows/cpp-ci-serial-programs-base.yml +++ b/.github/workflows/cpp-ci-serial-programs-base.yml @@ -106,7 +106,7 @@ jobs: uses: actions/checkout@v7 with: repository: dayfine/PokemonSimulation - ref: bdca47c5045797be1d2a1f0931ad6a8f15ab3225 + ref: d3eea1b5c04180f8b60eb98b0d65f70aca6b1abb path: StoryReplaySource - name: Verify replay preview bytes and independently regenerate its route input @@ -284,7 +284,7 @@ jobs: import json from pathlib import Path data = json.loads(Path('frlg-parcel.native.json').read_text()) - assert data['game'] == 'frlg' and data['checkpoint']['id'] == '00.05' + assert data['game'] == 'frlg' and data['checkpoint']['id'] == '02.01' assert len(data['checkpoint']['events']) == 3 PYTHON