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

[General] Can't import Mania/Encore saves #12

Open
Mefiresu opened this issue Oct 12, 2022 · 4 comments
Open

[General] Can't import Mania/Encore saves #12

Mefiresu opened this issue Oct 12, 2022 · 4 comments
Labels
bug Something isn't working

Comments

@Mefiresu
Copy link
Owner

Achievements, medals and other stats load correctly, while Mania/Encore saves don't seem to be loaded at all.
This could be an endianness issue when reading SaveData.bin, need to investigate and possibly upstream a fix.

@Mefiresu Mefiresu added the bug Something isn't working label Oct 12, 2022
@Mefiresu
Copy link
Owner Author

This is definitely an endianness issue since the save file is essentially a memory dump of the state of the game.
However this means that little/big endian compatibility could only be ensured if the struct layouts are modified to mimic little endian layouts and alignments.

@Doom32x1
Copy link

Doom32x1 commented Jan 9, 2023

the savegames have minor very minor differences, it seems to be that in the mania pc/switch/ps4/xbox the saves are edited different than in the RSDKv5 saves. I created exactly the same savefile on pc and on wii and opened the files with "beyond compare Hex comparison editor" to see those differences (the savegame was: sonic and tails, green hill zone, 3 lives, quitted after entering the bonus):

[](https://imgbox.com/RlKTGwDY)

then i edited the PC save file with SonicMania-SaveEditor.exe and only choose 7 chaos emerald
https://imgbox.com/LDSHjkbv

then I did the same comparison but with the file edited, you can see the differences, the data containing the slot savefile info is slighty different, look at the 03 located in the pc and in the wii savegame:
https://imgbox.com/NMoPrBny

now you have to edit the same hex value 7F from the pc, i edited following the location of the 03 value from the pc save, just 11 spaces after, now you have the 7emerald on wii too :D (here is the savefile with the savegame on green hill with 7 chaos emerald for wii: https://www.mediafire.com/file/t17sm04h7ocyz3n/SaveData.bin1/file, rename it to SaveData.Bin)

And here is a zip with the savefiles i used to made this comparison. Maybe its useful for someone or maybe someone can update his sonic mania editor: https://www.mediafire.com/file/74jbtfn46f4p3q8/saves_for_comparision.zip/file

if you try to use any sonicmania save editor with the wii savefile, it will crash or will give you a buggy savefile, you have to do what i did

@Mefiresu
Copy link
Owner Author

Mefiresu commented Jan 9, 2023

the savegames have minor very minor differences, it seems to be that in the mania pc/switch/ps4/xbox the saves are edited different than in the RSDKv5 saves.

Do you mean that the official game savefiles are different compared to the decompilation?

My understanding was that there's just a mismatch between original vs. decomp game state struct (padding, big/little endian values, 32vs64bit pointers...), and that the saved data just corresponds to a raw dump of that struct, which could explain the differences.

@Doom32x1
Copy link

Doom32x1 commented Jan 9, 2023

the savegames have minor very minor differences, it seems to be that in the mania pc/switch/ps4/xbox the saves are edited different than in the RSDKv5 saves.

Do you mean that the official game savefiles are different compared to the decompilation?

My understanding was that there's just a mismatch between original vs. decomp game state struct (padding, big/little endian values, 32vs64bit pointers...), and that the saved data just corresponds to a raw dump of that struct, which could explain the differences.

yeah exactly, they are almost identical, but rdskv5 seems to add some blanck spaces or just 00 00 00 in a line, you can see the comparison in the images i attached, im not a developer but maybe this is usefull for someone to update one of those open source github sonic mania saves editors proyects, perhaps a programmer can make them compatible :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants