Академический Документы
Профессиональный Документы
Культура Документы
How do we do flee?
Maxim Likhachev Carnegie Mellon University 24
Kinematic Flee Behavior
Move away from a target point T
V=[v, ]= [max. speed,+]
=+
P
T
compute motion
direction
Problems approaching a
moving target?
Solutions?
Maxim Likhachev Carnegie Mellon University 26
Kinematic Arrival Behavior
Approach a target point T
if d < arrival radius
V=[v, ]= [0,]
=
else
V=[v, ]= [K*d,] for some constant K
=
P
T
compute motion
direction
d
Familiar to control
folks?
Maxim Likhachev Carnegie Mellon University 27
Kinematic Wander Behavior
Random wandering
d = random with bias towards 0
= +d
V=[v, ]= [max. speed,]
compute motion
direction
from Artificial Intelligence for Games by I. Millington & J. Funge
Maxim Likhachev Carnegie Mellon University 28
Dynamic Seek Behavior
Move towards a target point T
A=max. accel *normalize([dx,dz])
dd=K(-) limited by max. angular acceleration
P
T
compute motion
direction
d
dz
dx
Take care for angle
wrapping
Maxim Likhachev Carnegie Mellon University 29
Dynamic Seek Behavior
Move towards a target point T
A=max. accel *normalize([dx,dz])
dd=K(-) limited by max. angular acceleration
P
T
compute motion
direction
How do we do flee?
d
dz
dx
Take care for angle
wrapping
Maxim Likhachev Carnegie Mellon University 30
Dynamic Flee Behavior
Move away from a target point T
A=-max. accel *normalize([dx,dz])
dd=K(--) limited by max. angular acceleration
compute motion
direction
P
T
d
dz
dx
Maxim Likhachev Carnegie Mellon University 31
Dynamic Flee Behavior
Move away from a target point T
A=-max. accel *normalize([dx,dz])
dd=K(--) limited by max. angular acceleration
compute motion
direction
from Artificial Intelligence for Games by I. Millington & J. Funge
Maxim Likhachev Carnegie Mellon University 32
Dynamic Flee Behavior
Move away from a target point T
A=-max. accel *normalize([dx,dz])
dd=K(--) limited by max. angular acceleration
compute motion
direction
http://www.red3d.com/cwr/steer/SeekFlee.html
Maxim Likhachev Carnegie Mellon University 33
Dynamic Arrive Behavior
Approach a target point T
if d < arrival radius then v
des
=0
else v
des
=K*d for some constant K
A=K
1
*(v
des
-v
current
)*normalize([dx,dz])
dd=K(--) limited by max. angular acceleration
compute motion
direction
K
1
can be set to 1/T
(T is in secs)
Meaning of T?
P
T
d
dz
dx
Maxim Likhachev Carnegie Mellon University 34
Dynamic Arrive Behavior
Approach a target point T
if d < arrival radius then v
des
=0
else v
des
=K*d for some constant K
A=K
1
*(v
des
-v
current
)*normalize([dx,dz])
dd=K(--) limited by max. angular acceleration
compute motion
direction
from Artificial Intelligence for Games by I. Millington & J. Funge
Maxim Likhachev Carnegie Mellon University 35
Dynamic Arrive Behavior
Approach a target point T
if d < arrival radius then v
des
=0
else v
des
=K*d for some constant K
A=K
1
*(v
des
-v
current
)*normalize([dx,dz])
dd=K(--) limited by max. angular acceleration
compute motion
direction
http://www.red3d.com/cwr/steer/Arrival.html
Maxim Likhachev Carnegie Mellon University 36
Dynamic Arrive Behavior
Approach a target point T
if d < arrival radius then v
des
=0
else v
des
=K*d for some constant K
A=K
1
*(v
des
-v
current
)*normalize([dx,dz])
dd=K(--) limited by max. angular acceleration
compute motion
direction
How would you
implement
velocity matching
behavior?
Maxim Likhachev Carnegie Mellon University 37
Dynamic Pursue Behavior
Pursue a moving target T that isnt close
compute motion
direction
P
T
d
dz
dx
T T
T
Where will seek
direct the
character?
Whats the
problem?
Solutions?
Maxim Likhachev Carnegie Mellon University 38
Dynamic Pursue Behavior
Pursue a moving target T that isnt close
seek with target position at:
d/v
current
*V
T
compute motion
direction
P
T
d
dz
dx
T T
T
Where will pursue
direct the
character?
Maxim Likhachev Carnegie Mellon University 39
Dynamic Evade Behavior
Evade a moving target T that isnt close
flee with target position at:
d/v
current
*V
T
compute motion
direction
P
T
d
dz
dx
T T
T
Maxim Likhachev Carnegie Mellon University 40
Dynamic Evade Behavior
Evade a moving target T that isnt close
flee with target position at:
d/v
current
*V
T
compute motion
direction
http://www.red3d.com/cwr/steer/PursueEvade.html