Sign in to follow this  
vinnyvicious

Reducing amount of animations in game with procedural solutions

Recommended Posts

I'm currently working on a small third-person shooter along with a friend, who is an artist. Today, i've finished the state machine that controls all the possible states that the player can be in. My friend was going to use that as a reference to start animating the player model. Unfortunately, since we are just two guys, i think the combination of states is going to affect his productivity. I mean:

  • Walking_WithRifle
  • Walking_NorthWest_WithRifle
  • Walking_Backwards_WithRifle
  • StrafeLeft_WithRifle
  • Crouched_Walking_WithRifle
  • Crouched_StrafeLeft_WithRifle

We have several other weapon types (Melee, Pistol, RPG, Grenade, Mine, etc.). I'm trying to find a solution for this problem with code, but the engine i am using (Urho) is limited on what i can do. For the different weapon types, since they mostly affect the upper body parts, i was thinking about asking him to animate just an idle pose with each of the weapons, and then i can use that to blend with other states (Walking, Running, Crouched Walking, etc.)

However, for the NW, SW, and other diagonal movements... what can i do? A rotation of the pelvis bone? What do you guys suggest?

Also, for the StrafeLeft/StrafeRight... is that something that i can also do with rotation?

Share this post


Link to post
Share on other sites
However, for the NW, SW, and other diagonal movements... what can i do? A rotation of the pelvis bone? What do you guys suggest?

For that you can simply have 4 animations : N,S,E,W and then do a blend by direction.

Also, for the StrafeLeft/StrafeRight... is that something that i can also do with rotation?

For that you can do mirror of animation, but it's a tricky thing to have it working and you also need to do a mirror bone setup to set each mirror bone.

since they mostly affect the upper body parts, i was thinking about asking him to animate just an idle pose with each of the weapons, and then i can use that to blend with other states

 
You can do a masked blend to animate the bottom part and animate the upper part, simply combine the pose.

Edited by Alundra

Share this post


Link to post
Share on other sites

If i blend Left and Forward, for example, how can i associate the blending amount from A to B based on the direction vector?

As for mirroring, why would i need mirror bones? Maybe just invert the values?

Share this post


Link to post
Share on other sites

You can compute the angle using atan2 or dot product which will gives you an angle in [-PI, +PI].
Using this angle you can select the 2 animations and then compute the blend factor of the two.
Mirroring is a tricky thing, you have to set the mirror bone + set the mirror axis, mirror the quaternion using that.

Edited by Alundra

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this