Top Banner
Character Animation 1
26

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

Apr 19, 2020

Download

Documents

dariahiddleston
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 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

Character Animation

1

Page 2: 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

Overview

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

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

Page 3: 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

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

Page 4: 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

Regular layout 2 (no arcade box)

Info Here

(To switch between regular

Page 5: 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

Regular layout 2 (no arcade box)

Info Here

(To switch between regular

Page 6: 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

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

Page 7: 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

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

Page 8: 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

Interpolation

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

• Two commonly used methods– Linear

– Cubic

Page 9: 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

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

Page 10: 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

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

Page 11: 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

Motion Root Placement

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

Page 12: 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

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

Page 13: 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

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

Page 14: 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

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

Page 15: 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

Layering Example

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

Page 16: 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

Approach I : Sphere Man in Box World

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

Page 17: 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

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

Page 18: 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

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

Page 19: 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

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

Page 20: 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

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

Page 21: 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

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

Page 22: 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

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

Page 23: 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

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

Page 24: 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

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

Page 25: 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

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

Page 26: 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

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