Romhacking.net

Romhacking => Newcomer's Board => Topic started by: werewolfslayr925 on September 15, 2017, 02:34:33 PM

Title: Dragon Warrior 1 in Spanish
Post by: werewolfslayr925 on September 15, 2017, 02:34:33 PM
I noticed that the first Dragon Warrior has yet to be translated into Spanish and have taken up the task of translating it. I've got some basic menu stuff down using the DW Text Editor (http://www.romhacking.net/utilities/1290/), but I wonder if there's a better way to accomadate for the syntactical, grammatical, and spelling differences between English and Spanish by just editing the hex code in something like Hexposure. I've always been a bit bashful about going over the character lengths and how to make the game read properly when I do. Could anyone throw me a bone on this?

For the sake of example, would it be possible to shorten the spaces needed for Fairy ("Hada") and Wings ("Alas") in order to make two more spaces for Herb ("Hierba")? If so, how would I go about doing it without breaking the game, and would I use the same method for longer strings of text as in dialogue?
Title: Re: Dragon Warrior 1 in Spanish
Post by: Psyklax on September 15, 2017, 03:46:07 PM
I actually hacked Dragon Warrior to implement a DTE routine in order to replace the original English text with a better version, but I gave up after trying to hack the title screen and finding it harder than anticipated. You're welcome to use the routine in your hack, as it'll really help to fit a good Spanish translation in there. The text system is really simple (I didn't even know there was a utility for Dragon Warrior, I never use such things, just hex editors). Shall I share my work? :)

EDIT: I've just tested your theory of adding spaces to items, and can confirm that, since it's just as nice a system as the dialogue system, yes you can. :) The game simply knows which number item to pick, and counts the FF bytes as it goes. So for example when you get the Torch, the game counts the amount of FFs before it reaches what it believes is the text for Torch. So it doesn't matter how long each individual item's name is - in fact, you could max out lots of items and still have plenty of room, since there's lots of empty space at the end of the ROM bank. Looking at what's already in the game, seven is the typical maximum name, eight if it's unique I think (because seven is the maximum before hitting the number counter). Trying to get more than seven letters would require hex editing to do something to the menu.

EDIT2: the game stops counting after nine characters, so there's your limit. Of course, with some serious hacking, that limit could be removed... but I think you're better off naming everything within seven letters, to be safe. :)

EDIT3: Ignore what I said about 'empty space at the end of the ROM bank': that's where I put my DTE routine. :D Looks like you're stuck with the space you have there.
Title: Re: Dragon Warrior 1 in Spanish
Post by: werewolfslayr925 on September 15, 2017, 06:54:52 PM
Thanks, Psyklax! I would love to use what you've got. How shall we do the transfer? Also, sorry for the n00bish question: what's a DTE? And 9 spaces for items is usually more than enough. Between the DWTE and your tools, I should have a good setup. I've translated other stuff before—mostly academic stuff—and I wanna contribute something to this medium and to this community. (This should be less trouble and more reasonable than the Downtown Nekketsu Monogatari translation I've tried to cut my teeth on, no?)
Title: Re: Dragon Warrior 1 in Spanish
Post by: Psyklax on September 16, 2017, 03:59:48 AM
Take my advice: if you're serious about getting into ROM hacking, ditch those game-specific editors. There's nothing you can't do with a hex editor like HxD and WindHex32 EX. I'll give you everything you need to get started, just let me know if you have trouble.

First of all is my DTE routine, which stands for Dual Tile Encoding. Basically it means that instead of spending one byte spelling the letter 'a', you can have 'ab' with just one byte. This compresses the text significantly, meaning you should have no problem fitting all your text in the ROM. It works like this: each byte has 256 possible values. Since the English alphabet plus numbers and punctuation rarely needs more than 70 values, the rest are free to use. Some are reserved by the game (such as knowing where the line ends, for example), but the majority have no use, and can be used by a DTE routine instead.

