Accessible FE12 hacking

A new milestone:

It is now possible to add new map sprite animations and it can be done by simply importing a GIF-animation. The importer automatically looks for the alpha channel and sets all alpha pixels to palette index 0, therefore you have 32 colors + alpha channel for map sprites to work with.

25 Likes

Time for something exciting! After studying the code on how maps are actually drawed I now understand all the important parts. The way FEDS generates Maps is actually really interesting. First of all, images are stored in texture arrays (.ta files) and there are maps that use just an image for the entire map but those are an exception. Mostly there is a bunch of assets that get loaded into the map on several layers. Both asset and layer count for a map can be as big as 255 and each asset comes with it’s own 8bit palette giving you nearly no limitation on colors. (Although FE12 seems to use RGB555 everywhere, so you have effectivly 32768 unique colors)

Now the exciting part is that the engine uses 3D functions to draw the assets you just don’t see much of it because all objects are aligned orthogonal. Manipulating draw calls yields interesting results:


We can warp the very fabric of space in FE12 as it seems. Messing with 3D functions is fun but the bigger deal is probably were this knowledge leads to.

I learned how we can assign terrain information and how roofs work in FE12. I also learned where the Minimap is stored, how to make maps bigger (Max size is 32x32 for FEDS btw) and how the assets get loaded. At this point I decided it would be a good idea to start with this:

Yes, this is the beginning of a map editor for FE12. It already loads the assets with their palettes correctly. Now I need to display them at the right coordinates to show what a map actually looks like. The way FE12 draws maps is really powerful since we can just add a bunch of images to a map at the coordinates we like and assign terrain info in a 24x24px grid. Limitations are very low. A texture can be 256x256px at maximum but for big maps you can just store multiple textures of this size and you will probably never reach the limitations of a texture array.

This is getting more and more exciting with each new discovery! :smiley:

26 Likes

Are we just not gonna comment on the sheer speed of which these advancements have been made.

11 Likes

We’re too dumbfounded about the accomplishments to really do so. Either way this is fast as hell.

1 Like

The Legend of HeartHero: Officially part of the ROM hacker canon.

1 Like

@HeartHero

It took a bit longer than I’d have liked and things are still a bit messy, but here’s most of my FE12 work. It consists of the basics: character, item, and class editors. I consider these to be some of the most fundamental elements of Fire Emblem hacking, so I decided to contribute what I know to try to enhance this editor. Keep up the good work!

6 Likes

Alright, this took way longer than expected but I made some huge progress lately. Correct texture loading was just the beginning of map editing for FE12 but getting a flawless representation of how everything looks ingame is another story. The biggest obstacle was to determine how a texture is loaded for assets on a layer.

For an asset there are four points that determine where on the map it gets drawn. However, there are also four points that cut a specific part from the texture associated with the layer. These four points do not only contain position data of a texture but also data for rotation and mirroring. It’s easy to draw a texture that has no rotation or mirroring applied to it but getting that extra information was a little bit more complicated. The solution was to get the minimal X and Y values of all points for the reflection of a rectangle that represents the texture area. With this rectangle and comparisms to the actual rectangle I was able to interpret the data correctly.

The editor now draws the maps like they appear in the game. I also improved the UI a lot:

In my research on tiles I also figured out how animated tiles work and made another interesting discovery. Each layer can be connected with a animation controller that has several parameters for animating a layer. This is usually used for water animations but I imagine you can get very creative with it. You can overlap several animated layers with semi transparency so stuff like moving cloud shadows should be possible in FEDS.


Here we have fast constant movement.


This on the other hand uses a sine function to animate the layer.

How about we combine constant movement + sine movement with semi transparency and animated tiles over other layers?

This works just fine as it seems. Let me tell you one thing: It’s really amazing what FE12 can do. Options for animation controllers will be available within the map editor.

Just two hours ago I also finished the map compiler which is really important. Reading binary data and working with more dynamic objects is just one half of the deal after all. Now the data gets accurately saved as well. This means that I can focus on the editor functions next. :smiley:

40 Likes

YO WHAT THE FUCK THIS IS SO COOL

4 Likes

This game is gonna look so sophisticated with hacking.

The editor progresses. I originally used the GDI Library for map rendering which is not only a pretty old standard within .NET but limited as well. Especially when it comes to rendering performance. That’s why I switched the entire editor view to render maps within the Monogame engine. Now the maps render much faster and I implemented some basic camera controls. Layers can now be enabled/disabled with instant feedback and I also added a terrain view. With the switch to Monogame I can also display animated tiles and animated sprites for character placement directly within the editor at a later stage. :+1:

21 Likes

So map terrain data is just like Pokémon where you have to assign an ID for each tile on the map instead of a general tileset config. That’s interesting.

3 Likes


Now animated tiles aren’t static anymore within the editor window. :slight_smile:

27 Likes

All hail the torches! Finally they get justice in DSFE.

1 Like

I’ve downloaded the modules but i don’t know how to change the class of my characters.

OP, do you think you’ll be able to find a way to convert the cmb files(used for chapter scripts) to a human editable format, like what Exalt does for 3DSFE? That would be huge, imo

Hey, HeartHero. Do you think you could rip all of the fe11/12 maps into image files for the mapping repo I’m building? Extra bonus if you can also get me the tilesets. Me love you long time!

3 Likes

Is this still planned for a public release? I just stumbled across this and it looks amazing :open_mouth:

2 Likes

Is the project still alive? I am always looking forward to have an FE12 hacking tool

3 Likes