Repository navigation
MaxLair: shrink the ore box 2 px down so digit ringing can't block the ore prompt (#1925) - #1932
Merged
Merged
Conversation
…e ore prompt (#1925) In enter_lobby() the solid-color check for the ore-payment prompt used the box {0.930, 0.050, 0.065, 0.010}, whose top two rows sit flush against the "xNNN" ore counter. On capture cards with visible 8 px block artifacts, the ringing of the digits bleeds into those rows and pushes the box stddev sum right up against the is_solid limit of 10, so the prompt is intermittently missed. A missed prompt leaves arrow_count off by one, the boss list only gets a plain A, and "Boss Slot" silently falls back to Slot 1. Move the box to {0.930, 0.052, 0.065, 0.008} (y 56..64 at 1080p): the ringing rows drop out and the stddev sum on the issue #1925 capture goes from ~9.7 to ~3.5. Add Test_MaxLairEnterLobbyOrePrompt, a regression test on the 1920x1080 screenshot attached to #1925 (added to CommandLineTests in PokemonAutomation/CommandLineTests#PR), asserting the shrunken box still passes the solid-color check on that capture.
Mysticial
approved these changes
Nov 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1925 (Max Lair AutoDA: ore-payment prompt missed → "Boss Slot" silently falls back to Slot 1). Depends on PokemonAutomation/CommandLineTests#57 for the test image.
Verification (on the issue's 1920x1080 screenshot)
Replicated
extract_box_reference()+image_stats()+is_solid()exactly on the attached capture:{0.930, 0.050, 0.065, 0.010}(x 1786..1910, y 54..64) stddev sum{0.930, 0.052, 0.065, 0.008}(x 1786..1910, y 56..64) stddev sumPer-row stddev sums inside the old box's x range reproduce the issue's table exactly (y=53: 35.9, y=54: 24.2, y=55: 15.8, y=56: 4.2, y=57-62: 3.1, y=63: 2.3, y=64: 1.7): the top two rows of the old box (54, 55) still contain the "×379" digits' block-compression ringing (the digits end at y≈52 and the capture has 8 px block artifacts), which is what pushes the box's stddev to the limit and makes the prompt flaky. Moving the box 2 px down drops those rows and the check passes with ~3x margin.
Changes
enter_lobby(): ore box{0.930, 0.050, 0.065, 0.010}→{0.930, 0.052, 0.065, 0.008}(the issue's suggested fix, option 1), with a comment explaining why.Test_MaxLairEnterLobbyOrePrompt: regression test on the issue's screenshot asserting the shrunken box still passes the solid-color check (ImageSolidCheckwith the same defaultsenter_lobby()uses; on failure the message includes the box stats viadebug_string()). Registered inPokemonSwSh_Tests.cpp.The full command-line suite passes locally (Linux CI equivalent, aarch64): 20,936 passed, 0 failed, 5 skipped — including
PokemonSwSh::MaxLairEnterLobbyOrePrompt - PokemonSwSh/MaxLair_EnterLobbyOrePrompt/MiraBox_macOS_Japanese_OrePaymentPrompt.png.Note: the issue also suggests making the missed-prompt failure more visible (e.g. a warning when the ore check sits near the limit); that's a larger behavioral change, so I left it out of this PR.