Modding Rundown: Animations

Started by thetommyboy2002, March 10, 2007, 11:21AM

Previous topic - Next topic
Sorry, been running chkdsk on a bad hard disk all day, when I wasn't trying to get our "broadband" to actually BE broadband, so I haven't had much time to play today.
But I think that you may be on the right lines.
Interestingly I set the External Animations path up to a subdir called "anims" under where I've been exporting to, and now both my animations "associated" with Actors are getting exported into that dir (albeit one is suspiciously small). Maybe we need to export separate anims into that dir to build up a library, then somehow get the exporter to load them all into one larger animation/skeleton file.
I'll try playing with the naming of the note tracks a bit, but it strikes me that if you look at a "real" original animation file ie 05_thing.igb, you see the names as "menu_idle" etc, NOT as "ea_menu_idle", so I'm thinking that the ea is not set up in the note track in max, but is a code the game uses to recognize the external Animations within the "skeleton" files. But this is guess work on my part.
I have an hour or two to play now so I'll see what i can get done.

October 22, 2009, 01:49PM #46 Last Edit: October 22, 2009, 01:59PM by Mr. Law^^
Well I've found a tut somewhere (but my history is cleared by tuneup util.) which says how to create multiple animations by adding every part the biped into a group. Actually creating a group of the biped (including Bip0x Footsteps). It said to give the group the name of the animation. I remember how the tut went though:

- Select Bip01
- Put it in Figure mode
- Select every biped (including footsteps)
- Click on Group > Group. Give it the name of the animation.
- Click on Group > Open
- Select Bip01 and turn Figure Mode off.
- Animate all you want. After you're done, click on Group > Close. This causes the square around the biped to disappear and making the group visible as 1 "object" instead of separate bipeds.
- For multiple animations, create a new biped and rename it to Bip01 (the previous one is now in a group and unselectable) and repeat the above steps.

If you added Bip01 in the igActor then it'll be renamed to the name of the animation, for example menu_idle. However, I was able to create 2 groups. When I disabled footsteps of the second set of bipeds, max crashed. Also when I cloned the bip01 (the second one, which is also a method to create a new skelly but with used animations), max crashed. So that's why I said to create a new set of bipeds, I did not try that before.

EDIT: Created a new scene. Was able to create 4 bips atm. But an idea just jumped in my head: Alchemy Animation modifier, which controls the looping of animations. I think it needs to be applied on the groups, when created to prevent looping on animations you don't want it to have.

Interesting.
I'd see first if you can export one working animation via the group method if I were you, then creating multiple bipeds is not a problem, I've done it before. If you need animations for the new ones, just save your animation set as a .bip file (select bip01 go to motion>general>save) then load them up for each new biped.
I'll keep trying the build a library of anims and hope to import it somehow method.

RE:But an idea just jumped in my head: Alchemy Animation modifier, which controls the looping of animations. I think it needs to be applied on the groups, when created to prevent looping on animations you don't want it to have.

Definitely. I used its settings when exporting the menu_anims, idle loops, goodbye doesnt etc.
So far I'm not having any luck with my animnameDB library. I've made one with 8 or so in, but cannot as yet pursuade the exporter to put them together.
So maybe you are on the right track with the multi biped/group/anim route.
But I will say this: I've a little experience with making meshes and animations for a few games and whilst its not unknown to have separate files for animations, it is kind of weird to have to build a new biped for every single anim. Think about it: the standard set in a 4_combat file is about 40-100 or so anims. Thats a lot of bipeds, imo. It might be how its done, but its weird if it is, and really wasteful of resources, time etc.

October 22, 2009, 02:31PM #49 Last Edit: October 22, 2009, 03:22PM by Mr. Law^^
I'm going to try it out now. I made menu_action and idle so far. I checked the exported DB file.. It has both in it. I'll edit my results here.

EDIT: Getting close. Groups is the way to go (I think). Putting the modifiers on those groups helps: I defined action as the first actorAnimation in the igActor. Action doesn't loop, so it has to be set to "Clamp". I modified the intervals aswell. The animation worked when I chose a character and left the char menu to the battlezone. However, when I went to the hero menu, the animation was played again (just once).

This may sound weird but, can groups be put together in a group? So those groups become subgroups? If so, that might be the answer, because you have to set the actorAnimation in the igActor. Which has to have the name of the group. If the main group is defined, all animations HAVE to load, because they are subgroups.

