game animation - 國立臺灣大學
TRANSCRIPT
![Page 1: Game Animation - 國立臺灣大學](https://reader034.vdocuments.site/reader034/viewer/2022052106/62880e413a036931d8738b31/html5/thumbnails/1.jpg)
Ken-Yi Lee
Game Programming, Fall 2020 @ National Taiwan University
Game Animation
![Page 2: Game Animation - 國立臺灣大學](https://reader034.vdocuments.site/reader034/viewer/2022052106/62880e413a036931d8738b31/html5/thumbnails/2.jpg)
2
Game Programming
● Rendering
● Looping and control
● Math
● Animation
● Physics
● Behaviour and navigation (AI)
● Effects
● Networking
![Page 3: Game Animation - 國立臺灣大學](https://reader034.vdocuments.site/reader034/viewer/2022052106/62880e413a036931d8738b31/html5/thumbnails/3.jpg)
3
Game Programming
● Rendering
● Looping and control
● Math
● Animation
● Physics
● Behaviour and navigation (AI)
● Effects
● Networking
![Page 4: Game Animation - 國立臺灣大學](https://reader034.vdocuments.site/reader034/viewer/2022052106/62880e413a036931d8738b31/html5/thumbnails/4.jpg)
4
![Page 6: Game Animation - 國立臺灣大學](https://reader034.vdocuments.site/reader034/viewer/2022052106/62880e413a036931d8738b31/html5/thumbnails/6.jpg)
6
Demo : 2D Game Kit
● Play
● Introduce scene assets
![Page 7: Game Animation - 國立臺灣大學](https://reader034.vdocuments.site/reader034/viewer/2022052106/62880e413a036931d8738b31/html5/thumbnails/7.jpg)
2D sprite animation
● Keyframes / image sequence
7
![Page 8: Game Animation - 國立臺灣大學](https://reader034.vdocuments.site/reader034/viewer/2022052106/62880e413a036931d8738b31/html5/thumbnails/8.jpg)
8
![Page 9: Game Animation - 國立臺灣大學](https://reader034.vdocuments.site/reader034/viewer/2022052106/62880e413a036931d8738b31/html5/thumbnails/9.jpg)
9
![Page 10: Game Animation - 國立臺灣大學](https://reader034.vdocuments.site/reader034/viewer/2022052106/62880e413a036931d8738b31/html5/thumbnails/10.jpg)
10
![Page 11: Game Animation - 國立臺灣大學](https://reader034.vdocuments.site/reader034/viewer/2022052106/62880e413a036931d8738b31/html5/thumbnails/11.jpg)
11
![Page 12: Game Animation - 國立臺灣大學](https://reader034.vdocuments.site/reader034/viewer/2022052106/62880e413a036931d8738b31/html5/thumbnails/12.jpg)
12
![Page 13: Game Animation - 國立臺灣大學](https://reader034.vdocuments.site/reader034/viewer/2022052106/62880e413a036931d8738b31/html5/thumbnails/13.jpg)
13
![Page 14: Game Animation - 國立臺灣大學](https://reader034.vdocuments.site/reader034/viewer/2022052106/62880e413a036931d8738b31/html5/thumbnails/14.jpg)
14
![Page 15: Game Animation - 國立臺灣大學](https://reader034.vdocuments.site/reader034/viewer/2022052106/62880e413a036931d8738b31/html5/thumbnails/15.jpg)
15
![Page 16: Game Animation - 國立臺灣大學](https://reader034.vdocuments.site/reader034/viewer/2022052106/62880e413a036931d8738b31/html5/thumbnails/16.jpg)
16
![Page 17: Game Animation - 國立臺灣大學](https://reader034.vdocuments.site/reader034/viewer/2022052106/62880e413a036931d8738b31/html5/thumbnails/17.jpg)
17
![Page 18: Game Animation - 國立臺灣大學](https://reader034.vdocuments.site/reader034/viewer/2022052106/62880e413a036931d8738b31/html5/thumbnails/18.jpg)
18
![Page 19: Game Animation - 國立臺灣大學](https://reader034.vdocuments.site/reader034/viewer/2022052106/62880e413a036931d8738b31/html5/thumbnails/19.jpg)
19
![Page 20: Game Animation - 國立臺灣大學](https://reader034.vdocuments.site/reader034/viewer/2022052106/62880e413a036931d8738b31/html5/thumbnails/20.jpg)
20
![Page 21: Game Animation - 國立臺灣大學](https://reader034.vdocuments.site/reader034/viewer/2022052106/62880e413a036931d8738b31/html5/thumbnails/21.jpg)
21
![Page 22: Game Animation - 國立臺灣大學](https://reader034.vdocuments.site/reader034/viewer/2022052106/62880e413a036931d8738b31/html5/thumbnails/22.jpg)
22
![Page 23: Game Animation - 國立臺灣大學](https://reader034.vdocuments.site/reader034/viewer/2022052106/62880e413a036931d8738b31/html5/thumbnails/23.jpg)
23
Sprite renderer
![Page 24: Game Animation - 國立臺灣大學](https://reader034.vdocuments.site/reader034/viewer/2022052106/62880e413a036931d8738b31/html5/thumbnails/24.jpg)
24
Demo : 2D Game Kit
● Inspect Ellen [Prefab]
![Page 25: Game Animation - 國立臺灣大學](https://reader034.vdocuments.site/reader034/viewer/2022052106/62880e413a036931d8738b31/html5/thumbnails/25.jpg)
25
Animation clip : keyframe animation
![Page 26: Game Animation - 國立臺灣大學](https://reader034.vdocuments.site/reader034/viewer/2022052106/62880e413a036931d8738b31/html5/thumbnails/26.jpg)
26
Demo : 2D Game Kit
● Inspect Ellen prefab
● Inspect Ellen_Idle animation
![Page 28: Game Animation - 國立臺灣大學](https://reader034.vdocuments.site/reader034/viewer/2022052106/62880e413a036931d8738b31/html5/thumbnails/28.jpg)
28Source: Unity Learn
Tight ?
![Page 29: Game Animation - 國立臺灣大學](https://reader034.vdocuments.site/reader034/viewer/2022052106/62880e413a036931d8738b31/html5/thumbnails/29.jpg)
29
![Page 30: Game Animation - 國立臺灣大學](https://reader034.vdocuments.site/reader034/viewer/2022052106/62880e413a036931d8738b31/html5/thumbnails/30.jpg)
Root motion
30
![Page 31: Game Animation - 國立臺灣大學](https://reader034.vdocuments.site/reader034/viewer/2022052106/62880e413a036931d8738b31/html5/thumbnails/31.jpg)
Root motion
31
![Page 32: Game Animation - 國立臺灣大學](https://reader034.vdocuments.site/reader034/viewer/2022052106/62880e413a036931d8738b31/html5/thumbnails/32.jpg)
Root motion
32
![Page 33: Game Animation - 國立臺灣大學](https://reader034.vdocuments.site/reader034/viewer/2022052106/62880e413a036931d8738b31/html5/thumbnails/33.jpg)
Root motion
33
![Page 34: Game Animation - 國立臺灣大學](https://reader034.vdocuments.site/reader034/viewer/2022052106/62880e413a036931d8738b31/html5/thumbnails/34.jpg)
34
Demo : 2D Game Kit
● Inspect Ellen prefab
● Inspect Ellen_Idle animation
![Page 35: Game Animation - 國立臺灣大學](https://reader034.vdocuments.site/reader034/viewer/2022052106/62880e413a036931d8738b31/html5/thumbnails/35.jpg)
Parametric animation
35
![Page 36: Game Animation - 國立臺灣大學](https://reader034.vdocuments.site/reader034/viewer/2022052106/62880e413a036931d8738b31/html5/thumbnails/36.jpg)
Parametric animation
36
Interpolation between consecutive frames ?
![Page 37: Game Animation - 國立臺灣大學](https://reader034.vdocuments.site/reader034/viewer/2022052106/62880e413a036931d8738b31/html5/thumbnails/37.jpg)
37
Smooth or sharp ?
Parametric animation
![Page 38: Game Animation - 國立臺灣大學](https://reader034.vdocuments.site/reader034/viewer/2022052106/62880e413a036931d8738b31/html5/thumbnails/38.jpg)
Animation clip: Curves
38
● (DEMO) Ellen [Prefab] > Animation > Ellen_IdleWithGun
![Page 39: Game Animation - 國立臺灣大學](https://reader034.vdocuments.site/reader034/viewer/2022052106/62880e413a036931d8738b31/html5/thumbnails/39.jpg)
39
(DEMO)
![Page 40: Game Animation - 國立臺灣大學](https://reader034.vdocuments.site/reader034/viewer/2022052106/62880e413a036931d8738b31/html5/thumbnails/40.jpg)
State machine
40
● Current state ?
● On state enter / leave ?
Jump
Idle
Walk
![Page 41: Game Animation - 國立臺灣大學](https://reader034.vdocuments.site/reader034/viewer/2022052106/62880e413a036931d8738b31/html5/thumbnails/41.jpg)
State machine
41
● Current state ?
● On state enter / leave ?
● Transition between states ?
Jump
Idle
Walk
![Page 42: Game Animation - 國立臺灣大學](https://reader034.vdocuments.site/reader034/viewer/2022052106/62880e413a036931d8738b31/html5/thumbnails/42.jpg)
Animation state machine
42
● Current animation ?
● On animation play / finished ?
● Blending between animations ?
Jump
Idle
Walk
![Page 43: Game Animation - 國立臺灣大學](https://reader034.vdocuments.site/reader034/viewer/2022052106/62880e413a036931d8738b31/html5/thumbnails/43.jpg)
Animator controller
43
![Page 44: Game Animation - 國立臺灣大學](https://reader034.vdocuments.site/reader034/viewer/2022052106/62880e413a036931d8738b31/html5/thumbnails/44.jpg)
44
Animator states
![Page 45: Game Animation - 國立臺灣大學](https://reader034.vdocuments.site/reader034/viewer/2022052106/62880e413a036931d8738b31/html5/thumbnails/45.jpg)
45
(DEMO)
![Page 46: Game Animation - 國立臺灣大學](https://reader034.vdocuments.site/reader034/viewer/2022052106/62880e413a036931d8738b31/html5/thumbnails/46.jpg)
Animator transition
46
![Page 47: Game Animation - 國立臺灣大學](https://reader034.vdocuments.site/reader034/viewer/2022052106/62880e413a036931d8738b31/html5/thumbnails/47.jpg)
BlendTree
47
![Page 49: Game Animation - 國立臺灣大學](https://reader034.vdocuments.site/reader034/viewer/2022052106/62880e413a036931d8738b31/html5/thumbnails/49.jpg)
49
![Page 54: Game Animation - 國立臺灣大學](https://reader034.vdocuments.site/reader034/viewer/2022052106/62880e413a036931d8738b31/html5/thumbnails/54.jpg)
54
![Page 55: Game Animation - 國立臺灣大學](https://reader034.vdocuments.site/reader034/viewer/2022052106/62880e413a036931d8738b31/html5/thumbnails/55.jpg)
55
(DEMO)
![Page 56: Game Animation - 國立臺灣大學](https://reader034.vdocuments.site/reader034/viewer/2022052106/62880e413a036931d8738b31/html5/thumbnails/56.jpg)
Inverse kinematics (IK)
56
![Page 57: Game Animation - 國立臺灣大學](https://reader034.vdocuments.site/reader034/viewer/2022052106/62880e413a036931d8738b31/html5/thumbnails/57.jpg)
Inverse kinematics (IK)
57
Set desired target
![Page 58: Game Animation - 國立臺灣大學](https://reader034.vdocuments.site/reader034/viewer/2022052106/62880e413a036931d8738b31/html5/thumbnails/58.jpg)
Inverse kinematics (IK)
58
Always possible ?
Set desired target
![Page 59: Game Animation - 國立臺灣大學](https://reader034.vdocuments.site/reader034/viewer/2022052106/62880e413a036931d8738b31/html5/thumbnails/59.jpg)
59
(DEMO)
![Page 60: Game Animation - 國立臺灣大學](https://reader034.vdocuments.site/reader034/viewer/2022052106/62880e413a036931d8738b31/html5/thumbnails/60.jpg)
60
3D Model
![Page 61: Game Animation - 國立臺灣大學](https://reader034.vdocuments.site/reader034/viewer/2022052106/62880e413a036931d8738b31/html5/thumbnails/61.jpg)
Skinned mesh renderer
61
![Page 62: Game Animation - 國立臺灣大學](https://reader034.vdocuments.site/reader034/viewer/2022052106/62880e413a036931d8738b31/html5/thumbnails/62.jpg)
62
Rig
![Page 63: Game Animation - 國立臺灣大學](https://reader034.vdocuments.site/reader034/viewer/2022052106/62880e413a036931d8738b31/html5/thumbnails/63.jpg)
63
![Page 64: Game Animation - 國立臺灣大學](https://reader034.vdocuments.site/reader034/viewer/2022052106/62880e413a036931d8738b31/html5/thumbnails/64.jpg)
64
(DEMO)
![Page 65: Game Animation - 國立臺灣大學](https://reader034.vdocuments.site/reader034/viewer/2022052106/62880e413a036931d8738b31/html5/thumbnails/65.jpg)
65
Avatar
![Page 66: Game Animation - 國立臺灣大學](https://reader034.vdocuments.site/reader034/viewer/2022052106/62880e413a036931d8738b31/html5/thumbnails/66.jpg)
66
![Page 67: Game Animation - 國立臺灣大學](https://reader034.vdocuments.site/reader034/viewer/2022052106/62880e413a036931d8738b31/html5/thumbnails/67.jpg)
67
![Page 68: Game Animation - 國立臺灣大學](https://reader034.vdocuments.site/reader034/viewer/2022052106/62880e413a036931d8738b31/html5/thumbnails/68.jpg)
68
(DEMO)
![Page 69: Game Animation - 國立臺灣大學](https://reader034.vdocuments.site/reader034/viewer/2022052106/62880e413a036931d8738b31/html5/thumbnails/69.jpg)
Root motion
69
![Page 70: Game Animation - 國立臺灣大學](https://reader034.vdocuments.site/reader034/viewer/2022052106/62880e413a036931d8738b31/html5/thumbnails/70.jpg)
70
![Page 71: Game Animation - 國立臺灣大學](https://reader034.vdocuments.site/reader034/viewer/2022052106/62880e413a036931d8738b31/html5/thumbnails/71.jpg)
71
(DEMO)
![Page 72: Game Animation - 國立臺灣大學](https://reader034.vdocuments.site/reader034/viewer/2022052106/62880e413a036931d8738b31/html5/thumbnails/72.jpg)
72
![Page 74: Game Animation - 國立臺灣大學](https://reader034.vdocuments.site/reader034/viewer/2022052106/62880e413a036931d8738b31/html5/thumbnails/74.jpg)
74
(DEMO)
![Page 75: Game Animation - 國立臺灣大學](https://reader034.vdocuments.site/reader034/viewer/2022052106/62880e413a036931d8738b31/html5/thumbnails/75.jpg)
BlendTree
75
![Page 76: Game Animation - 國立臺灣大學](https://reader034.vdocuments.site/reader034/viewer/2022052106/62880e413a036931d8738b31/html5/thumbnails/76.jpg)
76
(DEMO)
![Page 77: Game Animation - 國立臺灣大學](https://reader034.vdocuments.site/reader034/viewer/2022052106/62880e413a036931d8738b31/html5/thumbnails/77.jpg)
Retargeting
77
![Page 78: Game Animation - 國立臺灣大學](https://reader034.vdocuments.site/reader034/viewer/2022052106/62880e413a036931d8738b31/html5/thumbnails/78.jpg)
78
![Page 79: Game Animation - 國立臺灣大學](https://reader034.vdocuments.site/reader034/viewer/2022052106/62880e413a036931d8738b31/html5/thumbnails/79.jpg)
79
(DEMO)
![Page 80: Game Animation - 國立臺灣大學](https://reader034.vdocuments.site/reader034/viewer/2022052106/62880e413a036931d8738b31/html5/thumbnails/80.jpg)
Inverse kinematics (IK)
80
![Page 81: Game Animation - 國立臺灣大學](https://reader034.vdocuments.site/reader034/viewer/2022052106/62880e413a036931d8738b31/html5/thumbnails/81.jpg)
Inverse kinematics (IK)
81
![Page 82: Game Animation - 國立臺灣大學](https://reader034.vdocuments.site/reader034/viewer/2022052106/62880e413a036931d8738b31/html5/thumbnails/82.jpg)
Inverse kinematics (IK)
82
![Page 83: Game Animation - 國立臺灣大學](https://reader034.vdocuments.site/reader034/viewer/2022052106/62880e413a036931d8738b31/html5/thumbnails/83.jpg)
83
Q & A
![Page 84: Game Animation - 國立臺灣大學](https://reader034.vdocuments.site/reader034/viewer/2022052106/62880e413a036931d8738b31/html5/thumbnails/84.jpg)
References
84
● Getting Started with Unity’s 2D Animation Package @ Unity Blog
○ https://blogs.unity3d.com/2018/11/09/getting-started-with-unitys-2d-animation-package/
● Mecanim Humanoids @ Unity Blog
○ https://blogs.unity3d.com/2014/05/26/mecanim-humanoids/
● Retargeting and Reusing Animation @ Unity Blog
○ https://learn.unity.com/project/re-targeting-and-re-using-animation