Skip to content

Tutorial: Translating EarthBound

tragicmanner edited this page Apr 24, 2015 · 8 revisions

Translating EarthBound

This guide aims to help anyone who would like to translate EarthBound into another language, dialect, or even create an alternative English version of EarthBound by following these steps:

  • Translate the main game text
  • Translate items and enemies
  • Translate and adjust menus
  • Translate/Modify game sprites
  • Translate/Modify game map tiles
  • Modify game fonts
  • Export and Modify compressed graphics

If any of that sounds confusing or difficult, don't worry! I'll do my best to describe each process in detail, and I'm available to help anyone who may have any questions about how to translate EarthBound, and there are a ton of great people who can help at the PKHack help thread.

Things to Consider

Before you begin, let me outline some potential problems with translating EarthBound so you can determine whether or not your language will work out.

  • This process currently does not support printing text from Right to Left - This could eventually be fixed someday
  • This process only allows for up to 128 characters TOTAL, including punctuation and formatting characters - As far as I can tell, 128 characters is the absolute limit in EarthBound, though in theory the game could someday support up to 176, it is probably not a simple process, but I will look into it if someone really needs more than 128 characters

Trying Out Your Translation

Compiling Your ROM

Now that you have edited a line that you can easily find in the game, save your changes and go into CoilSnake once more. Before getting started, you'll need to copy your EarthBound ROM:

  1. Copy your EarthBound ROM and rename it to something like EarthBoundExpanded.smc
  2. Click on the Compile tab in CoilSnake
  3. Click on the "Browse..." button next to the Base ROM field
  4. Find the ROM you renamed to EarthBoundExpanded.smc
  5. Click on "Browse..." next to the Project: field and navigate to your project folder
  6. Click on "Browse..." next to the Output ROM: field and create a new file with whatever name you want
  7. Click on the big "Compile" button
  8. CoilSnake will ask you if you want to expand your ROM. Say yes and it will expand your EarthBoundExpanded rom for you
  9. Now sit back and let the compilation process complete

Watch a video of these steps: http://youtu.be/cjVKUQSSkhQ

Now open up the newly created file with an emulator, and you'll be testing out your translation!

A Note on Testing

Verify your translation often by compiling and then running it periodically. This will allow you to catch any errors you may have caused or see if you made any mistakes while translating. If you have any problems, ask a question at the help topic on the PK Hack boards.

A NOTE ON LETTERS

If your language uses characters outside of the 26 letters that English uses you will need to modify the font to support your language's character set. I will go over this in the section "Modifying game fonts". For now, you should do two things: First, test that a simple change that only involves the Roman alphabet works when you compile. Then, go ahead and start translating and using your full language's character set in the ccs files when you translate them. Once you use any character outside of the Roman alphabet (such as ã in Portuguese), your game text will no longer compile, but that's okay. We'll go over how to fix this in the Font section.

Translating Items and Enemies

This is probably one of the simplest steps! All you have to do is edit:

  • enemy_configuration_table.yml
  • item_configuration_table.yml

Simple, right!

Enemy Configuration Table

This file contains information about all the enemies. Each enemy is represented by a number value, followed by all their attributes, such as Name, their Vulnerabilities, Item dropped, etc.

For a translation, there are only TWO attributes you need to change for an enemy:

  • Name
  • Gender

BUT WAIT?! Why would I change an enemy's gender?!

In English, when you use an article to refer to someone or something, you might use something like 'the' or 'a'. Articles in English do not reflect gender. But in other languages, articles can.

If your language DOES reflect gender in an article, then I would change the gender of the enemy to match what an article would indicate. For most enemies that are people, this will likely be the same gender as the individual. But with a lot of the animal, robot, or even abstract enemies, the gender will depend on the NAME. For example, in Portuguese, if I'm referring to a Coil Snake (which is called a Cobra Espiral), the name Cobra Espiral is feminine, and so I set the gender for the Coil Snake to be female. If your language also has neutral reflection in articles or verbs or any other type of word, you can use that as well.

EarthBound supports three gender options:

  • male
  • female
  • neutral

