How can I rename my characters in Secret of Mana?

Started by Wolfric, January 07, 2023, 12:04:19 PM

Previous topic - Next topic

Wolfric

I found a tool someone made to rename the characters and edit other tidbits, but it only works on the unmodified ROM's save files.

I'm currently playing Secret of Mana: Relocalized and the tool won't load the save for editing.

Is there any way I can edit the characters' names through Hex or something?
Join 7th Heaven, a JRPG/ARPG Discord Server! https://discord.gg/KYCNqCnCQn

Jorpho

Sure, through "Hex or something". :P

It might be useful for starters if you provided a link to this tool you found.

In some cases, editing save data is relatively straightforward, but sometimes save data is protected by a checksum, in which case one must determine the checksum algorithm and then re-calculate the checksum whenever one makes a change. (Alternatively one can conceivably deactivate the checksum verification in the ROM, but that's not necessarily much easier.)

In cases where a checksum is involved, sometimes it is easier to make an emulator save state and then edit the names in RAM, where they are unlikely to have any similar protections.
This signature is an illusion and is a trap devisut by Satan. Go ahead dauntlessly! Make rapid progres!

xenophile

Quote from: Wolfric on January 07, 2023, 12:04:19 PMIs there any way I can edit the characters' names through Hex or something?

Short answer is "no".

There are two issues:

1) Save games almost always have a checksum or other mechanism to know if they've been changed. This isn't specifically to prevent you from editing your save, but because battery backed saves on a cartridge aren't 100% foolproof and they want to prevent loading a corrupted save.

2) The fact that the tool you are using is failing means Relocalized has made some sort of change to the save file. It's likely that using the tool to edit it really would corrupt your save, and it's doing the right thing.

That said, it's likely that the names haven't actually been moved in the save (or you'd be able to find where they've moved by creating a save with the same names in unmodified SoM and comparing them in a hex editor), and if you can find documentation on the checksum location and calculation, you could pull this off. But it might be easier to just restart your game.

Wolfric

Quote from: Jorpho on January 07, 2023, 01:19:33 PMSure, through "Hex or something". :P

It might be useful for starters if you provided a link to this tool you found.

