1 2 What do game developers want for character animation? - high-quality animation - good compression of assets - reactive characters - motion variety & novel motion on-the-fly - minimal investment in animator time, design iteration time - artistic control

Most of these goals are conflicting with at least one or two others – so it’s about reaching a trade-off

Procedural techniques are all about getting the most out of fewer

3 4 5 6

Additive animations can be created by first subtracting a base pose from an animation What’s left becomes the additive animation, which can be recombined with a different animation later on

Uncharted used this to great effect to create variety in motion - Injured animations - Breathing - Idle pose variation

One strength of it is that you can add motion on only a subset of bones – allowing you to create various different animations from one base pose - Aiming

7 Often we want continuously variable motion

Use multiple samples, each with a parameter value Subdivide the parameter space (here, Delaunay triangulation) Recombine by blending samples nearby desired parameter value

Disadvantage – have to create enough aniamtions to adequately sample the parameter space

8 Crytek used these kinds of parametric spaces Their locomotion is parameterised by speed, turning angle and slope So they have some 3d parametric spaces

They also used something they called “procedural motion warping” - Some kind of IK as an additive animation layer

CRYSIS 2: Getting More Interactivity out of Animation-Data Ivo Herzeg GDC 2011

9 It’s possible to parameterize various kinds of poses

Aiming is another one that’s commonly done

10 11 The canonical example of character physics is the ragdoll, so let’s start there.

They’re pretty ubiquitous in games so no doubt you’re aware of the basic idea, which is to simulate the character as a set of constrained rigid bodies.

Animated character skeletons usually have a lot more bones than ragdoll bodies, so an essential step is to map the ragdoll bones’ transforms back onto the more complex character skeleton. Then the character can be skinned.

12

Passive ragdoll – a collection of dynamically-simulated bodies connected by constraints Pretty much only useful for ‘dead’ or unconscious characters - Or simulating the Pav on a Tuesday night (pictured)

A bunch of the screenshots in these slides will be taken from the demo framework. You can download a free version of Havok Physics and Animation complete with demos from http://www.havok.com/try-havok So you can play around with the demos, or integrate Havok in your own game or research

Havok’s ragdoll solution is in a lot of games – some have implemented it better than others Good – Saints Row 3

The difference is in the way the bodies and constraints are set up: • Fewer bodies are usually better – capsules for efficiency • Adjacent bodies overlap so that other objects don’t penetrate in between the joints (collisions between adjacent bodies in ragdoll are filtered out)

13 • Proper constraint limits so the joints don’t look ‘broken’

13 I’ll talk a bit more in a while about more sophisticated uses of ragdoll setups, but first let’s look at some other common techniques…

Basic interaction with a physics world is often done with a single rigid body.

Here’s the Havok Rigid Body Controller. It’s typically a capsule, since that allows the character to slide over obstacles like those stairs.

There’s some extra solver stuff under the hood that lets the character rigid body slide easily, stand on moving objects and so on.

14 This is a very robust solution, but not very high-fidelity – you can see the limitations when paired with animation.

However, with a bit of IK fixup it can look pretty good.

This here is using Havok’s foot placement IK, which also affects the hip positioning so that the feet can reach their targets - more on various kinds of IK later

15 Incidentally, Skyrim used another, asymmetrical, character controller for its horse physics – and here you can see a classic trade-off.

Often with there has to be a sort of fudging of the physics to make the game playable. So occasionally you get situations where the simulation is a little bit idiosyncratic.

16 Generally, using a single rigid body to simulate a character can get nice results.

In this paper, the authors used a rigid body with an inverted pendulum model of forces to keep the character upright.

17 Just Cause 2 had some nice examples of this too.

The player character can dangle beneath a helicopter, or hang off the sides of moving vehicles. In both cases, a bit of physical simulation

18 19 For the sake of argument, I’ll include IK under the umbrella of character ‘physics’

You probably all know what IK is - a procedural technique to calculate joint parameters given and end-effector goal Where an end-effector is generally just a local coordinate frame stuck to one of the bones of the skeleton

Here are two examples of basic IK solvers - CCD - 2-joint analytical IK for human limbs

There are lots of other ways to solve the IK problem

@article{tolani2000realtimeik, author = {Tolani, Deepak and Goswami, Ambarish and Badler, Norman I.}, title = {Real-time inverse kinematics techniques for anthropomorphic limbs}, journal = {Graph. Models Image Process.}, volume = {62}, number = {5}, year = {2000},

20 issn = {1077-3169}, pages = {353--388}, publisher = {Academic Press, Inc.}, address = {Orlando, FL, USA}, }

