Question to Users

Topics: User Forum
Jan 28, 2007 at 2:49 AM
Normally people ask me questions about the library, but I have a question to those of you who wish to use it. My question is, what do you think of the current example set? Is there anything that it makes you wish that the library has, but currently doesn't?

My only problem with it is the bear walking demo; when the bear stops walking, the animation just stops. It doesn't seem very convincing. However, with that particular animation, it's not really possible to make a realistic walk. I wish I had a model that had a complex walking and standing animation so that I could show how to use the blending features to make a realistic walk.

I am quite surprised at how well the blending turned out. The third demo switches between the animations seamlessly.
Jan 28, 2007 at 6:53 AM
Well, I'll give a quick overview of what I'm doing...

When I dive into something new, I do it with both feet encased in cement, so there's no backing out :-D

What I'm working on is using Aiko 3, a Poser/Daz3D hi-poly count character, which I'd like to combine with BVH mocap to create animated characters. This is done by taking the poser .CR2 file, converting it to FBX files with Bones, and then I'd like to throw BVH files at it.

Ideally, I'd love to be able to do things like blend a walk provided in one BVH into a stopped/standing pose provided in another, then blend the standing BVH with a 2nd that overrides the characters torso and arms for an animated convertation with hands flying as the character illustrates things.

Jan 28, 2007 at 6:02 PM
I believe using fbx and bvh in conjunction is possible, but you'd have to ask Michael about that. Blending a walk and standing animation is currently possible by just running the
two animations together at the same time and blending quickly from 0 to 1. This should look OK for most walk animations using the blending algorithm in the library.

The last part is not possible atm, but I was thinking of allowing blending at a per-bone level.
Jan 28, 2007 at 7:10 PM
I think per-bone animations with support for blending between .BVH files should be the next feature, after the 360 dll's are posted of course :)
Jan 28, 2007 at 7:39 PM
I would like to see the ability to assign animations to bones. The animation would be overridden by its parent bones animation (root for instance) once the user selected bone animation.

This feature would need the ability to be overridden on say a player death sequence where all currently animating parts stop and the final death animation takes over the entire mesh. You should also be able to override a bone's child heirarchy. Like if you want the upper torso to reload a gun and the right arm is in the middle of flipping some one off, you need that animation to stop while you reload the gun.

animations should also be "stackable" where you can give it five animations to do one after the other. (this will need to be overridden for the 'death sequence' animations.

to override animations i would typically use a parameter : "ForceAnimation"

this should only force overriding of all animations currently playing on the child bones that you apply the animation to

Hope that all makes sense,



Also havig a timer to when the animation should start is very useful.

There should also be events declared so we can take advantage of when the sub animations begin and end

There should also be a way to get the current bounding OBB of a given bone. This should only be calculated once per game update and only IF it is accessed otherwise there will be some performance issues.

By having the OBB of the given bones we will be able to calculate collisions.

You could also implement motions

Adding the ability to attach a sound cue to an animation would be nice. Have the sound play at a given animation frame or time since the animation started

Another feature would be the ability to manipulate the bone matrices directly in case you want to programatically have the players head move a certain direction or for body twist.

Also can you use multiple animations with the BVH files?
Jan 28, 2007 at 7:40 PM
oops i put my signature in the middle of the post! LOL
Jan 28, 2007 at 7:46 PM

I'm dislexic:

The first sentance needs to read:

I would like to see the ability to assign animations to bones. THE PARENTS BONE ANIMATiON (root for instance) WOULD BE OVERWRIDDEN BY THE CHILD BONE's animation.

Jan 28, 2007 at 8:15 PM
"I would like to see the ability to assign animations to bones. THE PARENTS BONE ANIMATiON (root for instance) WOULD BE OVERWRIDDEN BY THE CHILD BONE's animation."

So what you are saying is that you should be able to assign an animation to a parent bone and a child bone. While the parent bone's animation is running, the child bone's animation would also run, and its transform would be calculated by combining it with the parent's bone transform for the current frame. Is this correct?
Jan 28, 2007 at 8:34 PM
The parent animation would stop at the animation of the child bone's animation attachment. so say if the child animation was on the forarm the parents animation that could possibly affect the foram or fingers wouldnt affect the movement of the hand by the attached animation.

typically these are 'play once only' animations and are 'overridable' upon events such as 'reload' or 'player die' :)
Jan 28, 2007 at 9:49 PM
Here is a summary of the changes I would make if I were to implement all of your suggestions:

Lets say we have an AnimationController object with variable name controller.

