UndertaleModTool
UndertaleModTool copied to clipboard
The "TextureBlockSize" value of embedded textures is not dynamically calculated
Describe the bug
A extra value was introduced in GM 2022.3 to texture pages in the TXTR chuck, which is the size of the texture data that the texture page contains. For what the value is supposed to be, and since you can replace the texture data to anything through the ModLib interface, I suppose the value should be dynamically calculated during the serialization of texture pages. However, it's just read into the TextureBlockSize variable when texture pages are deserialized, which is simply written into the data file intact when texture pages are serialized. It's never recalculated in any way when the texture data is replaced, and for new, programmatically created UndertaleEmbeddedTexture instances, it's just set to 0.
The obvious effect of this is when new texture pages are added to data file, and are used in any way, graphics created from the page items in the texture page will not show up when the data file is ran. This visibly affects the NewTexturePacker script, which recreates texture pages anew; when it is ran on a GM 2022.3 game that uses the QOI image format, and the game is ran, no sprites or fonts will show up at all.
Reproducing steps
- Open a data file made in GM 2022.3
- Add a new texture page to the file programmatically, and add data to it
- Save the file
- Reopen the newly saved file
- Poke the new texture page and find it's TextureBlockSize is zero
or:
- Open a 2022.3 game that uses the QOI image format such as HoloCure
- Run NewTexturePacker.csx
- Save game and run
- Observe that no sprites and fonts show up
Setup Details
- UndertaleModTool version: commit b8a11a2
- Operating system: Windows 11
- Game: HoloCure