In some cases, editing save data is relatively straightforward, but sometimes save data is protected by a checksum, in which case one must determine the checksum algorithm and then re-calculate the checksum whenever one makes a change. (Alternatively one can conceivably deactivate the checksum verification in the ROM, but that's not necessarily much easier.)

In cases where a checksum is involved, sometimes it is easier to make an emulator save state and then edit the names in RAM, where they are unlikely to have any similar protections.

This one's the tool! https://www.zophar.net/utilities/snescheat/secret-of-mana-save-state-editor.html

I'm assuming Relocalized alters the save file due to the "Lowercase naming" option, which is the only thing I think could alter the save file from what it contains. I'm assuming the names haven't been moved, but the tool just won't accept the ".zst" due to differences.
Join 7th Heaven, a JRPG/ARPG Discord Server! https://discord.gg/KYCNqCnCQn

Jorpho

Quote from: Wolfric on January 07, 2023, 01:54:46 PMI'm assuming the names haven't been moved, but the tool just won't accept the ".zst" due to differences.
This is significant information. ".zst" is an emulator save state, as opposed to .srm, which would be actual save data.

The quick-and-dirty solution here would be to start a new game, give your character a name like AAAAAA, and create a savestate. Then start another new game, give your character a name like BBBBBB, create another new savestate at the same point in the game, and then compare it to the first one. There will probably be many differences due to the nature of save states, so you might have to repeat this process until it is clear where the name is stored.

Eventually, you will hopefully be able to start a new game, give your character the name you want, identify the particular bytes in the savestate corresponding to that name, and insert the bytes appropriately into your ongoing game.
This signature is an illusion and is a trap devisut by Satan. Go ahead dauntlessly! Make rapid progres!

Wolfric

Quote from: Jorpho on January 07, 2023, 05:55:01 PMThis is significant information. ".zst" is an emulator save state, as opposed to .srm, which would be actual save data.

The quick-and-dirty solution here would be to start a new game, give your character a name like AAAAAA, and create a savestate. Then start another new game, give your character a name like BBBBBB, create another new savestate at the same point in the game, and then compare it to the first one. There will probably be many differences due to the nature of save states, so you might have to repeat this process until it is clear where the name is stored.

Eventually, you will hopefully be able to start a new game, give your character the name you want, identify the particular bytes in the savestate corresponding to that name, and insert the bytes appropriately into your ongoing game.
I actually did something and compared the OG .zst with a .zst edited with the Save Editor, so name went from WOLFY to RANDI and these were the only differences between the two .zst files in hxd:

AC 9B A8 9E A3
B1 A9 A6 A0 B3

Ah, if only I could understand scribbles
Join 7th Heaven, a JRPG/ARPG Discord Server! https://discord.gg/KYCNqCnCQn

Jorpho

Quote from: Wolfric on January 21, 2023, 12:09:39 PMAh, if only I could understand scribbles
Like I said, you don't even need to do that in this case. If you replace AC 9B A8 9E A3 with B1 A9 A6 A0 B3, does it change the name like you want?

In any case, the encoding is dead obvious. If A9 if O, A6 is L, and A8 is N, then what could A7 possibly be?
This signature is an illusion and is a trap devisut by Satan. Go ahead dauntlessly! Make rapid progres!

Wolfric

#7
Quote from: Jorpho on January 21, 2023, 01:57:21 PMLike I said, you don't even need to do that in this case. If you replace AC 9B A8 9E A3 with B1 A9 A6 A0 B3, does it change the name like you want?

In any case, the encoding is dead obvious. If A9 if O, A6 is L, and A8 is N, then what could A7 possibly be?
Oh damn, somehow my stupid ass didn't think of the possibility of it being encoded, despite even making some damn gecko codes before.🥴

EDIT: Found it all! Through hxd.

Wish I could make this into a code but that's beyond my expertise, but the names are:

0000D810 03 has Randi's name (6 characters are stored for Randi)
0000D810 0F has Primm's name (6 characters are stored for Primm)
0000D820 0B has Popoi's name (6 characters are stored for Popoi)
Join 7th Heaven, a JRPG/ARPG Discord Server! https://discord.gg/KYCNqCnCQn

phonymike

The easiest way to do this would be to copy your .srm (battery backup file) and the relocalized ROM into a folder and run the game using Zsnes. Go to a save point at an Inn, but don't save the game yet, just make a savestate. Then edit the savestate with the savestate editor to make the names the way you want them. Then load the modified savestate in Zsnes, and save your game at the Inn like you normally do (saving at the Inn is when the game fixes the checksum).

Another method would be to use an emulator like Mesen-S, and open the memory tools, and select Save RAM in the dropdown menu. The locations for the names are
03 boy's name
0F girl's name
1B sprite's name

I have these values written down for what each letter is
 81=a - 9A=z
 9B=A - B4=Z
 B5=0 - BE=9

You can manually enter these letters into the Save RAM location of the game ($30:6000), only use 6 letters per name, and then save your game at the Inn and then you'll have your modified .srm file.

Lastly if you want to use a hex editor to change the names, you'll still need to fix the checksum of the .srm file or the game will think it's corrupt and it will erase all your saves. I wrote a program here. It's a command line program, if you don't know how to use a command line program you can just drag and drop your .srm file onto snessum.exe and it will fix the checksum and make the save game work.

Jorpho

Quote from: phonymike on January 22, 2023, 02:10:32 AMThen edit the savestate with the savestate editor to make the names the way you want them.
If I'm not mistaken, the whole issue is that the savestate editor does not work with savestates made with the relocalized version.

QuoteI wrote a program here.
Have you considered uploading that to RHDN? Looks like it might be handy. (Is it compiled for Windows, or does it need DOSBox?)
This signature is an illusion and is a trap devisut by Satan. Go ahead dauntlessly! Make rapid progres!

Wolfric

Quote from: phonymike on January 22, 2023, 02:10:32 AMLastly if you want to use a hex editor to change the names, you'll still need to fix the checksum of the .srm file or the game will think it's corrupt and it will erase all your saves. I wrote a program here. It's a command line program, if you don't know how to use a command line program you can just drag and drop your .srm file onto snessum.exe and it will fix the checksum and make the save game work.
Interesting! So here you're actually editing the .SRM directly, and then fixing the checksum of it.

Quote from: Jorpho on January 22, 2023, 01:25:47 PMIf I'm not mistaken, the whole issue is that the savestate editor does not work with savestates made with the relocalized version.
Pretty much this. lol
Join 7th Heaven, a JRPG/ARPG Discord Server! https://discord.gg/KYCNqCnCQn