Page 1 of 1

Adding characters in game code

Posted: 03 Aug 2024 12:22
by il.barbe
Hello everybody,
I'm quite new to all of this so this may sound silly, but is there any way to add characters in a code without breaking the game? What I'm doing is translating a videogame (the procession to calvary) into Italian, the problem is that there are some expressions in English that are way shorter than in Italian and I was trying to figure out if there is a way to (I guess) rewrite the code without making it too much of a nightmare. Pretty sure it can't be done but I still have some hope, thanks in advance!

Re: Adding characters in game code

Posted: 07 Sep 2024 12:15
by Paxtez
It's pretty difficult. The problem with inserting characters is that it shifts everything forward, so all the references to specific memory locations won't work. If you decompile the code, it's maybe possible to recompile it with adjusted offsets. But it's more often done with jumping in the code. You basically manually enter JMP assembly commands to go to a part in memory that isn't used, you overwrite it with new code, and then jump back to where you jumped from.

You might be able to to update the pointer. The game I mess with stores most of the strings in a big block, so you can find the part of the code that points to a specific string, edit that to point to another location where you have your desired longer string.

Re: Adding characters in game code

Posted: 07 Sep 2024 14:50
by Vag.GreekRoms
I have translated almost 40 (retro) games to Greek. You can, in general.
I don't know that game, but maybe you should start with some old games, so you gain some experience, it will help a lot. I suggest old NES/Gameboy/Master System, or even SNES/Genesis games. The reasons are that they will be easier, there will be no compression (some SNES/Genesis games use compression, some don't), and also, you'll have the right tools.
As for what you asked, to edit the letters and characters, you shouldn't use a hex editor, but a tile editor. A program that shows the bytes as graphics, with many different ways - and if you're lucky, in a non-garbled way. I strongly suggest Tile Molester for this! (e.g. this version https://www.romhacking.net/utilities/515/).
There may be plenty of available tiles for extra characters, or none at all, it depends on the game. You might need to edit existing letters that you don't need, even use one character for zero and O... Keep in mind that you don't have to use ASCII, you can change the order of the characters as you like - but if you do, an ASCII hex editor, like the excellent HxD, won't help you with the text. You will have to use a hex editor that supports tables, like Thingy32 (https://www.romhacking.net/utilities/570/).
But first of all, I suggest to read every rom hacking document and tutorial you can find ;-)