Of course, you will need to know which pairs of letters are most common in order to make this work, because you need to write a table inside the ROM of all those pairs. Fortunately, our good friend KingMike wrote a simple program that takes your script and tells you the most common pairs:
http://www.romhacking.net/utilities/306/
Next you need a simple way of dumping the text and re-inserting it. Again, I've already done it here. :) I used a versatile program called Pointer Tables that will work with almost any game, provided you know how the game works:
http://www.romhacking.net/utilities/502/
In this case, I made a table file for all the text characters in the game, found the text and the pointer table for it, and dumped the text. To insert your own text, you just replace what's in the dumped text file with your own.

You can use a different table file of course, which you'll need for Spanish due to the accented letters. I imagine there's a few letters used in English which aren't necessary for Spanish, so you could replace them. Once the text is in there, it's just a matter of changing the pointers to reflect the new text, which thankfully is easier in DW than most other games.

You can get started without worrying about the whole DTE thing, but if you can make a complete script, you can use DTE-Opt to compile your table of pairs, then put it in the ROM, then insert the script with a new table file that includes the pairs (my routine allows between 81 and ED, any more and it would affect things the game uses). For now, don't worry about that, but I have included an IPS patch that takes an original DW ROM and inserts my DTE routine so that it's ready to go. I did the hard part of programming it, so at least that's done. :)

The patch will work on this ROM, though I'm sure you've dumped your own. ;)
GoodNES name: Dragon Warrior (U) (PRG1) [!].nes
CRC32: D4D5F5D7

Of course, if all this looks like too much to handle, you can just do the translation and I can put it in the game, but I imagine you decided to do this as hacking practice, so that would defeat the purpose. :D Regardless, here's a zip with everything you need: my DTE patch, a table file, and a dump of all the text in the game (it's actually not that much compared to some games). I didn't dump the items, because that would be better to edit within a hex program since there's so little text, and space is a concern.

As for programs, I recommend HxD for general hex editing, WindHex32 EX for editing little bits of text (like the item list), and the two programs from this site that I've already mentioned. You'll also need a tile editor like Tile Molester to draw new characters for your Spanish alphabet, but remember you're limited to removing existing letters, because unlike in a Japanese game, you don't have a huge syllabary to replace.

So here's the zip file, let me know if you have any questions! :)
http://s346165667.websitehome.co.uk/psyktrans/dw.zip
Title: Re: Dragon Warrior 1 in Spanish
Post by: werewolfslayr925 on September 16, 2017, 05:13:29 PM
Psyklax, you rock! I've already started working on translating the dumped text in the zip file. Considering work and life and such, it may be a bit before I have a full script. Once I do, though, if there's anything beyond me about the other tools, I'll ask. Do you prefer questions in this thread or via PM? Thank you so much for your patience with me and for your work on this. Again, you rock!
Title: Re: Dragon Warrior 1 in Spanish
Post by: Psyklax on September 17, 2017, 01:11:21 AM
Quote from: werewolfslayr925 on September 16, 2017, 05:13:29 PM
Do you prefer questions in this thread or via PM?

I thought about that, but decided it's best to stay in the thread as others might learn something too. :) Before you start translating, don't forget to look at the graphics, because I guess you'll need accents on letters, and there's no space for new letters.
Title: Re: Dragon Warrior 1 in Spanish
Post by: werewolfslayr925 on September 17, 2017, 12:55:00 PM
I thought the same thing about the thread  :)

