Romhacking => Newcomer's Board => Topic started by: Madarina on June 20, 2021, 06:39:12 am

Title: Help with translating Fire Emblem: Genealogy of the Holy War to another language
Post by: Madarina on June 20, 2021, 06:39:12 am
Hey everyone,

as you can probably see, I'm pretty new to this forum. However, I already managed to teach myself some of the basics, such as how to calculate binary and hex values as well as some theoretical knowledge, and I did so with a specific purpose in mind: Making a full translation of one of my favorite games ever, Fire Emblem: Genealogy of the Holy War.

But first things first: The language I'll be translating to is German, and since Genealogy received an excellent English translation with Project Naga back in 2016, I'd love to take it as the basis for my own. If any of the original creators of Project Naga are on here, I hope this is okay with you. If not, please contact me - I've no intention to steal your work.

As for the translation itself, it's pretty much already done: I did the biggest chunk of it in last year's summer, and the only thing that's left is pretty much item names, menu texts, some additional special quotes as well as back-checking some of the scripts of the newer version (I worked with an older version for a very long time without realizing, and I admittedly have some issues with some of the newer texts). So what I basically need to do right now is trying to hack the text into the ROM.

After quite some time experimenting, I managed to put a basic table together, so I can at the very least look at the text in the ROM. However, I've run into some issues while trying to edit it:

1. After confirming I can edit text with my hex editor by changing a line in the game to complete nonsense, I thought a good place to start before I begin working with huge chunks of text would be the weapon names. I soon realized there are multiple places in the ROM where the weapon names are stored, and not always in the same way. There are at least three major "sections" with weapon names, one with all of the names written out (Iron sword, Steel sword, Silver sword, etc.) and two others where the weapon names are kinda abridged/cut off and have some coding in front of them (e.g. Iron swo, Steel sw, Silver s, etc.). I assume this is because of the original text limitation, and that the coding in front of those is some sort of pointer or code for the graphical item images. Anyway, I tried to hack the written-out names first, as those are the ones that appear in the translation. I did my best to keep all the coding intact (there's a 0x01 behind each of those names, and I put that back in after changing them), but it had no effect on the in-game text. So I tried both of the other offsets next (not typing in the full name, just a few letters to see if it did anything), but nothing happened. I started looking for pointers with Lunar Address for a bit (apparently, it's ExHiROM), but if at all, the only thing I found is a pointer table (first hex value repeated, increasing second value) for the section with the full names, which would make sense as those are the ones displayed in the game. Still, I've no idea what I'm doing wrong, since the text I edited simply won't show in the game.

2. Since the German language has umlauts such as Ä/ä, Ö/ö, Ü/ü and ß, I'll eventually have to add those to the game's font (though this is probably something I'll do a little later on, as it requires getting a bit more familiar with tile editing). However, coincidentally, Project Naga already uses some umlauts/accented letters in its font, such as ö in Mjölnir and á in Gáe Bolg. I found out the hex values for those too, but when I added them to my table, my table making program (Oriton) told me that the characters can't be saved and will be lost if I do so. I tried saving it anyway, but in the hex editor, the ö is only displayed as a normal o and the á likewise as a normal a, even though these characters are obviously part of Project Naga's font. Is there a way to display them correctly? Do I need a special table format that supports umlauts?

For now, I'd be very grateful if anyone could at least answer me these questions. If one of those was already answered in another thread/tutorial, feel free to point me to it.



Software used:

Fire Emblem: Seisen no Keifu ROM (unheadered)
Project Naga Patch Beta 7
Lunar IPS
WindHex32 (hex editor)
Lunar Address
Monkey-Moore (relative searcher)
Oriton (table maker)
Title: Re: Help with translating Fire Emblem: Genealogy of the Holy War to another language
Post by: Vehek on June 20, 2021, 11:30:18 am
On problem 2:
Odd. Oriton should only display that warning if the characters aren't in the selected code page (the text encoding of a text file - not the game's).
On my system, the default setting of "1252 (ANSI - Latin I") works fine when saving those umlauted letters. If that really doesn't work for you, then try changing the code page to a unicode one. Just remember to always set the code page to the one you changed it to before opening the table file again in the future.
Edit: But then changing it to unicode makes it not display correctly in WindHex because of the differences between the codepages.
Maybe you should switch to using a dedicated tool to dump or insert text rather than a hex editor with such limited adjustability in how it displays text.
Title: Re: Help with translating Fire Emblem: Genealogy of the Holy War to another language
Post by: Madarina on June 21, 2021, 06:28:58 am
Odd. Oriton should only display that warning if the characters aren't in the selected code page (the text encoding of a text file - not the game's).
On my system, the default setting of "1252 (ANSI - Latin I") works fine when saving those umlauted letters.

