Jump to content

[Tutorial] FE7 World Map Insertion


Primefusion
 Share

Recommended Posts

Introduction

I’ve seen some question topics pop up over the last few months regarding the world map in FE7. I’ve also had a few folks ask me personally about how I went about inserting my own into The Road to Ruin. This tutorial will guide you through the process of inserting your own world map into a FE7 ROM.

Before I start, I’d like to give a shout-out to NomadicTrooperGirl, who provided some great documentation in here.
Any offsets I post for images or palettes in this tutorial, I got from there. Thanks!

Overview

Tools we’ll be using:

  • Usenti
  • GBAGE
  • Hex Editor

Concepts you should be familiar with:

  • Palettes
  • Offsets
  • Hexadecimal numbers

Okay, so when I say “World Map”, there’s an important distinction to be made, since there’s really 3 different world maps the game uses.

  1. The map of the entire world of Elibe (I’ll call it the “Full View Map” from now on).
  2. The “zoomed in” map that covers Lycia, Bern, and Sacae (I’ll call it the “Zoomed In” Map).
  3. The “zoomed in” map that covers the Nabata desert.

I don’t have any information about the Nabata map, since I’ve never really needed to do anything with it. If someone’s got notes on it, please post them so I can add it to this tutorial (with credit, of course).

Important Note: When I learned how to insert the Zoomed In map, I initially had a lot of trouble trying to get palettes to work. I found out that the problem was that GBAGE was reading in .png files in a way I wasn’t expecting. The Zoomed In map needs to split into several pieces in or for it to be inserted. If a section didn’t use all of the colors of the palette, GBAGE would inappropriately assign the image a subset of the palette.

However, when I converted my images to .bmp, everything worked fine.
So, for this tutorial I really recommend saving your images as .bmp.

Table of Contents

Inserting the Full View Map

Inserting the Zoomed In Map

A Quick Word About World Map Events

Alright, that’s all for this tutorial! Feedback is appreciated. If you got stuck somewhere or would like me to expand on a certain part of the tutorial, feel free to post about it here.

Side note: This tutorial ended up having exactly 42 images. Very appropriate :B

Edited by Primefusion
Link to comment
Share on other sites

Formatting the Full View Map (Warning: spoilers contains large images)

 

The Full View Map is a single image that’s 240x160 pixels in size, with 8 extra pixels of height along the bottom (I’ll talk about that shortly). Total size: 240x168.
It’s located at offset 0x5D0AC0.
It uses the palette at 0x5D0A40.
Now, in vanilla FE7, the map uses 4 sets of 16 colors, and works some magic to get different parts of the map to use different sets of colors. I have no idea how to do this, so my map will use 1 16 color palette for all four sets. If you know how this magic works, please post about it!

u0wBiRF.png

I’ll be using my own Full View Map for this tutorial. You’ll need to come up with your own!

Here’s the palette for those curious:
io4rAgf.png

Pretty basic, but that’s okay.

Like I said earlier, the image has an extra 8 pixels of height along the bottom. Notice the first 8x8 section in the upper left. Now compare it to the bottom left 8x8 section. The game reads the first 8x8 section as the transparent color, so you’ll need to take your first section and stick it in the bottom row.
Here’s a quick way to do this in Usenti:

N5eyOv8.png

First, you’ll want to turn on the grid. It’s the middle of the three box icons, next to the zoom. If the grid size isn’t already 8x8, you can change it by going to View->Grid Settings.

Select that first8x8 section and cut it.

q1VqNpQ.png

Then, make sure that 8x8 section is your background color. Now go down to the bottom left of the map, and paste that section we cut into the first 8x8 section in the bottom row.

YHG61bn.png
 
Don’t forget to save!
Alright, your map should now be formatted like so:

T1fAnNS.png

Time for the actual insertion.

 

Inserting the Full View Map

 

Open the ROM in GBAGE:

w2RrGdd.png

Image is at 0x5D0AC0
Palette is at 0x5D0A40
Remember to set GBAGE’s width to 30 for proper viewing!

Okay, so let’s bring in our own map. Select “Import a Bitmap”.

IywaOnG.png

We’ll import the graphics and palette at the same time. Click ‘OK’

