Modern Game Engine Course Notes 03

Course from: BoomingTech

Animation System

Basics of Animation Technology

Fundamental base: The persistence of vision & Illusory motion (Phi phenomenon)

Challenges in Game Animation

  1. Interactive and dynamic animation
    • Vary according to the interaction
    • Cooperate with other gameplay systems
    • Make adjustments in complex environments
  2. Real-time
    • Compute per frame
    • Massive animation data(Disk and memory)
  3. Realism
    • More vivid expression
    • More authentic experience

2D Animation - Sprite animation

The electronic equivalent to cel animation

Application

Live2D A technology to generate 2D animation without 3D model

Make a Live2D animation

Prepare resources

Transform image by using control points for parts

Set animation “key frame”

3D Animation Techniques in Games

DoF(Degrees of Freedom)

Rigid Hierarchical Animation

Per-vertex Animation

Morph Target Animation

3D Skinned Animation

Advantages

2D Skinned Animation - Derived from 3D skinned animation

Physics-based Animation

Animation Content Creation

Skinned Animation Implementation

  1. Create mesh for a binding pose
  2. Create a binding skeleton for the mesh
  3. “Paint” per-vertices skinning weights to related skeleton
  4. Animate skeleton to desired pose
  5. Animate skinned vertices by skeleton and skinning weights

Different Spaces

Different Spaces

Skeleton for Creatures - Comprised of a hierarchy of rigid pieces known as joints

Joint vs. Bone

Humanoid Skeleton in Real Game - Number of joints in a humanoid skeleton

Joints for Game Play -Additional joints

Where to Start the Skeleton – Root Joint

Root joint

Pelvis joint

Bind Animation for Objects

Bind Pose – T-pose vs. A-pose

The pose of the 3D mesh prior to being bound to the skeleton

T-pose vs A-pose

Skeleton Pose: A skeleton is posed by transform its joints from the bind pose

Math of 3D Rotation

2D Rotation

3D Rotation

Euler Angle provides a brief description of 3D rotation and is widely used in many fields.

Problems of Euler Angle

Quaternion

Complex Number and 2D Rotation

2D Rotation with Complex Number

Quaternion

Rotation by Quaternion

Quaternion to Rotation Matrix

Quaternion Rotation Math

Given Axis Rotation by Quaternion

Joint Pose

Joint Pose - Orientation

Joint Pose - Position

Joint Pose - Scale

Joint Pose - Affine Matrix

Affine Matrix

Joint Pose Interpolation - Local Space vs. Model Space

Single Joint Skinning - Attach the vertices of a mesh to a posed skeleton

Quaternion Interpolation of Rotation NLERP vs. SLERP

Simple Animation Runtime Pipeline

Animation Runtime Pipeline

Catmull-Rom Spline (used for compressing animation)

Advanced Animation Technology

Animation Blending

Math of Blending: LERP

Align Blend Timeline Align Blend Timeline

Blend Space

1D Blend Space: Directional Movement

Players can move forward from multiple angles

We can blend any angle from three clips:

The technique is called 1D Blend Space.

2D Blend Space:

Skeleton Masked Blending:

Skeleton Masked Blending

Additive Blending:

Animation State Machine

Case: Jumping

ASM Definition:

Cross Fades: Two common ways

Animation State Machine in Unreal

Animation State Machine in Unreal

Layered ASM:

Animation Blend Tree

Blend Tree

LERP Blend Node

Usually extended to handle multiple inputs (e.g. Ternary/Quad LERP node)

Additive Blend node

Express Layered ASM in Blend Tree

Blend Tree Nodes:

Terminal node (Leaf Nodes)

Non-terminal node (No-Leaf Nodes)

Inverse Kinematics (IK)

Basic Concepts

Tone Bones IK

Complexity of Multi-Joint IK Solving

Check Reachability of the Target

Constraints of Joints

Heuristics Algorithm

Why? Too many joints + constraints, difficult to solve with analysis method

Basic Idea

CCD (Cyclic Coordinate Decent)

Optimized CCD:

  1. Add tolerance regions to each bone’s goal
    • Each bone stops rotating and moves onto the next bone within tolerance region
    • Helps to produce poses that are less rigid and more comfortable looking
  2. Use under-damped angle scaling
    • Each joint moves only a small amount toward the goal and distributes the movement across multiple bones
    • Produce less abrupt joint changes and more smooth and casual poses for character movement

FABRIK (Forward And Backward Reaching Inverse Kinematics)

FABRIKF with Constraints: Re-positioning

Multiple End-Effectors

IK with Multiple End-Effectors

Other IK Solutions:

Physics-based Method

PBD(Position Based Dynamics)

Fullbody IK in UE5

Animation Pipeline with Blending and IK

Animation Pipeline with Blending and IK

Facial Animation

Face is Driven by Complex Muscle System Facial Muscles

High Precision Requirements – Minor change makes difference:

Facial Action Coding System (From Movie Industry)

28 Core Action Units

FACS In Morph Target Animation

UV Texture Facial Animation

Animation Re-targeting

Share Animation Among Characters

Process Tracks – Handle animation tracks respectively

Align Movement by Pelvis Height – The movement of the character

Unresolved Problems of Re-targeting