øAslickproductions.org/forum/index.php?PHPSESSID=5f0fck550j2m4m2fpbtkj2vkm1&topic=1328.0;wap2e:/My Web Sites/Slick Productions - FFIV Message Board/slickproductions.org/forum/index675c.htmlslickproductions.org/forum/index.php?PHPSESSID=5f0fck550j2m4m2fpbtkj2vkm1&board=17.0;wap2e:/My Web Sites/Slick Productions - FFIV Message Board/slickproductions.org/forum/index675c.html.zx ôg^ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÈ`©~$OKtext/htmlISO-8859-1gzip@øÕ~$ÿÿÿÿÿÿÿÿTue, 10 Mar 2020 20:26:11 GMT0ó°° ®0®P®€§²ð® ôg^~$ Spell Animation Guide v0.85

Library of the Ancients > Final Fantasy V Research & Development

Spell Animation Guide v0.85

(1/6) > >>

LightPhoenix:
Version 0.85 is out!

I didn't get nearly as far as I wanted to this month, so I'm calling it version 0.85.  Unfortunately my work schedule for the next three to four weeks is brutal, and I can't guarantee I'll make much progress on the guide.  I also don't get any time off for the holidays (I work at a hospital).  Nonetheless, my plan is to update this on or around January 1st.

I'm proud to say that of the main 128 functions, only two are unknown.  F7 is a complete unknown to me right now; it's used in Exploder, and may be an enemy-only function.  Removing it from the Blue spell has absolutely no discernible effect.  FC runs based on the target, sets a flag, and that's all I know.  I think it's a flag to change rows, since it's used in Pull.  Of the F5/F6 functions, I'd estimate about a third of them are known, including most of the F5 functions.  In particular, Missile and Roulette functions are giving me a bit of trouble.

I'd like people who read through to comment on anything confusing or unclear.  If there's any issues, I can try to clarify or fix anything.

Jorgur:
This is great progress. We should now be able to add/replace magic to the game.

If you also find the lookup table for items, I can add the Sabre in v0.6 of my hack. ;)
Seing as the magic animations go by the common list, I am guessing that is also the case for weapons (and usables ?).

Note: The hacking guide has been updated and split into several documents. Check my topic for links.

LightPhoenix:
As it turns out, it's a little more complicated than it first seems.

One problem I was having was the "creature mask;" the color the monster changes when certain spells hit them (ie, blue for Ice, orange for Fire).  Changing the spell animation color didn't change this mask.

As it turns out, I was wrong about the meaning of one of the bytes.  The third byte isn't actually the animation shape.  The third byte is actually an animation routine.  This byte (and the high bit from the second byte, which as of yet I've never seen set) is passed to a variable ($F586) that in turn performs a lookup on a table at D9/7D42.  This table is a series of two-byte value indicating the address of the animation routine to perform.  These addresses all appear to be in the upper half of the D9 bank.

(Aside: they should be very easy to re-direct to expand)

The animation routines vary widely.  I'm still decoding them, but the basic format is a three-byte "header" whose purpose I have not discovered yet.  After the header are the instructions.  The end of the routine is given by a value of #FF.  This routine is read at (roughly) C1/C48A.

The instructions have two types.  Anything less than #80 is a simple frame call.  Anything with the bit 7 set (ie, above #7F) is a special instruction, given by the remaining bits.  Special instructions often take parameters, which are bytes that follow the instruction.  The number can vary, and is determined by the special instruction.

An example of the very simple code for Fire (at D9/8F5C):


--- Code: ---00 20 00 80 0A 10 11 12 13 80 00 FF
--- End code ---

The first three bytes are a header, whose function I have not determined.

The next byte is 80, which indicates a special function.  In this case, #80 indicates to use a creature mask of the color given in the next byte.  That makes this instruction 80 0A, and sets the creature mask to orange.  Changing the parameter on #80 does change the mask color; more on this below. 

Following that are individual frames to play: 10, 11, 12, 13. 

Next, we have another call to #80, this time with the parameter 00.  This indicates to clear the creature mask.

Finally, FF indicates the routine is over.

LightPhoenix:
(Part II: A Little More In Depth)

The parameters for #80 are not entirely straightforward:


--- Code: ---00: Clear
02: Violet
0A: Orange
12: Blue
1A: Yellow
22: Green
2A: Grey/Purple (Periwinkle?)
32: Brown
3A: Lavender
42, 4A, 52, 5A, 62, 6A, 72: Black
7A: Gray

--- End code ---

Looking at the code for #80, this increment of 08h becomes more apparent; the value gets divided by 8 to determine the color.  It also ignores any value higher than #0F (ie, above parameter 80).  I removed this restriction, and the function still worked, albeit with poor results.  None produced solid colors; most produced psychedelic rainbow patterns.  It looks like 42-72 are all blank masks; conceivably other colors could be added here.  They may be involved in the creature blinking when attacking though.

As an example of slightly more complicated functions, here are Ice (D9/914D) and Bolt (D9817C).


--- Code: ---Ice
22 20 05 80 12 CA 08 5D CB 80 00 FF

--- End code ---

--- Code: ---Bolt
20 00 0A 80 1A 83 12 1E 83 80 1F 83 12 20 83 80
21 83 12 22 83 80 23 83 12 24 83 80 25 83 12 26
83 80 27 C3 03 B2 40 83 12 41 83 80 42 83 12 43
83 80 44 83 12 45 80 00 FF

--- End code ---

Ice is an interesting one, but relatively straightforward.  The CA/CB function is a loop (#CA: start loop, #CB: end loop), with the first parameter being number of frames and the second being the starting frame.  Changing 08 to a lower number will result in a partial animation.  Changing it to 00 or greater than 08 crashes the game.  Putting in the frames manually (ie, 5D 5E 5F 60) does play the animation fine, albeit only half the animation since it's eight frames.  Obviously, using the loop is smaller than listing out every frame individually (4 bytes versus 8 bytes).

Bolt has a long function.  #83 superficially appears to control the animation color mask.  I believe this can be used for dynamic control of color; for Bolt this gives it a flashing animation as it switched between 83 12 and 83 80 (which I believe indicates no override from the master table).  Note that in the master table, #12 indicates a blue color; it does the same here.  I don't yet know what #C3 and #B2 do yet (or if it's one function #C3 with three parameters).  I'll need to look at the code and experiment.

I have a couple of very busy weeks ahead of me.  I'll try to keep up on the research, but it may be a couple of weeks before I post again.  After the 14th things should go a little smoother.

Jorgur:
Another good piece of progress. Good work, as usual.

It doesn't come as a surprise that each spell has its own routine, seeing as how different the spells can be. Weapon animations, however, I'm not so sure about. I would be happy to give you some advice on how to put down the missing pieces, but my guess is that you would prefer doing it on your own (like I do).

You should make a document on this, or if you don't have time, I could document it in your name (I have plenty of time :p). Perhaps a little later though, when everything has been tested and solved in detail.

Navigation

[0] Message Index

[#] Next page

Go to full version