Jump to content
Crimson Red

How to Fix Looping Battle Animations

Recommended Posts

Agro couldn't get the pupil from FE8 to work likely because the hard-coded way of looping isn't... well, coded, in FE7.

Well after some research I fixed it.

Here's the download of the fixed version just in case someone comes looking for it

You'll need a hex editor and of course, FEditor Adv. I use HxD. This should work for any looping animations imported from one game not inserted to the other, assuming you're using FEditor Adv since you need its auto-patches and all that other good stuff.

Here's the chat I had with Agro detailing it. I took out some lines, indicated by double line breaks. I'm the guy not named Agro.

[5:25:11 AM] ballin1337: the reason why it doesn't work

[5:25:14 AM] ballin1337: is because it's hard-coded

[5:25:20 AM] ballin1337: it probably doesn't work for ANY new classes

[5:25:24 AM] ballin1337: as I remember that I had a similar problem

[5:25:26 AM] Agro: http://puu.sh/NBew

[5:25:28 AM] ballin1337: with Lyon

[5:25:35 AM] ballin1337: you can fix this using hex in 2 ways AFAIK

[5:25:36 AM] Agro: ahhh i see

[5:25:44 AM] ballin1337: 1) do what I did, be lazy, and take out the loop

[5:25:49 AM] ballin1337: it looks bad

[5:25:53 AM] ballin1337: so if this is a hack you care about

[5:25:57 AM] ballin1337: you probably don't want to do that

[5:26:05 AM] Agro: sounds about right

[5:26:09 AM] ballin1337: 2) replace the looping with a real loop

[5:26:13 AM] ballin1337: as for what a "real loop" is

[5:26:15 AM] ballin1337: I don't know

[5:26:22 AM] ballin1337: but the existing one uses Command 47

[5:26:29 AM] ballin1337: can you launch me the frame data

[5:26:30 AM] ballin1337: for the pupil

ballin1337: if it's simple, it should only take like 10 minutes to fix

ballin1337: okay so I guessed it right the hex code is 47 00 00 85

[5:28:28 AM] ballin1337: this has to change to a loop

[5:28:33 AM] ballin1337: so lemme look how FEditor Adv does loops

[5:29:16 AM] ballin1337: you're in luck, one of my penultimate bosses is a mage~ *searches*

ballin1337: *tries to remember how the script converter works*

[5:31:45 AM] ballin1337: hmmmmm...

ballin1337: surprisingly

[5:35:07 AM] ballin1337: I don't see anything that resembles a loop code here

[5:35:09 AM] ballin1337: or anything abnormal

it's possible the script converter doesn't support it or something though

[5:35:36 AM] ballin1337: so I'll look at it in hex

[5:39:00 AM] ballin1337: I may have found it (EDIT: I did end up finding it at this point, but I wanted to do tests and whatnot to make sure I understood it completely).

[5:39:05 AM] ballin1337: but I'm going to look a little more to be sure

(insert me breaking down the code in hex which I doubt anyone cares about)

[5:41:39 AM] ballin1337: the only thing that's weird

[5:41:42 AM] ballin1337: is 01 09 00 85

[5:41:54 AM] ballin1337: because commands are usually one byte, and 01 would be that byte

[5:42:26 AM] ballin1337: but essentially it's saying command "0x0901" (it's in little endian, so it works like 85 00 09 01; 85 means "animation command" or something and 01 is USUALLY the code, but this one has an extra flag)

[5:42:32 AM] ballin1337: so I'm guessing to fix it

[5:42:38 AM] ballin1337: we should just change the pupil's 01 00 00 85 code

[5:42:41 AM] ballin1337: to be 01 09 00 85

[5:42:48 AM] ballin1337: I'll test it for you though

[5:42:51 AM] ballin1337: before I go make you do useless work

