-
Notifications
You must be signed in to change notification settings - Fork 1k
Restore Japanese Town Map
This tutorial restores the Japanese town map without compromising number of letters, location, or "(pokemon)'s nest" lengths. Most of the code was taken from the pocketrgb-en github, thanks!
Japanese town map vs English version:
We have 3 problems here:
- We need to add the town map border, and change the dialog box border
- If the English text is longer than 10 tiles, it will overflow and cover up part of the map. We need to split the English text into 2 lines, (unlike in dialog boxes) without white space in between.
- As it is marked as a line of text, there is white space added to the entire top line of the map, which will cover up the top tiles of the map border even if the text doesn't stretch that far.
What we’ll get after this section is a Japanese-looking map where town name text can fit on two lines, with either a white space in front or not, for example one of these two:
The code for the map name part was taken from the pocketrgb-en github, thanks!
GRAPHIC CHANGES
First we need to change the border graphics, which is a map redrawing job as the missing border is actually still in the town map tiles in the English game. As of December 2023 when this tutorial was written, Polished Map (https://github.com/Rangi42/polished-map) which works for individual towns etc does not work with the overworld Town Map. Follow this other tutorial to edit the town map graphics and learn more about how the Town Map itself works: https://github.com/pret/pokered/wiki/Edit-the-Town-Map
In case the above tutorial goes down, the editing instructions are:
Download Tilemap Studio. Open the Town Map tilemap which is at gfx > town_map > town_map.rle. Pick the RBY Town Map format. Load the tileset which is at gfx > town_map > town_map.pnp. Edit the map and save. That’s it.
Reference image:
We have now created 1 more row of white tilespace where the town names go. The Japanese text is all on this one bottom line, with 1 white space before it starts. The English text is too long and will overflow onto the map both with town names and pokemon nest phrases like “charmander’s nest”. If you have a map term more than 9 or 10 characters long, the game will insert a white line across the entire top line of the map.
So you have a few options here:
-
Move where the text appears so long names like “cinnabar island” which would overflow, are broken up into 2 lines.
-
Move where the text is placed left one line (to start at 0,0 and 0,1 coordinates instead of the original 0,1 coordinates leaving a blank tile in front of the town or pokemon name).
-
Delete “town, island” etc from the location names, or create icons like emoji to symbolize them instead of using words.
-
Shorten Pokemon names as in their original official translations here which were written before the text length got extended (https://tcrf.net/Prerelease:Pok%C3%A9mon_Red_and_Blue/International_Localization)
-
Edit the font and charmap.asm so it contains ligatures (combinations of multiple letters in one tile) to the point where the town names fit as they are. An example is putting “li” which was originally two squares, into one square, and edit charmap.asm accordingly.
-
Edit the font similar to the Japanese gym leader names on the Trainer Card screen in the Restoring Gym Leader Names tutorial, so 3 commonly-used letters in pokemon names get split between 2 tiles (such as “mon” taking up 2 tiles instead of 3), and edit charmap.asm accordingly.
-
Edit the text to allow text on top of text (accent marks, diacritics, dakuten) so for example “charmander” could be “(on top) char (on bottom) mander” and technically take up one line and a half. You can do that via this other tutorial here (https://github.com/pret/pokered/wiki/Restore-Dakuten-and-Hakuten-Mechanic-to-Graphic-Accentuation-(--%C2%B4--,--%5E--,-etc.))
-
Edit things so the background of text is invisible instead of white.
-
Make a code that automatically splits lines of text that get over a certain character length into a new line.
The rest of this tutorial is assuming you want to option one which is to split the lines manually.
We can create new rules for where text is supposed to go in a new line in dialog or on-screen. There is one extra line worth of white space between each line of text. If you erased that white line, 3 or 4 lines of text would fit in a dialog box at once instead of just 2 as we have in the original game. The code was for line feeds was taken from the pocketrgb-en github.
- Go to: pokered (main folder) > home > text.asm
Delete (or comment out by putting ; in front) the red lines that start with - and add the green lines that start with +. Do not add the - and + symbols themselves.
.NotTerminator
+ cp "<LF>" ; used on town map for names
+ jr z, .line_feed
cp "<NEXT>"
jr nz, .NotNext
......
- bit 2, a
jr z, .ok
+ .line_feed
ld bc, SCREEN_WIDTH
.ok
- Go to pokered (main folder) > charmap.asm. Change:
; Control characters (see home/text.asm)
+ charmap "<LF>", $1f ; "line feed", used on town map names
charmap "<NULL>", $00
This means if we type into dialog or item names etc (text inside “”) it will create a “line feed”.
- Go to: pokered MF > data > maps > names.asm
Now since we changed the map, a town name or string of words that appears on it (such as “CHARMANDER’S NEST”) can’t be longer than 10 or 11 characters without it overflowing onto the map, so put right where you want any line feeds (line breaks without white space in between) to be. For most languages this will obviously either be where you would normally put a space mark or break the word into bits of meaning. For example change:
PalletTownName: db "PALLET TOWN@" PalletTownName: db "GREENSBURG@"
To:
PalletTownName: db "PALLETTOWN@" PalletTownName: db "GREENSBURG@"
- Adding “‘S NEST” to pokemon names such as CHARMANDER will now make them too long, they will overflow onto the map.
Go to: pokered (main folder) > engine > items > town_map.asm
call GetMonName
- hlcoord 1, 0 ; coord = coordinates. display pokemon name on town map at (x, y) coordinates.
+ hlcoord 0, 0 edit to (1, 0) if want 1 blank space before pokemon name starts, as in English translation.
+; hlcoord 0, 1 ; use this for "NEST OF CHARMANDER" instead of "CHARMANDER'S NEST" (pokemon name will appear below NEST text)
call PlaceString
ld h, b
ld l, c
+ hlcoord 0, 1 ; move "'s NEST" text down one line, versus pokemon name which is at (0,0)
; hlcoord 0, 0 ; use this for "NEST OF CHARMANDER" instead of "CHARMANDER'S NEST"
ld de, MonsNestText
call PlaceString
Change:
MonsNestText: db "'s NEST@"
To anything suitable to be broken up into a second line, for example, the following: db "NEST@"
Which will end up in-game as: CHARMANDER NEST
If you need to switch things around and say, for example, “NEST OF CHARMANDER” due to grammatical rules in your language, change the y coordinates so NEST (MonsNestText) appears above the pokemon name (GetMonName), as noted in the code above.
Here is the difference in coordinates. The Japanese original sets the x-coordinate to 0 as in “NEST” (shown at 0,1), the English sets it to 1 as in “CHARMANDER” (shown at 0,0):
ROOT WORD CHANGES
If you need to more heavily edit the actual Pokemon or town name when you attach a grammatical suffix or something in your language (for example, “foot” to “feet”), in which a difference in the root word is required depending on if you are saying "CHARMANDER'S NEST" or just "CHARMANDER", you need to copy-paste the list of pokemon (or town) names to create a duplicate. Rename that list. Edit it to what you need. Then tell the code to reference that list instead of the main pokemon or town name list when it is calling the town map.
DIALOG BOX BORDERS
Finally we need to change the dialog box text away from the “pokeball corners” and to the Japanese version.
Go to, and open up in an image editor: pokered-jp > gfx > text_box.png pokered > gfx > font > font_extra.png pokered > gfx > font > font_battle_extra.png
Copy-paste the dialog borders from the pokered-jp image into the correct spots in the two pokered images. This is tricky on first glance because just like with the badge leader name text images, the images here aren’t a matching shape. Enable a grid that’s 16 pixels with cross sections every 4 pixels (or, if you can’t do that, just enable a grid every 4 pixels), and if necessary enable “stick to grid” so the selection tool grabs it square by square, and you will be able to more easily see the 16pixel tiles and be able to copy-paste them to the other image in correctly. Example of a grid enabled and using the selection tool:
Or you can steal the finished images from pocketrgb-en's font_battle_extra_RG.png
Good job! Your town map screen should now be finished!