Skip to content

A Pokémon randomizer warp/door tracker and guiding tool.

License

Notifications You must be signed in to change notification settings

PeteAmbos/PokeNav

Repository files navigation

Table of Contents

1. Introduction

This is a Pokémon randomizer warp/door tracker connection and guiding tool.

It is also a side & passion project and a first foray into full-stack web dev by someone who is not a dev or CS student, so please, bear with me here.

With more and more people trying out randomizer mods for Pokémon games, this project strives to build a web app to fix the where the hell are all these doors going and how the hell do I get back to the next gym/E4 member/story beat feeling. Basically, users should be able to track the links between doors and warp points, and get a route (when available) of how to get from A to B.

2. Implementation

The backend is going to be built with Django and the Django REST Framework, while a Vite & Vue.js implementation handles the frontend. Connection data is planned to be stored as graph data, using NetworkX graphs stored as JSON files.

3. Data

3.1. Sourcing

Currently, there is game data available for one Pokémon region: Hoenn, more specifically for the Emerald version of Hoenn. The raw data for this comes from the repo of the Pokémon Emerald Randomizer, originally comissioned by online personality Eric "PointCrow" Morino and created by darkstormgames, XLuma, AtSign and turtleisaac and graciously made available under a GPL-3.0 licence. My deepest thanks go out to them, without their consolidation of the games raw data into a structured format I could go off of, this project would not have been possible.

The used raw data can be found in the base_graph_data/hoenn/hoenn_data_raw directory.

3.2. Processing

3.2.1. Raw Data Parsing

The JSON files from the randomizer repo contains significantly more information than is necessary for the this application, meaning that the data was parsed down into more simplified data structures. This also made data about pre-existing connections between warps and areas more amenable to further processing as graph edges.

The methods used for data processing can be found in the .py files in the base_graph_data/hoenn/data_parse_methods directory.

Raw location data only had to be simplified down to structured datasets (dictionaries) that only contain the relevant key-value-pairs and a sequential ID. Warp data was treated much the same, just that, as the raw warp data contained duplicate entries for the same warps, a deduplication step had to be performed before simplification.

Preexisting connections, such as walkable transitions between routes which are not randomized, had to be extracted from the raw location data, as these were stored as values of the entries of their locations. This step included a check to make sure that no connection appeared multiple times, as both connected locations contained the connection data, but these would be saved in the graph as only one bidirectional edge.

3.3. Simplified Data Structures

All simplified data structures are represented by dictionaries in Python. Prototypes can be found in base_graph_data/hoenn/prototypes.

3.3.1. simplified locations

Key type default Description
id str "HOE-L-XXXX" Location ID with sequential numbering (instead of XXXX), beginning at 0000.
name str N/A Readable name of location.
games list ["EMRL"] Abbreviation for the games the location appears in. Preparation for future implementation of other Hoenn games like Ruby and Sapphire.
MapId str N/A Map IDs used by raw data structures. Retained for reference and future data implementations.

3.3.2. simplified warps

Key type default Description
id str "HOE-W-XXXX" Warp ID with sequential numbering (instead of XXXX), beginning at 0000.
origin str N/A Map ID of warp origin location.
originId list N/A ID of warp origin location.
standardTarget str N/A Map ID of non-randomized target.
standardTargetId str N/A ID of non-randomized target.
isLocked bool N/A If access to warp is locked by default.

3.3.3. simplified connections

Key type default Description
type str "static" OR "random" OR "warp" Type of connection. "static" are pre-existing connections between locations. "warp" are connections between warps and their locations. "random" is reserved for user-entered data and not used in base data.
nodes set {ID1, ID2} Set of the IDs of the two connected warps/locations. WARNING: Sets are stored as lists in JSON due to file limitations.
weight int 1 Weight for graph edge for future complex routing implementations.

3.4. Graph Data

The base graph data are implemented as a undirected NetworkX graph, saved as a JSON file. They are mostly organized in the same way as data structures, with the dictionary key-value-pairs being replaced by attribute-value-pairs of the nodes and edges. Locations and warps are stored as nodes and connections are stored as edges. A pre-created JSON representation of the Hoenn base graph data can be found at base_graph_data/hoenn/hoenn_base_graph.json. A .py file that can be used to restore it from the base data can be found at base_graph_data/hoenn/data_graph_init.py. It can also be used to create a JSON of the simplified data pre-graph creation and a PNG plot of the base graph data.

command line args/flags of data_graph_init.py

arg/flag type default Description
--base-data-path str "hoenn_data_raw/" Path to the base data directory.
--log-simplified-data, -lsd flag N/A Log the simplified data to a JSON file.
--json, -j flag N/A Output the graph data as a JSON file.
--plot, -p flag N/A Plot the data graph as a PNG.
--help, -h flag N/A Show a help message and exit.

About

A Pokémon randomizer warp/door tracker and guiding tool.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published