Map Sprite Insertion Mania

Tags: #<Tag:0x00007f5601ea5a20>

#1

I was absolutely shocked one day when an experienced hacker who shall remain nameless told me they couldn’t figure out importing map sprites. It never struck me as something particularly hard, a fairly simple procedure with GBAGE. I figured I’d write this tutorial using his hack, in case anyone else finds themselves in the same predicament.

Here’s what you’ll need:

For this tutorial, I am going to import the Eirika Lord map sprite into Fire Emblem: Dream of Five.

Consider this our starting point for the tutorial.

Importing Standing Sprites

Alright, so the first thing we need to do is open up the ROM we’re importing from in Nightmare. In my case it’s FE8. We’re going to get the standing sprites and the moving sprites.

First we’ll tackle the standing sprites. Open the “Standing Map Sprite Editor.” Should look something like this:

See the highlighted text? That’s the pointer to the standing graphics for Eirika Lord. Guess where we’re going in GBAGE?

And although this is optional for imports, you can also use the palette control and image control settings to make the images friendly for editing as well.

Setting the width to 2 (large map sprites need a 4), and then using one of these offsets (depending on the color scheme you want and the ROM you’re editing).

FE7 Map Sprite Palette Offsets:
Player Team (Blue): 194594
Enemy Team (Red): 1945B4
NPC Team (Green): 1945D4
Stoned?: 1945F4
Link Arena Team 4 (Grey): 194614
Flashback Palette: 194654
Evil looking Palette?: 1946F4

FE6 Map Sprite Palette: 
Player Team (Blue): 100968 
Enemy Team (Red): 100988
(Follows the same pattern, Green and Gray Arena palettes probably are the two after them)

FE8 Map Sprite Palette:
Player Team (Blue): 59EE20
Enemy Team (Red): 59EE40

Click “Save a bitmap,” save it to wherever you’d like, and we’ve got our standing sprites ready and available. Let’s import them to FE7, shall we? I’m going to import the map sprites to free space at 00DD0000. Open the ROM that you want the map sprites to be imported to, and with “Image Control” in GBAGE, click “Import a bitmap.” Make sure the compressed graphics box is checked, otherwise you’ll just make a mess instead of a map sprite (it’ll look right in GBAGE, but the game won’t be able to read it properly). This window should come up.

Remember to un-check the ‘Import palette’ box, there’s no need to use it for map sprite insertions!

DD0000 is the offset that I’m writing the data to. You can write it anywhere your heart desires (I’m just choosing a random spot in FE7’s free space). Click “Ok” and your map sprites will now magically be in the game. But that’s not all, folks! Now we need to make sure the game knows where to find your freshly imported map sprites. Open the “Standing map sprites editor” for your respective version (in my case it’s FE7).

Now we have Eirika Lord standing there. But when you move her or hover over her with the cursor we still get Lyn Lord.

Importing Moving Sprites

Alright, now we have to import the other half of a map sprite. Back to FE8 I go! This time, I’m opening the “Misc Map Sprite Editor.” This process is largely similar to the last one, just using different offsets.

I highlighted “0x81C3ED4,” guess where we’re going in FE8 with GBAGE? 1C3ED4!

Boom, bitch. Get out the way. Just save that bitmap shit, okay? Notice that I gave her the enemy palette (it doesn’t matter as far as the import goes, since we aren’t importing palettes) and set the width to 4 to make the image friendlier for editing. When it comes to custom map sprites, just editing one of these in Usenti or another program mindful of palette orders solves 99.9% of all technical problems.

Now that we’ve gotten our moving sprites, it’s time to import it to FE7. But where do we write it? Well, I’m going to write it where the standing map sprite ended. How do we know where it ended? Open up your hex editor, go to the offset where you wrote it (DD0000 in my case) and scroll down until you’re back to free space.

Old XP screenshot because I didn’t feel like retaking this one. #ThrowbackThursday

Looks like DD0160 is our lucky offset. I’ll be writing the moving sprites to DD0160. Time to open up the receiving ROM with GBAGE and complete the transplant. Just like before, on the “Image Control” window click “Import a Bitmap.”

This should all look rather familiar to you. Uncheck the import palette and abort boxes, and smack that “Ok.” You’ve just given it consent, so it isn’t rape when it fucks your ROM.

GBAGE will notify you that the graphics have been inserted. So now it’s time for the last leg of our little journey, referencing the moving sprites in the map sprite’s new ROM. Open up the other game’s “Misc Map Sprites Editor” (FE7 in my case) and replace the pointers for your map sprite of choice.

If you’ve been following along, you’ll notice that I replaced Animation Pointer but did not alter Another Pointer. It just so happens that Eirika’s map sprites work perfectly under the existing pointer.

That second pointers contains instructions on rendering the moving sprites (positioning on the status screen and when highlighted, sometimes height becomes a factor where map sprites are getting clipped by a bad pointer). The general rule of thumb is to use a pointer from a map sprite that’s similar to the one you’re using. You can import these, however, with a simple copy+paste from the source ROM to the implant destination in a hex editor.

The end.

[spoiler=Regarding screwed up palettes]

Note the two cavalier map sprites with odd palettes.

(4/1/16): if your image palette is screwing up, it’s because the graphics that the game uses have “indexed palettes”, which means there’s an extra bit of info contained within the image that designates what colours go where. Using Paint and most other image editors destroys indexing, so we recommend ripping a map sprite from the game, opening it in Usenti, and then pasting your new graphic over the top of it. You will know that the image has an indexed palette as to the right side there will be a series of palettes - one for the player side, another for the enemy side, etc. - Agro


An image file with an indexed palette.[/spoiler]


Map Sprite/Class Card Repository
"Fire Emblem Swan Song"
[SOLVED] Inserting a custom animation?
[Fangames] What are you working on?
The Grand Library of FEU [UNDER CONSTRUCTION]
#2

Quick addition - Remind people that they need to have ‘compressed graphics’ checked when they go to import a map sprite, or it makes a mess.


#3

Thanks for the note, made sure to include that and a few notes about custom map sprites.

And also fixed that horrible section about the second pointer for the moving sprites. It’s still sorta “throw shit against a wall” for an explanation, but it was pretty awful before.


#4

I get how to replace but how do you add more sprites? Like increasing max index for portraits/animations in feditor?


#5

Could you explain a bit more about the another pointer? How do i know its length? Where does an another pointer end? at the FFs? Or what??


#6

As with the tutorial on Serenes Forest, it was never specified that users should be using Usenti as the final program to parse their images through so that palette indexing doesn’t get destroyed. You can copy and paste images into Usenti but you cannot save an image with Paint, and then import it directly into the game.