Title: Dead Reckoning in Sports and Strategy Games
1Dead Reckoning in Sports and Strategy Games
8.4
Building a Sports AI Architecture
8.5
Terry Wellmann
Dayne Mickelson AI Game Programming November 4,
2005
2Dead Reckoning in Sports and Strategy Games
Dead Reckoning (DR)
- PREDICT FUTURE MOTIONEstimation the position of
an object given - its original position
- intended course
- Speed
- amount of time passed
3Dead Reckoning in Sports and Strategy Games
Origins in Real Life
- Developed for Navigators / Sailors
- Not taking wind or current into consideration
- The Stronger the effect of these outside factors
the less reliable an estimate - For Heavy fog without GPS System
- DR Provides enough info to steer clear of
dangerous obstacles estimate position
4Dead Reckoning in Sports and Strategy Games
Real Life Usage
- Used in Military Exercises
- Effectively know where enemy
- will be at time of attack
- Estimate movement of enemy fleets / troops
- Between instances of -
- Visual Contact
- Radar
- Spy Satellite Visualization
-
5Dead Reckoning in Sports and Strategy Games
DR Use in Video Games
- Military Simulation
- Attack effectively if know where enemy will be
located at time of attack - Sports Games
- Exchange the ball/puck every few seconds between
players. - Know where teammate / opponent will be
- Offset Latency of Online Games
6Dead Reckoning in Sports and Strategy Games
Implementation of Dead Reckoning
- PSEUDO-BROWNIAN MOTION
- KINEMATICS
7Dead Reckoning in Sports and Strategy Games
Implementation of Dead Reckoning
- MOST Basic Level of Dead Reckoning
- Uses Newtons First Law of Motion
- Knowing objects position and speed we can assume
it will continue to travel in straight line - Pt P0 vt
- This simple model is good for objects free of
outside influence - Asteroid, Spaceship, hockey puck
- Px,t1 Px,t vx
- Py,t1 Py,t vy
- Pz,t1 Pz,t vz
8Dead Reckoning in Sports and Strategy Games
Implementation of Dead Reckoning
- Human Players cant do much better
- Model might be TOO GOOD
- EX.) Shooting at enemy player
- May insert evaluation errors into calculation
- Add random variable with mean actual velocity.
Dependent on Difficulty Level.
9Dead Reckoning in Sports and Strategy Games
Implementation of Dead Reckoning
- Object that is Extremely maneuverable and
impossible to predict its velocity vector over
lengthy periods - UFO or Mosquito
- Dominated by overwhelming outside factors
- Assume that object's initial position and
magnitude of velocity vector is known. - Compute average displacement
10Dead Reckoning in Sports and Strategy Games
Implementation of Dead Reckoning
- Initial Position
- After Time t Passed
- Calculate Spherical region of space in which it
could have moved
11Dead Reckoning in Sports and Strategy Games
Implementation of Dead Reckoning
- If objects initial velocity is unknown it can
be compute by 1st derivative of plotted position - Estimate future trajectory by using its
acceleration vector - Acceleration, Initial Position, Velocity
- Pt P0v0t0.5at2
12Dead Reckoning in Sports and Strategy Games
Implementation of Dead Reckoning
- Ballistic Missile
- or Spaceship
- Enemy Ship Water current vector applied to
enemy ship is same as AIs own ship, so they
actually cancel out - Human Player from accel. buttons pressed
- Can compute acceleration of any object in game
13Dead Reckoning in Sports and Strategy Games
Dead Reckoning in Sports Games
- AI is trying to shoot ball or puck past an active
obstruction or at goal (goalie, defensemen,
cornerback, hole...) - AI is trying to pass the ball or puck to human
player (FOOTBALL 3rd dimension) - ALL cases AI will apply dead reckoning to
computer most likely trajectory. - Determine weather the humans current trajectory
will take him to an open spot or if another
player will intercept pass
14Dead Reckoning in Sports and Strategy Games
Dead Reckoning in Sports Games - Soccer
15Dead Reckoning in Sports and Strategy Games
Dead Reckoning in Sports Games - Football
16Dead Reckoning in Sports and Strategy Games
Dead Reckoning in Military Simulation
- Reconnaissance plane over ENEMY FLEET Provides
Fleets - 1.) position 2.) velocity 3.) heading
- BOMBING RAID CAN BE PLANNED
- Determine targets of incoming missile attacks so
can guide anti-missile defenses - Submarine Simulation
- Floating mines blink in and out of radar contact
- Use DR to determine volumes where mines likely
17Dead Reckoning in Sports and Strategy Games
PREDICT ENEMY MOVEMENT with FOG OF WAR
18Dead Reckoning in Sports and Strategy Games
Dead Reckoning in Online Games
- Use DR to subdue the effects of network latency
in multiplayer online games
- Each player periodically broadcasts a packet
containing his location, velocity, and
acceleration - During intervals between packets each machine
uses DR to compute approximate positions of all
other players - When new incoming packet is received, the local
state of the world is updated accordingly
19Dead Reckoning in Sports and Strategy Games
Dead Reckoning other Applications
- CAN INFER AN AGENTS INTENTIONS GOALS
20Building a Sports AI Architecture
8.5
Terry Wellmann
NBA Inside Drive
21Building a Sports AI Architecture
THE GAME OF BASKETBALL
- GAME AI
- Straightforward to solve
- Simulating cohesive group decision making is more
difficult
- IN THE REAL WORLD TEAMS SPEND
- HOURS PRACTICING TO
- Improve the skills of individual athletes
- Train a group of independently thinking
individuals how to function as a cohesive unit
22Building a Sports AI Architecture
PLANNING SPORTS AI ARCHITECTURE
Goals to Keep in Mind
- KISS No need to add extra complexity if doesnt
add to users experience - Break decisions down to various levels of
responsibility - Plan out the architecture
- Dont be afraid to make a mistake
- Dont underestimate the power or randomness
allows user to observe behaviors that are more
complex and realistic than they actually are.
23Building a Sports AI Architecture
PLANNING SPORTS AI ARCHITECTURE
INDIVIDUAL AGENT (Player) PLANS
- Identify high level decisions the player will
make and arrange like decisions together - Offensive
- Defensive
- Shared Plans
- Pass
- Shoot
- Drive
- Run Play
- Rescue
- Teammate
- Position defender
- Double team ball
- Steal ball
- Steal pass
- Block Shot
- Take a Charge
- Rebound
- Inbound ball
- Free Throw
- ETC.
24Building a Sports AI Architecture
PLANNING SPORTS AI ARCHITECTURE
INDIVIDUAL AGENT (Player) PLANS
- AgentPlan class serves as base class for all
plans - class AgentPlan
-
- ..
- float EvaluateInitiation()
- float EvaluateContinuation()
- void Initiate()
- void Update()
-
-
Evaluate how Desirable it is for a plan to
continue being used if it is currently executing
Called every iteration and is responsible for
carrying out plan
Evaluates how Desirable it is for a plan to
execute
Performs 1-Time decision making each time the
plan is initiated
25Building a Sports AI Architecture
PLANNING SPORTS AI ARCHITECTURE
AGENT (Player) PLANS
float EvaluateInitiation() float
EvaluateContinuation() Returns number (-1.0
1.0) for each plan and allows you to build
complex system where plans can be compared Each
plan evaluates the current situation
independently and determines how appropriate it
is to be used Return Large number (gt1.0) if
strongly encouraged
26Building a Sports AI Architecture
PLANNING SPORTS AI ARCHITECTURE
AGENT (Player) PLANS
Break logic into additional update function 1.)
Handle the ball handler decision-making 2.)
Handle the non ball handler decision-making PRIOR
ITY RANK ORDER - if equal evaluation values 1.)
BallHandler_Shoot 2.) BallHandler_Pass 3.)
BallHandler_Drive 4.) BallHandler_RunPlay Dont
want to be on fast break and pull up for
3-Pointer ASSUME drive plan only returns gt0 if
player can drive towards basket (aka. their not
well defended)
( .55 )
( .55 )
( gt 0 )
27Building a Sports AI Architecture
PLANNING SPORTS AI ARCHITECTURE
ADDITIONAL AGENT (PLAYER) AI
Must now make high level decisions in
hierarchical system FOR THE CURRENT
PLAYER POTENTIAL SUCCESS OF SHOT FROM CURRENT
LOCATION - 3 Pointer (guards OK, big men NOT
OK) - BASED ON ATTRIBUTE POINTS TYPE OF
SHOT -guard (layup) -big men (dunk) TELL
PLAYER TO EXECUTE
28Building a Sports AI Architecture
PLANNING SPORTS AI ARCHITECTURE
TEAM MANAGEMENT
Set of COMMON STATES, OFFENSIVE STATES, and
DEFENSIVE STATES with clear TRANSITION
POINTS Each STRATEGY plan evaluates the current
situation independently and determines how
appropriate it is to be used Use FINITE-STATE
Machine for framework of architecture OFFENSIVE
DEFENSIVE STATES complement each
other Inbound Transition Frontcourt Rebound Rec
over Ball Free-throw
29Building a Sports AI Architecture
PLANNING SPORTS AI ARCHITECTURE
TEAM MANAGEMENT
COMMON STATES neutral situation (ball not in
play) Pre-game Substitution Tip-Off Post
Game Time-out Halftime Halftime TRANSITIONS
triggered based on a game event Made Shot A
foul Missed Shot A timeout A
steal Halftime
30Building a Sports AI Architecture
31Building a Sports AI Architecture
32IN CONCLUSION
- Dead Reckoning is an easy way to predict the
trajectory of objects for the game. - Dead Reckoning can also be used to predict the
behavior of a human player. - Sports present a unique set of challenges to AI
application. - When user plays against AI, the game
- must CAPTURE the abilities, personalities,
- and decision making of that player.
- Agent plans, team management, agent AI, and agent
mechanics can be applied to any sport game. - AI development is all about good planning and
trial and error.