26
Character Animation 1

Character Animation - pages.cpsc.ucalgary.capages.cpsc.ucalgary.ca/~bdstephe/585_W13/d401_animation.pdf · Character Animation 1. Overview • Animation is a big topic • We will

  • Upload
    others

  • View
    41

  • Download
    3

Embed Size (px)

Citation preview

Character Animation

1

Overview

• Animation is a big topic• We will concentrate on character animation as is used in

many games today– humans, animals, monsters, robots, etc.

Character Representation

• A character is represented as a hierarchy of transforms (the skeleton)– 4x4 transform matrices with parent/child relationships– Called a bone, joint or node

• A particular configuration of a skeleton is called a pose– the state of a skeleton at a particular time of animation

Regular layout 2 (no arcade box)

Info Here

(To switch between regular

Regular layout 2 (no arcade box)

Info Here

(To switch between regular

Motion Data

• Procedural– Algorithmically generated

• E.g. Inverse kinematics

• Keyframed– Animator lays down important keyframes & timing between

frames– Motion is reproduced through interpolation (tweening) of key

frames• Hybrid

– Combines both procedural and keyframed elements– E.g. Key framed character with head tracking, Blending between

last keyframe and Ragdoll

Key framing

• Ways to generate key frames– Created by an animator with an animation tool (e.g. Maya,

SoftImage, Max)– Motion capture

• Acquired through sampling motion of actor(s) wearing sensors• Requires extensive clean up before use

– Procedural• E.g. sampling a complex cloth simulation generated offline

Interpolation

• A frame of animation data is usually generated via interpolation of key frames.

• Two commonly used methods– Linear

– Cubic

Interpolation Cont’d

• Linear interpolation is simple to implement and efficient– But needs many key frames to record complex motion– Motion can look robotic

• Cubic interpolation– More natural-looking motion– Can reproduce more complex motion with fewer key frames

• Memory savings– More expense to evaluate– Probably the best overall choice with modern hardware

Interpolation Cont’d

• Interpolating orientation poses special problems– Which way to interpolate?

• Usually we choose the shortest arc• Problems with rotations near 180o

– Euler angle representation• Orientations are not unique• Gimbal lock

– Quaternions• Interpolate nicely• Larger to store

Motion Root Placement

• At Center of Mass• At Pelvis for Bi-peds• Less typically – at Base of character (e.g. between feet)

Importance of the Motion Root

• Motion Root is Handle for Physics & AI – to manipulate position, orientation & velocity of character– A collision representation is attached to the Motion Root.

• Motion Root is an attachment point for camera– Used for computing camera placement relative to character and

environment– Hence path traced by the motion root needs to be continuous

Control vs Animation: Conflicting Goals

• Gameplay designer – wants responsiveness, player control– Want player to have analog control of speed character– Want to have fine-grained control for aligning player to objects in

the world– Want player to execute multiple actions simultaneously – e.g.

shoot while running• Animators & Art directors – want realistic motion that

looks good– Want artistic control– Perfect transitions – no sliding, no awkward joint positions– Natural timing – no snapping or odd pauses– But we may not have manpower or memory to animate every

transition

Organizing Animation to Maximize Reuse

• Layering– Separate Layers eg. Face, Hand, Hair, Full Body– Multiple animations within a layer– Transition by blending:

• Cyclic Animations have same no. of frames and are frame sync– Partial Sets: E.g. animate only arm for weapon reloads

• Flipping– Mirroring an animation symmetrically

Base Layer – Full Body

Animation – move Animation – move-lean-l Animation – move-lean-r Animation – run-incline Animation – run-spine-down Animation – run-stairs-down Animation – run-stairs-up

GDC 2010: Animation & Player Control in Uncharted: Drake’s Fortune

Layering Example

GDC 2010: Animation & Player Control in Uncharted: Among Thieves

Approach I : Sphere Man in Box World

GDC 2010: Animation & Player Control in Uncharted: Drake’s Fortune

Approach I : Sphere Man

• 100% Controller-driven approach• Player modeled as 2 Spheres or 1 Capsule• Controls drive the velocity of SphereMan• Animation is played as dressing• Works but not great for realistic human characters • Lots of Sliding

• E.g. Uncharted 1, Jax & Daxter

Approach 2: Pure Animation

• Root node displacement is purely driven by animator• AI reads root node position from motion data• Character position, orientation updated from this

displacement• Advantages:

– Feel of motion is driven artistically– Better footstep registration

• Cons:– Memory intensive– Labour intensive– Not as responsive e.g. cannot handle intermediate speeds well

Approach 3: Blending between Animation & Player control

• More commonly used• Based on Player Intention:

– Select the closest matching animation– Play animation & blend towards Control direction

0

0.25

0.50

0.75

1.00

0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1

Blend Towards Player Control

Blend

GDC 2010: Animation & Player Control in Uncharted: Drake’s Fortune

Approach 3: Cont’d

• “Warp” animation – extend the time between key frames – to create sense of anticipation e.g. wind ups– To create sense of release e.g. charged jump

• Cons– Give up some controller responsiveness– Some foot slippage

• Pros– But surprisingly, feels rights (when properly tuned)

• “Momentum”-based design approaches are gaining popularity

Approach 4: Procedural

• Animation driven by procedural model • Simpler for non-articulated objects:

– Cars, planes, crates, pucks, clothing, terrain• Biomechanics – integrates Forces & collisions by

modeling character as a system of muscles, springs– E.g. Horses in Red Dead Redemption

• Open research area for characters

www.naturalmotion.com

Motion Sequencing

• For each character, the AI maintains the current “behavioural state”

• Motion Tree is a animation state machine:– Conditions– Nodes containing animation & playback parameters

• AI generates an “intention structure” which is evaluated by the Motion Tree

• Motion Tree generates a list of animations to be played in sequence and blend parameters

• Lower-level animation controllers- manage playback, transitions & frame syncing

Transitions

• Several ways to splice animations together– Cut

• Immediately jump to beginning of new animation• Instant visual feedback• Features pop if animations aren’t aligned

– Phase align and cut• Jump to phase-aligned frame of new animation• Instant visual feedback• Less popping• Assumes animations have single, compatible phase value

– Wait for alignment and cut• Play current animation until phase aligns then cut• Introduces lag• Some animation may not have same alignment points

Transitions

• Several ways to splice animations together– Glue animations

• Play a special artist-built animation between the current and new animation

• Looks good• But needs a lot of them

Transitions

• Blending– Cross-fade current and new animation– Looks good for short transitions, Long transitions look robotic– Animations should be similar– Computationally expensive– Can blend animation with procedural techniques – e.g. IK ,

physics ragdolls– Additive Blending – add rotation delta

In Closing

• Animation systems are a lively research area• We’ve only covered High Level ideas• Character animation is tough

– Complex trade-off between aesthetics and control responsiveness