Extract DRA enemy definitions with asset tool - #3456
Open
mathisto wants to merge 3 commits into
Open
Conversation
sozud
reviewed
Jul 31, 2026
| @@ -0,0 +1,209 @@ | |||
| package sotn | |||
Collaborator
There was a problem hiding this comment.
Wait until @Xeeynamo responds before changing but my opinion is we shouldn't duplicate sotn_str in the assets tool. You can just call it from go instead
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds an
enemydefsasset handler that extracts the completeEnemyDeftables into editable YAML and regenerates C initializer headers in the existing compilation units. Introduces a new string handler with complete font tables for US, EU (contains special accent chars the US doesn't), and JP (including support for dakuten and handakuten encoding of the katakana). Though I don't know much Japanese, I did do some research and ensured the characters matched up. Much of the PR's line diff bulk is from the massive amount of deletions that will no longer need to be manually maintained. Go is not my lingua franca but I tried to keep your existing code conventions. Please dont hesitate to rip me apart; it might not be idiomatic.This covers 2,805 records across seven tables:
The handler models the entire structure, including stats, elemental properties, item drops and rates, hitboxes, and flags. Element masks and item IDs use the existing
ElementsandItemDropsenums, while stable IDs and expected record counts protect against missing or reordered entries.Generated YAML and initializer headers remain ignored. Keeping the generated initializers inside the original source files lets the compiler continue to place and deduplicate the pointed-to strings instead of retaining hardcoded
.rodataaddresses.Name encoding
Enemy names use the game's 8x8-font encoding. As mentioned, the shared string handler supports the PSX and PSP character tables, dakuten and handakuten composition, and the PSP European glyphs.
PSX and HD generated sources retain readable
_S(...)strings. PSP headers contain pre-encoded strings because its string-processing step runs before generated includes are expanded.The ordinary
go test ./...reaches the existing unrelated vet failure inassets/spritesheet/handler.go:168(fmt.Errorfuses%wwith a string). Anyone have any more info on this failure? I'd love to take a swing at that as well.