Skip to content

FRLG add selection arrow detection and start menu navigation#1129

Open
Dalton-V wants to merge 5 commits intoPokemonAutomation:mainfrom
Dalton-V:frlg-add-saving
Open

FRLG add selection arrow detection and start menu navigation#1129
Dalton-V wants to merge 5 commits intoPokemonAutomation:mainfrom
Dalton-V:frlg-add-saving

Conversation

@Dalton-V
Copy link
Contributor

Selection arrow detection and saving tested on Switch1 and Switch2 with different capture cards.

items.add(m_color, m_arrow_box);
}
bool SelectionArrowDetector::detect(const ImageViewRGB32& screen){
double screen_rel_size = (screen.height() / 1080.0);
Copy link
Collaborator

Choose a reason for hiding this comment

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

You need use GameSettings::instance().GAME_BOX. Take a look at the other FRLG programs. (https://github.com/PokemonAutomation/Arduino-Source/blob/main/SerialPrograms/Source/PokemonFRLG/Inference/Dialogs/PokemonFRLG_DialogDetector.cpp#L40)

GAME_BOX gives the location of the actual game screen within the entire screen. Then you want all the FRLG inference boxes to be relative to the game box instead of the entire screen.

The idea is that if the game box moves, we only change one setting and everything will work again.

If you want to convert your existing boxes (which are relative to the entire screen) to being relative to the game box, apply this operation:
(x - {0.09375, 0.00462963, 0, 0})/{0.8125, 0.962963, 0.8125, 0.962963}

So taking your first example:

x = {0.685, 0.055, 0.03, 0.075}
(x - {0.09375, 0.00462963, 0, 0})/{0.8125, 0.962963, 0.8125, 0.962963} =
{0.727692, 0.0523077, 0.0369231, 0.0778846}

Copy link
Collaborator

Choose a reason for hiding this comment

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

Also, to derive box coordinates relative to the game box, Box Draw supports that now.

Set the "Content Box" to {0.8125, 0.962963, 0.8125, 0.962963} (which is the current coordinates of the FRLG game box). Then when you draw the box, it will give you coordinates relative to that.

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.

2 participants