Soldier animations -- how does the animation system work?

In this forum you will find and post information regarding the modding of Star Wars Battlefront 2. DO NOT POST MOD IDEAS/REQUESTS.

Moderator: Moderators

Post Reply
PlayerX

Soldier animations -- how does the animation system work?

Post by PlayerX »

I was originally going to post this in the BF1 section but from what I can tell, BF1 and BF2 soldier animations seem to be identical so I'll post it here in case anyone else modding for BF2 can help or benefit from the answers too.

I've been trying to figure out how to add new soldier animations to the units. I read the BF2 animation docs, but there seems to be a gap in what is explained and how you would implement/insert new animations. I'm going to use BF1 as an example since that's what I mod for and am familiar with.

My understanding is that in the weapon ODF, you can set the animation that is executed when a unit is using that weapon. By default, it would be an animation defined within the "human" set of anims. In almost all of the unit ODFs, what I always see is:

AnimationName = "all_inf_snowtrooper"

To be honest, I've never been quite sure if this command works or if it is ignored and some hardcoded default is used that loads the human animations regardless. When I looked at the "Shipped Common Animations" folder in my BF modtools, I don't see anything that references the "snowtrooper" anywhere in the various human bank folders. So first question is, why is all_inf_snowtrooper used all over the place?

But then that leads to another similar question. When I look at the ODF for the lightsabre (BF1 version), we see this:

AnimationBank = "lightsabre"

But in the modtools common animations folder, what I see in the folder "human_bank_3" are a set of anims that have the prefix "human_sabre_". I've always been under the assumption that the name that follows "human_" is the bankname, yet here the folder's bankname appears to be "sabre" not "lightsabre" so how is it that when we assign the animationbank in the ODF, that somehow the game makes the connection between "lightsabre" to "sabre"?

Finally, in the BF1 "force push" ODF, once you do load the "lightsabre" animation bank, you can then use the command:

FireAnim = "2"

..which again, I'm assuming that it tells the ODF to use the second stored animation in the "lightsabre" animationbank. This would seem to correspond to the "human_sabre_stand_shoot3" animation (I also am guessing that the anim for the lightsabre swing is "human_sabre_stand_shoot"). What determines the ordering in the bank (so that I know which FireAnim number to call?)

It's all been maddening to figure out... I don't know how many other modders are also confused by all this but I'd be grateful for any insight by anyone who knows what the linkage is between the animation assets in the modtools are, with what is actually then used in the ODFs to call them.
PlayerX

Post by PlayerX »

Hi fred, yes your BF2 animation doc was the first thing I read when I was trying to understand how all of this works together. It was a LOT to absorb so I know a lot of it may have slipped through the mental cracks here and there. I know some things that I tested using the doc as a guide turned out not to be supported in BF1 (e.g. SkeletonLowRes seems to be only for BF2, and I didn't realize that AnimationName and SkeletonName are supposedly the same ODF command until I read it -- quite unusual, I always thought they referred to different things). In the end, it made it a bit hard to be confident that if my experimenting was not working whether I was making mistakes or if I was trying to use a non-existent BF1 command.

I guess the one thing that was missing from the doc, which might fill in the gaps for me (and maybe others), would be an example of how the developer takes those unit animations that are in the various anim folders, and eventually ends up with an anim that can be loaded from the ODF and works in the game. Obviously all of these get munged into their binary counterparts, and then put into the common folder so that they can be referenced by the ODFs. That's really where my confusion started (as noted, why is the animation name "human_sabre_" and then somehow the animationbank is "lightsabre" in the ODF? Where does the connection occur between "sabre" and "lightsabre". I thought that the command would've been: AnimationBank = "sabre")

I'll give an example of something that I was trying to do based on my (limited) understanding of BF soldier animations which I thought would be possible but doesn't seem to work. I wanted to port one of the Jedi animations in the BF2 modtools folder over to be used in BF1. It didn't matter which one, just wanted to prove it could be done (if that were possible, then eventually I wanted to make all-new custom soldier animations of my own).

In the human_sabre folder, there's "human_sabre_stand_useforce_full". I munged the entire folder and it creates:

- human_sabre.anims
- human_sabre.zaabin
- human_sabre.zafbin

in the /assets/sides/common/munged folder of BF2 modtools.

I thought that if I copy over these files into my BF1 sides/rep/munged folder, I could then reference the useforce animation from my weapon ODF e.g. in the lightsaber (melee) or a cannon ODF, I could then put:

AnimationBank = "sabre"
FireAnim = "7" (just guessing, since I didn't know what index the useforce anim would be stored at, I thought maybe it could be alphabetical order even)

This didn't seem to change anything really in-game, and I did go back and try "lightsabre" to see if that was the bankname it was expecting but no luck there either. It's been a while but I think I also tried copying the zaabin/zafbin/anims to my c:\BfBuilder\Data\Common\munged folder to see if that might work (which also seemed to fail).

It also occurred to me that maybe the Jedi in BF2 use different skeletons and that their Jedi animations aren't compatible with the units in BF1 (but I didn't really know how to verify this). So, lots and lots of confusion and unanswered questions. A search on GT didn't yield any answers either.

And here we are :)
PlayerX

Post by PlayerX »

Ah okay thanks for the detailed explanation fred, I do think I'm finally starting to understand a bit more about how this works (dimly, but clouds are starting to clear a little).

I did notice that for the grenade ODFs, that they don't use FireAnim, they seem to use ForceFireAnimation instead. Is there a reason for this? Does it work differently than FireAnim or did the programmers simply not coordinate on what they wanted to call the function? :)

EDIT: Also, how would I rebuild (munge) the animations that come with the BF1 modtools? Unlike the BF2 modtools, there is no munge_animation.bat file in the Common Animations root folder. I copied over the bat file from the BF2 mod folder and while I can munge inside an individual human_bank folder (which then creates a .ZAT file) I can't seem to figure out how to get it to create the same output as what I see in the already munged anims that are included with the BF1 modtools i.e. the finalized zafbin and zaabin. All that I have is the ZAT. As well, the BF2 anim documentation doesn't seem to describe what a ZAT file is....
User avatar
Teancum
Jedi Admin
Jedi Admin
Posts: 11080
Joined: Wed Sep 07, 2005 11:42 pm
Projects :: No Mod project currently.
Games I'm Playing :: Destiny
xbox live or psn: No gamertag set
Location: Indiana

Post by Teancum »

Maybe ForceFireAnimation forces an override of the default animation. Just a thought.
Post Reply