(I bet Xeld probably knew this; he probably coded it this way so that 09 is the custom loop flag or whatever. Also, Cam's script converter doesn't differentiate between C000001 and C000901, not to his fault; as for what the "85" [0x85] is, think of that as the game's way of saying "this is an animation command", noting that while looking at the frame data in hex, the byte order is reversed due to little endian, so it's actually 0x85000001 or 0x85000901 depending on whether it doesn't loop or loops respectively)

I bet you someone on like team overtroll or something already knows this

[5:43:12 AM] ballin1337: and just doesn't want to share it or something

[5:43:21 AM] ballin1337: or rather didn't think it was important (EDIT: I mean nothing bad, but sometimes people overlook small little things like this, thinking that it isn't really useful info. I've done it myself, at the very least)

[5:43:24 AM] Agro: well i already asked everyone there

[5:43:28 AM] Agro: and everyone was like

[5:43:39 AM] Agro: "you'll probably have to redo it from scratch" and i was like wut

[5:43:41 AM] ballin1337: lol

[5:43:47 AM] ballin1337: alright, well let me test

[5:44:12 AM] ballin1337: I could test it on my guy, but I'm not trying to break him, just fix the pupil, so I guess I need an animation testing ROM...

[5:44:47 AM] ballin1337: oh I guess I have to rip the entire pupil anim now

[5:44:49 AM] ballin1337: can you tell me which ID it is please

[5:44:55 AM] Agro: um

[5:44:55 AM] Agro: ...

[5:44:57 AM] Agro: hold

[5:45:11 AM] Agro: do you need me to like

[5:45:14 AM] Agro: send you the frames and shit

[5:45:15 AM] Agro: i can do that

[5:45:25 AM] ballin1337: lol

[5:45:27 AM] ballin1337: just the ID will work

[5:45:29 AM] ballin1337: I'll rip them myself

[5:45:57 AM] Agro: 95

[5:46:04 AM] ballin1337: thanks

[5:46:49 AM] ballin1337: good thing I still have a savestate on my animation tester ROM with a mage o_O

[5:46:57 AM] ballin1337: I surprise myself sometimes... ahem

[5:47:10 AM] Agro: how random

(At this point I try a bunch of stuff and fail a couple times, and laugh it off before continuing)

[5:55:22 AM] ballin1337: XD

[5:55:43 AM] ballin1337: hold on though

[5:55:47 AM] ballin1337: let me try a few more things before I forfeit

[5:55:56 AM] Agro: whooo

[5:55:59 AM] Agro: go blazer go

[5:57:31 AM] ballin1337: okay

[5:57:33 AM] ballin1337: I fixed it

[5:57:58 AM] Agro: you did?!

[5:58:03 AM] ballin1337: yes

[5:58:05 AM] ballin1337: works perfectly.

[5:58:10 AM] Agro: yesyesyesyesyesyesyes

[6:02:15 AM] ballin1337: there's a glitch with it though

[6:02:24 AM | Edited 6:02:30 AM] ballin1337: as I made every mode loop

[6:02:40 AM] ballin1337: I have to limit it to only certain ones

[6:02:47 AM] ballin1337: 01/02, 03/04, 05, and 06

[6:02:50 AM] ballin1337: and 12

ballin1337: lol sorry

[6:04:17 AM] ballin1337: I'm being lazy

[6:04:26 AM] ballin1337: this fix will be the real one

[6:04:29 AM] ballin1337: and then I'll like

[6:04:30 AM] ballin1337: idk

[6:04:32 AM] ballin1337: copy/paste this chat

[6:04:38 AM] ballin1337: so people know how to do it in the future

[6:04:41 AM] ballin1337: unless you don't want your lines copied

[6:04:44 AM] Agro: do it

[6:07:06 AM] ballin1337: damnit, my game glitched D:

[6:07:09 AM] ballin1337: y u glitch silly game

[6:07:12 AM] ballin1337: probably because I deleted code

[6:07:39 AM] Agro: do you need to send the frame data agen

[6:07:39 AM] ballin1337: figures that was a bad idea

[6:07:41 AM] ballin1337: no

[6:07:42 AM] ballin1337: lol

[6:07:43 AM] ballin1337: I backed up

[6:07:49 AM] Agro: heh

[6:10:15 AM] ballin1337: okay

[6:10:18 AM] ballin1337: it's fixed for real this time

[6:11:01 AM] Agro: rly

[6:11:03 AM] Agro: RLY

yes really

[6:11:21 AM] ballin1337: back-up just to be safe though

[6:13:13 AM] Agro: yesssss

[6:13:17 AM] Agro: you sexy beast you

[6:13:24 AM] Agro: works like a charm

[6:13:31 AM] Agro: actually those don't really work

[6:13:48 AM] Agro: works like a mexican illegal immigrant!

[6:14:02 AM] ballin1337: lol

[6:14:09 AM] ballin1337: I actually laughed, good one ;)

[6:14:17 AM] Agro: apologies if you happen to be mexican

For the record I'm not Mexican

so the hard part was figuring out what to do (kinda, and I'm sure some genius will come in and point how they could have done it in 5 minutes or it's already been done this way several times or something...)

the easy part is actually fixing it; it beats the CRAP out of remaking the animation.

All you have to do is (granted, I'm assuming you have some experience with FEditor Adv and HxD, so I won't go over basic hacking concepts)