EDIT2: yes it's possible, just tried it out. However, no animation was played in-game. I wonder what the main group's name must be in order to access all other animations.


EDIT3: I think I got it. Period. It's actually a mixture of my previous theory on using multiple igActors and groups. To sum it up in one sentence:

Create a new biped for every animation and put it in a group and THEN bind it to it's own igActor.

Okay, one sentence can not describe the method. :P Because you still need to add this line to each igActor's properties:

actorAnimation = <Name of the animation>

Next, uncheck Extract Anims in the exporter. It'll create one big file (if you have 2 anims of 14 frames each, it'll create a 120kb file if I'm correct). It won't create a DB file, so it's one file to go. Try it out in-game.

As a proof of concept, here's my anim file: http://www.mediafire.com/?yzkzizyz2dn

You'll notice the character getting up. That's menu action. It only happens when the character or skin is selected.

Good work.
I'm a few beers past trying it out tonight, and still sort of wish it were a bit easier than having 40-odd bipeds in one file, but if it works, it works.
Work allowing, I'll check it out tomorrow, or at the weekend.

OK, I made three bipeds, did the group thing for each, created an actor for each with an animation name in each actor (menu_idle, menu_action and menu_goodbye. Each actor was created when the appropriate action was palying, as we have done with the working "single" animation exports).
But it's not working correctly. The menu idle sort of plays, but doesnt actually play the animation, just goes into the pose. action and goodbye dont seem to play at all.
Maybe I've missed something. I'll check again.
I still think we should only have one biped, and possibly only the one actor which accesses a database, tracklist or somesuch that all the animations are in. Of course, I've still little or no idea how to get there, but thats what I'd expect to see.

D'oh! had the animations unchecked in the actor dialog.
Now I get only the idle playing and it loops through every animation. No sign that action or goodbye are working. Plus, all the animations are 3 ft lower than they should be, and the right arm is messed up (that was the one I animated most, having made a custom set for swordsman where he waves his sword about).
Am I right in thinking that with this multi-biped-group method you are still not seeing more than one animation work in-game (despite it sort of looking like they are there in a hex editor)? Because thats what I'm seeing, with your file and my own.

Cue more playing around for me...

October 23, 2009, 03:55AM #53 Last Edit: October 23, 2009, 07:44AM by Mr. Law^^
You're right about it. Did you use frame 0 for each anim? Because I'm starting to think that each anim needs to start after the other, like you normally would when you create anims with just one skeleton. If that's not the case, then I don't know. Perhaps renaming each actor to igActor01. It's like the only actor which the game recognizes as far as I know. So what if there are multiple igActor01 in the file? Hopefully sgFinalizer can provide some answers. I'm thinking of optimizing the file by combining the igActor01's into one. I think I saw an optimization set for it in the program. Meh, this is making me tired just like my schoolprojects XD

Wanna know what would be great? If we could open the IGB files with sgFinalizer, Insight viewer and what not. Especially the animations XD Looking at those with a hexeditor hurts my eyes XD

EDIT: tbh, sgFinalizer let's you know if you did the right thing. How do I know this? Well, with there being 2 actors there are 2 animDB's seperated from eachother with one animation each, which is not what we are trying to aim for. There has to be a way to add more animations in one animationdatabase in one file. Problem is, I ran out of ideas XD

October 23, 2009, 12:29PM #54 Last Edit: October 23, 2009, 12:41PM by Mr. Law^^
Okay, to continue my previous post, I'm going to experiment with the values in the igActor01 box. By now we know actorAnimation = ..  makes the animation specified active in the database. adding more lines doesn't increase the list at all. Why? I don't know. I'm pondering if it's something that has to be added in the alchemy scripts or not. Or there must be some line that has to be added in the igActor. I'm thinking of the following "values":

actorAnimationDatabase =
actorAnimationList =
igAnimationDatabase =
igAnimationList =
igAnimation =

I'm not sure about the latter one, because actorAnimation is the line that defines the animation the actor has to play. Apparently, multiple actors is not the way to go, otherwise it would've worked.

@ Tommy: I checked PS2 anims. They do HAVE multiple bip01's in it. Means the use of groups is good.

Quote from: Mr. Law^^ on October 23, 2009, 12:29PM
@ Tommy: I checked PS2 anims. They do HAVE multiple bip01's in it. Means the use of groups is good.