20 IK is very useful for cases where you need the character to register accurately with its surroundings – ie touch something

HumanIK is Autodesk’s full-body IK middleware

- set position and rotation targets for end-effectors - control propagation of pose through character skeleton - layer IK on top of animation - retarget animations

http://area.autodesk.com/gdc2011/humanik

21 22

Looks like a cool full-body IK middleware solution I haven’t heard of anybody who’s using it yet

23

lots of interesting approaches in academic literature mostly not feasible for games pipelines - complexity of implementation - heavy numerical matrix solutions, numerical optimisation - game devs don't like these - memory and processing heavy -- frame budget ~16ms -> <1ms for animation - allowing less artistic control - heavy emphasis on automation, theoretical solutions

24 So let’s get back to ragdsolls and dynamical simulation, and talk about

@inproceedings{wrotek2006dynamo, author = {Wrotek, Pawel and Jenkins, Odest Chadwicke and McGuire, Morgan}, title = {Dynamo: dynamic, data-driven character control with adjustable balance}, booktitle = {Sandbox '06: Proceedings of the 2006 ACM SIGGRAPH symposium on Videogames}, year = {2006}, isbn = {1-59593-386-7}, pages = {61--70}, location = {Boston, Massachusetts}, doi = {http://doi.acm.org/10.1145/1183316.1183325}, publisher = {ACM}, address = {New York, NY, USA}, }

25 26

As far as I can remember, the tool is called Endorphin and the SDK/runtime is called You can download the learning edition of Endorphin and play around with it, it’s a lot of fun

NaturalMotion have their own physics system and drive the characters with muscles. They’ve cooked up various controllers that can drive these characters toward certain behaviors – balancing, flailing, curling up into a ball and so on

They started out evolving these behaviors with genetic algorithms

27

GTA4 uses the Euphoria SDK, and it’s hands-down the best drunk guy simulator in the business.

By which I mean - Doing high-fidelity motion with physics is hard - But for very dynamic motion Euphoria works great

28

@book{featherstone2007book, author = {Featherstone, Roy}, title = {Rigid Body Dynamics Algorithms}, year = {2007}, isbn = {0387743146}, publisher = {Springer-Verlag New York, Inc.}, address = {Secaucus, NJ, USA}, }

29 Efficient algorithms for calculating the dynamics of articulated bodies Reduced coordinate formulation (as opposed to maximal coordinate approach of ragdolls)

Articulated body algorithm - Given x compute y

Composite rigid body algorithm - Given x compute y

These algorithms provide equations of motion – can serve as the basis for optimization techniques

30 @inproceedings{witkin1988spacetimeconstraints, author = {Witkin, Andrew and Kass, Michael}, title = {Spacetime constraints}, booktitle = {SIGGRAPH '88: Proceedings of the 15th annual conference on Computer graphics and interactive techniques}, year = {1988}, isbn = {0-89791-275-6}, pages = {159--168}, doi = {http://doi.acm.org/10.1145/54852.378507}, publisher = {ACM}, address = {New York, NY, USA}, }

@phdthesis{popvic1999thesis, author = {Popovic, Zoran}, note = {Chair-Witkin, Andrew}, title = {Motion transformation by physically based spacetime optimization}, year = {1999}, isbn = {0-599-52017-5}, order_no = {AAI9950032}, publisher = {Carnegie Mellon University}, address = {Pittsburgh, PA, USA},

31 }

@inproceedings{liu2002synthesiscomplex, author = {Liu, C. Karen and Popovi\'{c}, Zoran}, title = {Synthesis of complex dynamic character motion from simple animations}, booktitle = {SIGGRAPH '02: Proceedings of the 29th annual conference on Computer graphics and interactive techniques}, year = {2002}, isbn = {1-58113-521-1}, pages = {408--416}, location = {San Antonio, Texas}, doi = {http://doi.acm.org/10.1145/566570.566596}, publisher = {ACM}, address = {New York, NY, USA}, }

31 Compute the next frame of motion taking into account - a desired pose state (eg tracking a reference motion, or applying constraints on end-effectors) - equations of motion

Sumit Jain

@INPROCEEDINGS{Vangelis04practicalphysics, author = {Evangelos Kokkevis Vangelis}, title = {Practical Physics for Articulated Characters}, booktitle = {Proc. of GDC}, year = {2004} }

@article{jain2009optimisationbasedinteractive, author = {Jain, Sumit and Ye, Yuting and Liu, C. Karen}, title = {Optimization-based interactive motion synthesis}, journal = {ACM Trans. Graph.}, volume = {28}, number = {1},

32 year = {2009}, issn = {0730-0301}, pages = {1--12}, doi = {http://doi.acm.org/10.1145/1477926.1477936}, publisher = {ACM}, address = {New York, NY, USA}, }

32

@misc{jakobsen2001advanced, title = {Advanced Character Physics}, year = {2001}, author = {Thomas Jakobsen}, howpublished = {Proceedings, Game Developers Conference}, }

@inproceedings{kawachi2004lightweightalgorithm, author = {Kawachi, Katsuaki and Kanade, Takeo and Suzuki, Hiromasa}, title = {A lightweight algorithm for real-time motion synthesis}, booktitle = {VRST '04: Proceedings of the ACM symposium on Virtual reality software and technology}, year = {2004}, isbn = {1-58113-907-1}, pages = {49--56}, location = {Hong Kong}, doi = {http://doi.acm.org/10.1145/1077534.1077545}, publisher = {ACM}, address = {New York, NY, USA}, }

33 @article{Hecker2008variedmorphologies, author = {Hecker, Chris and Raabe, Bernd and Enslow, Ryan W. and DeWeese, John and Maynard, Jordan and van Prooijen, Kees}, title = {Real-time motion retargeting to highly varied user-created morphologies}, journal = {ACM Trans. Graph.}, issue_date = {August 2008}, volume = {27}, issue = {3}, month = {August}, year = {2008}, issn = {0730-0301}, pages = {27:1--27:11}, articleno = {27}, numpages = {11}, acmid = {1360626}, publisher = {ACM}, address = {New York, NY, USA}, }

33 @article{shi2007meshpuppetry, author = {Shi, Xiaohan and Zhou, Kun and Tong, Yiying and Desbrun, Mathieu and Bao, Hujun and Guo, Baining}, title = {Mesh puppetry: cascading optimization of mesh deformation with inverse kinematics}, journal = {ACM Trans. Graph.}, volume = {26}, issue = {3}, month = {July}, year = {2007}, issn = {0730-0301}, articleno = {81}, publisher = {ACM}, address = {New York, NY, USA}, keywords = {geometry processing, inverse kinematics, mesh deformation, nonlinear optimization}, }

@article{muller2007positionbaseddynamics, author = {M\"{u}ller, Matthias and Heidelberger, Bruno and Hennix, Marcus and Ratcliff, John}, title = {Position based dynamics},

34 journal = {J. Vis. Comun. Image Represent.}, volume = {18}, number = {2}, year = {2007}, issn = {1047-3203}, pages = {109--118}, doi = {http://dx.doi.org/10.1016/j.jvcir.2007.01.005}, publisher = {Academic Press, Inc.}, address = {Orlando, FL, USA}, }

34 My stuff

@inproceedings{O'Brien:2011:SVC:2019406.2019443, author = {O'Brien, C. and Dingliana, J. and Collins, S.}, title = {Spacetime vertex constraints for dynamically-based adaptation of motion- captured animation}, booktitle = {Proceedings of the 2011 ACM SIGGRAPH/Eurographics Symposium on Computer Animation}, series = {SCA '11}, year = {2011}, isbn = {978-1-4503-0923-3}, location = {Vancouver, British Columbia, Canada}, pages = {277--286}, numpages = {10}, url = {http://doi.acm.org/10.1145/2019406.2019443}, doi = {10.1145/2019406.2019443}, acmid = {2019443}, publisher = {ACM}, address = {New York, NY, USA}, }

35 36

Recent games of note FIFA ’12 Overgrowth

37

(NaturalMotion & Rockstar's RAGE derived from ) • initial posture from parametric blend (aiming direction) • drive ragdoll to this posture • state machine reacts to collisions etc

Max Payne’s dive animations are actively simulated - diving pose is single frame, augmented by physics simulation - his posture changes as he collides with obstacles in mid-air

Results are very fluid, but this kind of thing still does take a lot of artist tweaking

38

39 Overgrowth from Wolfire Games - Game about rabbit combat

- mostly programmed by on e guy - heavy use of IK and physics - cuts down on the amount of animation assets needed

Hybrid Procedural and Physics-based Animation in OVERGROWTH Alex J. Champandard

40

Runtime rig – the idea that the kind of tools artists use to pose and animate characters in modellers like 3DSMax and Maya could be used at runtime

Combining all the techniques we’ve talked about on a single rig

Procedural Characters and the Coming Animation Technology Revolution Alex J. Champandard AiGameDev.com

41 Happy to answer questions now, or you can contact me at my Trinity address References for papers are all in the comments of the slides

Anyone interested in game dev for mobile platforms, keep an eye out for Havok announcements at GDC next week

42