1) Dump the data of an animation that doesn't loop properly using FEditor Adv.

2) Open the frame data using HxD (you may want to keep a back-up, but edit the one whose name matches the main data so you don't have problems with file correlation or something when you insert it).

3) (READ STEP FOUR BEFORE THIS) Find instances of 47 00 00 85, the original looping command. This mechanism won't work anymore, but I don't suggest deleting the bytes. Rather, make it use something unused. I used 17 00 00 85 instead, because then I just have to change the '4' to a '1', and C17 (17000085) is unused and at least for me, didn't affect the game.

4) Right underneath the above code should be an 01 00 00 85. This is equivalent to C01 in a FEditor script. All you have to do is turn it into 01 09 00 85. ONLY do this for the modes that have looping normally! In other words, replace C47/47000085, then replace the 01000085 in the same mode underneath it. DO NOT just replace all or you will end up making other animations loop, such as the standing animation and whatnot. It's not cute, to say the least, and it can get way buggy.

5) After you change the relevant ones (for magic users it should be modes 01-06 and 12; for just the ranged animations, just 05-06 and 12, probably) save and insert the edited data using FEditor Adv.

That's all there is to it. It's rather easy and I'm glad it is because it'd be pain to remake them.

Now someone go and fix all the relevant animations in my stead :P

Edited by Strawhat Luffy

Share this post


Link to post
Share on other sites

yay working pupil animation

not that anyone but me cares

Share this post


Link to post
Share on other sites

Even if they don't care about the pupil someone might care about another animation

Like say the Necromancer one or something

and it might work from FE7 to FE8 (e.g. Nergal) was well although some other problems might arise, such as the one from Nergal's dark aura effect :\ those can be replaced as well, but actually importing the effect would be hard

Share this post


Link to post
Share on other sites

*applauds* i was considering using the pupil for DR.

Um, I thought necromancer already worked in FE7? I think Sholes had ported it to his hack way back when and (correct me if I am wrong) that if it was an issue you would have pointed out how to fix it when you made Sacred Contention.

Share this post


Link to post
Share on other sites

That would be "stopping the loop" from happening solution.

Unfortunately for us when people remake animations, they're not as accurate as BwdYeti's rips.

I see what you did here. FEditor's own "looping" frames "L" command in the script is different than the hardcoded "85 00 00 47" command code. I'm presuming it's the code you posted, the "85 90 00 47".

Wonder why we never thought of trying that before.

As for the Dark Aura effect, it could work... if it's already in FE8 and they didn't delete it for another ASM effect. Otherwise, it's pure ASM like spells.

The only thing left to do for "magic class animation-wise" is to figure out the hardcoded index entries for that "Sage Rune/Mage flicker" switch for the animations. Because, if you notice, mages who get imported on a slot other than a previous mage animation entry use the Sage Rune effect, rather than the normal mage flicker.

Edited by shadowofchaos

Share this post


Link to post
Share on other sites

I meant as in "It's unused in there somewhere with access to it cut off" type ASM.

That means you're going to have to make a new command for it even if the unused data is there... but that's just being hopeful.

Edited by shadowofchaos

Share this post


Link to post
Share on other sites
Um, I thought necromancer already worked in FE7? I think Sholes had ported it to his hack way back when and (correct me if I am wrong) that if it was an issue you would have pointed out how to fix it when you made Sacred Contention.

no, and I fixed it back then by stopping it, which is an ugly solution, but I didn't really perfect Sacred Contention which was made forever ago anyhow, so eh

That would be "stopping the loop" from happening solution.

oh, yes

Unfortunately for us when people remake animations, they're not as accurate as BwdYeti's rips.

It's quite a bit of work to make them so accurate, so yeah, I think that's reasonable... I mean BwdYeti's pretty skilled in both programming and battle sprites AFAIK, so...

I see what you did here. FEditor's own "looping" frames "L" command in the script is different than the hardcoded "85 00 00 47" command code. I'm presuming it's the code you posted, the "85 90 00 47".

...no, no

it's "85 00 09 01"

it's coded in the code that says "wait on the last frame until HP depletion is completed"; instead it says "repeat the frames in between this and the animation depletion routine (which is coded into the spell animation which is initiated by C05) until HP depletion is completed".

lol

The only thing left to do for "magic class animation-wise" is to figure out the hardcoded index entries for that "Sage Rune/Mage flicker" switch for the animations. Because, if you notice, mages who get imported on a slot other than a previous mage animation entry use the Sage Rune effect, rather than the normal mage flicker.

