Skip to content

Add json library and convert description table into json#807

Open
BuffYoda21 wants to merge 19 commits into
gamestabled:data-driven-refactorfrom
BuffYoda21:json
Open

Add json library and convert description table into json#807
BuffYoda21 wants to merge 19 commits into
gamestabled:data-driven-refactorfrom
BuffYoda21:json

Conversation

@BuffYoda21

@BuffYoda21 BuffYoda21 commented Mar 29, 2026

Copy link
Copy Markdown
Contributor

This PR adds this json library that supports jsonc (which is +25k of this PR's diff) and goes ahead and converts all the descriptions originally defined in descriptions.cpp to json in description_table.jsonc. There are also item_table.jsonc, location_table.jsonc, and settings_table.jsonc which are not implemented yet and are really just included in this PR so I don't lose them.

I chose jsonc over json since these files would become the primary way developers would interact with surface level changes like adding a new item, setting, location, etc so making them more humanly readable is important. I understand that parsing jsonc vs json does take more overhead but the difference in runtime is all just startup cost and most users likely wouldn't notice a difference.

These data files are intended to be shared with the upcoming OoT3D archipelago implementation so that syncing changes between them remains easy. Best case scenario becoming entirely automated when a new release is published here.

Small note, in order for intellesense not to get upset for trying to reference the json files, contributors will need to add "${workspaceFolder}/build" to their includePath in c_cpp_properties.json. Not sure if there is another better way to do this since that will mean if you haven't built the app yet or run make clean intellesense will get upset.

-------------------- Original Post --------------------

Very big change but I believe this is the best way to ensure maintainability and scalability as the project grows. The json files used here can also be used for an eventual archipelago implementation making maintaining parody between the standalone and AP randomizers much easier. Currently plan to convert the following to be data driven (but will add to this list as necessary):

  • Item table (Json written, not implemented)
  • Location table (Json written, not implemented)
  • Settings (Json written, not implemented)
  • Location access (not written)
  • Entrance table (not written)
  • Descriptions (Json written and implemented)

@BuffYoda21

Copy link
Copy Markdown
Contributor Author

Went ahead and pushed commit 3b5823d and a32fa39 for the sake of having them here. It currently has an issue that causes a crash during seed generation a few frames after displaying Caching Settings...Done that I have been struggling to resolve. Azahar logs print repeated errors similar to [ 4.967245] HW.Memory <Error> core/memory.cpp:Read:481: unmapped Read32 @ 0x00000000 at PC 0x001FC5C8 and when running $DEVKITARM/bin/arm-none-eabi-addr2line -e OoT3D_Randomizer.elf 0x001FC5C8 it outputs C:/devkitPro/devkitARM/arm-none-eabi/include/c++/15.1.0/bits/stl_vector.h:1283 but I have no idea how to figure out what vector is the issue other than blindly guessing.

Just to clarify, everything works perfectly up until commit a3fe894

@BuffYoda21

Copy link
Copy Markdown
Contributor Author

Decided to pivot my current approach and reset basically everything to how it was before I messed with it but keep the json files I made. This is because the way I was doing things (using a python script at the start of the build process to convert the json data into cpp code) was a little dumb and wouldn't have been great to maintain anyway. My new approach will have the json files embedded into the app it's self and read from them on app startup.

@BuffYoda21

Copy link
Copy Markdown
Contributor Author

Might as well take this opportunity to update my fork since there have been plenty of changes

@BuffYoda21

Copy link
Copy Markdown
Contributor Author

Small note, in order for intellesense not to get upset for trying to reference the json files, contributors will need to add "${workspaceFolder}/build" to their includePath in c_cpp_properties.json. Not sure if there is another better way to do this since that will mean if you haven't built the app yet or run make clean intellesense will get upset.

@BuffYoda21 BuffYoda21 changed the base branch from main to data-driven-refactor June 26, 2026 15:59
@BuffYoda21 BuffYoda21 changed the title Refactor codebase to a data driven format Add json library and convert description table into json Jun 26, 2026
@BuffYoda21 BuffYoda21 marked this pull request as ready for review June 26, 2026 16:13
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.

1 participant