I already edited the unnecessary characters in YY-CHR . Most of it was unnecessary punctuation (parentheses, semicolons, that double period thing) and unnecessary letters (capital X, capital W, lowercase  w; I plan to call Gwaelin "Laura" in line with the Japanese, and I can't think of any Spanish words that use those letters). If I need anything else, I think there are three spaces after the punctuation. Could I use two of those?
Title: Re: Dragon Warrior 1 in Spanish
Post by: Psyklax on September 17, 2017, 03:03:59 PM
Quote from: werewolfslayr925 on September 17, 2017, 12:55:00 PM
If I need anything else, I think there are three spaces after the punctuation. Could I use two of those?

If you check the table file, those byte values are already used for other things, so you should avoid them. In fact, just look at the table file and my explanation of it. You'll see that there aren't many things you can use (because 81 to ED are used by my DTE routine, and everything else is taken).
Title: Re: Dragon Warrior 1 in Spanish
Post by: werewolfslayr925 on September 19, 2017, 01:23:41 PM
Quote from: Psyklax on September 17, 2017, 03:03:59 PM
If you check the table file, those byte values are already used for other things, so you should avoid them. In fact, just look at the table file and my explanation of it. You'll see that there aren't many things you can use (because 81 to ED are used by my DTE routine, and everything else is taken).

Right. Duh. Sorry about that  :P Thanks for the tip to look at the .tbl

I managed to replace all of the unnecessary letters/punctuation as follows:

k = á
w = é
W = í
X = ó
Z = ú
; = ñ
( = ¿
) = ¡

(I kept capital K because of the town of Kol.)

I have officially run into my first major translation hack problem. There's a line that's called up whenever you try to use the Staff of Rain, the Stones of Sunlight, Erdrick's Token. In the script dump it comes up as:

[ME] held the [INV] tightly.%

The problem is that, grammatically, this line won't work in Spanish as gendered articles would have to be used (e.g. both "las Piedras del Sol" and "el Palo de Lluvia" respectively) lest it be a sloppy translation (e.g. "[ME] agarró Palo de Lluvia firmamente"). Perhaps using the dte, I could fit the articles into those item names (and only those item names?) in Spanish. The alternative would be to eliminate the line altogether and just have the "But nothing happened." ("Pero no ocurrió nada.") come up, an alternative for which I would need some instructions). Of course I would prefer to translate it as truly as possible to the "original" text, so it's probably better to go with the former if it's possible. What would you advise?
Title: Re: Dragon Warrior 1 in Spanish
Post by: Psyklax on September 19, 2017, 02:49:46 PM
I'm sure people translating into languages other than Japanese and English often encounter problems such as these. :) Japanese doesn't really inflect at all, and English only minimally (his/her for example), so a language like Spanish will have these gender problems. Trust me, it's nothing like the problems in Slavic languages like Russian (no articles, but three genders, gendered/numbered past tense, six noun cases...). :o I'm not sure how people manage when translating to Russian. Japanese and to a large extent English are very flexible in that you can just drop a word in somewhere and it'll be fine, but imagine your example with the staff: in Russian you'd need to change the item completely to be grammatical.

For example, let's say the item is "red book". In Russian, krasnaya kniga. But if you say "[ME] held the red book" it would be "[ME] derzhal krasnuyu knigu". Not only that, but "held" is in masculine, but if the player is female, it should be "derzhala".

Anyway, I'm rambling. :D What can you do? The easy option is simply to forget the article, even if it doesn't look so good. After all, "el Palo" just about fits in the inventory, but "las Piedras" doesn't. Option 2 is to widen the inventory to fit the articles, which would be nicer but would also require a good bit of hacking. I know this from doing it on Aighina's Prophecy. It was a lot of work, but it was worth it for me, because it widened the text window, allowing me to have more dialogue on screen.

So, if you think "[ME] agarró Palo de Lluvia firmamente" sounds bad, the only good option is to hack the item menu. Not impossible, but not easy. I noticed also that the text includes several cases of "thy [INV]", so unless you just ignored that in your translation, you couldn't use articles there anyway. I wonder what people usually do when translating English games to Spanish? Have you played any? (I haven't, of course)

Oh, and regarding using the DTE to fit the item names: that's not the problem. There are two space problems you worry about when translating ROMs: SCREEN SPACE and ROM SPACE. The problem with the dialogue is ROM SPACE, which is fixed by compressing the text with DTE. The problem with the menu is SCREEN SPACE, so any amount of compression won't help you, because it just won't fit on the screen (without hacking). :)
Title: Re: Dragon Warrior 1 in Spanish
Post by: werewolfslayr925 on September 20, 2017, 12:47:38 PM
Quote from: Psyklax on September 19, 2017, 02:49:46 PM
So, if you think "[ME] agarró Palo de Lluvia firmamente" sounds bad, the only good option is to hack the item menu. Not impossible, but not easy. I noticed also that the text includes several cases of "thy [INV]", so unless you just ignored that in your translation, you couldn't use articles there anyway.

