# C#代写 | COMP 476 Advanced Game Development Assignment 3

Assignment 3

Question #1: (10%) [Theoretical Question]
Consider using a Hierarchical N-gram predictor to predict the next move of your
opponent for a fighting game where the only actions are L and R moves. Suppose
that we have the following training data (observed sequence of moves):
L R R R R R R L L R L R L R L R R L R R L R L R L L L L R L R R
a) (5%) Using a hierarchical 3-gram predictor, what is the predicted next action for
input “R R R”, if we want at least 5 samples for prediction?
b) (3%) Using a hierarchical 3-gram predictor, what is the predicted next action for
input “R R R”, if we want at least 15 samples for prediction?
c) (2%) Using a hierarchical 3-gram predictor, what is the predicted next action for
input “R R R”, if we want at least 30 samples for prediction?
For each question above, give the details of your prediction. Just writing “R” or “L”
without any justification will result in no marks.
Question #2: (5%) [Theoretical Question]
Consider a sphere with radius 3 and center point (1, 1, 1) colliding with triangular
face of an object. Vertices of the triangle are (-3, -3, -7), (3, -3, -1), and (-3, 3, -1).
Determine the following:
a) (3%) the contact normal; and
b) (2%) the interpenetration depth.
Question #3: (10%) [Theoretical Question]
Consider the following contact data from the above interpenetration of two objects
(object 1 being the side view of a right circular cone):
Centre of mass for object 1,  = (12, 15.75, 0)
Centre of mass for object 2,  = (29, 8, 0)
Mass for object 1,  = 2
Mass for object 2,  = 51.528
Contact point,  = (19, 14, 0)
Contact normal,  = (1, −1, 0)
Penetration depth,  = 3.8
Note that the inertia tensor for object 1 (a right circular cone with radius 7 and
height 7) is
 = 36.75 0 0
0 14.7 0
0 0 36.75

and the inertia tensor for object 2 is
 = 389 0 0
0 389 0
0 0 778

Perform the following calculations (show your work) to use nonlinear projection to
resolve the interpenetration.
a) (4%) Find the linear and rotation components, (
)
and (!
)
, of the inertia for
both objects.
b) (1%) Compute the total inertia, ”
.
c) (1%) Compute the amount of linear movement (∆
)
for both objects.
d) (2%) Compute the amount of angular movement (∆!
)
for both objects.
e) (2%) Compute the total rotation , (∆\$) %
(∆&)’
((&)’
), to be applied to the orientation
quaternions for both objects to obtain the required amounts of angular
movements.
f) (BONUS: 2%) Assuming the right circular cone has an orientation quaternion of
* = [1, 0, 0, 0], and noting that this orientation quaternion is altered by the total
rotation [0, (∆*)] (computed in e), expressed in quaternion form) by the formula
* = * + .
1
2
/ 00, (∆\$) 1
(∆!
)
(!
)
23 *
(using quaternion math), what is the change in orientation of the cone in Euler
angles? (Show some work…)

E-mail: vipdue@outlook.com  微信号:vipnxx