Skip to content

Restore Japanese Town Map

hydhyro edited this page Jun 25, 2024 · 10 revisions

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:

image

Contents

  1. Introduction
  2. Graphic changes
  3. Root word changes
  4. Dialogue box borders

1. Introduction

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 tutorial 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:

image

2. 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. It's compressed and not a .png like other images:

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.

image

We have now have 2 shorter rows of white space. You have a few easy sample options here for more space:

  1. Move where the text appears so long names like “cinnabar island” which would overflow, are broken up into 2 lines.

  2. Delete “town, island” etc from the location names, or create icons like emoji to symbolize them instead of using words.

  3. Shorten Pokemon names as in the pre-release versions here: https://tcrf.net/Prerelease:Pok%C3%A9mon_Red_and_Blue/International_Localization

  4. 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, or "mon" which was 3 letters, into 2 letters. Then edit charmap.asm accordingly.

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 pocketrgb-en.

  1. 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
  1. 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 <LF> into dialog or item names etc it will create a “line feed”.

  1. 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 add an <LF>. For example, change:

PalletTownName:      db "PALLET TOWN@"
PalletTownName:      db "GREENSBURG@"

To:

PalletTownName:      db "PALLET<LF>TOWN@"
PalletTownName:      db "GREENS<LF>BURG@"
  1. 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.

If you need to have just the 's of "CHARMANDER's" on the top line, but NEST on the bottom line, or something like that, all you have to is assign the coordinates then use "call placestring". If it is coming directly after another line of text with coordinates already declared, such as in the below where 's comes directly after the pokemon name, all you nee to do is write "call (text string name)" then "call placestring". You can do this to print several strings of text, for example to accommodate for languages with extremely different word order or grammatical rules:

+	hlcoord 0, 0  ; places pokemon name with 0 whitespace. edit to (1, 0) if want 1 blank space before pokemon name starts, as in English translation. 
	call PlaceString
+	ld de, MonsNestPossessiveText ; places 's in CHARMANDERS NEST directly after pokemon name
+	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)
+	ld de, MonsNestText ; places NEST on line below the pokemon name
...
+MonsNestPossessiveText:
+	db "'s" ; 's for CHARMANDER's NEST. will appear on same line as charmander
MonsNestText:
	db "NEST@" ; will appear on line below charmander + 's

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):

image

3. 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, editing the pokemon names 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. An example of this is in the tutorial for restoring to the Japanese pokedex: https://github.com/pret/pokered/wiki/Restoring-to-the-Japanese-Pokedex-Screen

4. Dialogue 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 > gfx > font > font_extra.png

pokered > gfx > font > font_battle_extra.png

You can redraw the Japanese border yourself, or copy-paste it in from here:

image

Good job! Your town map screen should now be finished!

Clone this wiki locally