Giter VIP home page Giter VIP logo

palworld-save-tools's Introduction

palworld-save-tools

Tools for converting Palworld .sav files to JSON and back.

This tool currently supports additional parsing of the following data in the Level.sav not handled by uesave or other non-Palworld aware Unreal save editors, emcompassing almost all known data structures as of Palworld v0.1.4.0:

  1. GroupSaveDataMap
    • Groups such as in-game organizations and guilds
  2. CharacterSaveParameterMap
    • Characters such as players and pals
  3. MapObjectSaveData
  4. ItemContainerSaveData
  5. CharacterContainerSaveData
  6. DynamicItemSaveData
  7. FoliageGridSaveDataMap
  8. BaseCampSaveData
  9. WorkSaveData

Instructions

Important

Converting Level.sav files to JSON will result in very large files, and may require significant amounts of RAM to process. Use a modern text editor such as Visual Studio Code or a Jetbrains IDE to open these files.

Prerequisites

  1. Python 3.9 or newer.

Windows GUI steps

  1. Download the latest release from [https://github.com/cheahjs/palworld-save-tools/releases/latest].
  2. Unzip the file into a folder.
  3. Drag and drop your .sav file (for Steam on Windows, these are located at %LOCALAPPDATA%\Pal\Saved\SaveGames\<SteamID>\<SaveID>) onto convert.cmd to convert the file into JSON.
  4. To convert the .sav.json file back into a .sav file, drag and drop your .sav.json file onto convert.cmd.

Note

In the event that the convert.cmd fails to function correctly, try to disable Python's app execution aliases ("Manage app execution aliases"), or failing that, please use the Terminal instructions below

Terminal

  1. Download the latest release from [https://github.com/cheahjs/palworld-save-tools/releases/latest].
  2. Unzip the file into a folder.
  3. Open a terminal in the folder you just unzipped.
  4. Depending on how Python is installed, the next steps should use either python, python3, or py.
  5. Run python convert.py <path to .sav file> to convert the .sav file to a .sav.json file.
  6. Run python convert.py <path to .json file> to convert the .sav.json file to a .sav file.

Note

On Windows, you can drag and drop the convert.py file and the .sav/.sav.json file to avoid typing out the path.

Additional command line arguments:

  1. --to-json: Force SAV to JSON conversion regardless of file extension
  2. --from-json: Force JSON to SAV conversion regardless of file extension
  3. --output: Override the default output path
  4. --minify-json: Minify output JSON to help speed up processing by other tools consuming JSON
  5. --force: Overwrite output files if they exist without prompting
  6. --custom-properties: Comma-separated list of paths from paltypes.py to decode. This can be used to ignore processing of types that are not of interest. For example --custom-properties .worldSaveData.GroupSaveDataMap,.worldSaveData.CharacterSaveParameterMap.Value.RawData will only parse guild data and character data.

Developers

This library is available on PyPi, and can be installed with

pip install palworld-save-tools

Note

Due to ongoing rapid development and the potential for breaking changes, the recommendation is to pin to a specific version, and take updates as necessary.

Roadmap

  • Parse all known blobs of data
  • Optimize CPU and memory usage

Development philosophy

  • No additional dependencies. Scripts should run with a default install of Python. Distributing binary builds of Python is laden with AV false positives.
    • Optional dependencies are allowed, for example switching out the stdlib's JSON library for something more performant.
  • Correctness of the conversion process is more important than performance. SAV > JSON > SAV should yield bit-for-bit identical files (pre-compression).

Projects that make use of palworld-save-tools

Note

This does not serve as an endorsement of any of these projects, use at your own risk.

palworld-save-tools's People

Contributors

cheahjs avatar kriscris avatar magicbear avatar nathanvegetable avatar xnul avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

palworld-save-tools's Issues

What's the current progress?

I really need this tool and I'd love to contribute, but there's currently no code in the repository and I have no clue

Script runs and does nothing

Common issues before reporting

Have you modified the save files
I only changes the python to py.

Have you tried the latest release
Yes

Describe the bug
When I drop the .sav onto the .cmd files it seems to run fine but just ends with "Press any key to continue." and does nothing.

PermissionError: [Errno 13] Permission denied

File C:\Users\Administrator\Desktop\change\savefiles/Level.sav uncompressed successfully
File C:\Users\Administrator\Desktop\change\savefiles/Level.sav (type: 50) converted to JSON successfully
File C:\Users\Administrator\Desktop\change\savefiles/Players/3E22F785000000000000000000000000.sav uncompressed successfully
File C:\Users\Administrator\Desktop\change\savefiles/Players/3E22F785000000000000000000000000.sav (type: 49) converted to JSON successfully
Converted save files to JSON
JSON files have been parsed
Changes have been made
JSON files have been exported
Traceback (most recent call last):
File "C:\Users\Administrator\Desktop\change\fix-host-save.py", line 244, in
main()
File "C:\Users\Administrator\Desktop\change\fix-host-save.py", line 121, in main
json_to_sav(uesave_path, level_json_path)
File "C:\Users\Administrator\Desktop\change\fix-host-save.py", line 211, in json_to_sav
with open(sav_file, 'wb') as f:
^^^^^^^^^^^^^^^^^^^^
PermissionError: [Errno 13] Permission denied: 'C:\Users\Administrator\Desktop\change\savefiles/Level.sav
Can someone help me fix it?

Unable to decompress Level.sav

Hey,
As many player, my server just started after 1.13 and no more player or building was on server.
I tryied to investigate with the help of your tool but i'm unable to decompress Level.sav, if this file is corrupted, there is a way to fix it ? I using lastest version of convert.py

this is the output:

C:\Users\user\Documents\temp\palworld-save-tools-windows-v0.13.0\pal>python3.11 convert.py Level.sav
Converting Level.sav to JSON, saving to Level.sav.json
Decompressing sav file
Traceback (most recent call last):
  File "C:\Users\user\Documents\temp\palworld-save-tools-windows-v0.13.0\pal\convert.py", line 118, in <module>
    main()
  File "C:\Users\user\Documents\temp\palworld-save-tools-windows-v0.13.0\pal\convert.py", line 52, in main
    convert_sav_to_json(args.filename, output_path, args.minify_json)
  File "C:\Users\user\Documents\temp\palworld-save-tools-windows-v0.13.0\pal\convert.py", line 75, in convert_sav_to_json
    raw_gvas, _ = decompress_sav_to_gvas(data)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\user\Documents\temp\palworld-save-tools-windows-v0.13.0\pal\lib\palsav.py", line 25, in decompress_sav_to_gvas
    uncompressed_data = zlib.decompress(data[12:])
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^
zlib.error: Error -3 while decompressing data: invalid block type

i joined the file
Level.zip

Transfer from Level.sav to Level.sav.json not possible

Hi! Thank you for the great tool, it has worked very well for me a couple of times. Unfortunately, I wanted to use it right now to roll back the latest players and now converting the Level.sav to Level.sav.json does not work anymore.

That is the errorcode:

C:\Users\User\Downloads\yml_to_sav>python convert.py luggi/Level.sav --minify-json
Converting luggi/Level.sav to JSON, saving to luggi/Level.sav.json
Decompressing sav file
Loading GVAS file
Traceback (most recent call last):
File "C:\Users\User\Downloads\yml_to_sav\lib\archive.py", line 108, in read_fstring
return data.decode(encoding)
^^^^^^^^^^^^^^^^^^^^^
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.12_3.12.496.0_x64__qbz5n2kfra8p0\Lib\encodings\utf_16_le.py", line 16, in decode
return codecs.utf_16_le_decode(input, errors, True)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
UnicodeDecodeError: 'utf-16-le' codec can't decode bytes in position 8-9: unexpected end of data
decoding with 'utf-16-le' codec failed

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "C:\Users\User\Downloads\yml_to_sav\convert.py", line 118, in
main()
File "C:\Users\User\Downloads\yml_to_sav\convert.py", line 52, in main
convert_sav_to_json(args.filename, output_path, args.minify_json)
File "C:\Users\User\Downloads\yml_to_sav\convert.py", line 77, in convert_sav_to_json
gvas_file = GvasFile.read(raw_gvas, PALWORLD_TYPE_HINTS, PALWORLD_CUSTOM_PROPERTIES)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\User\Downloads\yml_to_sav\lib\gvas.py", line 124, in read
gvas_file.properties = reader.read_properties_until_end()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\User\Downloads\yml_to_sav\lib\archive.py", line 168, in read_properties_until_end
properties[name] = self.read_property(type_name, size, f"{path}.{name}")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\User\Downloads\yml_to_sav\lib\archive.py", line 177, in read_property
value = self.read_struct(path)
^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\User\Downloads\yml_to_sav\lib\archive.py", line 289, in read_struct
value = self.read_struct_value(struct_type, path)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\User\Downloads\yml_to_sav\lib\archive.py", line 325, in read_struct_value
return self.read_properties_until_end(path)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\User\Downloads\yml_to_sav\lib\archive.py", line 168, in read_properties_until_end
properties[name] = self.read_property(type_name, size, f"{path}.{name}")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\User\Downloads\yml_to_sav\lib\archive.py", line 174, in read_property
value = self.custom_properties[path][0](self, type_name, size, path)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\User\Downloads\yml_to_sav\lib\rawdata.py", line 16, in decode_group_data
group["value"]["RawData"]["value"] = decode_group_data_bytes(
^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\User\Downloads\yml_to_sav\lib\rawdata.py", line 67, in decode_group_data_bytes
"player_name": reader.read_fstring(),
^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\User\Downloads\yml_to_sav\lib\archive.py", line 110, in read_fstring
raise Exception(
Exception: Error decoding utf-16-le string of length 6: b'@\xdbs\xdcg g 5\xd8'

I will add the zipped Level.sav
Level.zip
Can you please assist?

Sheepball cannot be edited.

PalEdit-main

Python 3.12.1
"E:\SteamLibrary\steamapps\common\Palworld\PalEdit-main"
Opening file C:/Users/m3062/AppData/Local/Pal/Saved/SaveGames/76561198059212876/7210D0D7470FF4A7DB62238AABAD98FC/Level.sav.json
Error occured: 'CharacterID'
Error occured: 'Sheepball'
Error occured: 'Sheepball'
Created Entity of type PinkCat: <PalInfo.PalObject object at 0x000002606278A120>
Created Entity of type ChickenPal: <PalInfo.PalObject object at 0x000002606278A720>
Created Entity of type ChickenPal: <PalInfo.PalObject object at 0x000002606278A720>
Created Entity of type PinkCat: <PalInfo.PalObject object at 0x000002606278A120>
Error occured: 'Sheepball'
Error occured: 'Sheepball'
Created Entity of type PinkCat: <PalInfo.PalObject object at 0x000002606278A120>
Created Entity of type ChickenPal: <PalInfo.PalObject object at 0x000002606278A720>
Unknown list contains 5 entries

Maybe CharacterID error is because it is not English.

uesave.exe missing from release?

"uesave.exe is missing" when running convert-singe-sav-to-json.cmd. uesave folder is created upon running, but no uesave.exe present

Publish Python Module

Can you publish this as a python module so that I can use it without cnping specific functions? It feels like I'm stealing your work.
Can you support accepting byte data for the json and sav data?
Can you decouple gvas from json_to_sav and sav_to_json stuff and have it take gvas byte data instead?
Can you not do any file i/o? If I want to write to or read from a file I want to do it myself. The root python scripts can be responsible for the file i/o =).

Thanks!

Not an issue just a BIG thanks

I just wanted to thank you and all other Contributors which this possible. I sucessfully recovered the character of my wife on our local save. For some reason she had to chreate a new one, so i used your tool to get access to the data. Then i simply swapped the id's in the old characterfile with the new id. After that i replaced all entries of the old id with the new one in Level.sav.

Before there are upcoming any questions: That method was used on a Co-op save, no dedicated server involved! There's allready an existing guide which provides all necessesary information.

Error after convert sav to json on Level.sav

image

Im trying to use "convert-single-sav-to-json.bat" on my Level.sav but after some minute working, its stop and says what images shows, its happen on 2 of my machines, and on 2 savegames, 1 server with up to 200 diferent players, and on a totally fresh saveworld

sorry for my language, its my first post on Github, thanks for ur time

Whats im doing wrong?

Invalid time stamp

스크린샷 2024-01-29 033810

Last online real time included in the guid has an invalid time stamp format
Other instances use a time stamp format of .net (18 digits) and an unknown time stamp format of 12 to 13 digits

.py is missing

When I drag and drop a onto the convert sav to json.bat file it says that "convert-single-sav-to-json.py" is missing?? I downloaded the whole code including ue-save, python 12, i got the recommended studio. Don't get what I'm doing wrong, any pointers?

Error when using 0.9.0 or 0.10.0

This is a dedicated server Level.sav that I'm trying to recover. The server randomly crashed last night and this is the only file I have
Level.zip

Have you tried the latest release
Yes, while I was trying to use this tool, it was updated to 0.10.0. I downloaded the new version and the same error came up
image

Describe the bug

The script ends with this error, but I've attached a screenshot showing the whole issue.
"UnicodeDecodeError: 'utf-8' codec can't decode byte 0xf9 in position 270: invalid start byte"

Any help would be appreciated! Thanks

Unable to Convert .sav to json

I'm trying to get a level.sav converted to json, but when I do i get the following error:

Python 3.7.9
This will convert the save file "C:\Users\Rob\AppData\Local\Pal\Saved\SaveGames\76561197968543780\ECFEC12B4F4040CC8369D58C254B6179\Level.sav" to JSON format.
Continue? [Y,N]?Y
Traceback (most recent call last):
File "convert-single-sav-to-json.py", line 7, in
from lib.palsav import *
File "C:\Users\Rob\OneDrive\Desktop\New folder (2)\lib\palsav.py", line 130, in
def uesave_to_json_params(uesave_path: str) -> list[str]:
TypeError: 'type' object is not subscriptable
Press any key to continue . . .

I'm not savvy with python or coding at all, and unsure how to resolve this issue.

KeyError: 'package_file_version_ue4'

PS F:\download\palworld-save-tools-windows-v0.13.0> python .\convert.py C:\Users\Administrator\Desktop\Saved\Level.sav.json
Converting C:\Users\Administrator\Desktop\Saved\Level.sav.json to SAV, saving to C:\Users\Administrator\Desktop\Saved\Level.sav
Loading JSON from C:\Users\Administrator\Desktop\Saved\Level.sav.json
Traceback (most recent call last):
File "F:\download\palworld-save-tools-windows-v0.13.0\convert.py", line 118, in
main()
File "F:\download\palworld-save-tools-windows-v0.13.0\convert.py", line 63, in main
convert_json_to_sav(args.filename, output_path)
File "F:\download\palworld-save-tools-windows-v0.13.0\convert.py", line 93, in convert_json_to_sav
gvas_file = GvasFile.load(data)
^^^^^^^^^^^^^^^^^^^
File "F:\download\palworld-save-tools-windows-v0.13.0\lib\gvas.py", line 135, in load
gvas_file.header = GvasHeader.load(dict["header"])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "F:\download\palworld-save-tools-windows-v0.13.0\lib\gvas.py", line 67, in load
header.package_file_version_ue4 = dict["package_file_version_ue4"]
~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^
KeyError: 'package_file_version_ue4'

json.decoder.JSONDecodeError keeps happening and have no idea how to fix it.

image_2024-01-26_143354674

Converting it to json works fine, i put it into save editor change some things, then when i want to change it back to .sav it doesnt work anymore.
edit: I tried without changing anything to the json file and tried to convert it back to the sav file still doesnt work maybe im just missing something idk

Exception: not a compressed Palworld save

Hi,

Using the latest release, python 312, getting this error when trying to convert some of my saves.

"Converting C:\temp\oldsave\529B1B83000000000000000000000000.sav to JSON, saving to C:\temp\oldsave\529B1B83000000000000000000000000.sav.json
Decompressing sav file
Traceback (most recent call last):
File "C:\Users\user\Downloads\palworld-save-tools-windows-v0.11.0\convert.py", line 120, in
main()
File "C:\Users\user\Downloads\palworld-save-tools-windows-v0.11.0\convert.py", line 52, in main
convert_sav_to_json(args.filename, output_path, args.minify_json)
File "C:\Users\user\Downloads\palworld-save-tools-windows-v0.11.0\convert.py", line 75, in convert_sav_to_json
raw_gvas, _ = decompress_sav_to_gvas(data)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\user\Downloads\palworld-save-tools-windows-v0.11.0\lib\palsav.py", line 11, in decompress_sav_to_gvas
raise Exception(
Exception: not a compressed Palworld save, found b'\x00\x00\x00' instead of P1Z

529B1B83000000000000000000000000.log

I've uploaded the save (renamed to .log so I can upload it), I suspect it's corrupted, but I'd appreciate if you could have a look. Thank you.

"Python is not installed"

I keep getting a message saying Python is not installed when trying to convert a sav to json. I have python installed, and I can see it print the python version. Do I need to have a very specific version? I installed the latest stable version (3.12.1)

python-error

Getting this issue

Checking if Python is installed as python3
C:\Users\Andrew\AppData\Local\Microsoft\WindowsApps\python3.exe
Found Python at python3
Python version:
Python 3.12.1
Converting C:\Users\Andrew\Desktop\Convert\Level.sav to JSON, saving to C:\Users\Andrew\Desktop\Convert\Level.sav.json
Decompressing sav file
Loading GVAS file
Traceback (most recent call last):
File "C:\Users\Andrew\Desktop\Convert\convert.py", line 120, in
main()
File "C:\Users\Andrew\Desktop\Convert\convert.py", line 52, in main
convert_sav_to_json(args.filename, output_path, args.minify_json)
File "C:\Users\Andrew\Desktop\Convert\convert.py", line 77, in convert_sav_to_json
gvas_file = GvasFile.read(raw_gvas, PALWORLD_TYPE_HINTS, PALWORLD_CUSTOM_PROPERTIES)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Andrew\Desktop\Convert\lib\gvas.py", line 124, in read
gvas_file.properties = reader.read_properties_until_end()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Andrew\Desktop\Convert\lib\archive.py", line 166, in read_properties_until_end
properties[name] = self.read_property(type_name, size, f"{path}.{name}")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Andrew\Desktop\Convert\lib\archive.py", line 175, in read_property
value = self.read_struct(path)
^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Andrew\Desktop\Convert\lib\archive.py", line 287, in read_struct
value = self.read_struct_value(struct_type, path)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Andrew\Desktop\Convert\lib\archive.py", line 323, in read_struct_value
return self.read_properties_until_end(path)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Andrew\Desktop\Convert\lib\archive.py", line 166, in read_properties_until_end
properties[name] = self.read_property(type_name, size, f"{path}.{name}")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Andrew\Desktop\Convert\lib\archive.py", line 249, in read_property
value = self.read_prop_value(value_type, value_struct_type, value_path)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Andrew\Desktop\Convert\lib\archive.py", line 271, in read_prop_value
return self.read_struct_value(struct_type_name, path)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Andrew\Desktop\Convert\lib\archive.py", line 323, in read_struct_value
return self.read_properties_until_end(path)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Andrew\Desktop\Convert\lib\archive.py", line 166, in read_properties_until_end
properties[name] = self.read_property(type_name, size, f"{path}.{name}")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Andrew\Desktop\Convert\lib\archive.py", line 265, in read_property
raise Exception(f"Unknown type: {type_name} ({path})")
Exception: Unknown type: n♥ArrayProper (.worldSaveData.ItemContainerSaveData.Value.Slots)
Press any key to continue . . .

any help would be appreciated.

Guild error after convert

Common issues before reporting

Have you modified the save files
If you have, please ensure that the JSON files are valid.
No
Have you tried the latest release
Please download the palworld-save-tools-windows.zip file from releases in case it's been fixed.
Yes
Describe the bug
A clear and concise description of what the bug is.
xNul/palworld-host-save-fix#18
Lost the guild.
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.

json to sav error

Screenshot_6
Getting an issue dropping level.sav.json onto the json-to-sav.bat; giving me a keyerror: root

Drag and drop onto .py file

I am unable to drag and drop the .sav file onto the .py file. When I do nothing runs. The .py file doesn't highlight which leads me to believe that there is no interaction happening.

Try convert sav to json but got error

image

I was running dedicate server on my PC and then power surge when come back it ask to create new character , I didn't do back up file but keep to corrupt file back up

How do I tell player name from the converted JSON from a player sav?

I'm trying to determine who is who by reading the JSON content.
Though we could guess by hair color, or technology tree or other factors like that, I read the file and couldn't find anything that looked like the player name, couldn't find the level either.
Any idea how that is encoded in the file?

char_map error

Using the latest version I see here. Im getting this on my Level.sav, corrupted or any suggestion ?

offset 1002377: StructType for ".worldSaveData.MapObjectSpawnerInStageSaveData.SpawnerDataMapByLevelObjectInstanceId.ItemMap.Value" unspecified, assuming Struct(None)
offset 1002657: StructType for ".worldSaveData.ItemContainerSaveData.Value" unspecified, assuming Struct(None)
offset 1353947: StructType for ".worldSaveData.CharacterContainerSaveData.Value" unspecified, assuming Struct(None)
offset 1362163: StructType for ".worldSaveData.GroupSaveDataMap.Key" unspecified, assuming Guid
offset 1362163: StructType for ".worldSaveData.GroupSaveDataMap.Value" unspecified, assuming Struct(None)

Loading JSON
Decoding GroupSaveDataMap
Decoding CharacterSaveParameterMap
Traceback (most recent call last):
File "C:\users\Wick\Downloads\palworld-save-tools-windows-v0.6\convert-single-sav-to-json.py", line 40, in
main()
File "C:\users\Wick\Downloads\palworld-save-tools-windows-v0.6\convert-single-sav-to-json.py", line 32, in main
decode_character_data(json_blob)
File "C:\users\Wick\Downloads\palworld-save-tools-windows-v0.6\lib\rawdata.py", line 132, in decode_character_data
char_map = level_json["root"]["properties"]["worldSaveData"]["Struct"]["value"][
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
KeyError: 'CharacterSaveParameterMap'

Add tests that run on each release

Add additional tests:

  • Verify all .sav files decode and encode properly
  • Verify save game binary is equal after a decode and encode cycle
  • Verify .bat files work on Windows

The converted file is invalid

Hello, after converting the Level.sav file into a json file using convert-single-sav-to-json.bat, I did not modify any data. Then, using the convert-single-json-to-sav.bat tool, I converted this json file back into a new Level.sav file and replaced the original game save with it. However, when I open the game and select this save file to enter the game, it gets stuck on the loading screen, completely frozen, and I have to use the Task Manager to close the game process.

I also noticed one thing: the original Level.sav file is a different size from the Level.sav file after two conversions. The latter is slightly larger.

tojson.log

not correctly handeling special characters in nicknames

i named my player \udb40\udc21\udb40\udc21 \u2067Alex
and well it does not correctly get handled it is able to create the dict no problem but crashes when trying to json.dump

so to replicate set ur player name to some special characters for example right to left overrideand it will crash when converting
dont really think its a problem with uesave since it handels it correctly just does not escape it but not sure

Converting a JSON to SAV seems to corrupt some characters

One player can't log back in my server. I suspect a character corruption. So I delete the .sav file associated with the player and modified the Level.sav to remove every instance of his GUID in the file. there was only 2. I convert the JSON back to sav using your tool, everything went well. I logged back in my character the world was working, my character was there, however 2 other player had lost their character. One was showing online in the game but has a UUID 0000000.

If you need my sav file to test stuff, I can provide them. I can help you debug stuff. I'm a software dev, but no experience with python. I can probably run the app in debug mode and check stuff. Anyway let me know what I can do to help fix this.

0.4.1 Error when dragging Level.sav ontop of it

Python 3.12.1 This will convert the save file "C:\Users\Phoenix\Downloads\palworld-save-tools-windows-v0.4.1\Level.sav" in JSON format in back to .sav format. This will overwrite your existing .sav file! Continue? [Y,N]?Y Loading JSON from C:\Users\Phoenix\Downloads\palworld-save-tools-windows-v0.4.1\Level.sav Traceback (most recent call last): File "C:\Users\Phoenix\Downloads\palworld-save-tools-windows-v0.4.1\convert-single-json-to-sav.py", line 39, in <module> main() File "C:\Users\Phoenix\Downloads\palworld-save-tools-windows-v0.4.1\convert-single-json-to-sav.py", line 28, in main data = json.load(f) ^^^^^^^^^^^^ File "C:\Users\Phoenix\AppData\Local\Programs\Python\Python312\Lib\json\__init__.py", line 293, in load return loads(fp.read(), ^^^^^^^^^^^^^^^^ File "C:\Users\Phoenix\AppData\Local\Programs\Python\Python312\Lib\json\__init__.py", line 341, in loads s = s.decode(detect_encoding(s), 'surrogatepass') ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ UnicodeDecodeError: 'utf-8' codec can't decode byte 0xd4 in position 1: invalid continuation byte Press any key to continue . . .
Save is from linux if that matters

Level.sav: UnicodeEncodeError

Hey there, thanks for your work
While trying to convert a level.sav, I stumble across that error
image

Which means the conversion is stopped around a value, perhaps having some strange character in there:
image

Syntaxt error in reader.py ?

Hi, I tryed to use the "convert-single-sav-to-json.bat" by drag and drop a sav file.
The program doesn't work and report a syntax error in the line 139 of reader.py.
I try to find it by myself, downloading again the 0.5 version, differents sav files but I have the same error again and again.
I don't know if I did something wrong or if I don't have the appropriate version for python (3.12)

image

Thank to your work and your help

Module Import Error

image

Python 3.12 is installed through microsoft store as recommended.

I attempted uninstalling python 3.12 from the store, then installing 3.12.1 from the python org directly. Same error.

I tried with both installed, and still the same error.

image

CMD Closes after Putting Save File In

Common issues before reporting

Have you modified the save files
No

Have you tried the latest release
Yes

Describe the bug
The cmd does nothing. I've installed python; both locally and via microsoft store to test.
I drag the save file over, and it automatically closes, causing no .json to be created.

I tried on another laptop, and only installed microsoft store python [3.12] - and same issue occurs.
Have tried multiple save files.

UnicodeEncodeError: 'utf-8' codec can't encode characters in position

Hi using Python 3.12.1 with latest release and my save is unmodified.

Getting an error when trying to convert Level.sav -
UnicodeEncodeError: 'utf-8' codec can't encode characters in position

I checked where it reached in the json file and it seems a players nickname is causing the problem.

I will attach both Level.sav & json
Uploading Level.zip…

Attach doesn't seem to be working, here's a direct link - https://lolcatho.st/cat/me0wy83.zip

Issue when running command

problem when running command to convert .sav. I have python installed from the link that the dev provided on info section. Screen shots below.

Screenshot 2024-01-26 125501
Screenshot 2024-01-26 130245

Cannot convert Json to Sav

image
There is a little problem when it comes to convert Json to sav...
The screen says it all, if anyone know the problem.

Permission Denied

Im trying to convert a player save file to json. It works initially but at a certain stage it says permission denied.

CMD closes after typing Y

Hello,

After this screen:
image

I type Y and the CMD closes, no JSON created.
I need to download something else?
UESave is correctly setup.

There's any way to check logs or so?

Handle GVAS parsing entirely in Python

Instead of delegating to uesave-rs, parse the save game entirely within Python so we can:

  1. Remove an external dependency on uesave-rs.
  2. Avoid shuffling around massive JSON strings and incurring encode/decode costs multiple times

Implementation: UGameplayStatics::SaveGameToMemory

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.