I'm not sure what you're talking about. Can you elaborate or something

That means you're going to have to make a new command for it even if the unused data is there... but that's just being hopeful.

I might have an idea or two about how to do this in my head but I'm honestly not interested so I won't even begin to try

oh and hi BwdYeti, I see you checking out this silly little topic~

my script converter is far from perfect and probably misses a lot more than just loop markers

EDIT:

@Cam I'm glad you know

it's nifty and (mostly) serves its purpose anyhow

I mean it's not like you get paid to do this so I can't really complain if it's missing one or two things :\

Edited by Strawhat Luffy

Share this post


Link to post
Share on other sites

I'm not sure what you're talking about. Can you elaborate or something

This:

LilinaFE8SageRune.pngBleh-2.png

Normally it's like this:

MageEffect4.png

The mage "flicker" is the same command as the Sage's Drawing Rune as well as the Critical Rune, and only works on those designated animation slots.

It screws up spells unless you take it out.

Edited by shadowofchaos

Share this post


Link to post
Share on other sites

Wait, so, tl;dr synopsis/question: This fix makes capes/hair loop proplerly like the animations native to that particular game and it works for all new animations or just ones that are imported from one of the other GBA games? Am I understanding this right?

Edited by Lord Glenn

Share this post


Link to post
Share on other sites

It will work for every slot BUT the hardcoded one.

As in, use the 0x47 command when you're putting an animation in a slot in which the original game has looping with.

Share this post


Link to post
Share on other sites
The mage "flicker" is the same command as the Sage's Drawing Rune as well as the Critical Rune, and only works on those designated animation slots.

It screws up spells unless you take it out.

So emphasis on the second part; I am SURE I got the Sage drawing and critical runes working in multiple animations, and they didn't replace mages or sages. Am I lucky or what? I had no idea the commands ever had any issues with being used; they always worked for me. Is it an FE8 problem only? I see you only posted FE8 screenshots :O

Wait, so, tl;dr synopsis/question: This fix makes capes/hair loop proplerly like the animations native to that particular game and it works for all new animations or just ones that are imported from one of the other GBA games? Am I understanding this right?

Shadowofchaos answered but just in case that wasn't detailed enough for you

Let's say we have two games: FE7 and FE8. FE7 is the "original game". FE8 is the "new game", from which we are importing animations (i.e. they go from FE8 to FE7).

Animations already in FE7 should use: the hardcoded loop, C47. The game already knows how to do this. This *may* include say, inserting the female-sage animation from FE8 onto the male-sage animation from FE7, since they may be hardcoded exactly the same, but I'm not sure which is why I'm scratching this out.

Animations from FE8 should use: the new loop. The hardcoded loop is likely a pain in the ass to "import" from FE8, so it's easier to fix the loop by using FEditor Adv's new looping mechanism (C000901 versus just C01, essentially, but you have to do this in hex AFAIK, and must also replace the hardcoded loop with an unused command like C17 instead of C47).

New animations should use: the new loop. This time though, since you have the "original" script and "original" frames that you made by yourself (unless you're a sprite thief ;)), use the L command before the frames that should start looping. This is how new animations do looping.

As I didn't exactly understand your question, I just tried my best to make a better summary. Hopefully at some point I answered it :\ if not, feel free to try rephrasing your question or something

Edited by Strawhat Luffy

Share this post


Link to post
Share on other sites

So emphasis on the second part; I am SURE I got the Sage drawing and critical runes working in multiple animations, and they didn't replace mages or sages. Am I lucky or what? I had no idea the commands ever had any issues with being used; they always worked for me. Is it an FE8 problem only? I see you only posted FE8 screenshots :O

Happens in all of the GBA Games.

Share this post


Link to post
Share on other sites

So why didn't it happen with my animation? >_>' you say they don't work but it worked flawlessly so long as I gave time for the game to process the animation BEFORE the spell animation loads (or else they interfere or something)

Share this post


Link to post
Share on other sites

So why didn't it happen with my animation? >_>' you say they don't work but it worked flawlessly so long as I gave time for the game to process the animation BEFORE the spell animation loads (or else they interfere or something)

Take the male mage animation... paste it into another animation slot. It'll glitch up.

Share this post


Link to post
Share on other sites

Oh so it only happens with imported animations

Well there may be a way to fix it

or maybe not

thanks for giving info on it anyway, tbh I don't particularly need to do any of that so I don't have a need to fix it at the moment and as much fun as it is to try and do random hacks to help people I 1) probably don't have the skill to and 2) have other priorities that need tending to... :|

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...