Fr33dan / GPSaveConverter

Utility to transfer save files between the games installed from the Xbox app and other storefronts. https://ko-fi.com/fr33dan
361 stars 36 forks source link

Wo Long Fallen Dynasty save transfer #45

Open dawson2938 opened 1 year ago

dawson2938 commented 1 year ago

Tell me what I could provide to help

daygr commented 1 year ago

So here's the save table:

## Xbox Files:
| Container Name 1 | Container Name 2 | Blob ID |
| ---------------- | ---------------- | ------- |
| SAVEDATA00       |                  | SAVEDATA.BIN |
| SYSTEMSAVEDATA00 |                  | SAVEDATA.BIN |
## Non-Xbox Files:
Non-Xbox save location: C:\Users\<USER>\Documents\KoeiTecmo\Wolong\Savedata\<STEAM_USER_ID>\
| File Path |
| --------  |
| steam_autocloud.vdf |
| SAVEDATA00\SAVEDATA.BIN |
| SYSTEMSAVEDATA00\SAVEDATA.BIN |

I was also able to get GPSaveConverter to link the files by adding a File Translation:

Non-Xbox file name: ${FileDir}\\SAVEDATA.BIN
Xbox Blob ID:            SAVEDATA.BIN
Container Name 1:   ${FileDir}
Container Name 2:
Named Regex Groups:
  [0] : (?<FileDir>[A-Z]+[0-9]+)

However, when transferring the SYSTEMSAVEDATA00 in either direction, the game starts and reports that the saves are corrupted and creates a new save. It seems like the SYSTEMSAVEDATA00\SAVEDATA.BIN file tracks SAVEDATA[0-9]+ and there is some method of linking the validity of the save (and this behavior is not compatible between game versions, or needs to be translated).

Update: I managed to brute force going from steam to gamepass with a hex editor. For anyone curious, here are the steps:

  1. Run the game on gamepass and create a sacrificial character
  2. Exit the game
  3. Start GPSaveConverter
  4. Select Wo Long
  5. Add a File Translation and configure it as I described above (Make sure View -> Show File Translations is checked).
  6. Click on "Explore Xbox Files" in the top right, which will open file explorer
  7. In file explorer, click in the path back one directory (will be a long string), then copy and paste to create - Copy directories, there should be two or three long string directories and a containers.index file.
  8. Use GPSaveConverter to move in SAVEDATA00\SAVEDATA.BIN from steam
  9. Check the GPSaveConverter.log file to find exactly which file changed
  10. Open the backed up (original) <changed file> - Copy\<long string> file in a hex editor (I used HxD), view with 64 bit rows
  11. Open the modified <changed file>\<long string> file in another hex editor (or HxD tab), view with 64 bit rows
  12. Copy the first row (64 bits) from the backed up original file into the modified file (overwrite)
  13. Start the game on gamepass

The load game screen will be all messed up until you actually load the game and touch a battle flag to save, but then once it loads in, my character progress and items are there. This does not sync achievements nor access to the theater FMVs, so I will have to test what happens as I play. Also, the game throws an error about not owning all the content if you are transferring between versions with different DLC installed, including (unfortunately) the Zhuque armor preorder bonus, which I have on steam but not on gamepass.

I also trivially reversed this process to go back to steam, just take note of the DLC differences.

For the scope of GPSaveConverter, I don't know if the application will handle hex editing, so this might be something that a save editor would be better at handling.

I made a short youtube video going over this, if it helps anyone https://youtu.be/NxaR4vi8xgw

szombi commented 1 year ago

@daygr thanks! I used this tool with Loop Hero, but your description helped me a lot!