News: 11 March 2016 - Forum Rules, Mobile Version
Current Moderators - DarkSol, KingMike, MathOnNapkins, Azkadellia

Author Topic: Please explain like I'm 5...  (Read 360 times)

Striking Clock

  • Newbie
  • *
  • Posts: 2
    • View Profile
Please explain like I'm 5...
« on: April 29, 2018, 02:08:04 pm »
I've been looking through the tutorials and documents on the site, including The Definitive Guide to ROM Hacking tables and other resources. I think I've gotten better at understanding how tables work.

What I'm having trouble understanding is what happens next. Do the utilities people use to edit tables let them edit whole pieces of text? It sounds like it's just individual characters, so how does translation happen from there?

What are the utilities people recommend? I'm not sure just which ones are good in 2018. If anyone has a comprehensive guide that explains how to make translation patches for dummies I'd appreciate it.

 :beer:

Jorpho

  • Hero Member
  • *****
  • Posts: 3801
  • The cat screams with the voice of a man.
    • View Profile
Re: Please explain like I'm 5...
« Reply #1 on: April 29, 2018, 08:26:19 pm »
As there is considerable variation between games, often editing comes down to making changes character-by-character.  For instance, if your translated text contains more characters than the text you want to replace, and it's followed by a different section of text, then you will have to edit a pointer somewhere so that the program knows the different section of text starts at a different point in the ROM than it originally did.  Makes sense?

Perhaps you could start by saying what ROM you're planning to edit?
This depresses me. I feel like a goldfish right now...

Disch

  • Hero Member
  • *****
  • Posts: 2597
  • NES Junkie
    • View Profile
Re: Please explain like I'm 5...
« Reply #2 on: April 29, 2018, 10:37:22 pm »
In the most simple case, text in the ROM is stored on a way where 1 byte = 1 character in the string.  So the word "hello" might occupy 5 bytes in the ROM, one for each character.

Which byte gets mapped to which character can vary depending on the game.  Table files tell the hex editor (or some other tool) which byte gets mapped to what character, so that the tool can display the text so that the user can read it without having to look at a sea of raw hex.

So the table file itself doesn't really do anything in the game, it just gives tools a way of interpretting the data in the game.  If you want to edit the text itself, you'll have to change the bytes in the ROM.  This can be done directly with a hex editor... and I would recommend making a few VERY SMALL changes with a hex editor once you find some text just so you can see how it works.

But don't get too married to a hex editor -- it probably should not be your primary tool.  They're great to see raw unfiltered data, but you almost NEVER want to do the bulk of the work in one directly.  There's a better way to go 99% of the time.

In the case of translations, using a hex editor or relative searcher can be helpful for finding the text data, but once you've found it you'll probably want to use a text extraction tool like Atlas* to dump all the text from the game (or as much as possible) into text files... edit the text files normally, the use the tool to re-insert the text back into the ROM.  Trying to edit the text directly with a hex editor (and adjust any pointers that need adjusting) would be positively dreadful.

*(I say Atlas because that's the only one I've heard of.  I'm not a translation guy so this is not my area of expertise -- there might be a better one available, but Atlas might be a good one to start with unless someone gives a better recommendation).

Psyklax

  • Hero Member
  • *****
  • Posts: 644
    • View Profile
    • Psyklax Translations
Re: Please explain like I'm 5...
« Reply #3 on: April 30, 2018, 02:20:11 am »
Okay, the other guys gave a good overview of where to go next, I'll just toss my two cents in.

First thing, get WindHex 32 EX, it's a bit old but it's the nicest table-supporting hex editor I know of. As Disch said, a table just says what each byte represents in a ROM, when those bytes are used to represent text. Those bytes tell the game which graphic to use for each letter on the screen. WH32EX is a good tool to use if you have figured out your table and want to edit some text to see how it looks.

You should pick the first line in the game and mess around with it to see what happens: how many characters per line, which bytes are used for control codes - to tell the game to move to the next line, or that it's the end of that dialogue - and so on. A lot of early work on a translation is experimentation. It's reverse engineering after all, so you try lots of things to see what you can and can't do with the game as-is. Though often you can get around things if you learn assembly, but let's figure out the basics first.

So, it would help to know exactly which ROM you're hacking, and which system it's for. That makes a big difference: a SNES RPG is a lot different to a NES action game, for example. If there isn't much text, you could probably just do it all with WH32EX, but as Disch said, anything bigger will probably be better done with a dumper/inserter. I use Pointer Tables which is in the database of this site, because it'll work for any game or system provided you know what you're doing. Everyone mentions Atlas but I haven't got it to work.

Of course, to use Pointer Tables, you'll need to understand what pointers are. :) They're just a bunch of bytes (one to three, generally) that say where some data is stored - usually text, but also other stuff. Basically, here's how games display text: the game will have a command to load the next character of text (it has to do it one at a time), and it will use a pointer to know where to find it. So if there's a pointer table, it will probably get the number of the dialogue used and say (for example) "load from $A472 plus whatever the dialogue number is". There it will find the pointer, which tells it where to find the first character. It'll then continue from there until it sees a byte that it knows means "this is the end of the text".

How to find pointers is the tricky thing. If you use a debugging emulator and can understand assembly, this isn't so hard, but otherwise you could try searching for the address of a line of dialogue, with adjustments (I'll say more when I know what you're hacking ;) ), and you might get lucky. Learning assembly is worth it, though

Hopefully that makes sense. It should give you a start, at least. :D

Striking Clock

  • Newbie
  • *
  • Posts: 2
    • View Profile
Re: Please explain like I'm 5...
« Reply #4 on: May 01, 2018, 05:33:09 pm »
Thank you for the explanations! I think I get it now  :thumbsup:

A couple of people asked about the game I want to translate. Right now I'd just be doing this for myself (I'm not very confident in my Japanese) so I was thinking of starting with Araiguma Rascal for the SNES. It's a puzzle game and I don't remember it having a ton of text.