5haHzU9.png

Looks like my map uses fewer than 16 colors, but that’s okay. Go ahead and click ‘Finished.’

BGmYuNZ.png

Alright, there it is! Remember to hit File->Save to make things official.
Let’s see how the map looks in game:

WuQHVss.png

O-Oh…

Ha, no worries. This can be fixed pretty easily. It comes from the fact that the game is trying to use all four palettes to render the map, but I only use the first one.
There’s a few ways you can fix this.
    1. In Usenti, make sure the first four rows of colors in the palette are identical. Then reinsert.
    2. In GBAGE, import the palette (Uncheck import graphics!) 3 more times, at each set’s location. Since the first set is at 0x5D0A40, the next set will be exactly 0x20 bytes later at 0x5D0A60. The third at 0x5D0A80, and the fourth at 0x5D0AA0.
    3. The third option is to use a hex editor. I prefer this method, since it’s less intimidating than you might think, and goes pretty quickly.

Alright, let’s open up the ROM in a hex editor. I’ll use HxD. Head to offset 0x5D0A40, the location of the palette.

uCdm4cc.png

16 color palettes are 0x20 bytes long (what I have highlighted). We’re going to copy these 0x20 bytes, and paste-overwrite (Ctrl-B) over the other 3 sets of colors.

The second set of colors is at 0x5D0A60, so let’s overwrite those.

kz1GEwy.png

Okay, let’s overwrite the other 2 sets.

4auqGPE.png

Save, and let’s check out the ROM in action again.

fYWLZ0x.png

Now we’re in business! We’ve got our full view map in the ROM!

Edited by Primefusion
Fixing images
Link to comment
Share on other sites

Formatting the Zoomed In Map (Warning: Both spoilers contain large images.)

 

Inserting the Zoomed In map is a similar process to the Full View one, but there’s a lot more extra formatting that needs to happen before hand.

First up, the numbers:
- The palette is 4 sets of 16 colors at 0x574990. I’ll be using the same 16 color palette for each set.
- Start by making your Zoomed In world map 1024x688 (Save a copy of this since it comes in handy when doing World Map Events).
- The Zoomed In map then needs to get split up into 12 different sections.
- The first 8 sections are 256x256.
- The last 4 are 256x176.

These are their ROM locations:
Section 1: 574A10
Section 2: 57CA10
Section 3: 584A10
Section 4: 58CA10
Section 5: 594A10
Section 6: 59CA10
Section 7: 5A4A10
Section 8: 5ACA10
Section 9: 5B4A10
Section 10: 5BA210
Section 11: 5BFA10
Section 12: 5C5210

I’ll walk you through breaking them up. We’ll divide the map left to right, top to bottom.

Let’s start with our whole Zoomed In map:

6VaHwtO.png

I’ll be referring to different sections of the map by number:

5m7yaDF.png

Sections 1 through 8 are 256x256, while sections 9 through 12 are 256x176.


Open the map up in Usenti and go to Image->Size. Change the size to 256x256. You should end up with something like this:

7y5Ykpi.png

Now select File->Save As and name it something useful. I’ll name this first section “1.bmp”. Whatever folder you’re keeping your images in should now contain the full Zoomed In map and this first 256x256 section.

The reason I did a Save As was so that the first section would contain the palette that the entire map uses. We’ll be copy/pasting every section of the map into “1.bmp” and then saving as another image.
Let me show you what I mean. Go back to the full map, and turn on Usenti’s grid. Make sure the size is set to 256x256.

A6OGuVL.png

Using the grid to help you, select the second 256x256 section in the first row. You can also use Usenti’s coordinate system as a guide.

arPaDV4.png

The coordinates are what the red arrow is pointing to. It should be near the bottom right of Usenti. The current size of the selection box will appear in the area I outlined in green as you drag out the box.

Copy your selection into “1.bmp” or whatever you called it.

odJHKUh.png

Now do a “Save As” again and call it something else. I’ll use “2.bmp”.

7LwyXyb.png

You’ll repeat this process for sections 3 through 8. I’ll walk through it with you one more time.

Select the 256x256 section:

6eAx1Gg.png

And copy it into the smaller file.

