Author Topic: [FFX] Battle camera animations?  (Read 4715 times)

Husbjörn

  • *
  • Posts: 36
    • View Profile
[FFX] Battle camera animations?
« on: 2015-08-02 12:00:26 »
I have been trying to reverse engineer the battle abilities / skills from FFX and have made decent progress with regards to stats (power, calculation formulas, mp cost, etc.), flags (targets, elements, types, stealing, menu usability), names / descriptions, status infliction / removal rates and visual animations. There are still about 20 bytes of data per skill I haven't been able to decipher however. Also, there doesn't really seem to be much, if any, information on this available online for whatever reason, but I'm pretty sure there are people around who do posess this knowledge judging by youtube videos of "hacks" etc. If not, I'd be happy to share what I've found out.

Anyway, on to my question at hand.
It appears that the visual animations for skills have camera and character animations built-in (though as for the character's casting animation it seems this can sometimes, but not always, be changed by setting byte 25 in the skill data). Unfortunately this has the end result that most animations used for enemy skills tend to have the camera shift away from the targets and focus solely on the caster for the entire duration of the animation, which naturally isn't desirable. I was wondering if anybody know of a way to get around this (if indeed there is one without needing to find and modify the individual animation data itself). I have so far come up with nothing which is rather off-putting.

Tirlititi

  • *
  • Posts: 874
    • View Profile
Re: [FFX] Battle camera animations?
« Reply #1 on: 2015-08-02 12:31:55 »
I don't know anything about FFX script and there have been really few public releases of tools in my knowledge. The hacks you saw are probably hack made by memory card hacking and not game hacking (the tool's name is FFXED, I think it'll interest you if you don't know it).

In FFIX, the spell animations include the camera movements and are found at 2 different places :
- For the enemies' specific animations, they are near the enemies' statistics and such. Not the exact same place though but in a separate sub-file that is next to the statistics sub-file.
- For shared spell animations, they are found at a totally other place than everything else (I think they are the last data found before the cinematics).

Note that what I call "spell animation" here is more the sequencing of the animations (whichever model animation is used at whichever moment, the camera movements, etc...). And enemies' spell animations often use one of the shared spell animation.

