Jump to content
Lamia

FE4 Magic Animation Tutorial

Recommended Posts

Lamia here with some more FE4 resource nonsense for you. This time, I'll be going over the feature that is the coding of magic animations. This is complex stuff to do manually, so bear with me.

In FE4, magic animation is broken down into codes that do specific things. Load graphics, change colors, make it move a certain way, all that stuff. Stringing them all together in wondrous ways can get you the animation you desire. Fair warning, pretty much all special animation during battle is classified as the same sort of code; things like the EXP bar showing, level ups, dialogue and more are called up in a similar manner, so don't mess with those.

I can't be certain and say that this is all different from the GBA series due to my lack of experience in those games, but what I can say is that there's no special program required, just your wits and lots and lots of time for experimentation and testing.

First off, the codes. Each code is separated into two bytes, and paired up as such in pattern: XX YY XX YY XX YY XX YY, and so forth.
YY is the main part. Change it to certain numbers to define what kind of aspect you're changing in the animation, such as sprites and colors.
XX is the variable for YY. Change it for different effects in the current aspect.

Each code is read one by one per frame, unless confronted with wait commands.

The list of codes:
 

 


XX 00 effect mask
XX 02 load tiles (pauses codes until graphics finish loading)
XX 04 display tiles
XX 06 tile effects
XX 08 battle scene mods
XX 0E ? (deals with background)
XX 10 battle scene mods (slightly different)
XX 16 effects, palette
XX 1A placement/scrolling
XX 1C secondary palette?
XX 1E screen scroll to defender
XX 20 screen shake (uses variable, no special codes)
XX 22 add background hue
XX 24 special masking? (fenrir triangle)
XX 26 ? (deals with foreground)
XX 28 load tiles (pauses codes until graphics finish loading) (different?)
XX 2A play sound
XX 2C play sound (slightly lower pitch)
XX 2E play sound (slightly lowerer pitch)

+$40 = add pause
- waits for a fixed period based on the action to allow it to finish, saves on space instead of using the 54 code after everything
- A3 56 for example will use a single animated white palette cycle from healing staves, but add a pause with it so that the next commands don't run while it's still cycling; it's also used for repeated single cycles such as the aforementioned)
- causes lockups for stuff that usually isn't used with pauses; only recommended for these codes: 40, 42, 4E, 56, 5A, 5E, 68

XX 54 wait command (frames)

XX FF control code

F8 FF pause for damage absorb, place after FA FF (as with rizziah)
F9 FF the point where the target dodges if it's a miss (using more than one is fine, just add an additional FC FF after each)
FA FF inflict damage if no miss
FB FF pause for healing, heals target (meaning don't use this for attack magic)
FC FF defender dodge action and reaction, must be placed after F9 FF (and the second FD FF) to prevent lockups
FD FF cast, the first use starts the animation loop on the caster, the second FD FF is for resting
FE FF wait? (doesn't do anything noticeable; free space)
FF FF exit animation



Now, let's take a look at an example custom animation I made: the Blazer tome. (no relation to the individual)
https://www.youtube.com/watch?v=Gcg2pbxsg-M

Location: $17929D (Fire's original location)
Code:
3B 08 3A 02 3B 68 17 1A 0A 46 01 2E
1E 04 FD FF 0F 16 0B 06 0A 54 F9 FF
01 2A 03 1E 12 1A 02 2A FA FF 48 1A
10 16 10 54 FD FF FC FF 1F 04 12 56 36 08 FF FF

Let's decode this, shall we? I have my own personal notes for all this, which I'll provide, of course. Detailed explanations are in bold.

3B 08 begin animation? (is this necessary?) I'm not sure if this code is needed, but it's at the beginning of EVERY magic animation. Won't protest.
3A-3B 02 wind This command preps the Wind tiles, by default 3A, and the pattern organizing them is 3B. I'm not positive the differences between 02 and 28, but left them be as it was how Wind originally loaded.
17 1A behind attacker location This positions the 'main' segment of the Wind graphic just behind the attacker's location.
0A-0B 06 unflatten appear (like fire, wind, etc) Preps the graphic for unflattening, making it appear out of thin air as the original Fire and Wind do.
01 2E (sound) Sounds are important!
1E 04 wind pattern? 04 codes display the tiles in a certain pattern, and no animation can function without one of these codes, without which there would be nothing to look at!
FD FF attacker cast The first FD FF code makes the caster move their arm down and their cloak and hair whoosh in the wind until the next FD FF.
0E-0F-10 16 bolganon red Bolganone is very convenient for reddish colors.
0A-0B 06 unflatten appear (like fire, wind, etc)
0A 54 wait In this case, I wanted the timing to appear just right. Liberal use of this ensures the animation flows well in your eyes!
F9 FF dodge if miss The defender will dodge the moment this code comes up and the attack was a miss. You can have multiple in one animation for flavor purposes, but be sure to use an extra FC FF code for each.
01 2A (sound)
03 1E super fast camera pan This code shifts the camera over. Obviously, this is very important.
12 1A scroll forward fast, defender detection Scrolls the displayed magic animation graphic towards the enemy until it touches their 'hitbox'. It's a big part of how the original Fire, Wind, and Elwind operate.
02 2A (sound)
FA FF hit if no miss Strikes and damages the defender at this point. Don't use more than one of these codes.
48 1A something to do with bypassing target Haven't experimented much with this, but it's part of the aforementioned Fire/Wind/Elwind code. Didn't want to mess with it, and it seems to work with it.
0E-0F-10 16 bolganon red The 10 16 code makes the Bolganone color fade out. A fair number of stringed-together color codes fade in, animate, and fade out in their respective colors in that numbered order. Experiment!
10 54 wait
FD FF attacker cast The caster lowers their arm and rests.
FC FF defender dodge action and reaction If the target dodged, they will go back into a resting and/or ready pose so that they can animate on their turn.
1F 04 clear wind pattern? Several animations have an additional 04 code at the end. I can only assume it clears the RAM so that future animations in the same battle don't get mucked.
12 56 reset tile/palette effects This lovely code erases most graphics and resets colors to the base that the environment uses. Use it!
36 08 end animation (I think this clears most non-tile effects) Like 3B 08, this code appears at the end of every animation. It probably resets 06 and 08 codes just in case.
FF FF exit animation The second most important part of all, of course.

Blazer is a simple C-rank Fire tome I designed to obviously emulate the original Wind in a fiery way. Feel free to copy this tome for your own use if you so desire.

My full magic animation notes text is here. Contained within are all of my code notes, the addresses for the regular magic animations, and some data on graphics locations.
https://pastebin.com/h06s0XTE


Extra Tips
-----

- When choosing XX 16 codes, most of them animate a set of colors, but only certain 'single' colors in a palette. Not all of them cycle through them all and not all of them cycle period, so experiment thoroughly to find what looks best for your animation. There's a fair few colors to choose from, and I certainly haven't found them all.

- Start from an existing magic animation close to what you're looking for (especially graphics-wise), and work from there. It's easier than starting from scratch.

- Nearly all animations, when loading sprites, need a secondary or even tertiary code to load it all properly, as some of the 02 codes organize the tiles in a certain way as well. When loaded, they take up a specific place in the RAM, so it's important to use trickery or clear them when changing graphics in the middle of an animation and/or ending the animation fully, lest you make tacky displays.

- Put a B7 16 code at the start of animations if you're having some color issues. It will clean up the 'base' color in the RAM so that the first one you load can 'fade in' proper.

- Magic animations are in a specific section of the ROM and it is inadvisable to try and repoint them away. Errors have occurred for me and I don't want to see the same thing happen to you all, but feel free to give it a shot if adventurous. Maybe I just screwed up at that time.

- Don't attempt to change the length of the space used for each without repointing to adjust when necessary. Each magic animation has its own length in bytes, listed in my accompanying notes.

- Sound samples are hardcoded as far as I can tell, I can't find a way to change them. If you're modifying the animation for Thunder without changing anything else, it's only going to use the same samples as its item number for Thunder (43). If you want to use different sound effects, you're going to have to change from the item number itself. Don't forget to use the Magic Animation Editor in Nightmare as well if needed to shift things around.

- Swords casting magic works in the same manner as tomes, no worries about those.

- Keep an unmodified FE4 ROM on hand to check how the original animations were done. You'll definitely need them for reference, time and time again.

- Long range tomes and ballistae and some other weapons have some sort of coding that adjusts the positions of the characters automatically at the start of battle. Use the Battle Positions Editor which is available in my FE4 resources topic.

- If you need to add an extra magic tome to the list, item number 56 is notably non-glitchy unlike the rest, and uses Fire sound samples. Keep in mind that there's no way yet to change item icons, so you'd need to move broken tomes to a different number.

- For the advanced, it's certainly possible to add your own graphics, so long as you use the proper codes to refer to them. Going step by step for this is really convoluted, and I'm not sure I'll even try to write a tutorial for that. Regardless, if I'm able to figure it out, I'm sure others could.


Lots of credit to the japanese FE4 community whom I couldn't have gotten started on this without.

Happy animating! Use this topic to ask about anything, especially if I didn't cover something, for the 3 other people into making FE4 projects.

Edited by Lamia

Share this post


Link to post
Share on other sites

Whoa. Those are really cool, if I understood code more I'd have to try it out.. Maybe when I finally have some free time..

Share this post


Link to post
Share on other sites

Hey Lamia I got the hex editor and practiced a bit with it (changed some stuff I wanted to so those problems are gone) But eh I am having issues changing magic spell colors how and where is each entry? I downloaded your notes thingy but I still can`t pinpoint exactly where each spell is located. I was trying to change Thor hammers pallette to holsety green but nothing is happening I think I am in the wrong string of numbers. Know where some of these spells color locations are exactly? I did what was told in the guide but I am probabaly not doing it correctly it says 16 affects pallette so what I do is locate the spell and edit all numbers before 16 but either nothing happens or the game crashes in battle :( I am clearly doing it wrong I thought 16 was the pallette number? gah I have 0 clue of what I am doing as usual :(

Hex editing is sorta fun heh I wanna mess with more stuff and I think magic colors would be a very nice touch.

Edited by Naglfar94

Share this post


Link to post
Share on other sites

you shouldn't be crashing if you only modify the byte before each 16 (palette code never crashes the game iirc)

you can double check to make sure you're on the right spell by temporarily replacing the 3B 08 with FF FF, if the game hangs then it's the right one

anyway, I've noticed that the thunder magics have notoriously tricky palettes, and I've had a lot of trouble changing them, you could try XX 1C codes to pair up with 16 but I never messed with them much, I only have one thunder-based tome in my project (spark) and it did fine using 00 16 (white)

it may be more hassle than it's worth, and I'm almost certain you can't get a green version of them while using the same sprites

Edited by Lamia

Share this post


Link to post
Share on other sites

you shouldn't be crashing if you only modify the byte before each 16 (palette code never crashes the game iirc)

you can double check to make sure you're on the right spell by temporarily replacing the 3B 08 with FF FF, if the game hangs then it's the right one

anyway, I've noticed that the thunder magics have notoriously tricky palettes, and I've had a lot of trouble changing them, you could try XX 1C codes to pair up with 16 but I never messed with them much, I only have one thunder-based tome in my project (spark) and it did fine using 00 16 (white)

it may be more hassle than it's worth, and I'm almost certain you can't get a green version of them while using the same sprites

Oh I see wait.. Lamia so I am supposed to put the numbers in before each 16? I see so er another question does that mean aswell as thor hammer being hard to edit the other Holy tomes are? as I had problems editing Holsety and Fala flame. Are the magic tomes multi layer? As I noticed if i change the bytes before the very first 16 in the entry only a single part changes. I want the main part of the spell to change but the more 16`s I got down the worse the problems get that is when crashing and such happens or glitches :(

Maybe using Holy tomes for color change is not a good idea?? also healing staves seem to be difficult they don`t seem to use 16 for color I will check again.

Here is a look at what I do this is the Holsety tome and what i do is go before each 16 and add the right numbers but not much happens I don`t get it. Am I supposed to edit other numbers in the string of any tome if I ever want to change only the pallette? as each time I do only the number before 16 only i get negative affects Here is a picture example of what I did I sent an image of it. basically I replaced 43 16 and changed it to a1 16 to try and make it fire red. When that did not work I went and did balgonone red since it works great for fire colors but that just made the whole thing glitchy it looked like FE5 thor hammer glitched. So it is clear I am doing something wrong when I edit at the 16`s for each spell as the same thing happens. Maybe seeing this image of what exactly i do can help a bit.

post-8375-0-58237900-1443485471_thumb.png

Edited by Naglfar94

Share this post


Link to post
Share on other sites

Oh I see wait.. Lamia so I am supposed to put the numbers in before each 16? I see so er another question does that mean aswell as thor hammer being hard to edit the other Holy tomes are? as I had problems editing Holsety and Fala flame. Are the magic tomes multi layer? As I noticed if i change the bytes before the very first 16 in the entry only a single part changes. I want the main part of the spell to change but the more 16`s I got down the worse the problems get that is when crashing and such happens or glitches :(

Maybe using Holy tomes for color change is not a good idea?? also healing staves seem to be difficult they don`t seem to use 16 for color I will check again.

Here is a look at what I do this is the Holsety tome and what i do is go before each 16 and add the right numbers but not much happens I don`t get it. Am I supposed to edit other numbers in the string of any tome if I ever want to change only the pallette? as each time I do only the number before 16 only i get negative affects Here is a picture example of what I did I sent an image of it. basically I replaced 43 16 and changed it to a1 16 to try and make it fire red. When that did not work I went and did balgonone red since it works great for fire colors but that just made the whole thing glitchy it looked like FE5 thor hammer glitched. So it is clear I am doing something wrong when I edit at the 16`s for each spell as the same thing happens. Maybe seeing this image of what exactly i do can help a bit.

like I said before, some spells are really picky and aren't easily changed, torhammer is one of them

as for your other questions:

- Are the magic tomes multi layer?
- When choosing XX 16 codes, most of them animate a set of colors, but only certain 'single' colors in a palette. Not all of them cycle through them all and not all of them cycle period, so experiment thoroughly to find what looks best for your animation. There's a fair few colors to choose from, and I certainly haven't found them all.

this means that of the 16 colors in a palette, the palette code only changes a couple of them

also healing staves seem to be difficult they don`t seem to use 16 for color I will check again.

check my guide again; they use 56 codes which means there's a pause as it changes colors (usually once)

I wouldn't recommend using 56 if you want to change the colors to something else generally, since that code can cause a lot of lockups with the incorrect number, and a rule of thumb is to just add a 54 code in places to refine timing better

your screenshot is kind of terrible since it's hard to read, but I found what you were changing

yes that is the correct address for one of holsety's colors, but keep in mind that not all colors picked cycle through colors; the palette code for that spot loops through greens I think

anyway, I went and did it for you if you want a red-colored holsety, so change these addresses:

179C2B: change 64 to A1, fire palette (minor color cycling)

179C39: change 43 to 50, part of falaflame palette (soft red-orange color cycling in the foreground)

179C3F: change 62 56 to 2D 16, part of rezaia palette (reddens the background mostly) also you could try 31 16 or 35 16 depending on your taste

179C4B: change this 54 code to last 48 frames (30) or more or less if you want

after making these changes you'll have a hella red holsety

Fire%20Emblem%204_00005.png

I'd recommend you play around with those color codes there to get a feel for them, but alternatively, the EASIEST spells to experiment with codes would most likely be the staves, healing and sleep especially; reason for that is because they are generally just a foreground layer with a very simple sprite, and the sprite itself contains a decent amount of colors (I think) so you can see most palette changes, and you can easily change its sprite to something else to experiment

as for what spells are really difficult to mess with due to their complicated coding:

Elfire (but color change is easy)

Meteo

Thunder

Elthunder

Tron (very)

Torhammer

Thunderstorm

Aura

Narga

Yotsmungand

Loptous

most everything else, including staves, are pretty easy to make simple mods for once you get a grasp on things

Edited by Lamia

Share this post


Link to post
Share on other sites

Yeah ehheh sorry about that Lamia I am not that good with screenshots haha so that one wasn`t the best. Anyway it worked out fine and i got that red Holsety I had dreamed of!! ah and in regards to those hard to change spells I will leave them alone as Holsety alone was a headache to change. Si basically the same logic that was applied to Holsety goes to all other spells. And I see what you did here kinda you split the colors up in the string.

What i was doing at every 16 number was I was putting in the full string of numbers before the 16 rather than what you did like for example these are just random made up numbers say the spell color in question used 3 sets of numbers so at the very first 16 I would go 43 45 50 16 and do the same thing at every 16 what you did was split them up into pieces and that colored Holsety the color I wanted heh I will test this out on changing fala flames color and see what happens.

Also in regard to healing staves er I am messing with it and I almost got it right almost but a missed the ball at some point close to success I got the animation I wanted yes.. but eh there is a layer missing I noticed the outer layer to the er... main part of the healing spell is missing I was trying to change the animation to blue 24 so i went and put 24 in front of every 56 I saw. I tried replacing 56 with 54 but it just makes pauses in between the spell so it seems I don`t need to do anything for timing here?? hmm in edition to reading your tutorial some more I better take I look at the way your hack is set up for reference since you have changed the colors of some things a good one would be your Imbue spell however I can`t tell what Imbue originally was before it became how it is it was either a recover staff (as it heals alot so far full health) or a Relive so I am not sure which of the two to look for. But gosh does it look good with that fiery red.

Share this post


Link to post
Share on other sites

Yeah ehheh sorry about that Lamia I am not that good with screenshots haha so that one wasn`t the best. Anyway it worked out fine and i got that red Holsety I had dreamed of!! ah and in regards to those hard to change spells I will leave them alone as Holsety alone was a headache to change. Si basically the same logic that was applied to Holsety goes to all other spells. And I see what you did here kinda you split the colors up in the string.

What i was doing at every 16 number was I was putting in the full string of numbers before the 16 rather than what you did like for example these are just random made up numbers say the spell color in question used 3 sets of numbers so at the very first 16 I would go 43 45 50 16 and do the same thing at every 16 what you did was split them up into pieces and that colored Holsety the color I wanted heh I will test this out on changing fala flames color and see what happens.

Also in regard to healing staves er I am messing with it and I almost got it right almost but a missed the ball at some point close to success I got the animation I wanted yes.. but eh there is a layer missing I noticed the outer layer to the er... main part of the healing spell is missing I was trying to change the animation to blue 24 so i went and put 24 in front of every 56 I saw. I tried replacing 56 with 54 but it just makes pauses in between the spell so it seems I don`t need to do anything for timing here?? hmm in edition to reading your tutorial some more I better take I look at the way your hack is set up for reference since you have changed the colors of some things a good one would be your Imbue spell however I can`t tell what Imbue originally was before it became how it is it was either a recover staff (as it heals alot so far full health) or a Relive so I am not sure which of the two to look for. But gosh does it look good with that fiery red.

read the guide again... adding 40 to the basic code usually adds pauses, so you're replacing a palette code with a wait code (makes no sense to the animation) so nothing will happen at that point

as for your inserting a bunch of numbers at once, nowhere in the guide does it say to do that either, codes are pairs only, which you can infer by looking at my sample magic blazer's code

Edited by Lamia

Share this post


Link to post
Share on other sites

Well eh I have good news to bring you Lamia I sorta got the hang of how magic colors work! There are still some mistakes inside but I managed to edit Elwind, Tornado and the recover staff to perfection. Well and the reserve staff too when used it shines 2 colors :P originally it was a mistake as I still did not understand what to do however the mistake made something that looks good so I am keeping the change heh. Now another thing what about Menus Lamia? I didn`t see anything about those in your notes. The status menus how did you change the colors of it in your hack? like the image above me with the dark blue status menu same process you went through? as magic? or something totally different? Not that such a small change like that matters much but eh is a big change from the same old boring brown/grayish color the default color menu uses.

Share this post


Link to post
Share on other sites

menus and nearly everything else is simply a hex-palette thing and I'm sure there's a GBA guide for that somewhere since the systems use the same color limit

Edited by Lamia

Share this post


Link to post
Share on other sites

Mmm? whats this you say? you mean the snes menus follow same thing as gba? I see well that should be easy/hard for me to do as I am not that experienced with gba hacking despite messing around with the games from time to time. But a guide should be easy to find since gba hackers far outnumbers us :'(

Share this post


Link to post
Share on other sites

I was talking about palettes, both systems have the same color limitations

Edited by Lamia

Share this post


Link to post
Share on other sites

Oh.... palettes that is what you meant so gba and snes use same color getup eh? I see so limits are the same eh? umm.. well... guess I better start researching the limits or something then eh... I honestly don`t know where to start with this status menu editing thing :( uhh on a side note during my magic palette changing I have hit another wall ehheh Fala Flame i was changing the spell to blue to get that whole blue flames theme going but failed about 90% through Fala Flame seems like another one of those hard to edit spells. As the background effect`s are not easy to track that spinning thing in the background won`t change color...

I call it a triangle of fire spinning but a may be something else :P and the sun flame?? I don`t know what to call that piece of the spell either is a ring of fire that surrounds the enemy during the spell that is hard to change too. But the rest such as the flame lines? in the background changed fine. Although maybe a half blue half red thing for that spell could potentially look good kinda like how some real life fire is red on outside blue in middle. But I was saving that for Balganone which will be easy to do seeing as to how I got the other spells 100%

Share this post


Link to post
Share on other sites

there are programs to figure out palette changing and such, along with finding the palettes themselves in the ROM (hex editing is required)

anyway as I've said before, using the color change code only changes specific colors in a palette out of the 16, so sometimes you may need to use more than one at a time to cover all the colors you need

Share this post


Link to post
Share on other sites

Ah I see so maybe I will have to use a different color set to fully color the Fala Flame since just using 24 alone won`t change all the colors within maybe if I mix them some will help however there are not too many blue colors in there to use.. Ah there is the restore staff blue I can use. combined with that other one. Also I still haven`t found anything with the menu thing.. I mean I did try to search I ended up looking inside a GBA hacking guide which didn`t have anything on it and i also did a direct search but didn`t find anything.

So I am gonna guess that the dialogue bubble location that you have in your guide is also the holder of the status menus color. I am gonna test that part out later as I think I will do the dialogue bubbles too.

Share this post


Link to post
Share on other sites

Hi Lamia, nice tutorial! (as always)

I want to ask you something

Is there a way to extract the FE4 magic animations and then insert them on a FE GBA rom?

I tried to ripp the spell using the screenshot option, but the it doesn't look really neat in a GBA rom

Is there something we can do about it? It would be interesting if we can add Forseti and Valflame on a FE8/FE7

Edited by Sagi

Share this post


Link to post
Share on other sites

Hi Lamia, nice tutorial! (as always)

I want to ask you something

Is there a way to extract the FE4 magic animations and then insert them on a FE GBA rom?

I tried to ripp the spell using the screenshot option, but the it doesn't look really neat in a GBA rom

Is there something we can do about it? It would be interesting if we can add Forseti and Valflame on a FE8/FE7

it will take a lot more work to make it look identical or even fairly similar to FE4, if that's what you were wanting to go for

it's hard to tell due to the poor framerate of your video, but it seems like you didn't quite animate it like the original, and the resolution of the tiles is too small, probably due to the native resolution of the SNES compared to GBA... don't resize, it looks REALLY ugly, I would say construct a pattern instead

additionally, there are two layers in the original animation, which I don't think is something that the animation maker for FEditor supports? in FE4/5 the background tiles of holsety overwrite the environment background, which is mainly why the screen darkens in the first place

still, not a bad first draft

falaflame/valflame is way simple by comparison, especially since you could probably hand-draw the whole animation in a decent amount of time and make it look nice, perhaps even improve on it

I would suggest taking this subject to another topic though, since this should be about FE4/5 construction specifically

Edited by Lamia

Share this post


Link to post
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.


  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...