Skip to content

MaxLair: shrink the ore box 2 px down so digit ringing can't block the ore prompt (#1925) - #1932

Merged
Mysticial merged 1 commit into
mainfrom
max-lair-ore-prompt-box-1925
Nov 19, 2026
Merged

Mysticial merged 1 commit into
mainfrom
max-lair-ore-prompt-box-1925

Conversation

@pa-devbot

Copy link
Copy Markdown
Collaborator

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:

value limit
old box {0.930, 0.050, 0.065, 0.010} (x 1786..1910, y 54..64) stddev sum 9.72 10 (right at the limit — the issue measured 9.66–10.05 depending on rounding)
new box {0.930, 0.052, 0.065, 0.008} (x 1786..1910, y 56..64) stddev sum 3.54 10 (issue measured 3.5 for rows 56..64)
color ratio distance to {0.594724, 0.405276, 0} 0.0256 0.15 (passes easily, as the issue says)

Per-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 (ImageSolidCheck with the same defaults enter_lobby() uses; on failure the message includes the box stats via debug_string()). Registered in PokemonSwSh_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.

…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 Mysticial closed this Nov 19, 2026
@Mysticial Mysticial reopened this Nov 19, 2026
@Mysticial
Mysticial merged commit 31f6255 into main Nov 19, 2026
9 of 16 checks passed
@Mysticial
Mysticial deleted the max-lair-ore-prompt-box-1925 branch November 19, 2026 03:49
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.

Max Lair (AutoDA): ore-payment prompt is missed, so "Boss Slot" silently falls back to Slot 1 (ore box stddev sits right at the is_solid limit)

2 participants