Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Is Animation Accumulation supported?

Discussion in 'Editor & General Support' started by tz, Jan 10, 2008.

  1. tz

    tz

    Joined:
    Oct 13, 2007
    Posts:
    91
    Quicky here:

    For translation of characters in 3rd person... is Unity assuming that we will procedurally move the characters, and that animations happen in place, or is there a way to cause the base object's transform to accumulate with the translation of the animation's root.

    (asking because I just brought a run anim loop in from Maya, and the character's transform is sitting still, while the animation is treated as an offset from the transform's position (so it warps back to the transform every loop)

    Haven't found anything on the boards or in the docs yet, so I assume I've done something obvious wrong.

    Tz
     
  2. AaronC

    AaronC

    Joined:
    Mar 6, 2006
    Posts:
    3,552
    For a cutscene, or for NPC's, your characters root node might translate, but for a 3rd person controller, you want the root to not translate on the x and z axies, ie you DO want it to run on the spot. Then you control which animation to play via player input using a script. Then you use a second script(Like the first person walker) to move the otherwise static rootnode around inside your unity scene. So 2 behaviours, which animation to play, and whether to move around or not.

    You can also calculate if the player is moving in 3d space, and if they are, play an animaion based on that movement.

    But running on the spot is what you want. With mocap, you often have to edit the root node to get that to happen (delete keys)

    Does that make any sense?

    EDIT: Rereading your post it sounds like a bit of unparenting within the Hieracy within unity might work.
    AC
     
  3. tz

    tz

    Joined:
    Oct 13, 2007
    Posts:
    91
    Ok, I think that infers to me that Unity doesn't have a built-in mechanism to drive the game object around via root node translation implicitly (we have animators at my day-job that will swear up and down that third person games should be driven by animation, and not procedurally, although my personal preference has always been procedural movement, and animation designed to match it).

    In our current system at work, we use multiple dimensions of animations (acceleration, lean, speed, heading, and overlays), all driven by their explicit root translations to move the game object at runtime.

    This naturally has the advantage of always looking right, but the challenge becomes to get the play feel correct. I prefer the other way, because you have more control of the game's feel, but it takes a lot of work to get rid of most of the foot sliding.

    So I guess that means I need to re-key my animations to remove all accumulating translation from both the root and the external IK controls that drive the feet and hands, and essentially animate the character as though he were on a treadmill in Maya.

    Regards!

    Tz
     
  4. AaronC

    AaronC

    Joined:
    Mar 6, 2006
    Posts:
    3,552
    I'm not sure we're on the same page. The character animation examples cover this topic really well, load a few of those models into your modelling app, and see what's happening there.
    AC
     
  5. tz

    tz

    Joined:
    Oct 13, 2007
    Posts:
    91
    It's cool. Every single demo I've found is procedurally driven, and doesn't utilize the root animation translations.

    With contemporary games that involve multiple simultaneous animation tracks playing at once it's not only necessary to use the animation's translation, but you have to non-linearly scale the animations into foot-plant driven phases that synchronize with each other. My only question here is whether or not Unity can extract the translations embedded into the root node of an animation for application to the transform the animation is attached to. There aren't any examples of this that I can find (including all of the new character samples, which exhibit a fair bit of foot sliding), so I'm going to go with the assumption it's non-supported (unless one of the fine Unity folks mention otherwise) and work accordingly.

    Thanks for the input!

    Best Regards.
     
  6. Mr. Animator

    Mr. Animator

    Joined:
    Oct 2, 2005
    Posts:
    193
    There's certainly no 'easy' way to use a character's root animation from maya to drive their movement in unity at this time. That said, I think you might be able to write a script that would do it manually, since you can access the transform information of your bones via scripting, and therefore you could read that information, zero it out, and apply it to another object (such as an empty game object that the character is parented to). Placing this type of logic in a LateUpdate should ensure that this manual operation would not cause weird 'flickering' of the character's root.

    This solution is a little hackish, but it should work. The only tricky business I foresee would be making sure that you're getting the information you want by properly using local and global translation values (local for the animation root, then convert that to a vector you can use to move the top node of the heirarchy in world space in the direction its currently facing.)

    Unless extremely precise footplanting or complex melee attacks are required, I'd probably recommend just doing procedural animation for your character's root and animating on a treadmill. I've worked both ways and if the translation is totally linear it really doesn't matter either way. The only time I've found using animation to drive movement to be especially useful is when the movement is not linear, such as a character lunging forward over the course of an attack anim.
     
  7. Chris-Mosely

    Chris-Mosely

    Joined:
    Oct 5, 2010
    Posts:
    7
    Animation accumulation is absolutely necessary if you're looking at building a AAA quality commercial game. Almost all the serious games out there use accumulation to drive the character forwards. This has several benefits.

    1. The simplest benefit is of course the foot sliding problem. The feet don't slide with animation accumulation. So you will get a much nicer end result. Driving the character procedurally is really really dated and better left for garage games...

    2. With animation accumulation you get much finer control of the forwards motion (what if you have a zombie for example that's limping along). Procedural velocity would look terrible if the character had to have a very characterised type of gate for example.

    2. You're putting control of the motion back in the hands of the animator/designer. In many teams, the animator of the lead character in your game isn't just making a bunch of animations and then handing them off to a programmer. That's just not how it's done. A script file for setting velocities is also a big no no. The animator is making animations, testing them in game and he has total control over how the character propels itself forward. This is critical for so many reasons.

    a. You have a tighter feedback loop from making a change to an animation and seeing the end result. Games these days are all about rapid prototyping.

    b. You need to empower your creatives. You can't keep going to a programmer every time you want to change the velocity of a motion/action.

    c. Interactions between characters, Hits, falls, etc. all take their positions from the animations. Procedural versions of these FXs are just nowhere near as good as hand crafted animated versions.

    Anway, I've been working on games now for 22 years (AAA) and you absolutely need animation accumulation in the engine. :)
     
  8. afalk

    afalk

    Joined:
    Jun 21, 2010
    Posts:
    164
    Perhaps the mixamo and/or locomotion approach would work well for you, esp the Mixamo motion computer which supports and uses Accumulated motion (my guess based on all the samples and the walk-through vids).
     
  9. PrimeDerektive

    PrimeDerektive

    Joined:
    Dec 13, 2009
    Posts:
    3,090
    Yeah, I believe the mixamo root motion computer is similar to what you're talking about.