• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

[Pokeemerald] Guide to Editing the Region Map

takyon

Villain
17
Posts
6
Years
    • Seen yesterday
    Going into this guide I will assume you already know how to compile pokeemerald and you have a 256x160 png of your region that you wish to insert into the game. Sorry for the terrible formatting.

    PREREQUISITES

    We will be needing:

    • Asesprite, GraphicsGale, GIMP, or any other software you are comfortable making your region map in (it is preferred to have a grid overlay of 8x8 to show off different tiles.)

    • GIMP (only for changing up the indexing, if there is a better software don't hesitate to share with a reply below!)

    • IrfanView (only to export palette, it might be possible to export through GIMP or some other software, but the palette export options there don't seem to support JASC-PAL)

    • Tilemap Studio

    • PoryMap (for later)

    • mGBA or your choice of emulator

    We will be making:

    • region_map.png

    • region_map.pal

    • region_map.bin

    • region_map_map.bin

    Gamefreak, in all their wisdom, decided to have two different instances of the region map, one for the Pokedex (graphics/interface) and the other for every other instance (graphics/pokenav). There is another called region_map_affine but it doesn't seem to be used, so we can skip it. If for any reason it has to ever be used, just repeat the steps for the other two tilemaps.

    We can use region_map.png and region_map.pal for both instances, however the tilemaps are very different.

    MAKE THE MAP

    If you haven't already, make your region map, making sure that you have 32 colours maximum, and in the end have 256 tiles or below being used.
    I usually use Asesprite because of its reference layer, but I'll make a quick region map through GIMP for this tutorial. Set the dimensions to 256x160, and Image->Configure Grid so that the grid is 8x8, and check View->Show Grid. Make sure the brush has anti-aliasing disabled.
    For this tutorial I decided to make Bangladesh into a Pokemon region.
    unknown.png


    MAKE THE TILESET

    Go to Tilemap Studio, Tools->Image to Tiles
    Your input should be the map that you just made.
    The output should be region_map.png or any other name you want. I named it tileset.png but it will have to renamed later.
    unknown.png

    Leave the other options (Tilemap/Palette) as is. Until Tilemap Studio is updated to include region map functionality we will have to do most of it manually.
    At this point Tilemap Studio should've automatically generated region_map.png. It will fail if you have more than 256 tiles, at which point you would have to go back to your picture editing software and simplify the map/reuse tiles. If you are dead set on using more tiles, check this out.

    MAKE THE PALETTE

    Use GIMP to open up the newly made region_map.png tileset. Go to Colors -> Map -> Rearrange Colormap
    unknown.png

    Your colors should exist from 0 to 31 (if they happen to cross 31 then that color probably won't show up in-game). You'll have to now manually move the colors so they occupy the second half of the palette, namely instead of 0-31, it'll occupy 112-143. Sadly I only know how to do it manually one by one, but I'm sure there might be an easier method I don't know of.
    unknown.png

    Save this change and save the tileset.
    Open IrfanView, Image->Palette->Export Palette... and save it as region_map.pal.
    However, even though the palette starts from 112, the .pal file needs it to be at the beginning of the file.
    Here's what that change would look like:
    unknown.png
    - >
    unknown.png


    And with that we have the two easy parts done. Time to head back to Tilemap Studio and make the two tilemaps. Your canvas should basically look exactly like the map you just made.
    unknown.png

    However the tilemap that the game uses is strangely different. That being said, go to File->Save As… and save default.bin. This won't be used in the game but will be useful in a bit.
    unknown.png


    MAKE THE TILEMAP PT.1 - GRAPHICS/POKENAV/REGION_MAP_MAP.BIN

    Go to Tools -> Resize. Resize to 32x128.
    unknown.png

    This is fairly simple, you basically need to separate each horizontal line by a straight line of the first tile. This sounds tedious, but with holding right-click on the canvas you can extend your selection.
    unknown.png

    Slowly but surely you'll have the same region but doubled in size with the first tile in each other line. Do File->Save As… and save as region_map_map.bin.
    This is what it should more or less look like:
    unknown.png


    MAKE THE TILEMAP PT.2 - GRAPHICS/INTERFACE/REGION_MAP.BIN

    Load the default tileset to get back to your normal canvas. (If you forgot, do Image to Tiles again)
    Go to Tools -> Resize. Resize to 64x32.
    unknown.png

    This is also fairly simple, you will need to separate each vertical line by a straight line of the first tile. The same advice from PT.1 applies, hold right-click on the canvas to extend your selection.
    unknown.png

    This is what it should look like at the end:
    unknown.png

    Once done, do Tilemap->Save As… and save as region_map.bin.

    INSERTING TO THE GAME

    The only thing to be changed now is region_map.png. It needs to be 128x120 pixels. If it is smaller, like my one, you'll get this error:
    Code:
    The specified number of tiles (233) is greater than the maximum possible value
    This is a simple fix, just expand the canvas and fill the new empty spaces with black.
    The inverse can also happen, where you see black tiles near the end of your region map. At that point you'd have to cut off some tiles so there are only 233 tiles.
    At this point everything should be completely done, bar any mistakes made in the process.
    You should have the tileset (region_map.png), the palette starting from index 112 (region_map.pal), and the two tilemaps for pokenav (region_map_map.bin) and pokedex (region_map.bin).
    Here's what I have:
    unknown.png

    Go to graphics/interface and paste and replace these three files:
    region_map.png
    region_map.pal
    region_map.bin

    Go to graphics/pokenav and paste and replace these three files:
    region_map.png
    region_map.pal
    region_map_map.bin

    And you should have a completely new region map in both your pokedex and everywhere else! You can edit this more through PoryMap with the Region Map Editor, but that's out of scope for this tutorial.
    unknown.png
    202989065_335522088223553_9093823587882704616_n.png

    Hope this helps.
     
    Last edited:
    11
    Posts
    4
    Years
    • Seen Jul 24, 2021
    Omg, this is the reason i stop working in my game a long time ago, now im gonna try this, thanks.
     
    2
    Posts
    13
    Years
    • Seen Aug 31, 2023
    Hey, thanks for this tutorial. I tried this and I got

    "graphics/pokenav/region_map.png" has an unsupported color type.
    make: *** [Makefile:277: graphics/pokenav/region_map.gbapal] Error 1

    Any advice?
     
    447
    Posts
    6
    Years
    • Seen yesterday
    Hey, thanks for this tutorial. I tried this and I got

    "graphics/pokenav/region_map.png" has an unsupported color type.
    make: *** [Makefile:277: graphics/pokenav/region_map.gbapal] Error 1

    Any advice?

    That error usually means your image isn't indexed.
     
    2
    Posts
    13
    Years
    • Seen Aug 31, 2023
    That error usually means your image isn't indexed.

    Yes, thanks.
    I had changed the resolution of the image with Paint, which I realized makes the image not indexed. I did it with GIMP instead and it worked.
     
    755
    Posts
    7
    Years
    • NY
    • Seen Oct 9, 2023
    Hey takyon, nice tutorial! It's very helpful since there are two different Town Maps in two different formats (and the extra region_map_affine, which is unused). I'm glad you found Tilemap Studio useful for it. However, it can be done more easily, especially with some new features in version 4.0.

    Using the same map of Bangladesh as an example (although I fixed a couple of white city borders which had turned yellow):

    UqH5kZ6.png


    Tilemap Studio version 4.0 lets the palette start from a non-zero index. The Gen 3 Town Map is actually why I added that, so instead of moving the colors down from 0 to 112 rows in GIMP, you can just start at index $70 (hex $70 = decimal 112). However, you'll need to change a couple more things:

    1. Specify a Color 0 that doesn't exist in the map. This is because color 0 gets placed at index 0, and may get treated as transparent in-game. Hoenn's Town Map uses black #000000 as its color 0, and the map doesn't use that color at all.
    2. Generate the tileset twice: first with the palette format as "PaintShop Pro (JASC-PAL)" (so we get a separate .pal file, but the tileset image will be grayscale), and then again as "Indexed in tileset image" (so the tileset will look properly colorful). All other settings should stay the same except the palette format. (This isn't strictly necessary, pokeemerald should work fine with a grayscale image since the palette is taken from the .pal file, but it does look better.)

    mSlBxNs.png


    This generates a Plain tilemap (so it doesn't take advantage of X/Y flip):

    GSFyolc.png


    And the palette already starts at the correct index:

    iUrVfbe.png


    Just like before, we have to trim the .pal file:

    4DON2Ug.png


    Now the tileset.png is done, but we still need to create graphics/pokenav/region_map_map.bin and graphics/interface/region_map.bin.

    graphics/pokenav/region_map_map.bin is easy: it's supposed to be in Plain format, which we already have; and it turns out that "resize 32x20 to 32x128 and manually separate the horizontal lines" is the same thing as "resize 32x20 to 64x64 and we're done".

    NXEtzgW.png


    yuv1lPi.png


    graphics/interface/region_map.bin is also pretty simple. The reason it has vertical lines is because it's in "GBA tiles + 8bpp palette" format, not "Plain" format. Each tile uses two bytes, not one, with the second byte enabling up to 1,024 tiles and X/Y flip. We shouldn't take advantage of that because the Pokénav map should look identical, and it's limited to the Plain format; but this does make conversion easier. Just use Tools->Reformat, the matrix-y toolbar button, or Ctrl+F:

    eDICcaa.png


    Then resize down to 32x32:

    WhVORuX.png


    iRgdCTZ.png


    You also don't need to change the size of the tileset image to be exactly 233 tiles: just count how many tiles it has (not counting any trailing blank ones on the bottom row), and edit the value in graphics_file_rules.mk:

    Code:
    graphics/pokenav/region_map.8bpp: %.8bpp: %.png
    	$(GFX) $< $@ -num_tiles 233

    There's one more detail, which didn't affect Hoenn's map or this one, but will matter for some people. When you zoom into the Pokénav map, you can pan over to see two tiles above and to the left of the regular map area (which I've highlighted here):

    uDBg5kj.png


    It turns out that the Pokénav is viewing the tiles on the opposite edges of the tilemap, highlighted here:

    ePvJIV7.png


    Tilemap Studio 4.0 also provides a tool to help with this: Shift Tilemap, or Ctrl+M.

    dDZbMAU.png


    Instead of designing a 32x20 map which then gets padded to 32x32 and 64x64, you can design a 34x22 map (but don't put cities or anything important in the top-left two rows) and then shift them to the opposite edges of the 64x64 graphics/pokenav/region_map_map.bin.

    nKq2rr5.png


    So basically, my workflow would be this:

    1. Design a 34x22 tile (272x176 pixel) map image, being careful to keep the top two rows and columns unimportant (plain ocean/mountains/grass is fine for them).
    2. Use Image to Tiles to create a Plain tilemap with a palette starting at index $70 and a unique color 0; generate it twice, first as a JASC-PAL for the .pal file and then as an indexed palette for a good-looking .png file.
    3. Trim the extra colors out of the .pal file.
    4. Open the 34x22 tilemap, resize it to 64x64, shift it by (-2, -2) to move the top and left parts to the opposite edges, and save it as region_map_map.bin.
    5. Resize region_map_map.bin to 32x32, reformat it as GBA tiles + 8bpp palettes, and save it as region_map.bin.
    6. Update graphics_file_rules.mk with the correct tile count for the tileset.
    7. Replace the files in graphics/interface and graphics/pokenav.
     
    Last edited:
    5
    Posts
    3
    Years
  • This tutorial seems outdated, now the region map is located under graphics/pokenav/region_map.

    Also it would be nice to have a tutorial about adding multiple regions !
     
    3
    Posts
    304
    Days
    • Seen Oct 18, 2023
    Smalki, have you found anything regarding adding new regions and configuring region maps?
     
    10
    Posts
    304
    Days
    • Seen yesterday
    This tutorial seems outdated, now the region map is located under graphics/pokenav/region_map.

    Also it would be nice to have a tutorial about adding multiple regions !

    I would be really interested by that !
     
    2
    Posts
    189
    Days
    • Seen Oct 30, 2023
    I am having troubles getting the game to compile after changing the map. I was able to follow the guide and I have all of the files I need. During compilation, it reaches pokedex/region_map.pal and gives the following error:

    Unexpected EOF. No CRLF at end of file.
    make: *** [Makefile:321: graphics/pokedex/region_map.gbapal] Error 1

    Any ideas on what could be wrong? I can post all of my edited files if necessary.
     

    Lunos

    Random Uruguayan User
    3,114
    Posts
    15
    Years
  • I am having troubles getting the game to compile after changing the map. I was able to follow the guide and I have all of the files I need. During compilation, it reaches pokedex/region_map.pal and gives the following error:

    Unexpected EOF. No CRLF at end of file.
    make: *** [Makefile:321: graphics/pokedex/region_map.gbapal] Error 1

    Any ideas on what could be wrong? I can post all of my edited files if necessary.
    Palette files need to use a CRLF End of Line character in the very last line. Yours is probably using an LF character instead.
    If you have Notepad++, open your palette file in it and go to Edit -> EOL Conversion -> Windows (CR LF).
     
    2
    Posts
    189
    Days
    • Seen Oct 30, 2023
    This was exactly correct. The game compiles now. The map also technically displays in game but I have new problems. For one, the right most areas of the map I made are cut off. What is the limit that things can be placed on the right side of the map?

    My other issue is that the palette isn't displaying properly. I followed Rangi's method above for obtaining the palette file. I guess I'm confused about that. Should I be deleting all of the preceding 0 0 0 before the actual palette starts or am I just moving the palette to the top?

    Edit:

    it seems that the program really does not like you using 0 0 0 black in the actual map. I changed to 10 10 10 and now it works perfectly in game.

    Screenshot 2023-10-28 233849.png
     

    Attachments

    • Region Map.png
      Region Map.png
      2.9 KB · Views: 4
    Last edited:
    Back
    Top