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

Merged
merged 10 commits into from
Jan 22, 2025
Merged

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 3 times, most recently from 137ed37 to 9d6dc60 Compare January 21, 2025 00:33
Copy link
Collaborator

@adrienntindall adrienntindall left a comment

Choose a reason for hiding this comment

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

This is mostly nitpicks but otherwise good to go. Ping me when you need the approval and I can trust everything is fixed just 'cause it's a pain to review in browser

generated/abilities.txt Show resolved Hide resolved
src/battle/ov16_0223DF00.c Outdated Show resolved Hide resolved
src/overlay005/ov5_021E622C.c Outdated Show resolved Hide resolved
src/overlay005/ov5_021E622C.c Outdated Show resolved Hide resolved
src/overlay005/ov5_021E622C.c Outdated Show resolved Hide resolved
src/overlay094/ov94_0223E46C.c Outdated Show resolved Hide resolved
src/overlay097/ov97_02236380.c Outdated Show resolved Hide resolved
src/overlay104/ov104_0222DCE0.c Outdated Show resolved Hide resolved
src/overlay104/ov104_0223A0C4.c Outdated Show resolved Hide resolved
src/unk_0204AEE8.c Outdated Show resolved Hide resolved
@lhearachel lhearachel force-pushed the pokemon branch 2 times, most recently from 72dd777 to 1eff5a8 Compare January 22, 2025 05:34
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
@lhearachel lhearachel disabled auto-merge January 22, 2025 07:07
@lhearachel lhearachel merged commit 08b09b8 into pret:main Jan 22, 2025
2 checks passed
github-actions bot pushed a commit that referenced this pull request Jan 22, 2025
github-actions bot pushed a commit to lhearachel/pokeplatinum that referenced this pull request Jan 22, 2025
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.

3 participants