cheahjs / palworld-save-tools

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

Seems --custom-properties is not working #159

Closed AntiMoron closed 7 months ago

AntiMoron commented 7 months ago

I've test it in the following order:

# Just smiply add it
palworld-save-tools ./Level.sav --output save.json --to-json  --custom-properties=.worldSaveData.GroupSaveDataMap,.worldSaveData.CharacterSaveParameterMap.Value.RawData
# Seemed not working, so I removed the '=' behind the custom properties flag
palworld-save-tools ./Level.sav --output save1.json --to-json  --custom-properties .worldSaveData.GroupSaveDataMap,.worldSaveData.CharacterSaveParameterMap.Value.RawData
# Seemed not working, so I moved ahead the flag.
palworld-save-tools  --custom-properties .worldSaveData.GroupSaveDataMap,.worldSaveData.CharacterSaveParameterMap.Value.RawData ./Level.sav --to-json --output save2.json
# Does it really work? So I removed the flag.
palworld-save-tools ./Level.sav --to-json --output save3.json
# I don't know, passed only one value to the flag to see what will happen
palworld-save-tools  --custom-properties .worldSaveData.CharacterSaveParameterMap.Value.RawData ./Level.sav --to-json --output save4.json
# OK, minify json, to see if it support flags.
 palworld-save-tools  --custom-properties .worldSaveData.CharacterSaveParameterMap.Value.RawData ./Level.sav --to-json --output save5.json --minify-json

You can see from below, after added --custom-properties produced a larger json file. I'm confused.

image

AntiMoron commented 7 months ago

image

cheahjs commented 7 months ago

--custom-properties does not necessary reduce the output size of the JSON, only that it will not process any RawData byte arrays that are not set, so CPU time is saved. Unminified JSON output can be much larger since it will output each byte on a separate line with the corresponding whitespace.

AntiMoron commented 7 months ago

Thanks, get it.