If I understood well, the spells that are normally used by enemies on the party has always a camera centered on the party when casting (even when it's cast on enemies through hacking)? Or is it the other way?
What I would say is that the enemies' spell animations include camera movements centered on the party that are not included in the shared part of the animation. There even may be no camera movements in the shared part, hence the camera not moving at all until the end.


That's for FFIX, though. But I think IX and X are quiet close in terms of data structures. I've already seen some of them in IX and told myself "Ah ! They used the same system for FFX.".

Husbjörn

  • *
  • Posts: 36
    • View Profile
Re: [FFX] Battle camera animations?
« Reply #2 on: 2015-08-02 15:45:35 »
Thank you for your input.
I'm aware of FFXED and how it allows you to use skills presumably through some overflow bug in the game if you set item id's beyond what is normally obtainable within the game itself.
I cannot find said videos at this time and it's been a while since I saw them so maybe this was indeed what was used there, though I believe what was actually done was modifying some black magic spell and not done through an item.
Regardless, this Final Fantasy Wikia page lists a bunch of enemy skills with correct parameters: http://finalfantasy.wikia.com/wiki/List_of_Final_Fantasy_X_Enemy_Abilities.
Granted most of that is obtainable from just observing their effects in the game, but the power and accuracy values are interesting and do indeed match the enemy skills that reside in the game's data so they have probably been retrieved from there one way or another. The following quote from that page also suggests this:
Quote
Abilities listed in italics are not named in-game, but are named as such in the coding.

Upon inspection, it appears that both shared spells as you call them, and enemy-specific abilities are stored in the very same 96-byte structure (this is in memory upon running by the way so the way it is stored in the game files may be different). While roughly interchangeable there still appears to be something else influencing the skills however; for example I replaced all the bytes of the enemy skill "Meteor" with a byte-for-byte copy of the shared spell "Flare" and killed a Behemot King. He casts this skill as a final attack, but he still uses his "final attack" casting animation instead of his normal spell casting animation (which is normally used for Flare, which this monster can also use normally). Furthermore, Flare is a single-target spell (as denoted, and changeable, from its skill data) but Meteor hits all targets, as does Flare when used as his final attack. The camera animation likewise seems different to that used when casting Flare normally, but it doesn't make the camera look to the heavens as is done for the Meteor animation. As such there does indeed seem to be some other component at play here...

Quote
If I understood well, the spells that are normally used by enemies on the party has always a camera centered on the party when casting (even when it's cast on enemies through hacking)? Or is it the other way?
Not quite, I have recorded a video showcasing the results here: https://youtu.be/RwUtX31rvlc
There definately is quite a lot of camera animation in that spell when used "properly" by the behemoth as can be seen at the end of the video, but as you suggest it doesn't do more than show the character casting it and then the camera movement seems to stop there. It might possibly be that the character animation is supposed to tell the camera what to do next, and since there is no such data for the used character animation, it stays where it is until after the spell animation is done. I am not sure how much sense such a system would make though; just imagine all kinds of spells that use the default casting character animation but still moves the camera differently based on the spell. The functionality to do it differently certainly is in there, so then one can wonder why they would bake it into the caster animation in certain cases?

Quote
That's for FFIX, though. But I think IX and X are quiet close in terms of data structures. I've already seen some of them in IX and told myself "Ah ! They used the same system for FFX.".
Indeed, it's quite cool how the older games tend to be relatively similar with regards to certain data structures.

JBedford128

  • *
  • Posts: 113
    • View Profile
Re: [FFX] Battle camera animations?
« Reply #3 on: 2015-08-02 16:54:26 »
I believe the FFWiki's abilities list was mostly adapted from Siniroth X's guide, which may give more information.
« Last Edit: 2015-08-02 21:34:33 by JBedford128 »

Tirlititi

  • *
  • Posts: 874
    • View Profile
Re: [FFX] Battle camera animations?
« Reply #4 on: 2015-08-02 17:22:38 »
When I said "animation", I was more thinking of "animation sequencing". It's not a structure that details a model animation, but it's a sequencing code that may look like this :

Code: [Select]
Run "Cast Death" animation
Display "Meteor" on the screen for 1 second
Apply "Face Behemoth 1" camera over 0 second
Apply "Face Behemoth 2" camera over 1.5 seconds
Wait 1.5 seconds
Run "Death Fall" animation
Launch the "Meteor" shared spell animation
Apply "Looking over the Party" camera over 0 second
Apply "Looking the Party 1" camera over 3 seconds
Wait 3 seconds
Apply "Looking the sky" camera over 0 second
Apply "Looking the Party 2" camera over 2 seconds
Wait 5 seconds
End of sequence

The different animations (Cast Death, Death Fall, ...) and the different cameras being in a different structure somewhere else.

Maybe that's what is inside that 96-byte structure, no?
« Last Edit: 2015-08-02 17:24:42 by Tirlititi »

Husbjörn

  • *
  • Posts: 36
    • View Profile
Re: [FFX] Battle camera animations?
« Reply #5 on: 2015-08-02 21:18:25 »
Quote
I beliebe the FFWiki's abilities list was mostly adapted from Siniroth X's guide, which may give more information.
Sweet, I wasn't aware of that, seems like quite an interesting read!

Quote
When I said "animation", I was more thinking of "animation sequencing". It's not a structure that details a model animation, but it's a sequencing code...
Ah right. Yes, there may very well be something like that somewhere. If I were to guess, I'd assume it to be stored in a separate table somewhere in memory with only an offset from the beginning of that table stored in with the ability data, if they are indeed connected at all. Much like how player-usable abilities are kept in a separate location from enemy-exclusive abilities, where the latter has its name offsets into a different string table than the first, the static cameras may then be caused by the given offset, that points to a valid animation sequence in the enemy-exclusive table, having no corresponding sequence in the character-accessible memory block. Maybe. Though a crash would probably be the more likely outcome than just ignoring camera animations then.
I think I'll investigate by trying to replace one enemy-exclusive skill's data with another and see if that makes any difference or if it'll be the same result still. Heave and Meteor might be good candidates for a swap since they're both unique to the behemoth enemy.

Quote
Maybe that's what is inside that 96-byte structure, no?
No, the 96-byte structure contains the actual skill data.
I haven't managed to get it all figured out yet but when / if I do I guess I'll post a description of it.
It begins with a 4-byte ID that seems to vary incrementally for "listed" abilities such as white magic and black magic, but is set to zero for most other abilities ("Attack", "Defend", "Item", various overdrives, trigger commands, etc.) Following that is a 2-byte offset into the afforementioned string table used to store names and descriptions for player-accessible data. This offset is to the beginning of the ability's name string, then follows 6 unknown bytes and then there's another 2-byte offset corresponding to the description of the ability. Another 6 bytes follows, then there's a pair of two 2-byte values where one represents the visual animation used by the ability on land and the other under water. Then there's another unknown byte and then one that seems related to what casting animation the user of the ability will perform (physical attack, item useage, spell casting, or one of several special animations associated with the issuing actor). Four more unknown bytes follow but then I have the most of them figured out (about half of the skill data is made up of individual infliction rates and durations of all status effects present in the game).
So if anything, I'm guessing one of those unknown values might be an offset into another table containing such an animation sequence as you're describing.