Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
188 commits
Select commit Hold shift + click to select a range
a40f0e0
BDSP navigation: the story maps as JSON, their grids and plan costs, …
dayfine Nov 1, 2026
c3c16c8
BDSP navigation: the walker, with battles passed in
dayfine Nov 1, 2026
4383d4e
Unit tests: run the PokemonBDSP tests
dayfine Nov 1, 2026
155bf55
Merge bdsp/nav-v4 (#127: run the BDSP tests) into bdsp/walk-v4
dayfine Nov 1, 2026
de27314
BDSP maps: the story's maps as JSON, generated from the Diamond decomp
dayfine Nov 1, 2026
3a67d56
BDSP maps: load the built-in maps, with their points and regions, and…
dayfine Nov 1, 2026
796dd56
BDSP maps: the five interiors of 00.01 to 00.03
dayfine Nov 1, 2026
5c553b3
Merge bdsp/maps-v4 into bdsp/nav-v4: the maps come from the generator
dayfine Nov 1, 2026
22aea33
BDSP navigation: the story world and the route planner on the shared …
dayfine Nov 1, 2026
dc74ccb
BDSP navigation: the story code reads the JSON maps; the per-map grid…
dayfine Nov 1, 2026
bf77fbe
Merge bdsp/nav-v4 into bdsp/walk-v4: the maps move onto the shared Ma…
dayfine Nov 1, 2026
de7c108
BDSP navigation: the walker plans on the story world
dayfine Nov 1, 2026
e7ead80
BDSP maps: Route 202's training and exit areas as regions
dayfine Nov 1, 2026
ce58d01
Merge branch 'bdsp/maps-v4' into bdsp/nav-v4
dayfine Nov 1, 2026
c83b4e4
BDSP navigation: slide_to_wall(), and Route 202's areas from the map'…
dayfine Nov 1, 2026
c3ee13c
Merge branch 'bdsp/nav-v4' into bdsp/walk-v4
dayfine Nov 1, 2026
090783f
BDSP navigation: the walker calls the planner's slide_to_wall()
dayfine Nov 1, 2026
45a2eaf
BDSP maps: the loader takes names as string_view
dayfine Nov 1, 2026
75aedce
Merge bdsp/maps-v4 (45a2eaf73: the loader takes string_view) into bds…
dayfine Nov 1, 2026
fd2202d
BDSP navigation tests: name every field, or give it a default
dayfine Nov 1, 2026
7c21897
Merge nav/story-steps (e67d36ccb, #122: code health) into bdsp/maps-v4
dayfine Nov 1, 2026
2d4bed5
Merge bdsp/maps-v4 (7c21897ce: nav/story-steps e67d36ccb) into bdsp/n…
dayfine Nov 1, 2026
282212e
BDSP navigation: change grid cells with Pokemon::cell_at()
dayfine Nov 1, 2026
b798ef3
BDSP navigation: StoryWorld keeps seven methods; walking rules are fr…
dayfine Nov 1, 2026
d20ad68
Merge bdsp/nav-v4 (b798ef3ec: CI and code-health fixes) into bdsp/wal…
dayfine Nov 1, 2026
d5046f2
BDSP navigation: the walker calls the story world's free functions
dayfine Nov 1, 2026
6daf606
BDSP walker: formatting the code-health check asks for
dayfine Nov 1, 2026
91dfd2e
BDSP walker: the story language behind a getter and a setter
dayfine Nov 1, 2026
2bb2fb9
BDSP walker: walks take a JoystickPosition, and options instead of bools
dayfine Nov 1, 2026
b678b4a
BDSP walker: walk_route() and its helpers move to PlannedRoute
dayfine Nov 1, 2026
6a24b56
BDSP walker: walk_route() as a RouteWalker with one function per deci…
dayfine Nov 1, 2026
c459094
BDSP walker: the transition watchers take only what their callers set
dayfine Nov 1, 2026
352c9fc
BDSP walker: LegWalk is a plain struct
dayfine Nov 1, 2026
a0a71c8
Merge nav/story-steps (b966c5d93, #122) into bdsp/maps-v4
dayfine Nov 1, 2026
32af0ff
Merge bdsp/maps-v4 (#122 at b966c5d93) into bdsp/nav-v4
dayfine Nov 1, 2026
9322b6c
Merge bdsp/nav-v4 (#122 at b966c5d93) into bdsp/walk-v4
dayfine Nov 1, 2026
aeb36c8
BDSP walker: credit #1717 for the pieces adapted from it
dayfine Nov 1, 2026
bea9a8a
Merge bdsp/nav-v4 (CRLF Segment 00 tests header) into bdsp/walk-v4
dayfine Nov 1, 2026
b585b8c
BDSP navigation: Segment 00 tests header in CRLF
dayfine Nov 1, 2026
ba95847
BDSP walker: new files in CRLF
dayfine Nov 1, 2026
4cec241
BDSP walker: give up after the third dialogue the map does not explain
dayfine Nov 2, 2026
33761c2
BDSP walker: a scene at a map's edge stands in for the missing banner
dayfine Nov 2, 2026
b95836c
BDSP walker: wait for the scene's first line before failing on a miss…
dayfine Nov 2, 2026
608a99c
BDSP walker: no banner read is a warning; only a wrong banner fails
dayfine Nov 2, 2026
31816e5
BDSP walker: arriving with no banner read at all is a warning too
dayfine Nov 2, 2026
d839fb9
BDSP walker: time wall legs at the plan's pace, walk or run
dayfine Nov 2, 2026
2daaa60
BDSP navigation: people on the maps are no wall to stop against
dayfine Nov 2, 2026
a3b6900
Merge bdsp/nav-v4 forward
dayfine Nov 2, 2026
aade883
BDSP navigation: occupied() tells people from blocked tiles, in Story…
dayfine Nov 2, 2026
04656c2
Merge bdsp/nav-v4 forward
dayfine Nov 2, 2026
8d0840b
Merge the BDSP chain forward
dayfine Nov 2, 2026
1b7b60f
Merge the BDSP chain forward
dayfine Nov 2, 2026
1c0ffea
BDSP maps: the house's 1F row 8 is open at x 4 (console)
dayfine Nov 2, 2026
1ce3bb1
BDSP walker: watch for the new map's banner a while after the last leg
dayfine Nov 2, 2026
058c104
BDSP maps: the lab's door mat in Sandgem, a row below its door
dayfine Nov 2, 2026
7d6180f
Merge the BDSP chain forward
dayfine Nov 2, 2026
3090e64
Merge the BDSP chain forward
dayfine Nov 2, 2026
9712a58
Merge the BDSP chain forward
dayfine Nov 2, 2026
2a21276
Revert "BDSP maps: the lab's door mat in Sandgem, a row below its door"
dayfine Nov 2, 2026
34a0d2c
Merge the BDSP chain forward
dayfine Nov 2, 2026
d964429
Merge the BDSP chain forward
dayfine Nov 2, 2026
ed3b0b0
BDSP maps: Sandgem's row 11 has no door at the lab's mat after all
dayfine Nov 2, 2026
b8dbc5d
Merge the BDSP chain forward
dayfine Nov 2, 2026
ec50ad2
BDSP AutoStory walk: turn with a 50 ms D-pad tap
dayfine Nov 2, 2026
ac97a4d
BDSP AutoStory walk: after a trainer on a wall leg, judge the walk on
dayfine Nov 2, 2026
b6990c8
BDSP AutoStory walk: after a trainer on an open leg, plan from the ta…
dayfine Nov 2, 2026
eee7d46
BDSP AutoStory walk: turn an open leg with a tap too short to step
dayfine Nov 2, 2026
433501b
BDSP AutoStory walk: a straight stick walk goes on the D-pad
dayfine Nov 2, 2026
ac5f55d
BDSP AutoStory walk: put the route walker's console steps behind RouteIO
dayfine Nov 2, 2026
e8a5efc
BDSP AutoStory walk: test the route walker on scripted console outcomes
dayfine Nov 2, 2026
5286265
Merge bdsp/walk-v4-routeio into bdsp/walk-v4
dayfine Nov 2, 2026
8a4342f
BDSP AutoStory walk: a quiet tap followed by a moving one counted as …
dayfine Nov 2, 2026
29b51da
Merge origin/nav/story-steps into bdsp/maps-v4
dayfine Nov 2, 2026
e815395
Merge origin/bdsp/maps-v4 into bdsp/nav-v4
dayfine Nov 2, 2026
d4ec93b
Merge origin/bdsp/nav-v4 into bdsp/walk-v4
dayfine Nov 2, 2026
cc0bd03
BDSP maps: read a warp's destination from MapData's optional `to`
dayfine Nov 2, 2026
11d3f93
Merge bdsp/maps-v4 into bdsp/nav-v4
dayfine Nov 2, 2026
d5c17a0
BDSP navigation: build against the new MapData tile kinds and fields
dayfine Nov 2, 2026
9ddc2fb
Merge bdsp/nav-v4 into bdsp/walk-v4
dayfine Nov 2, 2026
cc669ea
BDSP maps: list every cell a map's rectangle touches in its source
dayfine Nov 2, 2026
5d60152
BDSP maps: PlayerHouse1F and Route201's console fixes as generator pa…
dayfine Nov 2, 2026
45144bf
BDSP maps: write each map's coord events from the decomp
dayfine Nov 2, 2026
7e5f739
Merge bdsp/maps-v4 (coord events) into bdsp/nav-v4
dayfine Nov 2, 2026
2a87f19
Merge bdsp/maps-v4 (coord events) into bdsp/walk-v4
dayfine Nov 2, 2026
eb0df85
Merge nav/story-steps into bdsp/maps-v4
dayfine Nov 2, 2026
71ad2b2
Merge bdsp/maps-v4 into bdsp/nav-v4
dayfine Nov 2, 2026
ace8659
Merge bdsp/nav-v4 into bdsp/walk-v4
dayfine Nov 2, 2026
20b518e
Merge nav/story-steps (24444f0fc: verify mode from #122) into bdsp/ma…
dayfine Nov 3, 2026
e531694
Merge bdsp/maps-v4 (20b518e5a: verify mode from #122) into bdsp/nav-v4
dayfine Nov 3, 2026
b22e947
Merge bdsp/nav-v4 (e531694c5: verify mode from #122) into bdsp/walk-v4
dayfine Nov 3, 2026
7e1bc25
Merge commit 'bb6db58990bd528ef9f0c54534ea3492dbbcf1e3' into HEAD
dayfine Nov 5, 2026
8805523
Merge commit '7e1bc25ebb37c16870937026e1b099e7c189c4a5' into HEAD
dayfine Nov 5, 2026
89f673f
Merge commit '8805523710a2ed6298583cc53652316116f0fc6e' into HEAD
dayfine Nov 5, 2026
4958325
Merge origin/nav/story-steps into bdsp/maps-v4
dayfine Nov 6, 2026
2039872
BDSP AutoStory maps: align with PR #231 lint conventions
dayfine Nov 6, 2026
8b1e730
Merge origin/bdsp/maps-v4 into bdsp/nav-v4
dayfine Nov 6, 2026
990a0e0
BDSP AutoStory nav: align with PR #231 lint conventions
dayfine Nov 6, 2026
166b859
Merge origin/bdsp/nav-v4 into bdsp/walk-v4
dayfine Nov 6, 2026
0d6adc7
BDSP AutoStory walk: align with PR #231 lint conventions
dayfine Nov 6, 2026
f7cd7cc
BDSP AutoStory maps: sync runtime maps from dayfine/PokemonSimulation
dayfine Nov 7, 2026
6985ef9
Merge origin/bdsp/maps-v4 into bdsp/nav-v4
dayfine Nov 7, 2026
a90341b
Merge origin/bdsp/nav-v4 into bdsp/walk-v4
dayfine Nov 7, 2026
40cc6a7
BDSP nav: fix C4456 local declaration shadowing in static lambdas
dayfine Nov 7, 2026
f02108f
Merge remote-tracking branch 'origin/bdsp/nav-v4' into bdsp/walk-v4
dayfine Nov 7, 2026
d2b8956
BDSP: consume pinned Simulation map resources and pickup identities (…
dayfine Nov 8, 2026
51b181b
Merge origin/nav/story-steps into bdsp/maps-v4
dayfine Nov 8, 2026
513fa15
Merge origin/bdsp/maps-v4 into bdsp/nav-v4
dayfine Nov 8, 2026
9c480af
BDSP walk: track encounter origin and lag recovery during tap walks
dayfine Nov 8, 2026
654e8f0
Merge origin/bdsp/nav-v4 into bdsp/walk-v4
dayfine Nov 8, 2026
d29fcef
BDSP AutoStory nav: adopt wall recovery localization and hazard modeling
dayfine Nov 8, 2026
44f8445
Merge remote-tracking branch 'origin/bdsp/nav-v4' into bdsp/walk-v4
dayfine Nov 8, 2026
070078e
BDSP AutoStory walk: adopt wall recovery for interrupted open and wal…
dayfine Nov 8, 2026
ea1c3c4
Merge remote-tracking branch 'origin/nav/story-steps' into bdsp/maps-v4
dayfine Nov 8, 2026
911c82c
Merge remote-tracking branch 'origin/bdsp/maps-v4' into bdsp/nav-v4
dayfine Nov 8, 2026
940a183
Merge remote-tracking branch 'origin/bdsp/nav-v4' into bdsp/walk-v4
dayfine Nov 8, 2026
ce09998
Merge origin/nav/story-steps into bdsp/maps-v4
dayfine Nov 8, 2026
d5eaf12
Merge origin/bdsp/maps-v4 into bdsp/nav-v4
dayfine Nov 8, 2026
a086675
Merge origin/bdsp/nav-v4 into bdsp/walk-v4
dayfine Nov 8, 2026
479cbf8
Merge remote-tracking branch 'origin/nav/story-steps' into HEAD
dayfine Nov 9, 2026
3e53237
Merge remote-tracking branch 'origin/bdsp/maps-v4' into HEAD
dayfine Nov 9, 2026
e909042
Merge remote-tracking branch 'origin/bdsp/nav-v4' into HEAD
dayfine Nov 9, 2026
1c9414f
Merge nav/story-steps into bdsp/maps-v4
dayfine Nov 9, 2026
d606225
Merge bdsp/maps-v4 into bdsp/nav-v4
dayfine Nov 9, 2026
4421529
Merge bdsp/nav-v4 into bdsp/walk-v4
dayfine Nov 9, 2026
1ad0b64
BDSP: fold #226 fixes into the map resource lock
dayfine Nov 9, 2026
c8780c4
Merge bdsp/maps-v4 into bdsp/nav-v4
dayfine Nov 9, 2026
3cf5d3f
Merge bdsp/nav-v4 into bdsp/walk-v4
dayfine Nov 9, 2026
ba18d4c
BDSP: fold #226 fixes into the story maps and route planner
dayfine Nov 9, 2026
9e05c38
Merge bdsp/nav-v4 into bdsp/walk-v4
dayfine Nov 9, 2026
5819bc0
BDSP: fold #226 fixes into the walk and location reader
dayfine Nov 9, 2026
d30b866
Merge nav/story-steps into bdsp/maps-v4
dayfine Nov 9, 2026
b892158
Merge bdsp/maps-v4 into bdsp/nav-v4
dayfine Nov 9, 2026
8156495
Merge bdsp/nav-v4 into bdsp/walk-v4
dayfine Nov 9, 2026
000a9d9
Merge remote-tracking branch 'origin/nav/story-steps' into HEAD
dayfine Nov 9, 2026
2326cf7
Merge remote-tracking branch 'origin/nav/story-steps' into merge/maps…
dayfine Nov 9, 2026
325d5f0
Merge bdsp/maps-v4 into bdsp/nav-v4
dayfine Nov 9, 2026
0493764
Merge bdsp/nav-v4 into bdsp/walk-v4
dayfine Nov 9, 2026
a369dcf
BDSP AutoStory: WarpFadeWatch follows a warp's fade on the shared Tra…
dayfine Nov 9, 2026
049be80
Merge bdsp/nav-v4 (merge of #122 b3aa69e19) into bdsp/walk-v4
dayfine Nov 9, 2026
f316979
Merge origin/nav/story-steps into bdsp/maps-v4
dayfine Nov 9, 2026
bd9f31f
Merge bdsp/maps-v4 (merge of #122 b3aa69e19) into bdsp/nav-v4
dayfine Nov 9, 2026
b6e936f
BDSP: time a walk's screen events in its result
dayfine Nov 9, 2026
e6fd052
BDSP: place a wild battle on an open leg's taps by its screen events
dayfine Nov 9, 2026
e03448d
BDSP: default-initialize the walk's event log directly (its construct…
dayfine Nov 9, 2026
53fd828
BDSP: count record_tap_battle()'s taps from 1, 0 for a step before th…
dayfine Nov 9, 2026
2310a11
BDSP: time a tap battle's step with a signed tap count
dayfine Nov 9, 2026
4f76548
BDSP: the route walker places an open leg's battle by its screen events
dayfine Nov 9, 2026
39a714f
Merge nav/story-steps into bdsp/maps-v4
dayfine Nov 9, 2026
efcf07b
Merge bdsp/maps-v4 into bdsp/nav-v4
dayfine Nov 9, 2026
c1ae800
Merge bdsp/nav-v4 into bdsp/walk-v4
dayfine Nov 9, 2026
0dcf7d5
Merge nav/story-steps into bdsp/maps-v4
dayfine Nov 9, 2026
cdd8896
Merge bdsp/maps-v4 into bdsp/nav-v4
dayfine Nov 9, 2026
9e2f426
Merge bdsp/nav-v4 into bdsp/walk-v4
dayfine Nov 9, 2026
7a2e267
Merge nav/story-steps into bdsp/maps-v4 (wait for a battle's opening …
dayfine Nov 9, 2026
10d4149
Merge bdsp/maps-v4 into bdsp/nav-v4 (wait for a battle's opening befo…
dayfine Nov 9, 2026
80c35de
Merge bdsp/nav-v4 into bdsp/walk-v4 (wait for a battle's opening befo…
dayfine Nov 9, 2026
8d5134a
Merge nav/story-steps into bdsp/maps-v4 (scene ends after its fade; s…
dayfine Nov 9, 2026
1465bba
Merge bdsp/maps-v4 into bdsp/nav-v4 (scene ends after its fade; scree…
dayfine Nov 9, 2026
4a10ec1
Merge bdsp/nav-v4 into bdsp/walk-v4 (scene ends after its fade; scree…
dayfine Nov 9, 2026
b0c0ab1
Merge nav/story-steps into bdsp/maps-v4: a step on the Switch HOME me…
dayfine Nov 9, 2026
2cb905b
Merge bdsp/maps-v4 into bdsp/nav-v4: a step on the Switch HOME menu f…
dayfine Nov 9, 2026
490f82c
Merge bdsp/nav-v4 into bdsp/walk-v4: a step on the Switch HOME menu f…
dayfine Nov 9, 2026
0383a49
Merge origin/nav/story-steps into bdsp/maps-v4
dayfine Nov 10, 2026
2e3265d
Merge origin/bdsp/maps-v4 into bdsp/nav-v4
dayfine Nov 10, 2026
8e80f62
Merge origin/bdsp/nav-v4 into bdsp/walk-v4
dayfine Nov 10, 2026
febb4d8
Merge remote-tracking branch 'origin/nav/story-steps' into bdsp/maps-v4
dayfine Nov 10, 2026
0a03de7
Merge origin/bdsp/maps-v4 into bdsp/nav-v4
dayfine Nov 10, 2026
72eecf7
BDSP AutoStory: split the nav headers by concern; no char* in new code
dayfine Nov 10, 2026
d9ddcb5
Merge remote-tracking branch 'origin/bdsp/nav-v4' into bdsp/walk-v4
dayfine Nov 10, 2026
d600725
BDSP AutoStory: split the walk headers by concern; no char* in new code
dayfine Nov 10, 2026
ac23121
Merge origin/nav/grid-story-steps into bdsp/maps-v4
dayfine Nov 11, 2026
6e1ff40
Merge origin/bdsp/maps-v4 into bdsp/nav-v4
dayfine Nov 11, 2026
84624ad
Merge origin/bdsp/nav-v4 into bdsp/walk-v4
dayfine Nov 11, 2026
c961cdb
Merge nav/grid-story-steps into bdsp/maps-v4
dayfine Nov 11, 2026
68059ab
Merge bdsp/maps-v4 into bdsp/nav-v4
dayfine Nov 11, 2026
5a0ba82
Merge bdsp/nav-v4 into bdsp/walk-v4
dayfine Nov 11, 2026
ba318ee
Merge origin/nav/grid-story-steps into bdsp/maps-v4
dayfine Nov 12, 2026
a83b323
Merge origin/bdsp/maps-v4 into bdsp/nav-v4
dayfine Nov 12, 2026
59de754
Merge origin/bdsp/nav-v4 into bdsp/walk-v4
dayfine Nov 12, 2026
dd39b09
Merge branch 'nav/grid-story-steps' into bdsp/maps-v4
dayfine Nov 12, 2026
3cd34d3
Merge branch 'bdsp/maps-v4' into bdsp/nav-v4
dayfine Nov 12, 2026
1aec965
Merge branch 'bdsp/nav-v4' into bdsp/walk-v4
dayfine Nov 12, 2026
d772087
Merge branch 'nav/grid-story-steps' into bdsp/maps-v4
dayfine Nov 12, 2026
35e0abe
Merge branch 'bdsp/maps-v4' into bdsp/nav-v4
dayfine Nov 12, 2026
181db88
Merge branch 'bdsp/nav-v4' into bdsp/walk-v4
dayfine Nov 12, 2026
2263e6e
Merge origin/nav/grid-story-steps into bdsp/maps-v4
dayfine Nov 12, 2026
ad8206a
Merge origin/bdsp/maps-v4 into bdsp/nav-v4
dayfine Nov 12, 2026
346ab5a
Merge origin/bdsp/nav-v4 into bdsp/walk-v4
dayfine Nov 12, 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
14 changes: 14 additions & 0 deletions .github/workflows/bdsp-map-resources.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: BDSP map resources
on:
pull_request:
workflow_dispatch:
jobs:
integrity:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- name: Prepare and check the approved BDSP resource pin
uses: dayfine/PokemonSimulation/integrations/arduino-source/verify-map-packs@4de7742a764d27293b4525d6ad2a6fc8a95f3e3a
with:
layout: resources
operation: prepare
10 changes: 10 additions & 0 deletions .github/workflows/cpp-ci-serial-programs-base.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,14 @@ jobs:
ref: 'master'
path: 'Arduino-Source/Packages'

- name: Prepare pinned BDSP map resources
id: map-resources
uses: dayfine/PokemonSimulation/integrations/arduino-source/verify-map-packs@4de7742a764d27293b4525d6ad2a6fc8a95f3e3a
with:
layout: resources
operation: prepare
consumer-directory: Arduino-Source

- name: Install Qt
uses: jurplel/install-qt-action@v4
with:
Expand Down Expand Up @@ -204,6 +212,8 @@ jobs:
# every file missed, compiling took 10-40% longer than before on Linux and macOS, and
# about twice as long on Windows.
CCACHE_DEPEND: 1
POKESIM_TOOLS_SOURCE: ${{ steps.map-resources.outputs.tools-source }}
POKESIM_SOURCE_CACHE: ${{ steps.map-resources.outputs.source-cache }}
run: |
cd Arduino-Source/SerialPrograms
mkdir bin
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/runtime-map-reader.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ jobs:
- uses: actions/checkout@v7
with:
repository: dayfine/PokemonSimulation
ref: 906956e94fc912ae9adb0e44845da780f3bc7e4c
ref: 4de7742a764d27293b4525d6ad2a6fc8a95f3e3a
path: publisher
- uses: actions/setup-python@v6
with:
python-version: '3.12'
- run: python devtools/runtime-map-tests/prepare_parity.py --publisher publisher --publisher-revision 906956e94fc912ae9adb0e44845da780f3bc7e4c --out runtime-map-pairs.json
- run: python devtools/runtime-map-tests/prepare_parity.py --publisher publisher --publisher-revision 4de7742a764d27293b4525d6ad2a6fc8a95f3e3a --out runtime-map-pairs.json
- run: cmake -S devtools/runtime-map-tests -B build-runtime-maps -DCMAKE_BUILD_TYPE=Debug
- run: cmake --build build-runtime-maps --config Debug -j4
- run: ctest --test-dir build-runtime-maps -C Debug --output-on-failure
Expand Down
12 changes: 8 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,11 @@ build_*/
.cache/*
Packages/*


# Local agent/linter environments.
.venv-code-health/
__pycache__/

# Local agent/linter environments.
.venv-code-health/
__pycache__/

# Prepared, pinned PokemonSimulation maps are external build inputs.
Packages/Resources/Pokemon/Maps/
.pokesim-map-source/
13 changes: 13 additions & 0 deletions SerialPrograms/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,19 @@ add_library(SerialProgramsLib STATIC ${CORE_LIBRARY_SOURCES} ${LIBRARY_SOURCES})
include(cmake/EmbedTextFiles.cmake)
pa_embed_text_files(SerialProgramsLib Source/Pokemon/Navigation/TestMaps
Pokemon/Navigation/Pokemon_NavigationTestMaps.h PokemonAutomation::Pokemon navigation_test_map_json)
# Prepared data is validated by the shared publisher tooling. No source-map
# fallback or network download is performed during configuration.
set(POKESIM_TOOLS_SOURCE "$ENV{POKESIM_TOOLS_SOURCE}" CACHE PATH "Pinned PokemonSimulation tools checkout")
set(POKESIM_SOURCE_CACHE "$ENV{POKESIM_SOURCE_CACHE}" CACHE PATH "Approved publishing Git cache")
if(NOT POKESIM_TOOLS_SOURCE OR NOT POKESIM_SOURCE_CACHE)
message(FATAL_ERROR "Prepare devtools/maps/map-resources.lock.json and set POKESIM_TOOLS_SOURCE/POKESIM_SOURCE_CACHE; see devtools/maps/RESOURCE_MAPS.md.")
endif()
include("${POKESIM_TOOLS_SOURCE}/integrations/arduino-source/resource-maps.cmake")
get_filename_component(POKESIM_CONSUMER "${CMAKE_CURRENT_SOURCE_DIR}/.." ABSOLUTE)
pa_pokesim_map_directory(BDSP_MAP_DIRECTORY bdsp "${POKESIM_CONSUMER}" "${POKESIM_SOURCE_CACHE}")
file(RELATIVE_PATH BDSP_MAP_RESOURCES "${CMAKE_CURRENT_SOURCE_DIR}" "${BDSP_MAP_DIRECTORY}")
pa_embed_text_files(SerialProgramsLib "${BDSP_MAP_RESOURCES}"
PokemonBDSP/Programs/AutoStory/Data/PokemonBDSP_AutoStory_Maps.h PokemonAutomation::NintendoSwitch::PokemonBDSP bdsp_map_json)


# Create binary target
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
#include "Pokemon/Navigation/Pokemon_RouteLog_Tests.h"
#include "Pokemon/Navigation/Pokemon_RuntimeMap_Tests.h"
#include "Pokemon/Navigation/Pokemon_WallRecovery_Tests.h"
#include "PokemonBDSP/PokemonBDSP_Tests.h"
#include "VideoGames/PokemonHome/PokemonHome_Tests.h"
#include "VideoGames/PokemonSwSh/PokemonSwSh_Tests.h"
#include "VideoGames/PokemonLA/PokemonLA_Tests.h"
Expand Down Expand Up @@ -94,6 +95,7 @@ UnitTestDatabase make_UNIT_TESTS_ALL(){
NintendoSwitch::add_tests_FailedToConnectDetector(ret);
NintendoSwitch::add_tests_UpdatePopupDetector(ret);
NintendoSwitch::Typewriter::add_tests_TypewriterTextMapping(ret);
NintendoSwitch::PokemonBDSP::add_tests(ret);
NintendoSwitch::PokemonBDSP::add_tests_DialogDetector(ret);
NintendoSwitch::PokemonBDSP::add_tests_MenuDetector(ret);
NintendoSwitch::PokemonFRLG::add_tests(ret);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
/* BDSP Transition Watchers
*
* From: https://github.com/PokemonAutomation/
*
* Adapted from PokemonAutomation/Arduino-Source#1717 by Developer-Butters.
*/

#include "PokemonBDSP_TransitionWatchers.h"

namespace PokemonAutomation{
namespace NintendoSwitch{
namespace PokemonBDSP{


WhiteScreenOverWatcher::WhiteScreenOverWatcher(Color color, const ImageFloatBox& box)
: VisualInferenceCallback("WhiteScreenOverWatcher")
, m_on(color, box, WhiteScreenWatcher::FinderType::PRESENT, std::chrono::milliseconds(100))
, m_off(color, box, WhiteScreenWatcher::FinderType::GONE, std::chrono::milliseconds(100))
{}
void WhiteScreenOverWatcher::make_overlays(VideoOverlaySet& items) const{
m_on.make_overlays(items);
}
bool WhiteScreenOverWatcher::process_frame(const ImageViewRGB32& frame, WallClock timestamp){
if (m_white_is_over.load(std::memory_order_acquire)){
return true;
}
if (!m_has_been_white){
m_has_been_white = m_on.process_frame(frame, timestamp);
return false;
}
bool is_over = m_off.process_frame(frame, timestamp);
if (!is_over){
return false;
}
m_white_is_over.store(true, std::memory_order_release);
return true;
}
bool WhiteScreenOverWatcher::white_is_over(const ImageViewRGB32& frame){
return m_white_is_over.load(std::memory_order_acquire);
}


} // namespace PokemonBDSP
} // namespace NintendoSwitch
} // namespace PokemonAutomation
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
/* BDSP Transition Watchers
*
* From: https://github.com/PokemonAutomation/
*
* Adapted from PokemonAutomation/Arduino-Source#1717 by Developer-Butters.
*/

#ifndef PokemonAutomation_PokemonBDSP_TransitionWatchers_H
#define PokemonAutomation_PokemonBDSP_TransitionWatchers_H

#include "CommonTools/VisualDetectors/BlackScreenDetector.h"

namespace PokemonAutomation{
namespace NintendoSwitch{
namespace PokemonBDSP{


// AutoStory-specific transition handling; shared watchers retain upstream behavior.
// A white screen (RGB sum over 500, stddev sum under 10) in `box`,
// present or gone for `duration`.
class WhiteScreenWatcher : public DetectorToFinder<WhiteScreenDetector>{
public:
WhiteScreenWatcher(Color color, const ImageFloatBox& box, FinderType finder_type, std::chrono::milliseconds duration)
: DetectorToFinder("WhiteScreenWatcher", finder_type, duration, color, box, 500, 10)
{}
};

// The screen in `box` went white for 100 ms, then stopped being white for
// 100 ms: an encounter's flash.
class WhiteScreenOverWatcher : public VisualInferenceCallback{
public:
WhiteScreenOverWatcher(Color color, const ImageFloatBox& box);

bool white_is_over(const ImageViewRGB32& frame);

virtual void make_overlays(VideoOverlaySet& items) const override;

virtual bool process_frame(const ImageViewRGB32& frame, WallClock timestamp) override;

private:
WhiteScreenWatcher m_on;
WhiteScreenWatcher m_off;
bool m_has_been_white = false;
std::atomic<bool> m_white_is_over = false;
};


} // namespace PokemonBDSP
} // namespace NintendoSwitch
} // namespace PokemonAutomation
#endif
14 changes: 14 additions & 0 deletions SerialPrograms/Source/PokemonBDSP/PokemonBDSP_Tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@
*/

#include "Common/Cpp/TestRunners/UnitTestDatabase.h"
#include "Programs/AutoStory/PokemonBDSP_AutoStory_Maps_Tests.h"
#include "Programs/AutoStory/PokemonBDSP_AutoStory_PlannedRoute_Tests.h"
#include "Programs/AutoStory/PokemonBDSP_AutoStory_RoutePlanner_Tests.h"
#include "Programs/AutoStory/PokemonBDSP_AutoStory_Segment00_Tests.h"
#include "Programs/AutoStory/PokemonBDSP_AutoStory_StoryMaps_Tests.h"
#include "Programs/AutoStory/PokemonBDSP_AutoStory_StoryWorld_Tests.h"
#include "Programs/AutoStory/PokemonBDSP_AutoStory_Walk_Tests.h"
#include "PokemonBDSP_Tests.h"

namespace PokemonAutomation{
Expand All @@ -14,6 +21,13 @@ namespace PokemonBDSP{


void add_tests(UnitTestDatabase& database){
add_tests_AutoStory_Maps(database);
add_tests_AutoStory_StoryWorld(database);
add_tests_AutoStory_RoutePlanner(database);
add_tests_AutoStory_StoryMaps(database);
add_tests_AutoStory_Segment00(database);
add_tests_AutoStory_Walk(database);
add_tests_AutoStory_PlannedRoute(database);
}


Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
/* BDSP AutoStory - Maps
*
* From: https://github.com/PokemonAutomation/
*
*/

#include <format>
#include <map>
#include "Common/Cpp/Exceptions.h"
#include "Common/Cpp/Json/JsonValue.h"
#include "PokemonBDSP_AutoStory_Maps.h"

namespace PokemonAutomation{
namespace NintendoSwitch{
namespace PokemonBDSP{

using Pokemon::MapData;
using Pokemon::TilePos;


namespace{

const std::map<std::string, MapData, std::less<>>& story_maps_by_name(){
static const std::map<std::string, MapData, std::less<>> maps = []{
std::map<std::string, MapData, std::less<>> parsed;
for (const auto& [name, json] : bdsp_map_json()){
MapData map = Pokemon::parse_map(parse_json(json), name + ".json");
if (map.name != name){
throw ParseException(std::format("{}.json: name is \"{}\".", name, map.name));
}
parsed.emplace(name, std::move(map));
}
return parsed;
}();
return maps;
}

} // namespace


const MapData& story_map(std::string_view name){
const auto& maps = story_maps_by_name();
if (auto iter = maps.find(name); iter != maps.end()){
return iter->second;
}
throw InternalProgramError(nullptr, PA_CURRENT_FUNCTION, std::format("No BDSP story map named \"{}\".", name));
}

TilePos map_point(std::string_view map, std::string_view point){
const MapData& data = story_map(map);
if (auto iter = data.points.find(std::string(point)); iter != data.points.end()){
return iter->second;
}
throw InternalProgramError(nullptr, PA_CURRENT_FUNCTION, std::format("{} has no point \"{}\".", map, point));
}

std::vector<TilePos> map_region(std::string_view map, std::string_view region){
const MapData& data = story_map(map);
std::vector<TilePos> tiles;
while (true){
const auto iter = data.points.find(std::format("{}.{}", region, tiles.size() + 1));
if (iter == data.points.end()){
break;
}
tiles.push_back(iter->second);
}
if (tiles.empty()){
throw InternalProgramError(nullptr, PA_CURRENT_FUNCTION, std::format("{} has no region \"{}\".", map, region));
}
return tiles;
}



} // namespace PokemonBDSP
} // namespace NintendoSwitch
} // namespace PokemonAutomation
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
/* BDSP AutoStory - Maps
*
* From: https://github.com/PokemonAutomation/
*
* The maps the story walks, as JSON files in the shared map schema
* (Pokemon_MapData.h): PokemonBDSP/Programs/AutoStory/Maps, written by
* devtools/maps/bdsp_maps.py from the Diamond decompilation and built into
* the program by CMake. Each is named as its file ("Route202").
*
* A map's named tiles are its points. A region, a list of tiles, is the
* points "<region>.1", "<region>.2", ... in order: the schema has
* single-tile points only.
*
* TODO: move the maps to PokemonAutomation/Packages (Resources/PokemonBDSP/Maps) when ready
*
*/

#ifndef PokemonAutomation_PokemonBDSP_AutoStory_Maps_H
#define PokemonAutomation_PokemonBDSP_AutoStory_Maps_H

#include <string>
#include <string_view>
#include <utility>
#include <vector>
#include "Pokemon/Navigation/Pokemon_Grid.h"
#include "Pokemon/Navigation/Pokemon_MapData.h"

namespace PokemonAutomation{
namespace NintendoSwitch{
namespace PokemonBDSP{


// (name, JSON text) of each map in PokemonBDSP/Programs/AutoStory/Maps/,
// built into the program by pa_embed_text_files() (cmake/EmbedTextFiles.cmake).
const std::vector<std::pair<std::string, std::string>>& bdsp_map_json();

// The map `name`, read from bdsp_map_json() on first use, with its patches
// applied. Throws InternalProgramError for a name it does not have, and
// ParseException if a map does not parse or is not named as its file.
// The name is a string_view so that a temporary string argument is not
// mistaken (by GCC's -Wdangling-reference) for what the result refers to.
const Pokemon::MapData& story_map(std::string_view name);

// The point `point` of the map `map`. Throws InternalProgramError for an
// unknown map or point.
Pokemon::TilePos map_point(std::string_view map, std::string_view point);

// The tiles of the region `region` of the map `map`, in order. Throws
// InternalProgramError for an unknown map, or a region with no tiles.
std::vector<Pokemon::TilePos> map_region(std::string_view map, std::string_view region);



} // namespace PokemonBDSP
} // namespace NintendoSwitch
} // namespace PokemonAutomation
#endif
Loading
Loading