Ah, that did the trick. For whatever reason, it had Cyrillic selected as the text file's setting. No idea why. Anyway, thanks a bunch! :thumbsup:
Title: Re: Help with translating Fire Emblem: Genealogy of the Holy War to another language
Post by: Madarina on July 04, 2021, 04:11:42 am
So, it's been a while, and since I've made at least some progress solving my problems, I think it's time for a quick update.

First off, I finally decided for a tile editor to work with (YY-CHR), and if anything, I figured I could start looking into how to add the infamous umlauts to the graphics. The first thing I noticed while looking for the letters in the tile editor was that they're basically split into two halves. The upper halves are always displayed in a 8x8 box on the left, while the bottom halves are displayed in the same kind of box on the right. I've no idea whether there's any way I can get the letters display as a whole (at first, I thought the tile format was too small). I was very confused by this, but after some time, I realized the letters were ordered the same way as those in my table.

So I started adding the characters to my table in same order as they are in the editor, and guess what! I stumbled upon some already implemented umlauts: Ä/ä, Ö/ö, Ü/ü and even ß! And after quite some trial and error, I can even use them in the game's text now! I never would've expected the patch to already include so many umlauts, especially ß, so huge, HUGE thanks to the people of Project Naga! You guys saved me a lot of work here.

With that problem out of the way, I'm still struggling with the weapon names, though. I started reading some stuff about pointers, and after experimenting around a bit, I managed to make out the text pointer for the weapon names on the menu. It was indeed in one of the sections with the abridged names, and I think I figured out more or less how it works by now. I'll take the pointer for the Iron sword as an example:

1)        2)         3)

The first byte (1) indicates how long the text displayed on the screen is (if I change the number, the text looks distorted). The second row of bytes (2) is the actual pointer (I tried this out by changing 0x20 to a lower number, and the text promptly disappeared from the screen). I'm not entirely sure what the purpose of the last two bytes is (3) as changing them had no effect on the in-game text, but since the 0x57 from the pointer is also in there, I'd suspect they are corresponding bytes in some way.

Now for the difficult part: I can't seem to change the pointer to get it to display the text that I want to. The sections with the weapon names all happen to be stored in the same bank (0x506700 for the full names and 0x504000 for the pointers), so that technically shouldn't be a problem. The full name for the Iron sword starts at 0x506700, and if Lunar Address is correct, the pointer for that should be 0x00 67. So I tried changing the pointer 0x205706 to 0x006706, but all I got was something that looked like stuck-together graphic data. I tried it out with 0x670006, but all I got was six vertical lines where the text should be. I then changed the very first byte (1) to 0x67, only for the lines to spill over the entire screen with a cut-off "Healthy" in the weapon name's place.

Since you normally would find the word Healthy in another place on the menu, I've got the sinking feeling that the menu text seen in game might actually not be stored as text, but as graphic data. If that's the case, this whole thing just got a lot more complicated, especially since all of the letters/words in the tile editor are still cut in two. Is it possible to at least make them appear complete in some way? Because I don't think I'm going to get very far if I just have to piece them together in my head all the time.