palworld-save-tools icon indicating copy to clipboard operation
palworld-save-tools copied to clipboard

Fail to parse the Level.sav by using covert.py after Palworld v0.3.3 patch

Open RickyLottery opened this issue 1 year ago • 6 comments

I have tried to parse the Level.sav after today's patch. However, the covert.py didn't manage to parse the file and reported the following Traceback

    File "xxx/palsave_tools/palworld_save_tools/archive.py", line 488, in property
    raise Exception(f"Unknown type: {type_name} ({path})")
Exception: Unknown type: UInt32Property (.worldSaveData.WorldMetaSaveVersionBitMask)

The reason might be that they had introduced some new data format or class.

Below is the notification of the patch this time. [Patch Notice] Palworld version v0.3.3 has been released.

===

・Fixed a bug that caused save data to become unreasonably large ・Other minor bugs fixed

RickyLottery avatar Jul 08 '24 10:07 RickyLottery

I used a savefile transfer tool based on this git, and it fails today. Maybe it's because of the update today.

TheAutomatic avatar Jul 08 '24 13:07 TheAutomatic

I was gonna port my savefile from gamepass to steam and i also encountered this problem.

raileehhh avatar Jul 08 '24 14:07 raileehhh

Authors have merged some code of PR https://github.com/cheahjs/palworld-save-tools/pull/181 to the main branch. This PR added the support of UInt32Property which is utilized in the new patch of PalWorld. I have managed to execute the source code to parse my .sav file which is:

python -m palworld_save_tools.commands.convert PATH_TO_YOUR_SAV_FILE

You might need to execute this command in the project's root directory (instead of the directory where covert.py is located).

From my perspective, this could be a temporary solution before authors publish a new version of the release package.

RickyLottery avatar Jul 08 '24 17:07 RickyLottery

You guys need to update the archive.py to accept these.

        elif type_name == "Int32Property":
            value = {
                "id": self.optional_guid(),
                "value": self.u32(),
            }
        elif type_name == "UInt32Property":
            value = {
                "id": self.optional_guid(),
                "value": self.u32(),
            }
        Within def property(
        
        I also threw in Int32Property just in case.
        
        Apply to the Reader.

deafdudecomputers avatar Jul 08 '24 21:07 deafdudecomputers

Authors have merged some code of PR #181 to the main branch. This PR added the support of UInt32Property which is utilized in the new patch of PalWorld. I have managed to execute the source code to parse my .sav file which is:

python -m palworld_save_tools.commands.convert PATH_TO_YOUR_SAV_FILE

You might need to execute this command in the project's root directory (instead of the directory where covert.py is located).

From my perspective, this could be a temporary solution before authors publish a new version of the release package.

Thanks for your suggestion, now it's able to create a .json file, is there anyway to transfer from a world to another? I found that there are billions of lines of the .json file, don't know where to change the player information.

TheAutomatic avatar Jul 09 '24 03:07 TheAutomatic

You guys need to update the archive.py to accept these.

        elif type_name == "Int32Property":
            value = {
                "id": self.optional_guid(),
                "value": self.u32(),
            }
        elif type_name == "UInt32Property":
            value = {
                "id": self.optional_guid(),
                "value": self.u32(),
            }
        Within def property(
        
        I also threw in Int32Property just in case.
        
        Apply to the Reader.

You also need to add the following lines to the def property_inner(...) function:

        elif property_type == "Int32Property":
            self.optional_guid(property.get("id", None))
            self.u32(property["value"])
            size = 4
        elif property_type == "UInt32Property":
            self.optional_guid(property.get("id", None))
            self.u32(property["value"])
            size = 4

This function is used for converting from .json back to .sav. Will work as a temporary solution with the above.

EDIT: Saw the latest release. Just use that instead

kssalanio avatar Jul 09 '24 04:07 kssalanio