cheahjs / palworld-save-tools

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

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

Open RickyLottery opened 1 month ago

RickyLottery commented 1 month ago

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

TheAutomatic commented 1 month ago

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

raileehhh commented 1 month ago

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

RickyLottery commented 1 month ago

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.

deafdudecomputers commented 1 month ago

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.
TheAutomatic commented 1 month ago

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.

kssalanio commented 1 month ago

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