- When we first create the controller object, no animations will run
- The user will have access to a collection of all the animations currently attached to the model via a controller.Animations property, and will be able to access them by index or name. Each animation contains a list of bones that it affects and a name.
- The user will be able to add additional animations to the collection.
- The user will have access to a property controller.RunningAnimations, which gives a list of the currently running animations.
- A running animation contains the settable time for the current animation, a duration, a speed factor (which can be set to 0 to disable automatic time advancing), and a list of the bones it is currently affecting. It also has a IsLooping property which can be set to false to prevent looping of the animation.
- The user can load and run animations by calling the controller.RunAnimation method, which optionally takes a list of strings. If no parameters are passed, then it makes the animation affect all the bones that are attached to the animation. Otherwise, it runs the animation for all the bones in the string list.
- There will be a controller.Bones property, which is a collection of bone objects. Each bone will have a bounding box property which will be calculated once a frame and only if it's called. It also contains a reference to the animation it is currently affected by, which can be null. A bone also has a settable transform that is used when the reference to its animation is null. This transform defaults to the models transform.

- To help sequence animations, there will be a controller.AnimationStateMachine property which contains a state machine for animations. The state machine is a graph of AnimationState objects.
- The user can access the currently running state by the controller.CurrentState property.
- An AnimationState object will call a delegate method every frame, and the controller object and elapsed time since the start of the state will be passed as parameters to the method. This will allow the user to do whatever he wants in a given state.
- Transitions are instantaneous and are done using the AnimationStateMachine.Transition method.

- An AnimationStart event will be fired whenever a new animation begins, and an AnimationEnd event will be fired when an animation ends. The latter will not be fired if the animation is set to loop.
- Animations will also have key/value pair collections, where the key is the time and the value is a delegate. This will allow users to attach universal events to animations at given times.

I believe this is the type of thing you are asking for. Is this correct?

Jan 28, 2007 at 9:54 PM
Oh yeah, and there would be a method to allow you to easily find all of the children of a bone that are affected by a given animation.
Jan 28, 2007 at 10:26 PM
The animation doesnt really need to store all the bones affected but rather the first bone affected. Like if you animate the entire hand with an animation it would link to the wrist bone and since all the fingers are children of the wrist they will perform the animation controlled by the wrist bone's animation override.

Jan 28, 2007 at 10:28 PM
Sounds like you have the gist of what i'm saying. I'd like to see if any other community members like this approach. I would just like for this to be as flexible as possible without overcoding :)
Jan 28, 2007 at 10:38 PM
dcastle, not sure how much of the code you would have to overhaul for those changes but it sounds like a really good idea. It would give us more control over the animations.
Jan 28, 2007 at 11:10 PM
It probably wouldn't take too long to implement since the animations are already run at a per-bone level anyway. The only problem is finding the vast number of models required to thoroughly test everything.
Jan 28, 2007 at 11:48 PM
dcastle, I have a character mesh you can use for testing. Would rather you not give it out mesh to the public but im willing to donate it for testing/development purposes.
Jan 29, 2007 at 12:12 AM
That would be great! You can email it to my hotmail account at

Of course, I won't share it with anyone and it will be used solely for testing purposes. If it has multiple animations for different bones as we discussed, that would be great.

BVH files for animation are fine.
Jan 30, 2007 at 1:46 AM
I've decided that if I do include a animation state machine, it will not be inside the controller. I think this provides no advantage since you can do the same exact thing by making a new class which contains an instance of a controller.

After initial tests, I really can't find a perfect way to make the state machine. Using delegates or events are the best ways to make it useable by everyone, but I think that a one delegate per state approach loses all type safety, unbinds the controller and the state machine, and will confuse lots of users.

Another possiblility is to have a IAnimationState interface, and make a default class implementation of it. This forces users to create a new class for each state, however.

A final approach is to have one method that is called each frame in the state machine and have the name of the current state passed to the method, and let users take it from there.


With that said, I will almost certainly implement the per-bone animation features I discussed earlier, and also allow blending at a per bone level.
Jan 30, 2007 at 6:01 AM
BVH can be used with both .X and .FBX.
I've posted help on this on homepage of the project. David, is there a way to make this into a separate WIKI page?

I am doing massive use of .FBX with .BVH in my project and it works great.
One of good things with this approach is that you can have a separate file for each motion.
You would probably want to do your own XML custom processor (based on Microsoft's XML importer) to control how models with their different animations and LODs get assembled, but this is a very game-specific feature.