Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
4d6adbd
BBQ: check Central Plaza arrivals; a failed quest fly fails the attempt
dayfine Oct 22, 2026
3f8fa64
BBQ tests: default-initialize scenario fields
dayfine Oct 23, 2026
a3548c5
Bound the BBQ return to Central Plaza
dayfine Oct 23, 2026
1b5b675
BBQ tests: default-initialize scenario fields
dayfine Oct 23, 2026
050accf
Merge origin/main into bbq/plaza-arrival-check
dayfine Oct 30, 2026
e0d9653
Merge origin/bbq/plaza-arrival-check into bbq/plaza-return-bounds
dayfine Oct 30, 2026
74bdd5b
Merge origin/main into bbq/plaza-arrival-check
dayfine Oct 31, 2026
9201fba
Merge origin/bbq/plaza-arrival-check into bbq/plaza-return-bounds
dayfine Oct 31, 2026
87008c7
Merge origin/main into bbq/plaza-arrival-check
dayfine Nov 1, 2026
a2b89f5
Merge origin/bbq/plaza-arrival-check into bbq/plaza-return-bounds
dayfine Nov 1, 2026
3a8f682
Merge origin/main into bbq/plaza-arrival-check
dayfine Nov 2, 2026
f87201e
Merge origin/bbq/plaza-arrival-check into bbq/plaza-return-bounds
dayfine Nov 2, 2026
7227d8c
Merge origin/main into bbq/tree3-navigation
dayfine Nov 9, 2026
c5a4078
PokemonSV: restore PlazaReturn test cases in PokemonSV_Tests.cpp
dayfine Nov 9, 2026
33a0581
Merge origin/main into bbq/tree3-navigation
dayfine Nov 9, 2026
f818ab7
Merge origin/main into bbq/tree3-navigation
dayfine Nov 10, 2026
f38a97f
Merge origin/main into bbq/tree3-navigation
dayfine Nov 12, 2026
c4c9884
Merge origin/main into bbq/tree3-navigation
dayfine Nov 12, 2026
cfd2433
Merge origin/main into bbq/tree3-navigation
dayfine Nov 13, 2026
29e8e26
Merge origin/main into bbq/tree3-navigation
dayfine Nov 14, 2026
157271f
Merge origin/main into bbq/tree3-navigation
dayfine Nov 16, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
/* Place Name Banner Reader
*
* From: https://github.com/PokemonAutomation/
*
*/

#include "CommonFramework/ImageTypes/ImageRGB32.h"
#include "CommonTools/Images/ImageFilter.h"
#include "CommonTools/OCR/OCR_Routines.h"
#include "PokemonSV_PlaceNameBannerReader.h"

