Docstoc

Dead Reckoning in Sports and Strategy Games

Document Sample
Dead Reckoning in Sports and Strategy Games Powered By Docstoc
					Dead Reckoning in Sports and Strategy Games
8.4
Francois Dominic Laramee

Building a Sports AI Architecture
8.5
Terry Wellmann Dayne Mickelson AI Game Programming November 4, 2005

Dead Reckoning in Sports and Strategy Games

Dead Reckoning (DR)
•PREDICT FUTURE MOTION Estimation the position of an object – given: •its original position
•intended course

•Speed
•amount of time passed
t

Dead 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

Dead 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

Dead 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

Dead Reckoning in Sports and Strategy Games

Implementation of Dead Reckoning

•INERTIAL MOTION

•PSEUDO-BROWNIAN MOTION •KINEMATICS

Dead Reckoning in Sports and Strategy Games

Implementation of Dead Reckoning
•INERTIAL MOTION
 MOST Basic Level of Dead Reckoning

Uses Newton’s First Law of Motion Knowing objects position and speed we can assume it will continue to travel in straight line Px,t+1 = Px,t +vx Py,t+1 = Py,t +vy Pt = P0 +vt Pz,t+1 = Pz,t +vz
This simple model is good for objects free of outside influence

Asteroid, Spaceship, hockey puck

Dead Reckoning in Sports and Strategy Games

Implementation of Dead Reckoning
•INERTIAL MOTION Human Players can’t 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.

Dead Reckoning in Sports and Strategy Games

Implementation of Dead Reckoning
•PSEUDO-BROWNIAN MOTION
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

Dead Reckoning in Sports and Strategy Games

Implementation of Dead Reckoning
•PSEUDO-BROWNIAN MOTION Initial Position After Time t Passed Calculate Spherical region of space in which it could have moved

Dead Reckoning in Sports and Strategy Games

Implementation of Dead Reckoning
•KINEMATICS 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 = P0+v0t+0.5at2

Dead Reckoning in Sports and Strategy Games

Implementation of Dead Reckoning
•KINEMATICS •Ballistic Missile or Spaceship •Enemy Ship – Water current vector applied to enemy ship is same as AI’s own ship, so they actually cancel out •Human Player – from accel. buttons pressed •Can compute acceleration of any object in game USES

Dead 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 human’s current trajectory will take him to an open spot or if another player will intercept pass

Dead Reckoning in Sports and Strategy Games

Dead Reckoning in Sports Games - Soccer

Dead Reckoning in Sports and Strategy Games

Dead Reckoning in Sports Games - Football

Dead Reckoning in Sports and Strategy Games

Dead Reckoning in Military Simulation
•Reconnaissance plane over ENEMY FLEET Provides Fleet’s: 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

Dead Reckoning in Sports and Strategy Games
PREDICT ENEMY MOVEMENT with FOG OF WAR

Dead 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

Dead Reckoning in Sports and Strategy Games

Dead Reckoning other Applications
•CAN INFER AN AGENT’S INTENTIONS & GOALS

$$$

Building a Sports AI Architecture
8.5
Terry Wellmann

NBA Inside Drive

Building a Sports AI Architecture

THE GAME OF BASKETBALL
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
GAME AI

•Straightforward to solve
•Simulating cohesive group decision making is more difficult

Building a Sports AI Architecture

PLANNING SPORTS AI ARCHITECTURE
Goals to Keep in Mind: to user’s experience

•KISS – No need to add extra complexity if doesn’t add
•Break decisions down to various levels of responsibility •Plan out the architecture •Don’t be afraid to make a mistake •Don’t underestimate the power or randomness – allows user to observe behaviors that are more complex and realistic than they actually are.

Building 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 •Position defender •Take a Charge •Shoot •Double team ball •Rebound •Drive •Steal ball •Inbound ball •Run Play •Steal pass •Free Throw •Rescue •Block Shot •ETC…. Teammate

Building 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(); …… }

Called how iteration it Evaluateevery Desirableandmakingplan totime the Evaluates how Desirable it for a aeach to execute for plan for Performs 1-Time decisionis is responsiblecontinue carrying out plan being is initiatedis currently executing plan used if it

Building 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 (>1.0) if strongly encouraged

Building 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 PRIORITY RANK ORDER - if equal evaluation values 1.) BallHandler_Shoot ( .55 ) 2.) BallHandler_Pass ( .55 ) 3.) BallHandler_Drive (>0) 4.) BallHandler_RunPlay Don’t want to be on fast break and pull up for 3-Pointer
ASSUME drive plan only returns >0 if player can drive towards basket (aka. – their not well defended)

Building 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

Building 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 Recover Ball Free-throw

Building a Sports AI Architecture

PLANNING SPORTS AI ARCHITECTURE
TEAM MANAGEMENT COMMON STATES – neutral situation (ball not in play) Pre-game Tip-Off Time-out Halftime Substitution Post Game Halftime

TRANSITIONS – triggered based on a game event Made Shot Missed Shot A steal A foul A timeout Halftime

Building a Sports AI Architecture

Building a Sports AI Architecture

IN 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.


				
DOCUMENT INFO
Shared By:
Categories:
Tags: Serious
Stats:
views:174
posted:1/22/2008
language:English
pages:32