In my translation, since Portuguese doesn't need the neutral form, I used neutral to indicate that the enemy's name is a proper noun. This allows me to provide options in the text to NOT include an article when referring to the enemy.

Modifying Game Fonts

Just a reminder: Make sure you are using at least CoilSnake 2.1 for the following to work.

First off, you are going to need to get a graphics editing program. Photoshop works perfectly, but you can also use the free version of GraphicsGale.

Preparing Your Font Images

The first step to expanding your font is making more space for fonts in your images. Luckily, CoilSnake does this for you! Here are some things to keep in mind:

  • The main three fonts (fonts 0, 1 and 2) are made up of 16 x 16 pixel tiles
  • Font 3 is made up of 8 x 16 pixel tiles
  • Font 4 is made up of 8 x 8 pixel tiles
  • The normal fonts are made up of 6 rows of 16 characters, making a total of 96 characters
  • The credits font doesn't follow this pattern, and we will not be expanding it
  • CoilSnake 2.1 will expand the font images to allow for an additional 32 characters in each of the main fonts (0-4)

Editing Your Fonts:

Okay, so, you're using CoilSnake and your font images all have some extra space on the bottom. Using the information I provided just above, map out where all the tiles are in each of the different images.

This can be done in Photoshop by going to Edit > Preferences > Guides, Grides & Slices

  • Under the Grid section, set Gridline Every: to the size that fits your font
  • For fonts 0, 1, and 2, that's going to be every 16 pixels
  • For fonts 3 and 4, I used every 8 pixels, just remember that font 3 the characters are 16 pixels tall, so two 8 pixel boxes represent a single character
  • Set the color to something easy to see. I usually use red

In GraphicsGale, you can do this by selecting the "Custom Grid" (looks like a grid made up of little white squares) and choosing which grid you want to use.

  • For fonts 0, 1, and 2 I use the 16x16 custom grid
  • For fonts 3 and 4 I use the 8x8 custom grid
  • Remember that font 3 is 8x16, so each character will be 2 8x8 blocks tall, and 1 block wide

Now that you can see where each tile is, edit the tiles with your language's characters. If you plan on using the original 96 characters in EarthBound, simply leave them as they are and draw your new characters in the 32 new font tiles.

You can also edit the entire font if you'd like by filling in all the original characters with the background color and drawing in your own custom font.

The ONLY thing you should remember is that EVERY FONT needs to follow the same pattern. The same position in each of the fonts should all have the same character in them for the sake of consistency.

So... Why do I have to make all the fonts follow the same order?

Not doing so can cause quite a bit of headache, especially because font 0,1, 2 and 3 can be used to display character names, fonts 0 and 1 are going to show item names, and font 4 is going to be used for some UI stuff, mainly headers for some windows in the game. So a lot of these fonts display shared text, and if the order of your characters is different between the fonts you can get some funky results where you aren't expecting them.

There has been a lot of discussion about using portions of the Mr. Saturn font for additional characters. I tried this, and it just didn't work out. Basically I was using the lowercase letters in the Saturn font (because they are identical to the uppercase letters) and re-purposing them for other characters. The problem is, if you go to a Mr. Saturn to sell it an item, it will confirm the item you want to sell using the saturn font. And item names have lowercase letters. So the lowercase letters would all come out as my additional characters and that's ugly.

Additionally, if you have any names for enemies and items that need characters from the Mr. Saturn font, you're out of luck. You cannot use these characters outside of the main game text, so that REALLY limits this option. If after adding 32 new characters you still find you need more space, contact me and we'll try and find a solution for you.

Updating Font Widths

Okay! So you've changed the font! Now you need to update your character widths!

Do this by going into your Fonts folder and opening the font widths file for each of your fonts, such as 0_widths.yml. These files contain the width values for each of the characters in your variable width fonts (Fonts 0, 1, and 2). How do you know your character widths, you ask? Simply look at how wide the character is in pixels and put that value in the corresponding spot in your widths file.

The order in the widths file goes from left to right. The very first tile is usually reserved for the space character (' '), so I would keep that tile blank if your language uses spaces to separate words.

You don't need to worry about adding an extra pixel to your characters to keep them separate, either. EarthBound automatically inserts a single pixel between each character.

