Skip to content

Commit 1d4af37

Browse files
committed
Fix AutoDA path detection.
1 parent e5f2482 commit 1d4af37

File tree

4 files changed

+22
-4
lines changed

4 files changed

+22
-4
lines changed

SerialPrograms/Source/CommonFramework/Globals.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ namespace PokemonAutomation{
2626
const bool IS_BETA_VERSION = true;
2727
const int PROGRAM_VERSION_MAJOR = 0;
2828
const int PROGRAM_VERSION_MINOR = 54;
29-
const int PROGRAM_VERSION_PATCH = 30;
29+
const int PROGRAM_VERSION_PATCH = 31;
3030

3131
const std::string PROGRAM_VERSION_BASE =
3232
"v" + std::to_string(PROGRAM_VERSION_MAJOR) +

SerialPrograms/Source/Pokemon/Pokemon_Types.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
#ifndef PokemonAutomation_Pokemon_Types_H
88
#define PokemonAutomation_Pokemon_Types_H
99

10-
#include <string>
10+
//#include <string>
1111
#include "Common/Cpp/EnumStringMap.h"
1212

1313
namespace PokemonAutomation{

SerialPrograms/Source/PokemonSwSh/Inference/PokemonSwSh_TypeSymbolFinder.cpp

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,14 @@ std::pair<double, PokemonType> match_type_symbol(const ImageViewRGB32& image){
8181
// }
8282

8383
double expected_aspect_ratio = item.second.aspect_ratio();
84-
// cout << item.second.slug() << " : " << expected_aspect_ratio << endl;
85-
if (std::abs(aspect_ratio - expected_aspect_ratio) > 0.05){
84+
double ratio = aspect_ratio / expected_aspect_ratio;
85+
#if 0
86+
cout << item.second.slug()
87+
<< " : expected = " << expected_aspect_ratio
88+
<< ", actual = " << aspect_ratio
89+
<< ", ratio = " << ratio << endl;
90+
#endif
91+
if (std::abs(ratio - 1) > 0.2){
8692
continue;
8793
}
8894

SerialPrograms/Source/PokemonSwSh/MaxLair/Inference/PokemonSwSh_MaxLair_Detect_PathMap.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@
1313
//#include "PokemonSwSh/MaxLair/Options/PokemonSwSh_MaxLair_Options.h"
1414
#include "PokemonSwSh_MaxLair_Detect_PathMap.h"
1515

16+
//#include <iostream>
17+
//using std::cout;
18+
//using std::endl;
19+
1620
namespace PokemonAutomation{
1721
namespace NintendoSwitch{
1822
namespace PokemonSwSh{
@@ -33,6 +37,14 @@ bool read_type_array(
3337
}
3438

3539
std::multimap<double, std::pair<PokemonType, ImagePixelBox>> candidates = find_type_symbols(screen, image, 0.20);
40+
// cout << candidates.size() << endl;
41+
42+
#if 0
43+
for (auto& item : candidates){
44+
cout << item.first << " : " << POKEMON_TYPE_SLUGS().get_string(item.second.first) << endl;
45+
}
46+
#endif
47+
3648
if (candidates.size() < count){
3749
// dump_image(console, screen, "ReadPath");
3850
return false;

0 commit comments

Comments
 (0)