Improve compatibility with translated Undertale data files - #1
Open
jsjsjsjsjsjsjson wants to merge 1 commit into
Open
Improve compatibility with translated Undertale data files#1jsjsjsjsjsjsjson wants to merge 1 commit into
jsjsjsjsjsjsjson wants to merge 1 commit into
Conversation
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
This PR improves compatibility with modified Undertale
data.win/game.unxfiles, especially translation patches that relocate expanded text and font data outside of the original chunks.Some patched files store translated strings, font records, glyph data, and font texture page entries in locations that the original parser did not expect. This could cause parse-time errors such as:
or allow the game to start while leaving translated dialogue blank, or directly cause Butterscotch to crash.
What changed
This PR adds support for:
STRGentriesFONTrecords and glyph recordsTPAGentries used by patched fontsThe updated string handling affects:
string_lengthstring_char_atstring_copystring_posstring_deletestring_insertWhy
Some translation patches do not fully rebuild the GameMaker archive layout. Instead, they append expanded translated text and related font metadata elsewhere in the file, then update offsets to point to those relocated records.
The existing parser assumes that these offsets always stay inside their original chunks. That works for the original Undertale data files, but it breaks with some translated files.
This patch keeps the original fast path for normal files, but adds fallback handling when relocated offsets are detected.
Testing
Tested with:
game.unxgame.unxwith relocated strings and fontsResults:
FONTparsing