I may just have to settle for a lack of articles, at least this time around. Perhaps after I'm done with my initial translation of the game and have set it down for awhile I can go back and revisit it to make it cleaner/more grammatically correct/accessible. Perhaps I could even up it to two versions: one with articles and proper grammar and one with fewer articles and less proper grammar (to keep the retro computer RPG feel).

As for the "Thy [INV]?" part, that probably suffers from the same problem but it's less problematic—at least in my mind/to my ears—considering the context of the question.

QuoteI wonder what people usually do when translating English games to Spanish? Have you played any? (I haven't, of course)

I've actually been meaning to download some of the spanish patches for other Famicom RPGs (e.g. Dragon Warrior III) to see how they translated certain things. Perhaps I'll do that this Friday.

QuoteOh, and regarding using the DTE to fit the item names: that's not the problem. There are two space problems you worry about when translating ROMs: SCREEN SPACE and ROM SPACE. The problem with the dialogue is ROM SPACE, which is fixed by compressing the text with DTE. The problem with the menu is SCREEN SPACE, so any amount of compression won't help you, because it just won't fit on the screen (without hacking). :)

Okay, so that brongs up a question, then. I was under the impression that the DTE would scrunch two letters together to make stuff fit better. I imagine diphthongs like "ia", "as", "ll", and "ie" would be pretty common in my script, so wouldn't "lluvia" and "piedras" be scrunched down at least a bit and be able to fit into the inventory screen? Perhaps I'll better understand how my script will work with the DTE once I see it in action?
Title: Re: Dragon Warrior 1 in Spanish
Post by: Psyklax on September 20, 2017, 03:09:43 PM
Quote from: werewolfslayr925 on September 20, 2017, 12:47:38 PM
I was under the impression that the DTE would scrunch two letters together to make stuff fit better. I imagine diphthongs like "ia", "as", "ll", and "ie" would be pretty common in my script, so wouldn't "lluvia" and "piedras" be scrunched down at least a bit and be able to fit into the inventory screen? Perhaps I'll better understand how my script will work with the DTE once I see it in action?

No, you're misunderstanding what Dual Tile Encoding is. As I explained before, when you look in the table file, each letter has a byte value assigned. It might be helpful to understand what exactly is happening inside the NES.

Basically, the CPU just reads a long continuous stream of "on and off" pulses, what we know as 1 and 0. These are bits, and to make our lives easier, they are organised into sets of eight, and called bytes. These bytes could refer to anything. They could be an actual number (so "05" could literally be the number 5 that is added to some other value) or it could represent something. In the ROM, you put a big chunk of bytes which are loaded into the PPU's RAM (picture processing unit) and the PPU interprets those bytes as pictures. Some of those pictures are letters, but that's arbitrary, they can be anything. They could be two letters in one block, if you can fit it (like "ll" for example).

The PPU has a separate part of RAM for what is displayed on the screen, called the name table. The collection of 16 bytes that create an 8x8 tile are referenced by another byte value, depending on where it is in RAM. So if one tile is stored in RAM between $0340 $034F, that will have the value $34. The CPU will receive a command from the game saying "put $34 in that position in the name table", it puts it there, the PPU sees it, and draws it on the screen.

What a Dual Tile Encoding routine does is take advantage of all the byte values that WON'T be used by a text routine, and instead taking them to mean two different tiles. These are still stored on screen in the same way, and stored in the VRAM in the same way. It doesn't save screen space. Instead, it saves space inside the ROM itself by needing fewer bytes to write dialogue. For example, the word "cat" would be normally three letters: in ASCII standard it would be 63 61 74 (note: very few games use ASCII standard for the bytes, at least in 8-bit consoles). But if the combination "at" is very common in our script, we could write is as 63 12, for example, using a byte that isn't normally used.

Of course, this varies from game to game, and you need some ROM space to not only store your newly-programmed routine, but also the table of two-character combinations. So, in my example, "at" would be combo number $12. For text-heavy RPGs like DW, the space you save through this is well worth it - but it doesn't save you screen space, as I said. You'd have to manually draw new tiles that have more than one letter in them. For example, in my Conan translation, I had tiles which had an apostrophe stuck in the corner, so that I didn't waste a tile on an apostrophe. That saves both screen and ROM space, obviously.

Sorry if that was a bit much, I just felt like explaining the whole idea in great detail. :) Hopefully it will help you understand what I mean by DTE. A note, however: you may be confusing it with Variable Width Font, or VWF, which DOES save screen space (not ROM space) by crunching the letters together. But this is almost impossible to use on the NES, and is only really seen on 16-bit consoles and up. The reason is the way graphics are produced: the tiles have to go into memory, then they have to go through a process where they're crunched together, then THIS has to go to the VRAM to go on screen. The NES simply doesn't have the memory or the layering to do this practically. It's not impossible, just impractical.
Title: Re: Dragon Warrior 1 in Spanish
Post by: filler on September 20, 2017, 03:24:21 PM
Quote from: werewolfslayr925 on September 20, 2017, 12:47:38 PM
Okay, so that brongs up a question, then. I was under the impression that the DTE would scrunch two letters together to make stuff fit better. I imagine diphthongs like "ia", "as", "ll", and "ie" would be pretty common in my script, so wouldn't "lluvia" and "piedras" be scrunched down at least a bit and be able to fit into the inventory screen? Perhaps I'll better understand how my script will work with the DTE once I see it in action?

