iebb / PalworldSaveEditor

Palworld Save Editor (in-browser)
MIT License
41 stars 5 forks source link

RawData fields? #3

Open Piezoelectric opened 5 months ago

Piezoelectric commented 5 months ago

Not sure if this is an issue or the exporter working as intended, but when I import Level.sav, some structs have RawData fields that look like this:

{
  "_type": "Array",
  "array_type": "ByteProperty",
  "value": {
    "_array_type": "Base",
    "_value_type": "Byte",
    "value": [
      14,
      0,
      0,
      0,
      83,
      97,
      118,
      ...etc...
    ]
  }
}

The arrays in RawData:value:value can be interpreted as bytestrings. For example in python, when I use chr() to convert the integers to their respective unicode chars (trimming out all integers below 32), I get a reformatted RawData string that looks like this:

"RawData": "SaveParameterStructPropertyr$PalIndividualCharacterSaveParameterCharacterIDNamePropertyBOSS_LilyQueen_DarkGenderEnumPropertyEPalGenderTypeEPalGenderType::FemaleLevelIntProperty2ExpIntProperty\u00e3z(NickNameStrPropertyTransfem Named LilyEquipWazaArrayPropertyWEnumPropertyEPalWazaID::IcicleThrowEPalWazaID::ShadowBallEPalWazaID::FrostBreathMasteredWazaArrayProperty\u00a2EnumPropertyEPalWazaID::DarkBallEPalWazaID::IceBladeEPalWazaID::DarkWaveEPalWazaID::FrostBreathEPalWazaID::ShadowBallEPalWazaID::IcicleThrowHPStructProperty6FixedPoint64ValueInt64Property8;ANoneTalent_HPIntProperty^Talent_MeleeIntPropertyBTalent_ShotIntPropertyPTalent_DefenseIntPropertyNFullStomachFloatProperty\u00bdOTCPassiveSkillListArrayPropertyNamePropertyCraftSpeed_up2MPStructProperty6FixedPoint64ValueInt64Property\u00a0\u0086NoneOwnedTimeStructPropertyDateTime\u00c0q\u00f2\u00df\u00b2\u00dcOwnerPlayerUIdStructPropertyGuidOldOwnerPlayerUIdsArrayProperty`StructPropertyOldOwnerPlayerUIdsStructPropertyGuidMaxHPStructProperty6FixedPoint64ValueInt64Property8;ANoneCraftSpeedIntPropertyFCraftSpeedsArrayPropertyStructPropertyCraftSpeedsStructProperty\u00c3PalWorkSuitabilityInfoWorkSuitabilityEnumProperty#EPalWorkSuitabilityEPalWorkSuitability::EmitFlameRankIntPropertyNoneWorkSuitabilityEnumProperty\"EPalWorkSuitabilityEPalWorkSuitability::WateringRankIntPropertyNoneWorkSuitabilityEnumProperty!EPalWorkSuitabilityEPalWorkSuitability::SeedingRankIntPropertyNoneWorkSuitabilityEnumProperty-EPalWorkSuitability)EPalWorkSuitability::GenerateElectricityRankIntPropertyNoneWorkSuitabilityEnumProperty#EPalWorkSuitabilityEPalWorkSuitability::HandcraftRankIntPropertyNoneWorkSuitabilityEnumProperty$EPalWorkSuitability EPalWorkSuitability::CollectionRankIntPropertyNoneWorkSuitabilityEnumProperty\"EPalWorkSuitabilityEPalWorkSuitability::DeforestRankIntPropertyNoneWorkSuitabilityEnumProperty EPalWorkSuitabilityEPalWorkSuitability::MiningRankIntPropertyNoneWorkSuitabilityEnumProperty'EPalWorkSuitability#EPalWorkSuitability::OilExtractionRankIntPropertyNoneWorkSuitabilityEnumProperty)EPalWorkSuitability%EPalWorkSuitability::ProductMedicineRankIntPropertyNoneWorkSuitabilityEnumPropertyEPalWorkSuitabilityEPalWorkSuitability::CoolRankIntPropertyNoneWorkSuitabilityEnumProperty#EPalWorkSuitabilityEPalWorkSuitability::TransportRankIntPropertyNoneWorkSuitabilityEnumProperty%EPalWorkSuitability!EPalWorkSuitability::MonsterFarmRankIntPropertyNoneEquipItemContainerIdStructPropertyUPalContainerIdIDStructPropertyGuid6\u007f\u00d4.5\u00ad8D\u0097\u00c9ce\u00e8X}\u008eNoneSlotIDStructProperty\u00d8PalCharacterSlotIdContainerIdStructPropertyUPalContainerIdIDStructPropertyGuid\u00d8\u00f1Q\u009d\u00a7\u00ae\u0097H\u00b3\u00fb\u00db\u009a\u0081#\u00dbxNoneSlotIndexIntPropertyNoneMaxFullStomachFloatProperty\u00c8CGotStatusPointListArrayProperty\u00e7StructPropertyGotStatusPointListStructProperty\u008aPalGotStatusPointStatusNameNameProperty\u00fb\u00ff\u00ff\u00ffg'YHPStatusPointIntPropertyNoneStatusNameNameProperty\u00fb\u00ff\u00ff\u00ffg'YSPStatusPointIntPropertyNoneStatusNameNameProperty\u00fc\u00ff\u00ff\u00ff;e\u0083d\u009bRStatusPointIntPropertyNoneStatusNameNameProperty\u00fb\u00ff\u00ff\u00ff@bc\u00cd\u0091\u00cf\u0091StatusPointIntPropertyNoneStatusNameNameProperty\u00fc\u00ff\u00ff\u00ffUcrs\u0087sStatusPointIntPropertyNoneStatusNameNameProperty\u00fb\u00ff\u00ff\u00ff\\Omi\u0090\u00a6^StatusPointIntPropertyNoneDecreaseFullStomachRatesStructPropertyFloatContainerNoneCraftSpeedRatesStructPropertyFloatContainerNoneLastJumpedLocationStructPropertyVector\u0088\u00d8.eP\u00bc@NoneNone\u00a8\u00d8\u00e8\u00f33W\u00a9D\u00b7(sZ\u00b3S\u00af"

This makes me wonder if the RawData field can be converted into additional JSON for ease-of-use, or if it's supposed to do that but the uesave-rs decoder isn't working properly.

Piezoelectric commented 5 months ago

This does appear to be the case, see here: https://github.com/cheahjs/palworld-save-tools

This tool currently supports additional parsing of the following data not handled by uesave or other non-Palworld aware Unreal save editors:

  1. Level.sav:GroupSaveDataMap
    • Groups such as in-game organizations and guilds
  2. Level.sav:CharacterSaveParameterMap
    • Characters such as players and pals
iebb commented 5 months ago

added RawData fields parsing inspired by https://github.com/DKingAlpha/palworld-uesave-rs (with a slightly different implementation)

iebb commented 5 months ago

this rawdata parsing is extremely slow (30x slower) in a wasm setting. currently investigating while turned off.