UESaveTool icon indicating copy to clipboard operation
UESaveTool copied to clipboard

Ran into an issue with trying to convert a .sav to .json. Error comes up as "Unexpected header, expected 'GVAS

Open avasiaxx opened this issue 1 year ago • 5 comments

image_2024-01-23_012550714

avasiaxx avatar Jan 23 '24 06:01 avasiaxx

Looks like you want to convert a Palworld Savegame. The savegame itself is gzip compressed. This can be either single or double compression. You can check byte 11 for which compression is used. Then you can use a lib like pako to decompress: switch (array[11]) { case 0x32: data = pako.ungzip(data); case 0x31: data = pako.ungzip(data); console.log("0x31"); break; default: }

Compressed data starts at byte 12

s0t7x avatar Jan 24 '24 13:01 s0t7x

@avasiaxx Here are some more caveats regarding Palworld Savegames:

  • Game uses unsupported package version 3 (4 extra bytes in header)
  • Game uses unsupported property types (NameProperty, DateTimeProperty etc.)

My SaveEditor is working right now but still missing a lot of information. I tried extending UESaveTool to work with Palworld but finally switched to uesave-rs and integrated it as WASM. Fixing UESaveTool isn't complicated but it's a lot!

s0t7x avatar Jan 24 '24 15:01 s0t7x

@avasiaxx Here are some more caveats regarding Palworld Savegames:

  • Game uses unsupported package version 3 (4 extra bytes in header)
  • Game uses unsupported property types (NameProperty, DateTimeProperty etc.)

My SaveEditor is working right now but still missing a lot of information. I tried extending UESaveTool to work with Palworld but finally switched to uesave-rs and integrated it as WASM. Fixing UESaveTool isn't complicated but it's a lot!

Could you make a repository for the wasm conversion from uesave-rs? I, too, was trying to do this but I have no grasp of Rust whatsoever..

beemerwt avatar Feb 02 '24 20:02 beemerwt

Hey guys, I kind of know how to support version 3, though I'm not quite sure what the extra bytes mean. It seems version 3 has 2-32bit integers that follow the SaveGameVersion value. In version 2, it was just a single one, the code for parsing the header was taken from another source (linked in the readme). I can do a quick modification to make PackageVersion be an array, but I'm not 100% sure that the two numbers are associated with the PackageVersion. TBH, I don't really know what any of the data means, again, the code was taken from another source.

The unsupported data types are a bit of a headache, I wish I knew how to generically parse properties, but I've been mostly left with looking at the binary in HxD. It seems each property type has a different structure so they have to be implemented individually. Someone has submitted a PR for NameProperty but Palworld also uses others that I have never seen or know anything about, such as MapProperty, I was trying to work with someone to support it, but I couldn't understand how the data structure was serialized.

I'm not going to make any promises, you're better off using another tool that is more complete and actively worked on, but I will be trying to get some of these issues resolved. Supporting more properties is going to be tough, especially the nested ones seem to have unique structures based on the nested properties.

ch1pset avatar Feb 08 '24 10:02 ch1pset

Hey @ch1pset, this repo may be helpful if you plan to extend UESave with new DataTypes PalEdit

The parser for the Level.sav of Palworld seems to be in a very complete state.

EDIT: I suggest to close this issue as the initial problem is solved (Palworld uses a wrapper format for its gvas) and open a feature request like "Support latest popular data types". Idk much about gvas so you may find a better title.

s0t7x avatar Feb 10 '24 15:02 s0t7x