I'm pretty sure what you're talking about here is called "squishy tiles". That's where you edit one of the font graphics to have two characters on it instead of one. From what you've said, there are probably no free tiles in the font left to do this with. DTE is where you represent two font tiles as a single byte instead of two bytes. It means your script is smaller, as in it takes up fewer bytes in the ROM.
Title: Re: Dragon Warrior 1 in Spanish
Post by: abw on September 20, 2017, 07:32:02 PM
Quote from: werewolfslayr925 on September 19, 2017, 01:23:41 PM
I have officially run into my first major translation hack problem.
[...]
The problem is that, grammatically, this line won't work in Spanish as gendered articles would have to be used
[...]
What would you advise?
Welcome to the art of translating ;).

In cases like this where the source language takes advantage of linguistic features not present in the destination language, you can also try completely re-wording the translated text to circumvent the problematic features. For example, could you use different translations for "Staff", "Stones", and "Token" that all use the same article (e.g. "la palmeta", "la piedra", and "la prenda")? Could you come up with a sentence that conveys the same meaning without requiring those pesky articles (e.g. "[ME] held the item '[INV]' tightly.")? Could you make some suitably generic text that doesn't rely on "[INV]" (e.g. "[ME] felt that this was not the right place to use that item.")?
Title: Re: Dragon Warrior 1 in Spanish
Post by: werewolfslayr925 on September 21, 2017, 03:59:39 PM
Quote from: Psyklax on September 20, 2017, 03:09:43 PM
What a Dual Tile Encoding routine does is take advantage of all the byte values that WON'T be used by a text routine, and instead taking them to mean two different tiles. These are still stored on screen in the same way, and stored in the VRAM in the same way. It doesn't save screen space. Instead, it saves space inside the ROM itself by needing fewer bytes to write dialogue. For example, the word "cat" would be normally three letters: in ASCII standard it would be 63 61 74 (note: very few games use ASCII standard for the bytes, at least in 8-bit consoles). But if the combination "at" is very common in our script, we could write is as 63 12, for example, using a byte that isn't normally used.

Of course, this varies from game to game, and you need some ROM space to not only store your newly-programmed routine, but also the table of two-character combinations. So, in my example, "at" would be combo number $12. For text-heavy RPGs like DW, the space you save through this is well worth it - but it doesn't save you screen space, as I said. You'd have to manually draw new tiles that have more than one letter in them. For example, in my Conan translation, I had tiles which had an apostrophe stuck in the corner, so that I didn't waste a tile on an apostrophe. That saves both screen and ROM space, obviously.

