Repository navigation
AutoStory: shared settle loop and Pokemon Center visit - #546
Conversation
run_settle() is one settle loop over TalkOver for every game, with the rule for each SettleKind (talk, after a warp, door) in one table. The door rule (1 s of the player still, 2.5 s calm, a look every 200 ms) comes from the BDSP tree as TalkOverRule's quiet and still fields and the PLAYER_STILL screen event. run_center_visit() is the shared order of a Center visit: in, settle, check inside, heal, out, settle (door or after warp), check outside. Games give the walks, reads and nurse through CenterVisitIO.
Door times private to the settle table, SettleEnd::Result nested, the IO last in run_settle() and the visit functions.
…or watching games
…the policy asks BDSP's title plays an attract movie, a town with people walking, that reads as the overworld; on console B (2026-11-15 03:42) the launch settled on it before the title took a press. A policy with overworld_after_load answers such a look with the title press and counts the overworld only after a title press and then the load's black.
Console B, 2026-11-15 04:21 (BDSP, Japanese): ZL on the title's attract movie went back to the title through a black, and that black counted as the load; the title, read as the overworld, then settled. With overworld_after_load, a press on an overworld look no longer arms the load, and a title showing again clears a black seen before it.
dayfine
left a comment
There was a problem hiding this comment.
Reviewed SHA: 4264e19
Scope: #546's own diff against nav/shared (settle loop, Center visit, TalkOverRule quiet/still, PLAYER_STILL, StoryLaunchPolicy::overworld_after_load and the title-press rule). CI green. The launcher was verified on console B, so I did not re-check it here.
Required
CenterVisitIO::settlereturnsvoid, so a failed settle doesn't reach the visit'sOutcome(Pokemon_CenterVisit.h,Pokemon_CenterVisit.cpp).run_settlereturnsSettleEndwith TIMED_OUT and BATTLE plus a failure text (e.g. "no fade or banner within 120 s ... (map mismatch)"). The visit throws all of that away.leave_center's comment says the AFTER_WARP settle "fails when none shows". With this interface, that only happens if each game's IO throws, and the header doesn't say it must. The BDSP/FRLG/sim implementations in the follow-ups could easily just log and carry on, and then theplace()read is the only guard left (it passes on UNKNOWN). Fix: havesettle()returnSettleEnd, and turn a non-QUIET end intooutcome_failed(...)with its text inenter_center/leave_center. Add a CenterVisit case for a settle that times out. If throwing is the intended contract, the header has to say so instead.- The PR description doesn't mention the launch change. Commits a96728c and 4264e19 add
StoryLaunchPolicy::overworld_after_load, them_title_pressed/m_load_seenrule and fiveStoryLaunchcases. The description and its Testing section only cover settle and Center visit. Add a bullet for it, including the console B 03:42/04:21 cases, and listStoryLaunchamong the suites.
Should fix
enter_centerafterline_up_and_walk_in()uses a DOOR settle withwarp = false(Pokemon_CenterVisit.cpp).line_up_and_walk_in()returnsvoid, so the visit can't tell whether the fade has happened yet. DOOR without a warp requirement ends after 1 s of PLAYER_STILL + PLAYER_CAN_MOVE. If the walk returns while the player stands on the mat before the fade starts, the settle can end outside, and the visit then failsheal_enter(RELOAD) for a door that would have worked.leave_centeralready handles the same case by using AFTER_WARP when nothing was seen. Do the same here: returnWarpSeenfromline_up_and_walk_in(), and settle AFTER_WARP (or a DOOR rule withwarp = true) when it saw nothing. The "no fade, but inside" branch can stay DOOR.
Question (not blocking)
- Launch: a dropped title press followed by a black.
m_title_pressedstays true once set, so any FADE_BLACK after a title look setsm_load_seen. If BDSP's title goes to the attract movie through a black when it's left idle, this sequence passes as a load: title read and pressed, press dropped (e.g. during the title's intro animation), title fades to black, movie. The movie would then settle as the overworld, which is the 03:42 failure coming back. Do you know whether the title goes to the movie through a black? If it does, a red caseTITLE, BLACK, OVERWORLD(movie)with no load would pin it down. One possible fix is to require the black to come within a few looks of the title press, or to clearm_title_pressedonce the movie path presses.
Nits
Pokemon_CenterVisit.cpprun_center_visit:Outcome incan beconst.Pokemon_CenterVisit.h: UNKNOWN passes both guards (the test "unknown" case covers this). A one-line note onenter_center/leave_centersaying so would help the follow-up authors.
Checked and fine: calling run_settle twice with since and then when is safe because TalkOver::look only sets m_quiet_since/m_calm_since when they're unset. The deadline is taken from the first look. The switch statements over SettleKind/CenterPlace return after the switch (no -Wswitch hole). Adding PLAYER_STILL as the last ScreenEvent keeps the static_assert and the name table in step, and no other switch over ScreenEvent exists. Tests follow name/input/expectation. SourceFiles.cmake and the test registration are complete.
Verdict
NEEDS_REWORK
…eup without a fade settles AFTER_WARP CenterVisitIO::settle returns SettleEnd, and enter_center/leave_center fail with its text on TIMED_OUT or BATTLE. line_up_and_walk_in returns WarpSeen; with no fade seen the settle into the Center is AFTER_WARP, as on the way out. Header notes that UNKNOWN passes both checks.
…e press A dropped title press on an idle title, followed by the attract movie's black, set the load seen and let the movie settle as the overworld. StoryLaunchPolicy::load_black_looks bounds how many looks after the title press the load's black may come.
|
Addressed in 2 commits on top, tip 6ed6e05:
|
dayfine
left a comment
There was a problem hiding this comment.
Reviewed SHA: 6ed6e05
Scope: the two commits since my last review (c0265f0, 6ed6e05), checked against each item in #546 (review). CI is green at this SHA. Code health shows 0 failures (advisories only), and CRLF endings are kept.
Prior items
- Settle result reaches the Outcome: resolved.
CenterVisitIO::settlenow returnsSettleEnd.settle_door()turns any end other than QUIET intooutcome_failed(CENTER_NOT_ENTERED / CENTER_NOT_LEFT, end.text), and it does this beforeplace()is read. The header states the contract. New cases cover a timeout on each door, and the expected call lists stop at the settle as they should. - PR description: resolved. There is now a
StoryLaunchbullet covering 03:42 and 04:21, and the Testing section lists the six StoryLaunch cases. - Lineup without a fade: resolved.
line_up_and_walk_in()returnsWarpSeen. A lineup that saw nothing settles AFTER_WARP, and the "no fade, but inside" branch keeps DOOR. Thehowlog line now includes what the lineup saw. The new case expectssettle_warp. - Dropped title press, then a black: resolved. The author's reply confirms the old code allowed this. A real load's black follows the press right away, so the fix counts a black only within
load_black_lookslooks of the press. A re-read title resets the counter to 0 and clearsm_load_seen. A press on the movie does not reset it, which is correct. The red case (TITLE, 3x TITLE_UNREAD, BLACK, OVERWORLD withload_black_looks = 3) traces tostuck on titlewith the inputs listed. I also checked the 04:21 path: a movie press within the window goes back to the title through a black, and that title clearsm_load_seen, so this doesn't regress.
- Nits:
const Outcome inis done. The header notes that UNKNOWN passes both checks.
Nits (non-blocking)
Pokemon_CenterVisit.cpp:settle_door()also runs the AFTER_WARP settle. A name likesettle_after_doorwould describe both uses.Pokemon_StoryLaunch.hload_black_looks: the window counts looks, not time. A look's length depends on what it pressed (pollvs a press's release). At the default of 10, that is about 5 s atpoll. Adding that figure to the comment would help whoever tunes it for another game.
Verdict
APPROVED
Base:
nav/shared(3df87aa). No parent PRs; the diff shows only this change.Seam 5, shared part: one settle loop and one Pokemon Center visit for every game (design note
2026-11-15-step5-design.md, decisions 1-6 as recommended).Pokemon_Settle:run_settle(rule, label, SettleIO&)is BDSP's talk_over() loop with the console behindSettleIO(look, press, flee a battle, log).settle_rule(SettleKind)is the one table: TALK, AFTER_WARP, and DOOR (1 s of the player still, 2.5 s calm, a look every 200 ms, from the BDSP tree's door rule, c771fb6). Timeouts return the same three failure texts as talk_over().TalkOverRulegetsquietandstillfields (defaults keep today's behaviour), andScreenEvent::PLAYER_STILLis added.Pokemon_CenterVisit:run_center_visit(label, CenterVisitIO&)=enter_center()(walk in, line up by sight if no fade and not inside, DOOR settle, failheal_enterif the reads say outside), the nurse,leave_center()(walk out, DOOR settle after a fade or AFTER_WARP without one, failheal_exitif still inside).heal_entermaps to pose_lost andheal_exitto warp_no_op.Pokemon_CenterVisit:CenterVisitIO::settlereturnsSettleEnd, and a settle that does not end QUIET fails the visit (heal_enter/heal_exit) with its text.line_up_and_walk_in()returnsWarpSeen; a lineup that saw no fade settles AFTER_WARP, as the way out does. UNKNOWN passes both place checks.StoryLaunch:StoryLaunchPolicy::overworld_after_load(BDSP). After the launch closed the game or saw its title, an overworld counts only after a title press on a look read as the title and then the load's black (FADE_BLACK), with no title since; until then an overworld look is the attract movie and takes the title press. The black must come withinload_black_lookslooks of the title press, so a dropped press on an idle title followed by the movie's black is not the load. From console B 2026-11-15: 03:42 (the attract movie settled as the overworld) and 04:21 (the press on the movie went back to the title through a black, and that black counted as the load).Next steps (follow-up PRs, not in this one):
StoryStepIO::settleandtalk_over()callrun_settle; dropTalkOverRule::doorand BDSP'sSettleKind;ConsoleStory::healandrun_into_centerbecome aBdspCenterVisit : CenterVisitIO(enter_lit_door, talk_to_nurse, run_into_door,pokemon_center_insideasplace()); the sim'sSimExecutor::healruns the same visit; a red sim case for walking to the nurse during the fade-in.wait_for_quiet_overworldcallsrun_settle(DOOR)with FRLG's look (400 ms) and cap (10 s), and its observer reports quiet as PLAYER_CAN_MOVE + PLAYER_STILL;center_enter/center_exitsteps callenter_center/leave_center, andheal_in_center(upstreamheal_at_pokecenter+healed_by_nurse) isheal(), withshows_pokemon_center_floorasplace(); RowSim's HEAL stub runs the visit; red sim cases for the 12.03 no-floor heal and a Center exit that stays inside.Testing
Pokemon::Settle(rule table, run_settle on a scripted screen) andPokemon::CenterVisit(fake IO: call order, both guards, settle timeouts, lineup without a fade), two new rows inPokemon::StoryFailureClasses, and six newPokemon::StoryLaunchcases for the load rule (03:42, 04:21, a title after a black, a late black after a dropped title press, a kept overworld). The launcher was checked on console B. Settle, CenterVisit and SceneJudges suites pass locally; Fork Draft CI runs the rest.