fnr1r / kadishutu

A save editor for Shin Megami Tensei V: Vengeance.
2 stars 0 forks source link

Loading save files from versions of the game that contained DLCs #1

Closed abc159835 closed 1 month ago

abc159835 commented 1 month ago

I'm excited to find a Save editor for SMT5V, as I'm having problems with the Savefile transfer. Since the other version does not contain the DLC - 2 Sacred Treasure Sets and my Savefile contains the data for this DLC. Therefore the game cannot Load this Save. I am asking for help if I can remove the relevant data for compatibility. Thank you!

fnr1r commented 1 month ago

Thanks for reporting this.

Unfortunately, data about which save file requires DLCs is stored in SysSave.

But there is a workaround.

  1. Create a save file without the DLCs
  2. Replace that save file with the one you want to load
  3. It should work.

Also some notes:

  1. If you had the Gleam Grenade and Haraedo Bead, you'll keep them.
  2. Same goes for DLC-exclusive Demons.
  3. Once again, same goes for DLC quests.
  4. The Mitama spawn adjustment options will disappear and their spawn rates will return to normal.

This is because DLCs are just files that the game checks for before granting you the DLC bonuses.

I don't know what will happen if you load a save file on the Safety difficulty when you don't have its DLC. It might act the same, but it might not. It shouldn't be an issue if your save file was not on that difficulty.

While I did find some differences between DLC and non-DLC save files, the only thing that matters is the info in SysSave.

In conclusion, the workaround I mentioned should work. I'll try to find a way to decrypt and edit the SysSave file.

fnr1r commented 1 month ago

Update: The decrypt, encrypt and update_hash commands work on SysSave.

Finding where DLC ownership info is stored might not be as hard as I thought.

fnr1r commented 1 month ago

Turns out I'm wrong, but analyzing SysSave still gave me valuable insight.

You can now remove a DLC flag from a save file by running: kadishutu edit $FILE dlc remove "2 Sacred Treasures Set".

If you want to do this yourself, do the following:

  1. Decrypt the save file with kadishutu decrypt $FILE $TEMP_FILE.

  2. You previously played with all DLCs, which gives us 0b11111110 or 0xfe.
    Since the other version of the game doesn't have the "2 Sacred Treasures Set" DLC, we're subtracting 0x10000000 or 0x40. Maths time! 0b11111110 - 0b10000000 = 0b01111110 or 0xfe - 0x40 = 0x7e Change the byte at 0x529 from 0xfe to 0x7e.

  3. Run kadishutu encrypt --update-hash True $TEMP_FILE $FILE to re-encrypt the save file.

As mentioned in my previous comment, you'll keep the items. However, I don't know what will happen if you add that DLC back.

IMO: Wost case is you'll have two of those items.

abc159835 commented 1 month ago

Thank you very much for your help, it has given me a better understanding of the archive structure.

Maybe because I'm a fool, I tried many times but didn't succeed. I can assure you that I successfully ran kadishutu edit xxxx\GameSave01.sav dlc remove "2 Sacred Treasures Set". The output of the program was fine, and after checking through the GUI commands, "2 Sacred Treasures Set" was indeed not selected. However, the game still prompts that the save file contains unlocked DLC, even though I used kadishutu to remove all DLC.

Kadishutu works well for modifying demons, the changes were successful and displayed in the game. The Kadishutu GUI cannot open player info; it errors out when trying to fetch my player name.

You reminded me: For SMT5V, the game contains all the DLCs, no additional downloads are needed. So, since modifying the save data didn't work, I tried to trick the game into thinking I had the "2 Sacred Treasures Set" (as it was a pre-order bonus, it cannot be purchased now).

I used SmokeAPI (https://github.com/acidicoala/SmokeAPI) and successfully unlocked the "2 Sacred Treasures Set" DLC. At the same time, I noticed that a DLC named "Japanese Voice Pack" was also unlocked.

That's strange, isn't the Japanese voice pack supposed to come with the game?!

Here is the relevant information from SmokeAPI when unlocking the DLC:

🟩│ 15:14:06.946 │  85:steam_apps.cpp           ┃ ISteamApps_BIsDlcInstalled -> App ID:  1875830, DLC ID:  2107724, Unlocked: true
🟩│ 15:14:06.946 │  85:steam_apps.cpp           ┃ ISteamApps_BIsDlcInstalled -> App ID:  1875830, DLC ID:  2107723, Unlocked: true
🟩│ 15:14:06.946 │  85:steam_apps.cpp           ┃ ISteamApps_BIsDlcInstalled -> App ID:  1875830, DLC ID:  2107722, Unlocked: true
🟩│ 15:14:06.946 │  85:steam_apps.cpp           ┃ ISteamApps_BIsDlcInstalled -> App ID:  1875830, DLC ID:  2107721, Unlocked: true
🟩│ 15:14:06.946 │  85:steam_apps.cpp           ┃ ISteamApps_BIsDlcInstalled -> App ID:  1875830, DLC ID:  2106500, Unlocked: true
🟩│ 15:14:06.946 │  85:steam_apps.cpp           ┃ ISteamApps_BIsDlcInstalled -> App ID:  1875830, DLC ID:  2107720, Unlocked: true
🟩│ 15:14:06.946 │  85:steam_apps.cpp           ┃ ISteamApps_BIsDlcInstalled -> App ID:  1875830, DLC ID:  2107725, Unlocked: true
🟩│ 15:14:06.946 │  85:steam_apps.cpp           ┃ ISteamApps_BIsDlcInstalled -> App ID:  1875830, DLC ID:  9999999, Unlocked: true
🟩│ 15:14:06.946 │  85:steam_apps.cpp           ┃ ISteamApps_BIsDlcInstalled -> App ID:  1875830, DLC ID:  9999999, Unlocked: true

Thanks again for your help, without your kindness, I wouldn't have been able to successfully transfer the game save. :)

fnr1r commented 1 month ago

I'm glad it worked out in the end.

Editing the player's name is broken, so the GUI doesn't write it to the file.

Could you give me the value at 0x529?

The 0th bit of this value is always unset for me, but I think it might be related to the Japanese Voice Pack DLC. I think Atlus may have wanted to make it a separate DLC, but decided not to and just included the data in the game. SmokeAPI detects that the game checks for a non-existent DLC but still unlocks it.

abc159835 commented 1 month ago

the value is 0xFE

fnr1r commented 1 month ago

Oh. I guess I was wrong. Thanks anyway.

abc159835 commented 1 month ago

I have just created a new save file, and without using SmokeAPI, the "2 Sacred Treasures Set" is indeed locked; the value changed from 0xFE to 0x7E.

Offset      0  1  2  3  4  5  6  7   8  9  A  B  C  D  E  F

00000520                            00 7E 00 00 00 00 00 00 

Comparing it to the state where all DLCs are unlocked:

Offset      0  1  2  3  4  5  6  7   8  9  A  B  C  D  E  F

00000520                            00 FE 03 00 00 00 00 00

I noticed a change in the value at offset 0x52A. After synchronizing the modification at offset 0x52A, it worked, and the save file loaded successfully without SmokeAPI being enabled.

By the way, after re-unlocking the "2 Sacred Treasures Set," I didn't receive duplicate items. :)

Thanks!