Skip to content

PokemonBDSP: MenuDetector sees past NEW tags; ShortDialogDetector accepts a long first line - #152

Draft
dayfine wants to merge 32 commits into
bdsp/walk-v4from
bdsp/detectors-v4
Draft

dayfine wants to merge 32 commits into
bdsp/walk-v4from
bdsp/detectors-v4

Conversation

@dayfine

@dayfine dayfine commented Nov 2, 2026 •

Copy link
Copy Markdown
Owner

Depends on #129 (base bdsp/walk-v4); the diff shows only this PR's change. Upstream copy: bdsp/detectors-upstream (dc884fd), the same change folded into one commit off upstream main; the four detector files are byte-identical to this branch, only the test registration sits in upstream's list.


BDSP's MenuDetector and ShortDialogDetector miss screens a new-game run goes through; this fixes both and adds image tests.

  • ShortDialogDetector missed dialogue whose long first line covers the small white box it checks at the right end (Rowan's "Now, go on, and leap into the world of Pokemon!"), so the program kept pressing X. It keeps the old check and also accepts the box's right end below the first line, so every screen it accepted before is still accepted.
  • MenuDetector's columns start a little further right (0.160 to 0.166), in the gap after each icon: with a NEW tag on TOWN MAP the second column took the edge of the tag and the menu went unseen.
  • New image tests for both (add_tests_DialogDetector, add_tests_MenuDetector): the new game's BAG/OPTIONS menu, menus with one and three NEW tags, dialogue with a long first line, a "???" name tab, and negatives (HOME, overworlds, dialogue, cloud shadows). MenuDetector runs with both skip_new_banner settings.

The screenshots are in CommandLineTests (PokemonBDSP/DialogDetector, PokemonBDSP/MenuDetector), which needs to merge first.

Testing

  • PokemonBDSP::MenuDetector (20 cases) and PokemonBDSP::ShortDialogDetector (6) pass with those screenshots checked out.
  • The screenshots come from new-game, Jubilife and Floaroma runs on a Switch through a 1080p capture card, where both fixes were used.

🤖 Generated with Claude Code

https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E

… menu and long first lines (behavior change)

Both detectors keep their old check and accept one more case, so every
frame they accepted before is still accepted; they only stop missing two
real screens:

- MenuDetector: a new game's menu has a "NEW" tag above the OPTIONS icon
  that breaks the top of the third white column. If the five columns are
  not white from the top, it now also accepts them white from below the
  tags (y = 0.170), still requiring the existing cross check.
- ShortDialogDetector: a long first line (Rowan's "Now, go on, and leap
  into the world of Pokemon!") covers the right-end white box. If that box
  is not white, it now also accepts the box's right end below the first
  line.

This changes what existing BDSP programs see for these screens. The
screenshots (positives and negatives) are registered per file from
CommandLineTests' PokemonBDSP/MenuDetector and PokemonBDSP/DialogDetector.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
// Whether the five columns between the icons are white from `top` down.
static bool stripes_white(const ImageViewRGB32& screen, double top){
for (size_t index = 0; index < 5; index++){
const ImageFloatBox stripe(0.160 + 0.166 * (double)index, top, 0.015, STRIPE_BOTTOM - top);

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dedup with menu_stripe

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done: MenuDetector is back to its old code; the new game's menu uses MenuDetector(color, true) (skip_new_banner), and the screenshot tests run both settings: the new-game menu is found only with skip_new_banner, and the negatives are negative either way.

void add_tests_DialogDetector(UnitTestDatabase& database){
database.add<Test_ShortDialogDetector>("PokemonBDSP/DialogDetector/IntroRowanNameTab_True.png", true);
database.add<Test_ShortDialogDetector>("PokemonBDSP/DialogDetector/IntroRowanNoArrow_True.png", true);
}

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we get another one here that's "regular"?

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added IntroRowanShortLine_True.png (dayfine/CommandLineTests#1): a normal box with one short line that the old right-end check already accepts. It is still an intro frame; an overworld one needs a console capture if you want that too.

…_new_banner

Review: MenuDetector(color, skip_new_banner = true) already checks the
columns from below the "NEW" tags, which is the new game's menu. So
MenuDetector goes back to its old code, and this PR changes only
ShortDialogDetector's behavior. The screenshot tests now run both
settings: the new game's menu is found with skip_new_banner and missed
without it; the negatives are negative either way.

ShortDialogDetector also gets an ordinary short-line box (Rowan's
"Barry, is it?") as a positive next to the two long-first-line screens.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
@dayfine dayfine changed the title BDSP MenuDetector and ShortDialogDetector: also detect the new game's menu and long first lines (behavior change) BDSP ShortDialogDetector: also detect dialogue whose long first line covers the right end (behavior change) Nov 2, 2026
dayfine added a commit that referenced this pull request Nov 2, 2026
MenuDetector keeps its old check (review on #152); the callers here pass
skip_new_banner instead.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
dayfine added a commit that referenced this pull request Nov 2, 2026
MenuDetector keeps its old check (review on #152); NewGame and Settings
pass skip_new_banner instead.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
dayfine and others added 23 commits November 1, 2026 17:20
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
In Jubilife after the Town Map, the second column took the edge of the
NEW tag on TOWN MAP, so the menu went unseen and the checkpoint save fell
back to blind presses (r65). Each column now starts a little further
right, in the clear gap after an icon; the new game's menu and the
Jubilife menu are found with either setting, and the negatives stay
negative.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
A menu with three NEW tags, a "???" name tab in Jubilife's plaza, a
one-line box with no tab, and cloud shadows over Floaroma as negatives.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
@dayfine dayfine changed the title BDSP ShortDialogDetector: also detect dialogue whose long first line covers the right end (behavior change) BDSP MenuDetector and ShortDialogDetector: see the menu past NEW tags and dialogue with a long first line (behavior change) Nov 2, 2026
@dayfine dayfine changed the title BDSP MenuDetector and ShortDialogDetector: see the menu past NEW tags and dialogue with a long first line (behavior change) PokemonBDSP: MenuDetector sees past NEW tags; ShortDialogDetector accepts a long first line Nov 2, 2026
@dayfine

dayfine commented Nov 2, 2026

Copy link
Copy Markdown
Owner Author

Screenshots are upstream now: PokemonAutomation/CommandLineTests#42.

@dayfine
dayfine added this pull request to stack #230 November 5, 2026 18:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant