Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor builds from res/pokemon/*/data.json #348

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

lhearachel
Copy link
Collaborator

@lhearachel lhearachel commented Jan 21, 2025

This is a big PR. As a general summary, the following actions have been taken:

  1. Some terminology in include/pokemon.h has been cleaned up, and some additional code related to evolutions and learnsets has been documented further.
  2. Structures used to reference data files for pl_personal, evo, and wotbl have been extracted to a standalone file struct_defs/species.h.
  3. metang has been added as a dependency as the successor to constgen. Its offerings are more robust, and those are on full display here.
  4. datagen is a new internal tool to replace json2bin. It makes use of Tencent/rapidjson to parse these JSON files and generate a slew of all relevant NARCs and generated headers.
  5. All of the underlying json2bin usage for parsing these data.json files has been removed.
  6. The structure of some elements in the data.json files has changed. A migration script has been provided under tools/scripts/migration for users to move any changes that they have made to the new schema.

Next Steps

  1. Extract footprints and pokedex-related data to pokedex.json for each species and refactor build into a single executable.
  2. Refactor graphics compilation script for pokegra, poke_icon, and otherpoke.

@lhearachel lhearachel force-pushed the pokemon branch 2 times, most recently from 941e094 to 137ed37 Compare January 21, 2025 00:22
This new code is responsible for packing the following archives:

- `pl_personal` -> basic information for each species: stats, types, etc.
- `evo` -> evolution lines for each species
- `wotbl` -> by-level learnsets for each species
- `ppark` -> catching show data for each species
- `height` -> y-offsets for front and back sprites for each species
- `pl_poke_data` -> sprite-rendering data for each species: animation
  ID, frame data, shadow size and offsets, etc.

Additionally, the following headers are generated:

- `res/pokemon/tutorable_moves.h` -> A listing of moves taught by each
  tutor and how much each move costs to be tutored
- `res/pokemon/species_learnsets_by_tutor.h` -> An array of bitmasks for
  each species designating which moves can be tutored to that species
@@ -137,9 +125,9 @@
"trainer_pos_m": 15,
"pokemon_pos_m": 4,
"entry_text": "They appear when the snow flowers\nbloom. When the petals fall, they\nretreat to places unknown again.",
"category": "Frost Tree Pokémon"
"category": "Frost Tree Pok\u00e9mon"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the Unicode intentional?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is not! Good catch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants