THE RIGHT FOOT IN
THE WRONG PLACE
CHARACTER
LOCOMOTION IN
HALF-LIFE: ALYX

© 2021 SIGGRAPH. ALL RIGHTS RESERVED.

THE PREMIER CONFERENCE & EXHIBITION IN
COMPUTER GRAPHICS & INTERACTIVE TECHNIQUESMISSING THE BAR• Gameplay animation started out
using traditional techniques• AnimGraphs, state machines,
blends, etc• Couldn’t meet our quality goals• With ~1 year left of development,
needed to find a new approach…
© 2021 SIGGRAPH. ALL RIGHTS RESERVED.

THE PREMIER CONFERENCE & EXHIBITION IN
COMPUTER GRAPHICS & INTERACTIVE TECHNIQUES

2

GoalsWhat we needed from a new gameplay animation system© 2021 SIGGRAPH. ALL RIGHTS RESERVED.

THE PREMIER CONFERENCE & EXHIBITION IN
COMPUTER GRAPHICS & INTERACTIVE TECHNIQUES

3

GOALSQUALITY• VR “Character Presence”− Character version of VR ‘Presence’− Easily broken by “gamey” movement− Both challenge and opportunity!

• Goal:− Reduce or remove foot slide© 2021 SIGGRAPH. ALL RIGHTS RESERVED.

THE PREMIER CONFERENCE & EXHIBITION IN
COMPUTER GRAPHICS & INTERACTIVE TECHNIQUES

4

GOALSMOVEMENT• Tight, dense virtual environments− Frequent changes of direction− Small window for attacks• Goal:− Character cannot leave navigation path
− Character must stop exactly at path goal

© 2021 SIGGRAPH. ALL RIGHTS RESERVED.

THE PREMIER CONFERENCE & EXHIBITION IN
COMPUTER GRAPHICS & INTERACTIVE TECHNIQUES

5

GOALSCONTENT• Small gameplay animation team
• Large variety of characters− Could not rely on mocap• Goal:− Work with limited content− Work for bipeds, quadrupeds… all the -peds© 2021 SIGGRAPH. ALL RIGHTS RESERVED.

THE PREMIER CONFERENCE & EXHIBITION IN
COMPUTER GRAPHICS & INTERACTIVE TECHNIQUES

6

GOALSPERFORMANCE• VR Motion Sickness is a “big deal”• Can’t let game make players feel nauseous• Must maintain 90+ frames per second− 0.011 seconds for entire frame• Goal:− Must be fast to calculate© 2021 SIGGRAPH. ALL RIGHTS RESERVED.

THE PREMIER CONFERENCE & EXHIBITION IN
COMPUTER GRAPHICS & INTERACTIVE TECHNIQUES

7

Options© 2021 SIGGRAPH. ALL RIGHTS RESERVED.

THE PREMIER CONFERENCE & EXHIBITION IN
COMPUTER GRAPHICS & INTERACTIVE TECHNIQUES

8

OPTIONS?
How are others solving these problems?

MOTION MATCHING

MACHINE LEARNING

Pros:

Pros:

• Shipped in other games• Lots of examples of good results• Conceptually simple• Dynamic, adapts to environment• Debuggable

Cons:
Cons:

• Requires lots of example content• Content Quantity => Quality• Hard to debug• Not gonna mocap a headcrab• Slow iteration time (training large data sets)© 2021 SIGGRAPH. ALL RIGHTS RESERVED.

THE PREMIER CONFERENCE & EXHIBITION IN
COMPUTER GRAPHICS & INTERACTIVE TECHNIQUES

9

OPTIONS?
What we went with

SEMI-PROCEDURAL LOCOMOTION
Pros:• Can remove foot slide• 2009 Thesis paper by Rune Skovbo Johansen• Procedural: More variety, Less content• Works with non-humanoids• Change foot steps at runtime
Cons:• http://runevision.com/thesis/• Multi-step animations?
• Extracted motion?
• Transitions?
• Foot Rotations?

© 2021 SIGGRAPH. ALL RIGHTS RESERVED.

THE PREMIER CONFERENCE & EXHIBITION IN
COMPUTER GRAPHICS & INTERACTIVE TECHNIQUES

10

Creating Foot Motion
Data© 2021 SIGGRAPH. ALL RIGHTS RESERVED.

THE PREMIER CONFERENCE & EXHIBITION IN
COMPUTER GRAPHICS & INTERACTIVE TECHNIQUES11

FOOTBASE

Position (Toe) + Direction (to Heel)

Always Touching Lowest Part of Foot© 2021 SIGGRAPH. ALL RIGHTS RESERVED.

THE PREMIER CONFERENCE & EXHIBITION IN
COMPUTER GRAPHICS & INTERACTIVE TECHNIQUES12

FOOTBASESTRIDESFor each animation:• Segment into strides• Stride start frame: “Stance Frame”− Middle of time on ground− Foot not moving− Close to body© 2021 SIGGRAPH. ALL RIGHTS RESERVED.

THE PREMIER CONFERENCE & EXHIBITION IN
COMPUTER GRAPHICS & INTERACTIVE TECHNIQUES

13

FOOTBASESTRIDESFor each Stance Frame:• Calculate FootBase relative to character• “Foot Cycle”: time between steps© 2021 SIGGRAPH. ALL RIGHTS RESERVED.

THE PREMIER CONFERENCE & EXHIBITION IN
COMPUTER GRAPHICS & INTERACTIVE TECHNIQUES

14

FOOTBASE

TRAJECTORIESFor each frame of each Foot Cycle:• Calculate Footbase Position + Direction• Project onto vector between steps (“Stride Vector”)• Convert to offset from projected position• Convert offset to be stride-relative© 2021 SIGGRAPH. ALL RIGHTS RESERVED.

THE PREMIER CONFERENCE & EXHIBITION IN
COMPUTER GRAPHICS & INTERACTIVE TECHNIQUES

15

FOOTBASE

STATIONARY ANIMATIONS• Previous Step Position == Next Step Position• All motion contained in Trajectory Offset© 2021 SIGGRAPH. ALL RIGHTS RESERVED.

THE PREMIER CONFERENCE & EXHIBITION IN
COMPUTER GRAPHICS & INTERACTIVE TECHNIQUES

16

FOOTBASE

ROTATION
Just like Translation:• RotationReference = Lerp(Start, End, Cycle)• Final Rotation = RotationReference + RotationOffset• Must handle > 180 degree rotations!

© 2021 SIGGRAPH. ALL RIGHTS RESERVED.

THE PREMIER CONFERENCE & EXHIBITION IN
COMPUTER GRAPHICS & INTERACTIVE TECHNIQUES

17

STRIDE DATAFOOT CYCLE DEFINITION ( ONE FOR EACH STEP )Float3stancePosition;// Starting Footbase position, in model space

Float

stanceDirection;// Starting Footbase direction, in model space

Float

stanceCycle;// Animation cycle (0-1) when foot cycle starts

Float3

middlePosition;// Footbase position halfway through the step

Float3

toStrideStartPos;// Vector from the end of the stride to the start// Foot cycles (0-1) of when the foot lifts and lands

Float footLiftCycle, footOffCycle, footStrikeCycle, footLandCycle;© 2021 SIGGRAPH. ALL RIGHTS RESERVED.

THE PREMIER CONFERENCE & EXHIBITION IN
COMPUTER GRAPHICS & INTERACTIVE TECHNIQUES

18

STRIDE DATAFOOTBASE TRAJECTORY ( ONE FOR EACH FRAME )Float3translationOffset;// Stride-relative offset from stride vector

Float

rotationOffset;// Stride-relative offset from stride rotation

Float

progression;// Location of projected pos as % along stride vector© 2021 SIGGRAPH. ALL RIGHTS RESERVED.

THE PREMIER CONFERENCE & EXHIBITION IN
COMPUTER GRAPHICS & INTERACTIVE TECHNIQUES

19

Stride Retargeting© 2021 SIGGRAPH. ALL RIGHTS RESERVED.

THE PREMIER CONFERENCE & EXHIBITION IN
COMPUTER GRAPHICS & INTERACTIVE TECHNIQUES

20

STRIDE RETARGETINGRUNTIME PLAYBACK

1. Predict next step position

2. Calc FootBase from Trajectories

3. Use FootBase as IK target© 2021 SIGGRAPH. ALL RIGHTS RESERVED.

THE PREMIER CONFERENCE & EXHIBITION IN
COMPUTER GRAPHICS & INTERACTIVE TECHNIQUES

21

STRIDE RETARGETING

Lowest point on foot must touch the FootBase
Calculate ankle position & rotation from FootBase
Use ankle as IK target for leg© 2021 SIGGRAPH. ALL RIGHTS RESERVED.

THE PREMIER CONFERENCE & EXHIBITION IN
COMPUTER GRAPHICS & INTERACTIVE TECHNIQUES

22

STRIDE RETARGETING

INVERSE KINEMATICS
Can’t use original ankle rotation© 2021 SIGGRAPH. ALL RIGHTS RESERVED.

THE PREMIER CONFERENCE & EXHIBITION IN
COMPUTER GRAPHICS & INTERACTIVE TECHNIQUES

23

STRIDE RETARGETING

INVERSE KINEMATICS
Bad things happen© 2021 SIGGRAPH. ALL RIGHTS RESERVED.

THE PREMIER CONFERENCE & EXHIBITION IN
COMPUTER GRAPHICS & INTERACTIVE TECHNIQUES

24

STRIDE RETARGETING

INVERSE KINEMATICS
1. Start by rotating the leg about the hip© 2021 SIGGRAPH. ALL RIGHTS RESERVED.

THE PREMIER CONFERENCE & EXHIBITION IN
COMPUTER GRAPHICS & INTERACTIVE TECHNIQUES

25

STRIDE RETARGETING

INVERSE KINEMATICS
1. Start by rotating the leg about the hip− Preserves natural foot angle© 2021 SIGGRAPH. ALL RIGHTS RESERVED.

THE PREMIER CONFERENCE & EXHIBITION IN
COMPUTER GRAPHICS & INTERACTIVE TECHNIQUES

26

STRIDE RETARGETING

INVERSE KINEMATICS
1. Start by rotating the leg about the hip
2. Align Horizontally− Align Foot to FootBase as it gets flat
− Otherwise, pop when lowest point changes© 2021 SIGGRAPH. ALL RIGHTS RESERVED.

THE PREMIER CONFERENCE & EXHIBITION IN
COMPUTER GRAPHICS & INTERACTIVE TECHNIQUES

27

STRIDE RETARGETING

INVERSE KINEMATICS
1. Start by rotating the leg about the hip
2. Align Horizontally
3. Align Vertically− Align with sloped FootBase based on:• How flat Foot is in original anim
• At beginning or end of stride© 2021 SIGGRAPH. ALL RIGHTS RESERVED.

THE PREMIER CONFERENCE & EXHIBITION IN
COMPUTER GRAPHICS & INTERACTIVE TECHNIQUES

28

STRIDE RETARGETING

INVERSE KINEMATICS
1. Start by rotating the leg about the hip
2. Align Horizontally
3. Align Vertically
4. Solve Leg IK for Ankle Position− Second pass to enforce Ankle limits© 2021 SIGGRAPH. ALL RIGHTS RESERVED.

THE PREMIER CONFERENCE & EXHIBITION IN
COMPUTER GRAPHICS & INTERACTIVE TECHNIQUES

29

Manipulating the Foot
Motion Data
© 2021 SIGGRAPH. ALL RIGHTS RESERVED.

THE PREMIER CONFERENCE & EXHIBITION IN
COMPUTER GRAPHICS & INTERACTIVE TECHNIQUES30

MANIPULATING THE DATASTEP LENGTH• Scale distance traveled• Affects foot step distance© 2021 SIGGRAPH. ALL RIGHTS RESERVED.

THE PREMIER CONFERENCE & EXHIBITION IN
COMPUTER GRAPHICS & INTERACTIVE TECHNIQUES31

MANIPULATING THE DATASTEP HEIGHT• Scale Trajectory Translation Offset• Affects height/intensity of step
• Scale step height with distance for consistency© 2021 SIGGRAPH. ALL RIGHTS RESERVED.

THE PREMIER CONFERENCE & EXHIBITION IN
COMPUTER GRAPHICS & INTERACTIVE TECHNIQUES32

MANIPULATING THE DATASTEP LOCATION
Change steps to go to new location• Turning• Uneven ground / stairs© 2021 SIGGRAPH. ALL RIGHTS RESERVED.

THE PREMIER CONFERENCE & EXHIBITION IN
COMPUTER GRAPHICS & INTERACTIVE TECHNIQUES33

MANIPULATING THE DATACURVED STRIDE PATHS• Curve path through original midpoint to prevent leg
intersection• Increase arch when walking up slopes© 2021 SIGGRAPH. ALL RIGHTS RESERVED.

THE PREMIER CONFERENCE & EXHIBITION IN
COMPUTER GRAPHICS & INTERACTIVE TECHNIQUES

34

Transitions & Blending© 2021 SIGGRAPH. ALL RIGHTS RESERVED.

THE PREMIER CONFERENCE & EXHIBITION IN
COMPUTER GRAPHICS & INTERACTIVE TECHNIQUES

35

TRANSITIONS AND BLENDING

All foot motion data can blend…
Except for Progression© 2021 SIGGRAPH. ALL RIGHTS RESERVED.

THE PREMIER CONFERENCE & EXHIBITION IN
COMPUTER GRAPHICS & INTERACTIVE TECHNIQUES

36

TRANSITIONS AND BLENDING

BlendsTransitions

Everything Else© 2021 SIGGRAPH. ALL RIGHTS RESERVED.

THE PREMIER CONFERENCE & EXHIBITION IN
COMPUTER GRAPHICS & INTERACTIVE TECHNIQUES

37

TRANSITIONS AND BLENDING

BLENDS
Match timing between animations• Sync foot cycles between animations− Force steps to start and end at same time
• Common practice in games

Can cheat!
• Fudge numbers on foot motion data
• System will move feet to right place© 2021 SIGGRAPH. ALL RIGHTS RESERVED.

THE PREMIER CONFERENCE & EXHIBITION IN
COMPUTER GRAPHICS & INTERACTIVE TECHNIQUES38

TRANSITIONS AND BLENDING

TRANSITIONS• Foot cycles are out of sync
• Can’t blend, must transition© 2021 SIGGRAPH. ALL RIGHTS RESERVED.

THE PREMIER CONFERENCE & EXHIBITION IN
COMPUTER GRAPHICS & INTERACTIVE TECHNIQUES

39

TRANSITIONS AND BLENDING

TRANSITIONS© 2021 SIGGRAPH. ALL RIGHTS RESERVED.

THE PREMIER CONFERENCE & EXHIBITION IN
COMPUTER GRAPHICS & INTERACTIVE TECHNIQUES

40

TRANSITIONS AND BLENDING

TRANSITIONS• Can’t change End of new stride• Can change Start© 2021 SIGGRAPH. ALL RIGHTS RESERVED.

THE PREMIER CONFERENCE & EXHIBITION IN
COMPUTER GRAPHICS & INTERACTIVE TECHNIQUES

41

TRANSITIONS AND BLENDING

TRANSITIONS
If foot is stationary on ground• StartPos = CurrentPos
Else• Move StartPos so reference points match• Clamp length of stride to original length© 2021 SIGGRAPH. ALL RIGHTS RESERVED.

THE PREMIER CONFERENCE & EXHIBITION IN
COMPUTER GRAPHICS & INTERACTIVE TECHNIQUES

42

TRANSITIONS AND BLENDING

TRANSITIONS• Calc remaining Offset between old and new footpositions• Blend out Offset over time

© 2021 SIGGRAPH. ALL RIGHTS RESERVED.

THE PREMIER CONFERENCE & EXHIBITION IN
COMPUTER GRAPHICS & INTERACTIVE TECHNIQUES

43

TRANSITIONS AND BLENDING

EVERYTHING ELSE
• Additive, per-bone blends, etc work
• But have to pick which source to pull foot motion
from© 2021 SIGGRAPH. ALL RIGHTS RESERVED.

THE PREMIER CONFERENCE & EXHIBITION IN
COMPUTER GRAPHICS & INTERACTIVE TECHNIQUES

44

Predicting the Next Step

© 2021 SIGGRAPH. ALL RIGHTS RESERVED.

THE PREMIER CONFERENCE & EXHIBITION IN
COMPUTER GRAPHICS & INTERACTIVE TECHNIQUES45

FOOTSTEP PREDICTION

WHERE WILL THE NEXT STEP LAND?

?

© 2021 SIGGRAPH. ALL RIGHTS RESERVED.

THE PREMIER CONFERENCE & EXHIBITION IN
COMPUTER GRAPHICS & INTERACTIVE TECHNIQUES46

FOOTSTEP PREDICTION

WHERE WILL THE NEXT STEP LAND?
• Foot Motion Data
− Offset from character at each step
− Animation frame of each step

• => Figure out where character will be at that time

© 2021 SIGGRAPH. ALL RIGHTS RESERVED.

THE PREMIER CONFERENCE & EXHIBITION IN
COMPUTER GRAPHICS & INTERACTIVE TECHNIQUES47

FOOTSTEP PREDICTIONROOT MOTION• Add up root motion from now till next stepD

© 2021 SIGGRAPH. ALL RIGHTS RESERVED.

THE PREMIER CONFERENCE & EXHIBITION IN
COMPUTER GRAPHICS & INTERACTIVE TECHNIQUES48

FOOTSTEP PREDICTIONPATHSGiven a navigation path…

© 2021 SIGGRAPH. ALL RIGHTS RESERVED.

THE PREMIER CONFERENCE & EXHIBITION IN
COMPUTER GRAPHICS & INTERACTIVE TECHNIQUES49

FOOTSTEP PREDICTION

PATHS… Move along the path by same distance asanimationD© 2021 SIGGRAPH. ALL RIGHTS RESERVED.

THE PREMIER CONFERENCE & EXHIBITION IN
COMPUTER GRAPHICS & INTERACTIVE TECHNIQUES50

FOOTSTEP PREDICTIONROTATION• Need to know facing direction at future location• 2 Modes:− Target Look Mode?
© 2021 SIGGRAPH. ALL RIGHTS RESERVED.

− Path Look Mode

THE PREMIER CONFERENCE & EXHIBITION IN
COMPUTER GRAPHICS & INTERACTIVE TECHNIQUES51

FOOTSTEP PREDICTIONROTATION• Target look mode
− Always facing a target point in the world− Assume stationary target© 2021 SIGGRAPH. ALL RIGHTS RESERVED.

THE PREMIER CONFERENCE & EXHIBITION IN
COMPUTER GRAPHICS & INTERACTIVE TECHNIQUES52

FOOTSTEP PREDICTIONROTATION• Path Look Mode:− Always facing forward along the path

© 2021 SIGGRAPH. ALL RIGHTS RESERVED.

THE PREMIER CONFERENCE & EXHIBITION IN
COMPUTER GRAPHICS & INTERACTIVE TECHNIQUES53

FOOTSTEP PREDICTION

PLACE FOOT
• Use FootBase offset to find foot position/rotation© 2021 SIGGRAPH. ALL RIGHTS RESERVED.

THE PREMIER CONFERENCE & EXHIBITION IN
COMPUTER GRAPHICS & INTERACTIVE TECHNIQUES54

FOOTSTEP PREDICTION

PLACE FOOT
• Update predicted foot position each frame− Ideally, shouldn’t move
− Don’t change once foot lands− Becomes the “Previous” position for next step© 2021 SIGGRAPH. ALL RIGHTS RESERVED.

THE PREMIER CONFERENCE & EXHIBITION IN
COMPUTER GRAPHICS & INTERACTIVE TECHNIQUES55

FOOTSTEP PREDICTION

Anim 1

TRANSITION BLENDING• How to predict character position when cross-fading

Anim 2Blend In Over Time© 2021 SIGGRAPH. ALL RIGHTS RESERVED.

animations?

Distance?

THE PREMIER CONFERENCE & EXHIBITION IN
COMPUTER GRAPHICS & INTERACTIVE TECHNIQUES56

FOOTSTEP PREDICTION

Anim 2

TRANSITION BLENDING• Find Velocity Delta at start of transition• Add Velocity Delta to root motion each frame

Velocity
Delta• Reduce Velocity Delta to 0 over time

Fade Out Over TimeD
Root Motion© 2021 SIGGRAPH. ALL RIGHTS RESERVED.

THE PREMIER CONFERENCE & EXHIBITION IN
COMPUTER GRAPHICS & INTERACTIVE TECHNIQUES57

FOOTSTEP PREDICTION

Anim 2

FIND TOTAL MOVEMENT FROMVELOCITY DELTA• Velocity added to Root Motion at time t:V(t) = VelocityDelta * (1 - t / BlendTime)

Delta
Distance
Fade Out Over TimeD

• Integrate to get distance at time t:
D(t) = (K/2)*t^2 + VelocityDelta *t + C
Where K = -VelocityDelta / BlendTime

Root Motion

𝑡1
Total Delta Distance = ‫)𝑡(𝐷 ׬‬
𝑡0© 2021 SIGGRAPH. ALL RIGHTS RESERVED.

THE PREMIER CONFERENCE & EXHIBITION IN
COMPUTER GRAPHICS & INTERACTIVE TECHNIQUES

58

Animation Selection© 2021 SIGGRAPH. ALL RIGHTS RESERVED.

THE PREMIER CONFERENCE & EXHIBITION IN
COMPUTER GRAPHICS & INTERACTIVE TECHNIQUES59

ANIMATION SELECTION• Stride Retargeting can change animations• Extreme changes look bad• Need to pick closest animation…

© 2021 SIGGRAPH. ALL RIGHTS RESERVED.

THE PREMIER CONFERENCE & EXHIBITION IN
COMPUTER GRAPHICS & INTERACTIVE TECHNIQUES

60

ANIMATION SELECTION• Stride Retargeting can change animations• Extreme changes look bad• Need to pick closest animation…

• Motion Matching© 2021 SIGGRAPH. ALL RIGHTS RESERVED.

THE PREMIER CONFERENCE & EXHIBITION IN
COMPUTER GRAPHICS & INTERACTIVE TECHNIQUES61

MOTION MATCHING

Why Now?
• Don’t need anim for every possibility− Stride Retargeting fills the gaps

• Already calculating future “goal” state• Leverage foot motion data

© 2021 SIGGRAPH. ALL RIGHTS RESERVED.

THE PREMIER CONFERENCE & EXHIBITION IN
COMPUTER GRAPHICS & INTERACTIVE TECHNIQUES62

MOTION MATCHING OVERVIEW

Metric 1
Metric 2

Metric 3
Metric 4• Metrics = measurements about the state of an animation. Can be about current state or desired future state• Eg: Current Velocity, Future Velocity© 2021 SIGGRAPH. ALL RIGHTS RESERVED.

THE PREMIER CONFERENCE & EXHIBITION IN
COMPUTER GRAPHICS & INTERACTIVE TECHNIQUES63

MOTION MATCHING OVERVIEWAll Animations
Sample 1

Sample 2

Sample 3

Sample 4…

Sample N

Metric 1

Value 1

Value 1

Value 1

Value 1…

Value 1

Metric 2

Value 2

Value 2

Value 2

Value 2…

Value 2

Metric 3

Value 3

Value 3

Value 3

Value 3…

Value 3

Metric 4

Value 4

Value 4

Value 4

Value 4…

Value 4

Sample all the animations at a fixed interval and calculate the value for each Metric© 2021 SIGGRAPH. ALL RIGHTS RESERVED.

THE PREMIER CONFERENCE & EXHIBITION IN
COMPUTER GRAPHICS & INTERACTIVE TECHNIQUES64

MOTION MATCHING OVERVIEWAll Animations

Goal
State

Sample 1

Sample 2

Sample 3

Sample 4…

Sample N

Metric 1

Value 1

Value 1

Value 1

Value 1

Value 1…

Value 1

Metric 2

Value 2

Value 2

Value 2

Value 2

Value 2…

Value 2

Metric 3

Value 3

Value 3

Value 3

Value 3

Value 3…

Value 3

Metric 4

Value 4

Value 4

Value 4

Value 4

Value 4…

Value 4

Define a Goal State, that represents the desired state of the character.
Calculate a ‘score’ for each sample based on how close it is to the Goal State© 2021 SIGGRAPH. ALL RIGHTS RESERVED.

THE PREMIER CONFERENCE & EXHIBITION IN
COMPUTER GRAPHICS & INTERACTIVE TECHNIQUES65

MOTION MATCHING OVERVIEWAll Animations

Goal
State

Sample 1

Sample 2

Sample 3

Sample 4…

Sample N

Metric 1

Value 1

Value 1

Value 1

Value 1

Value 1…

Value 1

Metric 2

Value 2

Value 2

Value 2

Value 2

Value 2…

Value 2

Metric 3

Value 3

Value 3

Value 3

Value 3

Value 3…

Value 3

Metric 4

Value 4

Value 4

Value 4

Value 4

Value 4…

Value 4

Score =© 2021 SIGGRAPH. ALL RIGHTS RESERVED.

σ((𝑮𝒐𝒂𝒍𝑽𝒂𝒍𝒖𝒆𝒏 − 𝑻𝒆𝒔𝒕𝑽𝒂𝒍𝒖𝒆𝒏 )𝟐 ∗ 𝑴𝒆𝒕𝒓𝒊𝒄𝑾𝒆𝒊𝒈𝒉𝒕𝒏 )THE PREMIER CONFERENCE & EXHIBITION IN
COMPUTER GRAPHICS & INTERACTIVE TECHNIQUES66

MOTION MATCHING OVERVIEW

Goal
State

Current
State

Metric 1

Value 1

Metric 2

All Animations
Sample 1

Sample 2

Sample 3

Sample 4…

Sample N

Value 1

Value 1

Value 1

Value 1

Value 1…

Value 1

Value 2

Value 2

Value 2

Value 2

Value 2

Value 2…

Value 2

Metric 3

Value 3

Value 3

Value 3

Value 3

Value 3

Value 3…

Value 3

Metric 4

Value 4

Value 4

Value 4

Value 4

Value 4

Value 4…

Value 4

Sample with lowest score becomes the current state.
Repeat process, but now the sample has to score better than the current state.
© 2021 SIGGRAPH. ALL RIGHTS RESERVED.

THE PREMIER CONFERENCE & EXHIBITION IN
COMPUTER GRAPHICS & INTERACTIVE TECHNIQUES67

LIVING WITH MOTION MATCHING

Using motion
matching is likeraising a child…

© 2021 SIGGRAPH. ALL RIGHTS RESERVED.

THE PREMIER CONFERENCE & EXHIBITION IN
COMPUTER GRAPHICS & INTERACTIVE TECHNIQUES68

LIVING WITH MOTION MATCHING

“Make
Good
Choices”© 2021 SIGGRAPH. ALL RIGHTS RESERVED.

THE PREMIER CONFERENCE & EXHIBITION IN
COMPUTER GRAPHICS & INTERACTIVE TECHNIQUES69LIVING WITH MOTION MATCHING“Don’tMake
Bad
Choices”© 2021 SIGGRAPH. ALL RIGHTS RESERVED.

THE PREMIER CONFERENCE & EXHIBITION IN
COMPUTER GRAPHICS & INTERACTIVE TECHNIQUES70

Avoiding Bad Choices© 2021 SIGGRAPH. ALL RIGHTS RESERVED.

THE PREMIER CONFERENCE & EXHIBITION IN
COMPUTER GRAPHICS & INTERACTIVE TECHNIQUES71

AVOIDING BAD CHOICESCLIP GROUPS• Put anims in groups• Only allowed to search in active groups• Game logic determines active groups© 2021 SIGGRAPH. ALL RIGHTS RESERVED.

THE PREMIER CONFERENCE & EXHIBITION IN
COMPUTER GRAPHICS & INTERACTIVE TECHNIQUES72

AVOIDING BAD CHOICESFILTERS
Sample 1

Sample 2

Sample 3 …

Sample N• Method to exclude certain samples

Value 1

Value 1

Value 1 …

Value 1

• Define valid metric range (Min/Max)

Value 2

Value 2

Value 2…

Value 2

Value 3

Value 3

Value 3 …

Value 3

Value 4

Value 4

Value 4 …

Value 4

© 2021 SIGGRAPH. ALL RIGHTS RESERVED.

• Skip samples that fail check

THE PREMIER CONFERENCE & EXHIBITION IN
COMPUTER GRAPHICS & INTERACTIVE TECHNIQUES73

LEAST BAD CHOICEWEIGHTS• Eventually need to pick between imperfect options

Weighted Score =• Add weight scales score for metric• Larger weights => More important෍((𝐺𝑜𝑎𝑙𝑉𝑎𝑙𝑢𝑒𝑛 − 𝑇𝑒𝑠𝑡𝑉𝑎𝑙𝑢𝑒𝑛 )2 ∗ 𝑴𝒆𝒕𝒓𝒊𝒄𝑾𝒆𝒊𝒈𝒉𝒕𝒏 )© 2021 SIGGRAPH. ALL RIGHTS RESERVED.

• Zero weight => Metric ignored• Best results when all weights close to 1

THE PREMIER CONFERENCE & EXHIBITION IN
COMPUTER GRAPHICS & INTERACTIVE TECHNIQUES74

Making Good Choices© 2021 SIGGRAPH. ALL RIGHTS RESERVED.

THE PREMIER CONFERENCE & EXHIBITION IN
COMPUTER GRAPHICS & INTERACTIVE TECHNIQUES75

IMPROVING ACCURACY

PICKING PATH SAMPLES

Time-Based Sampling
Goal Position
Animation Position• Time-based path sampling− Use physics to estimate future position− Guess at Acceleration/Jerk− Doesn’t match all anims

1

1

.6
.6

© 2021 SIGGRAPH. ALL RIGHTS RESERVED.

.3

.1

.3

.1

THE PREMIER CONFERENCE & EXHIBITION IN
COMPUTER GRAPHICS & INTERACTIVE TECHNIQUES76

IMPROVING ACCURACY

PICKING PATH SAMPLESDistance-Based Sampling
Goal Position
Animation Position• Distance-based path sampling− Find Position after moving X distance− Consistent for all animations− Easy to find along path

20

15

10

5

20

15

10

5

© 2021 SIGGRAPH. ALL RIGHTS RESERVED.

THE PREMIER CONFERENCE & EXHIBITION IN
COMPUTER GRAPHICS & INTERACTIVE TECHNIQUES77

IMPROVING ACCURACY

EXTRAPOLATING SAMPLES• What if Animation doesn’t move far enough?
• Estimate position based on final speed

20

15

10

5

20

15

10

5

© 2021 SIGGRAPH. ALL RIGHTS RESERVED.

THE PREMIER CONFERENCE & EXHIBITION IN
COMPUTER GRAPHICS & INTERACTIVE TECHNIQUES78

IMPROVING ACCURACYSLOPES / UNEVEN TERRAIN• Goal samples at different heights/distances• Anim samples flat
• => Flatten Goal samples
15
20

15

10

5
5

20

10

© 2021 SIGGRAPH. ALL RIGHTS RESERVED.

THE PREMIER CONFERENCE & EXHIBITION IN
COMPUTER GRAPHICS & INTERACTIVE TECHNIQUES79

IMPROVING ACCURACY

CORRECTIONS

•
•
•

20

15

10

© 2021 SIGGRAPH. ALL RIGHTS RESERVED.

Match is never perfect
Apply Correction for Position and Rotation
Must include corrections in Score for Current
Choice5

THE PREMIER CONFERENCE & EXHIBITION IN
COMPUTER GRAPHICS & INTERACTIVE TECHNIQUES80

Leveraging Foot Motion© 2021 SIGGRAPH. ALL RIGHTS RESERVED.

THE PREMIER CONFERENCE & EXHIBITION IN
COMPUTER GRAPHICS & INTERACTIVE TECHNIQUES81

LEVERAGING FOOT MOTION

FOOT POSITION METRIC• X,Y,Z position of FootBase• Character-relative• More accurate than foot bone position metric© 2021 SIGGRAPH. ALL RIGHTS RESERVED.

THE PREMIER CONFERENCE & EXHIBITION IN
COMPUTER GRAPHICS & INTERACTIVE TECHNIQUES82

LEVERAGING FOOT MOTION

FOOT STEP PROGRESSION METRIC• Metric for foot step progression• Matches how far through a step samples are• Convert Progression (0->1) to a 2D direction vector− So start and end match© 2021 SIGGRAPH. ALL RIGHTS RESERVED.

THE PREMIER CONFERENCE & EXHIBITION IN
COMPUTER GRAPHICS & INTERACTIVE TECHNIQUES83

LEVERAGING FOOT MOTIONSTEPS REMAINING FILTER• On stopping anims, Root still moves after feet stop
• Don’t want to pick these for short steps• Add “Steps Remaining” metric, use as filter© 2021 SIGGRAPH. ALL RIGHTS RESERVED.

THE PREMIER CONFERENCE & EXHIBITION IN
COMPUTER GRAPHICS & INTERACTIVE TECHNIQUES84

LEVERAGING FOOT MOTIONDISTANCE REMAINING FILTER• Need to stop exactly at end of path
• MM was picking clips that stopped just short• Add “Distance Remaining” metric− Filter out samples that don’t reach goal

• Scale root motion to stop at goal

© 2021 SIGGRAPH. ALL RIGHTS RESERVED.

THE PREMIER CONFERENCE & EXHIBITION IN
COMPUTER GRAPHICS & INTERACTIVE TECHNIQUES85

LEVERAGING FOOT MOTIONSEARCH FREQUENCY• Can perform new search at fixed intervals• Looked slightly better if only searching when a foot isplanted© 2021 SIGGRAPH. ALL RIGHTS RESERVED.

THE PREMIER CONFERENCE & EXHIBITION IN
COMPUTER GRAPHICS & INTERACTIVE TECHNIQUES86

METRICSCOMBINE SOLDIER• Metrics used by the combine soldier© 2021 SIGGRAPH. ALL RIGHTS RESERVED.

THE PREMIER CONFERENCE & EXHIBITION IN
COMPUTER GRAPHICS & INTERACTIVE TECHNIQUES

87

ANIMATIONS
117 Animations used for motion matching• Strafe Mode (77)• Face Path Mode (70)

− Idle*− Running turns: Left/Right x Large/Small Radius− Run Loop* x 8 directions− Strafe then Face Path x 8 directions− Short Hops*, 8 distances x 8 directions− Face Path then Strafe x 8 directions− Run Fwd then Bwd, Bwd then Fwd− Run Left then Right, Right then Left
− Square Strafe Clockwise, Counter-Clockwise− Stand to Run x 8 directions− Run to Stand x 8 directions− Plant turns: 90/180 Left/Right− All Strafe Mode Animations* Created before MM implementation and re-used© 2021 SIGGRAPH. ALL RIGHTS RESERVED.

THE PREMIER CONFERENCE & EXHIBITION IN
COMPUTER GRAPHICS & INTERACTIVE TECHNIQUES88QUESTIONS?
LIVE Q & A ON DATE TBD© 2021 SIGGRAPH. ALL RIGHTS RESERVED.

THE PREMIER CONFERENCE & EXHIBITION IN
COMPUTER GRAPHICS & INTERACTIVE TECHNIQUES

89