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

Fixed spine sprites in >= 2023.1 #1677

Merged
merged 4 commits into from
Jun 1, 2024

Conversation

XdotCore
Copy link
Contributor

Submachine Legacy did not work with before changing this.

Description

In gamemaker version past 2023.4, the image data for a spine sprite is held within UndertaleSprite.TextureEntry rather than the UndertaleSpineTextureEntry.

This fixes that by checking the version and populating UndertaleSprite.Textures but excluding UndertaleSpineTextureEntry.TexBlob.

Caveats

  • There are 4 bytes in the UndertaleSpineTextureEntry part of the binary that I do not know the purpose of, but it doesn't seem to affect anything.
  • I have not fully tested every version, but it works on at least 2023.4 and 2023.8, and it is possible this change is needed for before 2023.4.

Notes

I was able to add this smiley face to the spined flame with this change:
spine change example

Submachine Legacy did not work with before changing this.
UndertaleModLib/Models/UndertaleSprite.cs Outdated Show resolved Hide resolved
UndertaleModLib/Models/UndertaleSprite.cs Outdated Show resolved Hide resolved
UndertaleModLib/Models/UndertaleSprite.cs Outdated Show resolved Hide resolved
UndertaleModLib/Models/UndertaleSprite.cs Outdated Show resolved Hide resolved
UndertaleModLib/Models/UndertaleSprite.cs Outdated Show resolved Hide resolved
UndertaleModTool/Editors/UndertaleSpriteEditor.xaml.cs Outdated Show resolved Hide resolved
@XdotCore
Copy link
Contributor Author

I fixed the bracket style to Allman

Copy link
Contributor

@Jacky720 Jacky720 left a comment

Choose a reason for hiding this comment

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

I'm not a huge fan of just calling it Unknown. Seems to me like it's equivalent to the existing TexBlob length, suggesting the actual location of the TexBlob has moved, and I'd really like to track that down. Did you say that the data.win reserializes 1:1 with these changes?

@XdotCore
Copy link
Contributor Author

XdotCore commented Mar 7, 2024

Last I checked with Submachine: Legacy it was 1 to 1

Copy link
Contributor

@BenjaminUrquhart BenjaminUrquhart left a comment

Choose a reason for hiding this comment

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

The change was made between 2022.11 and 2023.1 (most likely in 2023.1 since I don't think there's a .12 release). The blob is indeed moved to the texture entry.

The field is the length of the texture blob. I would rename the variable to reflect this and change the version checks (would be also good to find games that use spine sprites made with 2022.11 and 2023.1 to confirm it works correctly).

@Miepee
Copy link
Contributor

Miepee commented May 15, 2024

bump @XdotCore

@XdotCore XdotCore changed the title Fixed spine sprites in >= 2023.4 Fixed spine sprites in >= 2023.1 May 15, 2024
@XdotCore
Copy link
Contributor Author

Since we have determined the unknown value to be the length of the texture entry, I think it would be best to find a game where there is multiple texture entries in the spine sprite >= 2023.1 to test if each UndertaleSpineTextureEntry corresponds 1:1 with the textures in the sprite and in the same order.

If that is determined to be true, then it would be best to save the length of the corresponding texture entry by somehow passing that into the UndertaleSpineTextureEntry when the sprite is first unserialized.

In response to @BenjaminUrquhart .

Copy link
Contributor

@BenjaminUrquhart BenjaminUrquhart left a comment

Choose a reason for hiding this comment

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

Must have missed the changes, sorry about that!

@BenjaminUrquhart BenjaminUrquhart merged commit fb312d9 into UnderminersTeam:master Jun 1, 2024
5 checks passed
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.

None yet

4 participants