Sorry if that was a bit much, I just felt like explaining the whole idea in great detail. :) Hopefully it will help you understand what I mean by DTE. A note, however: you may be confusing it with Variable Width Font, or VWF, which DOES save screen space (not ROM space) by crunching the letters together. But this is almost impossible to use on the NES, and is only really seen on 16-bit consoles and up. The reason is the way graphics are produced: the tiles have to go into memory, then they have to go through a process where they're crunched together, then THIS has to go to the VRAM to go on screen. The NES simply doesn't have the memory or the layering to do this practically. It's not impossible, just impractical.

Okay, I think I get it now. So the DTE saves space computationally and it does so by:

1. Referring the program to an unused byte that
2. contains info that refers to two separate graphical tiles—in this case, tiles containing images for letters—which the game then
3. draws onscreen, but
4. never in a way that goes beyond the space that the game would normally allow for words.

Is that the gist of it?

Quote from: filler on September 20, 2017, 03:24:21 PM
I'm pretty sure what you're talking about here is called "squishy tiles". That's where you edit one of the font graphics to have two characters on it instead of one. From what you've said, there are probably no free tiles in the font left to do this with. DTE is where you represent two font tiles as a single byte instead of two bytes. It means your script is smaller, as in it takes up fewer bytes in the ROM.

This is exactly what I was thinking of. Thanks for clarifying that. Now I have a better idea of what to expect.

Quote from: abw on September 20, 2017, 07:32:02 PM
Welcome to the art of translating ;).

In cases like this where the source language takes advantage of linguistic features not present in the destination language, you can also try completely re-wording the translated text to circumvent the problematic features. For example, could you use different translations for "Staff", "Stones", and "Token" that all use the same article (e.g. "la palmeta", "la piedra", and "la prenda")? Could you come up with a sentence that conveys the same meaning without requiring those pesky articles (e.g. "[ME] held the item '[INV]' tightly.")? Could you make some suitably generic text that doesn't rely on "[INV]" (e.g. "[ME] felt that this was not the right place to use that item.")?

This is most likely possible and your suggestions of different vocabulary are simultaneously helpful and—in the case of "palmeta"—hilarious. "Una palmeta" could also mean "a caning" as in beating someone with a cane. I don't think that's the best way to translate the word, but it did lead me to another, much better candidate, "la caña", which literally means a cane and functions perfectly for "staff" in a fantasy setting. I'll have to see about "la prenda". Thanks for the tip/lead :3
Title: Re: Dragon Warrior 1 in Spanish
Post by: abw on September 26, 2017, 10:26:16 PM
Quote from: werewolfslayr925 on September 21, 2017, 03:59:39 PM
This is most likely possible and your suggestions of different vocabulary are simultaneously helpful and—in the case of "palmeta"—hilarious. "Una palmeta" could also mean "a caning" as in beating someone with a cane. I don't think that's the best way to translate the word, but it did lead me to another, much better candidate, "la caña", which literally means a cane and functions perfectly for "staff" in a fantasy setting. I'll have to see about "la prenda". Thanks for the tip/lead :3
You're welcome - those example translations were courtesy of some random English -> Spanish online dictionary, so definitely use your own best judgement when choosing appropriate Spanish vocabulary :D. Translating and romhacking are both pursuits that reward cleverness and creativity, so whenever you encounter an obstacle that seems insurmountable, don't be afraid to try thinking outside the box!
Title: Re: Dragon Warrior 1 in Spanish
Post by: werewolfslayr925 on April 08, 2018, 02:59:37 PM
Apologies to the mods and anyone else for the thread necromancy. Sorry this has taken so long, but I have indeed finished a draft of the translation of the text dump. Hopefully this excuses the resurrection of the thread.

Psyklax, now that I've translated the entire text dump you provided, I plan on having at least one person look over it for grammar/word choice/any errors. Let's assume it's done, though: what's my next step in the hacking process? Running the DTE?