cheahjs / palworld-save-tools

Tools for converting Palworld .sav files to JSON and back
MIT License
763 stars 64 forks source link

Support for new Xbox Gamepass save format #173

Closed tylercamp closed 5 hours ago

tylercamp commented 2 months ago

I've extracted a recent Xbox/Game Pass Palworld save file using Xbox-Live-Save-Exporter and am unable to convert the newer Level-01.sav file found with the latest Game Pass version. This previously worked with older game versions (latest save is Level-01.sav, old save is Level.sav, both are preserved in the save files folder), but the new versions give an error with:

Exception: not a compressed Palworld save, found b'CNK' instead of b'PlZ'

The other .sav files are parsed successfully. Level-01.sav is definitely the most recent version, since in this save file I'm level two, but in Level.sav the "Level" field is omitted (aka "default value", i.e. Level 1.)

Opening Level-01.sav in a text editor I can see that the PlZ magic bytes are present but are later in the file than expected.

2745F66D4BC26F8E9FB379B7427282F7.zip

tylercamp commented 2 months ago

Note: It looks like this sort of resolves itself if you wait a little while after closing the game before loading the file into palworld-save-tools. This might be a sort of "dirty save" flag which suggest that it hasn't been synced/finalized yet.

This can be closed as wont-fix if needed.

EDIT: Was able to fix this by testing for CNK bytes before PlZ and, if found, 9 bytes are skipped before reading the next 3 again as the new set of magic bytes.

tylercamp commented 5 hours ago

Appears to be fixed by 3a39590