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

0.4 - Feybreak compatibility

Open cheahjs opened this issue 1 year ago • 4 comments

I haven't had the time to work on this project, so just documenting issues with raw data parsing:

New issues:

  • https://github.com/cheahjs/palworld-save-tools/issues/192
  • Group RawData has new fields
  • Unknown Work parsing

Previous updates:

  • https://github.com/cheahjs/palworld-save-tools/issues/178
  • https://github.com/cheahjs/palworld-save-tools/issues/187

cheahjs avatar Dec 24 '24 14:12 cheahjs

Additional new issue: New worldSaveData object added when random Pal mode is enabled, which results in this exception

 File "D:\project\palworld-save-tools\palworld_save_tools\gvas.py", line 131, in read
  File "D:\project\palworld-save-tools\palworld_save_tools\archive.py", line 386, in properties_until_end
File "D:\project\palworld-save-tools\palworld_save_tools\archive.py", line 399, in property
  File "D:\project\palworld-save-tools\palworld_save_tools\archive.py", line 534, in struct
  File "D:\project\palworld-save-tools\palworld_save_tools\archive.py", line 561, in struct_value
  File "D:\project\palworld-save-tools\palworld_save_tools\archive.py", line 386, in properties_until_end
  File "D:\project\palworld-save-tools\palworld_save_tools\archive.py", line 399, in property
  File "D:\project\palworld-save-tools\palworld_save_tools\archive.py", line 534, in struct
  File "D:\project\palworld-save-tools\palworld_save_tools\archive.py", line 561, in struct_value
  File "D:\project\palworld-save-tools\palworld_save_tools\archive.py", line 386, in properties_until_end
  File "D:\project\palworld-save-tools\palworld_save_tools\archive.py", line 475, in property
  File "D:\project\palworld-save-tools\palworld_save_tools\archive.py", line 575, in array_property
  File "D:\project\palworld-save-tools\palworld_save_tools\archive.py", line 561, in struct_value
  File "D:\project\palworld-save-tools\palworld_save_tools\archive.py", line 386, in properties_until_end
  File "D:\project\palworld-save-tools\palworld_save_tools\archive.py", line 495, in property
  File "D:\project\palworld-save-tools\palworld_save_tools\archive.py", line 528, in prop_value
Exception: Unknown property value type: UInt32Property (.worldSaveData.RandomizerSaveData.RegionRandomizeSpawnerHashList.RegionRandomizeSpawnerHashList.RemapRowNameHashList.Key)

I was able to resolve this error by updating the prop_value methods in FArchiveReader to

    def prop_value(self, type_name: str, struct_type_name: str, path: str):
        if type_name == "StructProperty":
            return self.struct_value(struct_type_name, path)
        elif type_name == "EnumProperty":
            return self.fstring()
        elif type_name == "NameProperty":
            return self.fstring()
        elif type_name == "IntProperty":
            return self.i32()
        elif type_name == "BoolProperty":
            return self.bool()
        elif type_name == "UInt32Property":
            return self.u32()
        else:
            raise Exception(f"Unknown property value type: {type_name} ({path})")

and FArchiveWriter to

    def prop_value(self, type_name: str, struct_type_name: str, value):
        if type_name == "StructProperty":
            self.struct_value(struct_type_name, value)
        elif type_name == "EnumProperty":
            self.fstring(value)
        elif type_name == "NameProperty":
            self.fstring(value)
        elif type_name == "IntProperty":
            self.i32(value)
        elif type_name == "BoolProperty":
            self.bool(value)
        elif type_name == "UInt32Property":
            self.u32(value)
        else:
            raise Exception(f"Unknown property value type: {type_name}")

oMaN-Rod avatar Dec 26 '24 16:12 oMaN-Rod

I ran into an exception in group.py -> 'decode_bytes()'. For group_type == "EPalGroupType::Guild", the player count read as a large number, the hexadecimal of that number is the same as the UID of the admin player.

I was able to workaround the exception be making the following change on line 63 of rawdata/group.py:

if group_type == "EPalGroupType::Guild":
    guild = {
        "admin_player_uid": reader.guid(),
        "unknown_guid": reader.guid(), # Line 63
        "players": [],
    }
    player_count = reader.i32()

topblast avatar Jan 06 '25 19:01 topblast

What @topblast mentioned got it working on the PalWorld 0.4.12. Much thanks.

mrdude2x avatar Jan 13 '25 00:01 mrdude2x

Had an issue that I fixed when converting back:

I edited line 251 from writer.write(bytes(p["transform"]["raw_data"])) to print(type(p["transform"]["raw_data"]), p["transform"]["raw_data"])

rxdep avatar Jan 15 '25 18:01 rxdep