Code
Here lie all of the docstrings in the PokemonCartographer.jl codebase.
PokemonCartographer.explore
— MethodCreate a Navmesh by playing the game.
Starting with a list of roms and save states, spawn a worker for each pair and merge the resulting navmeshes.
PokemonCartographer.genbatch!
— MethodGenerate a batch of jobs to run for every unvisited node in the navmesh.
PokemonCartographer.Nav.Navmesh
— MethodNavmesh(a::Navmesh, b::Navmesh)::Navmesh
Merge two Navmesh
es - a
and b
- into a new Navmesh
.
PokemonCartographer.Nav.Navmesh
— MethodNavmesh()::Navmesh
Create a new Navmesh.
PokemonCartographer.Nav.Navmesh!
— MethodNavmesh!(a0::Navmesh, a::Navmesh)::Nothing
Merge a
into a0
in place. See Navmesh(a::Navmesh, b::Navmesh)::Navmesh
for more details.
PokemonCartographer.Nav.Navmesh!
— MethodNavmesh!(n::Navmesh, from::Position, to::Position, d::Direction)::Nothing
Add an edge in n
between from
and to
labeled as direction d
.
from
and to
do not need to exist.
This will overwrite any previous edge between these two nodes.
PokemonCartographer.Nav.Navmesh!
— MethodNavmesh!(n::Navmesh, j::Journey)::Nothing
Add all locations found on Journey j
.
Filters out artifacts from animation delays.
PokemonCartographer.Nav.asbutton
— Methodasbutton(d::Direction)::Button
Convert directions to buttons.
Examples
asbutton(Up)
# output
ButtonUp::Button = 64
PokemonCartographer.Nav.asdirection
— Methodasdirection(b::Button)::Direction
Convert buttons to directions.
Examples
asdirection(ButtonUp)
# output
Up::Direction = 0
PokemonCartographer.Nav.connected
— Methodconnected(n::Navmesh, from::Position, to::Position)::Bool
Predicate to check if two nodes are connected.
Examples
n = Navmesh()
p1 = Position(0x01, 0x01, 0x01)
p2 = Position(0x01, 0x01, 0x02)
p3 = Position(0x01, 0x02, 0x02)
Navmesh!(n, p1, p2, Down)
Navmesh!(n, p2, p3, Right)
connected(n, p1, p3)
# output
true
PokemonCartographer.Nav.load_latest_artifact
— Methodload_latest_artifact()::Navmesh
Load the most recently published navmesh into memory.
PokemonCartographer.Nav.randomincomplete
— Methodrandomincomplete(n::Navmesh, nogolist::Vector{Position})::Union{Position, Nothing}
Select a random, incomplete vertex in the navmesh. Incomplete vertices have less than four outedges - e.g. Up, Down, Left, Right.
PokemonCartographer.Nav.route
— Methodroute(n::Navmesh, from::Position, to::Position)::Vector{Direction}
Find a route between from
and to
in the provided Navmesh, n
.
If no route exists an empty Vector will be returned instead.
Examples
n = Navmesh()
p1 = Position(0x01, 0x01, 0x01)
p2 = Position(0x01, 0x01, 0x02)
p3 = Position(0x01, 0x02, 0x02)
Navmesh!(n, p1, p2, Down)
Navmesh!(n, p2, p3, Right)
route(n, p1, p3)
# output
2-element Vector{Direction}:
Down::Direction = 2
Right::Direction = 1
PokemonCartographer.Worker.EmuCache
— TypeEmulators by location.
This way future jobs can pick up where a previous job left off.
PokemonCartographer.Worker.Job
— TypeThe work to be done.
PokemonCartographer.Worker.JobResult
— TypeWhat was found by running a Job
.
PokemonCartographer.Worker.JobResults
— TypeA collection of JobResult
using the desired merge behavior for each property separately.
PokemonCartographer.Worker.State
— TypeStates of the cartography agent state machine.
PokemonCartographer.Worker.bootstrapemu
— Methodbootstrapemu(emu::Emulator)::Emulator
Start from first boot of the emulator and get through the opening sequence.
PokemonCartographer.Worker.dialog_skip!
— Methoddialog_skip!(js::JobState, gb::Emulator, game::GameState, i::Int)::State
Press B until the dialog goes away.
PokemonCartographer.Worker.dojob
— Methoddojob(job::Job)::JobResult
Execute a job. Start from the provided state. Explore the world. Return what you find.
PokemonCartographer.Worker.fiddlewithmemory!
— Methodfiddlewithmemory!(emu::Emulator)
Set a bunch of flags in the emulator's memory to enable debug mode.
PokemonCartographer.Worker.go_to_target!
— Methodgo_to_target!(js::JobState, gb::Emulator, game::GameState, i::Int)::State
Navigate to the target location then switch to wandering.
PokemonCartographer.Worker.new_game!
— Methodnew_game!(js::JobState, gb::Emulator, game::GameState, i::Int)::State
Select the new game menu option (well "DEBUG" in the BLUEMONS.gb rom).
PokemonCartographer.Worker.open_fight_debug!
— Methodopen_fight_debug!(js::JobState, gb::Emulator, game::GameState, i::Int)::State
Open the FIGHT/DEBUG menu from the title page of BLUEMONS.gb.
PokemonCartographer.Worker.random_wander!
— Methodrandom_wander!(js::JobState, gb::Emulator, game::GameState, i::Int)::State
Wander around, biased towards the same direction you are facing. Never backwards.
PokemonCartographer.Worker.releasebuttons!
— Methodreleasebuttons!(emu::Emulator)
Release all of the buttons.