namespace PokemonAutomation{
namespace NintendoSwitch{
namespace PokemonSV{


// The banner is centered horizontally. On a lab screenshot (2026-10-22,
// Chinese (Traditional), landing at Central Plaza) the name 中心廣場 spans
// x 0.438-0.562, y 0.167-0.222, with the blue line under it at y 0.233 and
// the smaller "Terarium" subtitle below that. The read area stays above the
// line and is wider than the name, so that longer names fit.
PlaceNameBannerReader::PlaceNameBannerReader()
: m_box(0.300, 0.155, 0.400, 0.070)
{}

void PlaceNameBannerReader::make_overlays(VideoOverlaySet& items) const{
items.add(COLOR_BLUE, m_box);
}

std::vector<std::string> PlaceNameBannerReader::read(Logger& logger, Language language, const ImageViewRGB32& screen) const{
// The name is white, drawn straight over the scene. Keep only the
// brightest pixels; the scene behind it changes with the time of day,
// so try a few thresholds.
static const uint32_t MINS[] = {0xffe0e0e0, 0xffc0c0c0};

const ImageViewRGB32 cropped = extract_box_reference(screen, m_box);
std::vector<std::string> ret;
for (uint32_t mins : MINS){
ImageRGB32 filtered = to_blackwhite_rgb32_range(cropped, true, mins, 0xffffffff);

Check warning on line 39 in SerialPrograms/Source/VideoGames/PokemonSV/Inference/Overworld/PokemonSV_PlaceNameBannerReader.cpp

View workflow job for this annotation

GitHub Actions / code-health

Code health (advisory)

style: to_blackwhite_rgb32_range(): literal arguments true, 0xffffffff need a /*param=*/ comment (Google "Function Arguments", user review on fork #590)
std::string text;
for (char ch : OCR::ocr_read(language, filtered)){
if ((unsigned char)ch < 32){
continue;
}
text += ch;
}
logger.log("Place name banner: \"" + text + "\"");

Check warning on line 47 in SerialPrograms/Source/VideoGames/PokemonSV/Inference/Overworld/PokemonSV_PlaceNameBannerReader.cpp

View workflow job for this annotation

GitHub Actions / code-health

Code health (advisory)

style: build strings with std::format, not + on a literal / std::to_string / std::string (fork AGENTS.md "Strings")
ret.emplace_back(std::move(text));
}
return ret;
}


}

Check failure on line 54 in SerialPrograms/Source/VideoGames/PokemonSV/Inference/Overworld/PokemonSV_PlaceNameBannerReader.cpp

View workflow job for this annotation

GitHub Actions / code-health

Code health

namespace-close: close this namespace with // namespace PokemonSV
}

Check failure on line 55 in SerialPrograms/Source/VideoGames/PokemonSV/Inference/Overworld/PokemonSV_PlaceNameBannerReader.cpp

View workflow job for this annotation

GitHub Actions / code-health

Code health

namespace-close: close this namespace with // namespace NintendoSwitch
}

Check failure on line 56 in SerialPrograms/Source/VideoGames/PokemonSV/Inference/Overworld/PokemonSV_PlaceNameBannerReader.cpp

View workflow job for this annotation

GitHub Actions / code-health

Code health

namespace-close: close this namespace with // namespace PokemonAutomation
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
/* Place Name Banner Reader
*
* From: https://github.com/PokemonAutomation/
*
* Read the place name the game shows near the top of the screen after
* landing from a fly, e.g. "Central Plaza" over a blue line.
*
*/

#ifndef PokemonAutomation_PokemonSV_PlaceNameBannerReader_H
#define PokemonAutomation_PokemonSV_PlaceNameBannerReader_H

#include <string>
#include <vector>
#include "Common/Cpp/Logging/AbstractLogger.h"
#include "CommonFramework/Language.h"
#include "CommonFramework/ImageTools/ImageBoxes.h"
#include "CommonFramework/ImageTypes/ImageViewRGB32.h"
#include "CommonFramework/VideoPipeline/VideoOverlayScopes.h"

namespace PokemonAutomation{
namespace NintendoSwitch{
namespace PokemonSV{


class PlaceNameBannerReader{

Check failure on line 26 in SerialPrograms/Source/VideoGames/PokemonSV/Inference/Overworld/PokemonSV_PlaceNameBannerReader.h

View workflow job for this annotation

GitHub Actions / code-health

Code health

header-comment: document each namespace-scope header symbol
public:
PlaceNameBannerReader();

void make_overlays(VideoOverlaySet& items) const;

// OCR the banner's white text, once per brightness threshold. Returns
// the raw OCR text of each read, which is empty (or noise) when there
// is no banner.
std::vector<std::string> read(Logger& logger, Language language, const ImageViewRGB32& screen) const;

private:
ImageFloatBox m_box;
};


}

Check failure on line 42 in SerialPrograms/Source/VideoGames/PokemonSV/Inference/Overworld/PokemonSV_PlaceNameBannerReader.h

View workflow job for this annotation

GitHub Actions / code-health

Code health

namespace-close: close this namespace with // namespace PokemonSV
}

Check failure on line 43 in SerialPrograms/Source/VideoGames/PokemonSV/Inference/Overworld/PokemonSV_PlaceNameBannerReader.h

View workflow job for this annotation

GitHub Actions / code-health

Code health

namespace-close: close this namespace with // namespace NintendoSwitch
}

Check failure on line 44 in SerialPrograms/Source/VideoGames/PokemonSV/Inference/Overworld/PokemonSV_PlaceNameBannerReader.h

View workflow job for this annotation

GitHub Actions / code-health

Code health

namespace-close: close this namespace with // namespace PokemonAutomation
#endif
Loading
Loading