cheahjs / palworld-save-tools

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

Converting a JSON to SAV seems to corrupt some characters #25

Closed poudigne closed 9 months ago

poudigne commented 9 months ago

One player can't log back in my server. I suspect a character corruption. So I delete the .sav file associated with the player and modified the Level.sav to remove every instance of his GUID in the file. there was only 2. I convert the JSON back to sav using your tool, everything went well. I logged back in my character the world was working, my character was there, however 2 other player had lost their character. One was showing online in the game but has a UUID 0000000.

If you need my sav file to test stuff, I can provide them. I can help you debug stuff. I'm a software dev, but no experience with python. I can probably run the app in debug mode and check stuff. Anyway let me know what I can do to help fix this.

nestharus commented 9 months ago

I know when I was converting back and forth with uesave the only thing I was seeing were single byte changes from floating point numbers.

poudigne commented 9 months ago

Yeah, I'm trying to compare the correct level.sav.json with the level.sav.json after converting to sav then back to json. But... VSCode don't like files with 1M rows lol

nestharus commented 9 months ago

Compare them with code. I ran through the code with python and compared byte by byte. I printed the lines where the bytes were different.

cheahjs commented 9 months ago

Floating point numbers is the one known area where it doesn't convert 1-to-1, otherwise I'm planning on adding tests to ensure the conversion is bit-for-bit identical.

poudigne commented 9 months ago

Went back into the file to analyze more stuff, and noticed that I left some stuff related to the players. deleted those lines, converted to sav file, and seems to work just fine.