Not necessarily. You are seeing multiple references to bip01 (presumably in a hex editor), that might mean that the file contains multiple bip01s, or just that the one and only bip01 is referenced more than once. For instance, I just looked in one of my custom mesh files with a hex editor and found three "Bip01_Spine2" references in there. Doesn't mean that there are three bipeds in the file, (and I should know, because I made the mesh).
You may still be right about the multiple biped/group idea, but my intuition (for whatever that is worth) suggests to me that only one biped is more likely.
But I am guessing, not stating fact. It's not as if I am making any more progress with my "single biped" school of thought (though my pc has been down for 23 of the last 24 hours, and I have to go work now too, so I have had no chance to experiment further.)...

Hmm, you have a point. Theorytime:

So far the group idea could be good. Groups can be divided in 2 or more sections, thus making a tree of objects. So, I think a tree of certain objects have to be made.

Straight out facts:
- actorAnimation IS a must in any igActor01, as well as igActor = true.
- Groups have to be named after the animation.

Not certain:
- If multiple actors are necessary
- If Groups need to be placed in an igActor of their own, then add those in a group and then add those to the main igActor.

Going to need help with something. I can't find anything in the maxscripts that with a line that says "if animation /actoranimation = something, create animationdatabase/DB" or something. In other words, I need to find the script which enables the animationdatabase creation in alchemy.

I modified the actor script to give me a second animation option. So now I this:

Animation: <first animation_name>
Animation2: <second animation_name>

However, it creates a database of the first animation_name. Which means:

A) modifying the script so that a database can be made of both in 1 actor
B) the animations have to become subgroups of one major database. HOW??

October 24, 2009, 10:30AM #58 Last Edit: October 24, 2009, 11:11AM by thetommyboy2002
See, my theory would be that it maybe goes something like this:
The igactor would be named 05_thing_4_combat, (or whatever the filename will be). Checking the original skeletons you can see an entry in there of the files own name, to me that sort of suggests the igActor gets named for that file. Again, its just speculation on my part.
That actor actually is linked to ALL the animations in the set, but a NoteTrack (or some other method) lets the game (and exporter) know where one anim begins and ends, and the next begins and ends etc etc.
When I have time I'll play with giving the actor a notetrack, and then trial and error-ing the myriad ways of actually annotating said notetrack (ie you could have "start_menu_idle end" or "menu_idle end" or "Start -name menu_idle end" etc etc etc. Theres a lot of potential ways to label the animations, and from what I know, incorrect notation on the notetrack means no working animation). It could take a while, to say the least.
If you keep playing with the multi-biped theory, hopefully one or other of us might crack it.
I'll also try looking at the max scripts again in case I can see what you are looking for there.

EDIT: other stuff the "genuine" game anim files have are an entry of the name, so "09_spiderman.igb" file has an entry called "09_spiderman" within it, AND "09_spiderman_skel" as well.
There are also entries for "AnimationTrackList" (also in ours), and "afakeanim" (possibly its neccessary to have some sort of "dummy" animation).   

October 24, 2009, 11:25AM #59 Last Edit: October 24, 2009, 01:26PM by Mr. Law^^
You might wanna check an exported anim with sgFinalizer in the alchemy folder to see what some stuff are. I use it to check every action, to see if anything works. AnimTrackList mentions the bipeds and unworking animations.

There's one question running around in my head: but I'll ask it later, gotta check something XD

EDIT: Tommy, you forgot the Database thing in your theory. What you specify in the "Animation:" box of the exporter is the animationdatabase. And the animations have to be linked to the database (otherwise it wouldn't be one, t'doh).

This makes me thing that there has to be just one group which functions as a database, since the group thing works. So, let's assume the multi-biped theory, and put all of the bipeds in the same group. Hard to tell them apart (color 2 win?). Or, we could assume the single-biped theory. Then your theory can come to mind. However, the hard part is: how do you apply animation settings to each animation (like making it play only once instead of looping it) with one biped and all those frames? (if it's possible, I'd like to learn^^)

So to summon 2 theories up:
Multi-biped: 1 igActor, xx_name as groupname which will function as the database, all bipeds in that group, applying animation modifiers on each biped. Using NoteTrack to add notes and label the animations.
Single-biped: 1igActor, xx_name as groupname which will function as the database, 1 biped in the group, using notetrack to label the animations.

EDIT: added the following user defined properties to my 2 anims:
igAnimationState = true

What happened is that they disappeared in the wrong tree in sgFinalizer, but not visible in the animation list. Perhaps this is step 1 of the right method? Meh, I'll try more stuff out. Adding the UDP "igAnimationDatabase = true" to the igActor won't help.