Remember

  • AGAIN, every single font needs to follow the same pattern. If you add a character in one spot on one font, that same character needs to be in the same spot in all your other fonts (except for credits, because that one is different)
  • You can replace every single character in the whole font if you need to, allowing you to have up to 128 custom characters for your translation.

Using Your Expanded Fonts

Assuming you haven't changed the original 6 rows of your fonts, you can use them normally.

The expanded area in your text can be used by adding the code for each expanded character.

  • The codes run from b0 until cf
  • The whole font is technically all represented by codes, and the normal font codes run from 50 until af
  • A code will always need to be surrounded by square brackets [ ]

For example, if I wanted to type out "Olá!" using my expanded font, I would first need to check which tile in my font the á character is in:

So! The á character is on the last row. It's in the [c0] spot, so to write Olá!, it would be written like this: Ol[c0]!

So, the codes for each of the characters in the entire font, with the rows and columns corresponding to each tile in your image file, would look like this:

50 51 52 53 54 55 56 57 58 59 5A 5B 5C 5D 5E 5F  
60 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F  
70 71 72 73 74 75 76 77 78 79 7A 7B 7C 7D 7E 7F  
80 81 82 83 84 85 86 87 88 89 8A 8B 8C 8D 8E 8F  
90 91 92 93 94 95 96 97 98 99 9A 9B 9C 9D 9E 9F  
A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 AA AB AC AD AE AF  
B0 B1 B2 B3 B4 B5 B6 B7 B8 B9 BA BB BC BD BE BF  
C0 C1 C2 C3 C4 C5 C6 C7 C8 C9 CA CB CC CD CE CF

The easiest way to do this, or at least the way I did, was to write all the translation normally, and then do a search and replace for each of the special characters in my expanded font. So, in my original ccs files I would have written "Olá!", but then I would have done a find and replace and replaced all occurrences of á with [c0] when I was done.

Translating text_misc.yml

Text_misc.yml is difficult to translate because the text in this file will all be inserted back into the same place the text was originally pulled from. This is problematic because it means you cannot make the text any longer than it was originally. So, if a string was originally seven characters in English, it will only be able to be seven characters in your target language.

So, how do you fix this? To understand, we'll first go over the concept of pointers and memory addresses. If you already understand this, feel free to skip over the next section.

Memory and Pointers

The EarthBound ROM is made up of bits of information, binary values represented by 1s and 0s. To keep things nice and simple, these 1s and 0s are represented by hexadecimal values. Sounds complicated, I know, but believe me. It really does make things much simpler. So! Hexadecimal is pretty simple! It's a method of counting that has 16 values. Where the normal way we count has 10 values (0 1 2 3 4 5 6 7 8 9), hexadecimal has another 6 values for a total of 16 (0 1 2 3 4 5 6 7 8 9 A B C D E F).

So, why is this important? Remember when we setup a font, and we represented each character in the new characters we added with a value like B0? B0 is a hexadecimal value, and when the game sees it in the right context, it knows to print out a character from your expanded font! Very cool. While hexadecimal is used for things like the font, it is also used to indicate locations in the EarthBound ROM. Each byte in the ROM is represented by an address. For reference, a byte is two hexadecimal digits, such as C0, which means each letter in the game text takes up a byte!

When CoilSnake writes all the text you translated into the game, it converts each character into a byte and puts it into the EarthBound ROM. Most of this text is added to a portion of the ROM known as Expanded Memory. It's called this because we made the EarthBound ROM a little bigger so we could add more stuff to it. And since we added things to the game, it means that the original game has no idea that any of that stuff is there. Because of this, we have to change a few things in the original ROM space to let it know where to find our new text.

Luckily, in the original ROM for EarthBound there are thousands of memory locations that contain what is called a pointer. A pointer tells the game where to find a specific value. There are pointers that tell the game where to find sprites, pointers that tell the game where to find strings of text, and much more. By changing these pointers so they point to new locations in our expanded memory, we can let the game know where all the new stuff we've made is.

Changing a pointer is particularly valuable when we have something that is bigger than it was in the original EarthBound ROM.

Please message me with any suggestions you may have for this guide

Clone this wiki locally