cheahjs / palworld-save-tools

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

Question about PAL save data, possible bug? #151

Closed Ikariusrb closed 4 months ago

Ikariusrb commented 4 months ago

Common issues before reporting Summary: Trying to discern ownership mapping from PALs to Players in save data. IDs necessary for mapping may be missing.

I'm working on consuming the save data from the tool, and I've run into something I'm trying to understand.

I'm trying to sort out the captured PALs from the data, in order to automate breeding advice (do I have any precursor pals with traits I want?)

I've found the pal data under properties->worldSaveData->value->CharacterSaveParameterMap->value-> array mapping of value->RawData->value->object->SaveParameter which has a list including player characters and pal characters. Straightforward to distinguish between the two, but the pal entries have a block identifying the owners:

 "OwnerPlayerUId"=>
  {"struct_type"=>"Guid",
   "struct_id"=>"00000000-0000-0000-0000-000000000000",
   "id"=>nil,
   "value"=>"00000000-0000-0000-0000-000000000001",
   "type"=>"StructProperty"},
 "OldOwnerPlayerUIds"=>
  {"array_type"=>"StructProperty",
   "id"=>nil,
   "value"=>
    {"prop_name"=>"OldOwnerPlayerUIds",
     "prop_type"=>"StructProperty",
     "values"=>["00000000-0000-0000-0000-000000000001"],
     "type_name"=>"Guid",
     "id"=>"00000000-0000-0000-0000-000000000000"},
   "type"=>"ArrayProperty"},

So I presume from that data that I'm looking for a CharacterSaveParameterMap with an id matching the first value.

Unfortunately, when looking at the player data, I see this:

=> {"object"=>
  {"SaveParameter"=>
    {"struct_type"=>"PalIndividualCharacterSaveParameter",
     "struct_id"=>"00000000-0000-0000-0000-000000000000",
     "id"=>nil,
     "value"=>
      {"Level"=>{"id"=>nil, "value"=>39, "type"=>"IntProperty"},
       "Exp"=>{"id"=>nil, "value"=>1518301, "type"=>"IntProperty"},
       "NickName"=>{"id"=>nil, "value"=>"Ikarius", "type"=>"StrProperty"},
       "HP"=>
        {"struct_type"=>"FixedPoint64",
         "struct_id"=>"00000000-0000-0000-0000-000000000000",
         "id"=>nil,
         "value"=>{"Value"=>{"id"=>nil, "value"=>3450000, "type"=>"Int64Property"}},
         "type"=>"StructProperty"},
       "FullStomach"=>{"id"=>nil, "value"=>91.7082748413086, "type"=>"FloatProperty"},
       "IsPlayer"=>{"value"=>true, "id"=>nil, "type"=>"BoolProperty"},

First off, nowhere in the player data do I see an ID matching "00000000-0000-0000-0000-000000000001", and secondly, the "id" property is nil. So the question is whether we're missing IDs so we could map PAL ownership to players in a multiplayer save.

Happy to provide the raw save, the JSON-ified save, or anything else you'd want to look at- I'm doing my best to map this out, hoping you may have some insight here.

Have you tried the latest release I'm using v 0.19.0 of palworld-save-tools

Copy of .sav or .sav.json files If possible, attach the .sav or .sav.json file. Add to a zip file to compress it down from gigabytes down to megabytes to make it manageable.