pYHHRin.png

Go to File->Save As, and name it something useful. I’ll name it “3.bmp”

khw6hBO.png

Repeat the process for sections 4 through 8.

gpNEUZh.png

Okay, so now we’re on the smaller sections. Remember that they’re 256x176. Select section 9 in your map, and paste it into “1.bmp” or whatever you’re pasting into.

jCIhuE5.png

Since this section is smaller, we’ll need to resize it to get rid of the extra stuff along the bottom. Go to Image->Size and change it to 256x176.

EhQEZJW.png

Then do a Save As, and call it whatever. I’ll call it “9.bmp”

3UdZ8u3.png

Repeat for sections 10, 11, and 12.

z9d184n.png

Now that we have our 12 sections, we’re ready to insert them.

 

Inserting the Zoomed In Map

 

We’ll be inserting the sections to these locations:
Section 1: 0x574A10
Section 2: 0x57CA10
Section 3: 0x584A10
Section 4: 0x58CA10
Section 5: 0x594A10
Section 6: 0x59CA10
Section 7: 0x5A4A10
Section 8: 0x5ACA10
Section 9: 0x5B4A10
Section 10: 0x5BA210
Section 11: 0x5BFA10
Section 12: 0x5C5210

Remember that the palette is at 0x574990

Head to GBAGE and navigate to the first section.

5za6PJV.png

We’ll select “Import a Bitmap” and select the first section.

6FQc1le.png


Click ‘OK’.

spPtV5R.png

This one’s got a pretty smaller palette, just like the Full View map. But, that’s okay. Click ‘Finish’.

2ILJRV7.png

My background color is red so that it’s really obvious. I’m going to go ahead and guess that the game reserves that background stripe, so you’ll have to avoid it when spriting. If you have palette troubles later on, it may help to have the top left most pixel of section 1 be your background color.

Hit File->Save to make things official.
Okay, let’s go ahead and try to insert section 2. This time, though, we will NOT import the palette, only the graphics.

DnkuxJH.png

Click Ok and Finished.

xipPyq0.png

The reason I didn’t import the palette this time was to make sure that each section looks correct. We’re only supposed to insert the palette once and ensure that each section sticks to the palette. Remember to save.
I’ll walk you through inserting the next section, too. Type in the offset of section 3 into GBAGE.

kc2ZwOV.png

Select “Import a bitmap” and browse to and select section 3. Make sure to uncheck “Import Palette”

fJeE038.png

Now click ‘OK’ and then ‘Finished.’

Click File->Save As to make it official.

Now you just repeat these steps for sections 4 through 12.

Once you’re done you’ll want to make sure that you’re using the same palette for all 4 sets of colors. You’ll do the same thing in the hex editor that we did for the Full View map, just at a different offset (Or whatever method you used before).
Now to view it in-game:

yRqSDEY.png

We’re definitely not in Pherae anymore! Success!

Edited by Primefusion
Fixing images
Link to comment
Share on other sites

A Quick Word on World Map Events

No, I won’t be teaching you how they work or anything like that. You’ll want to go here for that knowledge.

I’m going to talk about coordinates. Say you want to load a map sprite in a specific spot. For the Full View map it’s pretty easy. Just get the coordinates from the single image and put them into your sprite loading command.

What about the Zoomed In map? Since the game stitches together the 12 sections, the coordinates are on the 1024x688 sheet. This is where the full map sheet comes into play. You can grab the coordinates there using Usenti, or Paint, or whatever image tool that has coordinates.

Then you can do stuff like:

PUTSPRITE 0x01 [640,285] Cavalier 0x30 0x00 0x00 0x00
PUTSPRITE 0x04 [624,300] Fighter 0x30 0x00 0x00 0x00
PUTSPRITE 0x01 [555,240] Cavalier 0x30 0x00 0x00 0x00
PUTSPRITE 0x04 [550,250] Fighter 0x30 0x00 0x00 0x00

And get results like this:

BwKYBrN.png

Edited by Primefusion
Link to comment
Share on other sites

the part about using a full 256 colors is some tilemap (the fabled "TSA") magic that I was looking into a while ago

Unfortunately I don't know of an easy way to make it work without doing it manually

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...