Sports Games: Artificial Intelligence and Physics

Published  . 0 views
↓ Download
Sports Games: Artificial Intelligence and Physics
1 / 1
Sports Games: Artificial Intelligence and Physics - slide 1 of 58 Sports Games: Artificial Intelligence and Physics - slide 2 of 58 Sports Games: Artificial Intelligence and Physics - slide 3 of 58 Sports Games: Artificial Intelligence and Physics - slide 4 of 58 Sports Games: Artificial Intelligence and Physics - slide 5 of 58 Sports Games: Artificial Intelligence and Physics - slide 6 of 58 Sports Games: Artificial Intelligence and Physics - slide 7 of 58 Sports Games: Artificial Intelligence and Physics - slide 8 of 58 Sports Games: Artificial Intelligence and Physics - slide 9 of 58 Sports Games: Artificial Intelligence and Physics - slide 10 of 58 Sports Games: Artificial Intelligence and Physics - slide 11 of 58 Sports Games: Artificial Intelligence and Physics - slide 12 of 58 Sports Games: Artificial Intelligence and Physics - slide 13 of 58 Sports Games: Artificial Intelligence and Physics - slide 14 of 58 Sports Games: Artificial Intelligence and Physics - slide 15 of 58 Sports Games: Artificial Intelligence and Physics - slide 16 of 58 Sports Games: Artificial Intelligence and Physics - slide 17 of 58 Sports Games: Artificial Intelligence and Physics - slide 18 of 58 Sports Games: Artificial Intelligence and Physics - slide 19 of 58 Sports Games: Artificial Intelligence and Physics - slide 20 of 58 Sports Games: Artificial Intelligence and Physics - slide 21 of 58 Sports Games: Artificial Intelligence and Physics - slide 22 of 58 Sports Games: Artificial Intelligence and Physics - slide 23 of 58 Sports Games: Artificial Intelligence and Physics - slide 24 of 58 Sports Games: Artificial Intelligence and Physics - slide 25 of 58 Sports Games: Artificial Intelligence and Physics - slide 26 of 58 Sports Games: Artificial Intelligence and Physics - slide 27 of 58 Sports Games: Artificial Intelligence and Physics - slide 28 of 58 Sports Games: Artificial Intelligence and Physics - slide 29 of 58 Sports Games: Artificial Intelligence and Physics - slide 30 of 58 Sports Games: Artificial Intelligence and Physics - slide 31 of 58 Sports Games: Artificial Intelligence and Physics - slide 32 of 58 Sports Games: Artificial Intelligence and Physics - slide 33 of 58 Sports Games: Artificial Intelligence and Physics - slide 34 of 58 Sports Games: Artificial Intelligence and Physics - slide 35 of 58 Sports Games: Artificial Intelligence and Physics - slide 36 of 58 Sports Games: Artificial Intelligence and Physics - slide 37 of 58 Sports Games: Artificial Intelligence and Physics - slide 38 of 58 Sports Games: Artificial Intelligence and Physics - slide 39 of 58 Sports Games: Artificial Intelligence and Physics - slide 40 of 58 Sports Games: Artificial Intelligence and Physics - slide 41 of 58 Sports Games: Artificial Intelligence and Physics - slide 42 of 58 Sports Games: Artificial Intelligence and Physics - slide 43 of 58 Sports Games: Artificial Intelligence and Physics - slide 44 of 58 Sports Games: Artificial Intelligence and Physics - slide 45 of 58 Sports Games: Artificial Intelligence and Physics - slide 46 of 58 Sports Games: Artificial Intelligence and Physics - slide 47 of 58 Sports Games: Artificial Intelligence and Physics - slide 48 of 58 Sports Games: Artificial Intelligence and Physics - slide 49 of 58 Sports Games: Artificial Intelligence and Physics - slide 50 of 58 Sports Games: Artificial Intelligence and Physics - slide 51 of 58 Sports Games: Artificial Intelligence and Physics - slide 52 of 58 Sports Games: Artificial Intelligence and Physics - slide 53 of 58 Sports Games: Artificial Intelligence and Physics - slide 54 of 58 Sports Games: Artificial Intelligence and Physics - slide 55 of 58 Sports Games: Artificial Intelligence and Physics - slide 56 of 58 Sports Games: Artificial Intelligence and Physics - slide 57 of 58 Sports Games: Artificial Intelligence and Physics - slide 58 of 58
Description: Sports Games: Artificial Intelligence and Physics Topics Sports Game Design and Development Architectures Class Structures Agent Cooperation Team based cooperation and Optimization Physics Object physics Agent physics Dead Reckoning

Related Topics

Download Presentation

"Sports Games: Artificial Intelligence and Physics" is the property of its rightful owner. Permission is granted to download and print the materials on this website for personal, non-commercial use only, and to display it on your personal computer provided you do not modify the materials and that you retain all copyright notices contained in the materials. By downloading content from our website, you accept the terms of this agreement.

Presentation Transcript

slide1. Sports Games: Artificial Intelligence and Physics<br>
slide2. Topics Sports Game Design and Development
Architectures
Class Structures
Agent Cooperation
Team based cooperation and Optimization
Physics
Object physics
Agent physics
Dead Reckoning
Strategy Development
Artificial and Human Elements<br>
slide3. Challenges Simulating a natural, well-known environment
Modeling fields, courts, rinks, etc.
Modeling player personalities and animations
Physics engine
Strategy
Sports are a form of Real-Time strategy
Strategies while confined to a set of rules and the size of the field, are numerous and constantly changing<br>
slide4. A Brief History A well known fact: Video game detail has improved over the years
From Tecmo Bowl to Madden 2008
Better player models
Larger fields, increased atmosphere
More intelligent AI
More modes, styles of play
Arcade versus Simulation
Longer play modes
Online play<br>
slide5. Building an Sports AI Architecture<br>
slide6. Building a Sports AI Architecture A Sports game has many CPU-Intensive tasks
Player animation
Route planning
Physics modeling
Strategy development
Breaking these down in a high level architecture confined by the rules of the game can help ease the complexity of the development<br>
slide7. Building a Sports AI Architecture Layering the architecture<br>
slide8. Building a Sports AI Architecture Plans
Offensive
Pass
Shoot
Drive to the basket
Defensive
Position the defender
Double team the ball handler
Shared
Rebound
Set up for a free throw
Plans enable the players to move freely and determine their own best routing methods
This level of abstraction provides a sense of realism to the game<br>
slide9. Building a Sports AI Architecture<br>
slide10. Building a Sports AI Architecture Example planning class
Class AgentPlan
{
float EvaluateInitiation();
float EvaluateContinuation();
void Initiate();
void Update();
}
Initiation and continuation are very important concepts because they determine if a plan is working and where to go next
Common return values are between -1.0 and 1.0
Update is called for every tick to update the AI<br>
slide11. Building a Sports AI Architecture High level strategy module sets a goal
An opportunity is seen to complete a through pass in front of the goal for a score
Plan is created
An opportunity is seen to complete a through pass in front of the goal for a score
Route finding plots course
Each player (opponent and team) is considered, momentum(team and player), and even ball planning
Execute plan
Not all plans will work out
Depending on the skill level of the other team and unforeseen occurrences, this leaves the game interesting<br>
slide12. Building a Sports AI Architecture States
A game can be broken into states with responsibilities and transition points.
Moving from an offensive state to a defensive state
These states can govern the types of plans that will be used
In an offensive state you wouldn’t push all your defenders back
Well you might
But more often than not you will push defenders up so that they can support an offense and keep momentum moving in the positive direction<br>
slide13. Building a Sports AI Architecture<br>
slide14. Building a Sports AI Architecture Agent AI
Well thought out collection of utility functions and data used by the plans
Determine a player’s chance of success
Determine the likelihood of certain actions
Dunks, lay-ups, bicycle kicks, etc
Based on real-world player abilities and conditions of the game
Perform the action and determine the type of action that can be performed by providing a wrapper to the mechanics<br>
slide15. Building a Sports AI Architecture Agent Mechanics
Considered to be low-level AI
Manage and select animations to be used
Some of these decisions are determined through the use of a random number
This gives the effect that the game is more real
Humans do not always react to the same situation in the same way
This level also takes into consideration the kinds of commands that users would input into the system
Run
Shoot
Pass<br>
slide16. Dead Reckoning<br>
slide17. Dead Reckoning Originally developed as a tool for navigators
Determining the position of his ship given parameters such as direction, intended course, and speed
Estimating position based on past position and trajectory
This becomes more complicated when other factors are taken into consideration
Wind or current<br>
slide18. Dead Reckoning Inertia
Dead Reckoning at its most basic level reduces to Newton’s first law of motion
Knowing an object’s position and speed, we can assume the object will continue to travel in a straight line.
Pt = P0 + vt
Px,t+1 = Px,t + vx
Py,t+1 = Py,t + vy
Pz,t+1 = Pz,t + vz
These calculations can sometimes prove to be “too good”
Incorporating an error calculation might help
Even the best quarterbacks have a bad game<br>
slide19. Dead Reckoning Pseudo- Brownian Motion
An extremely maneuverable object is harder to predict velocity vectors over lengths of time
In the case of a UFO which can do whatever it pleases (Or so we assume), knowing the velocity magnitude can only help us determine a spherical region of possible positioning
In sports games this can be observed as objects in motion which experience seemingly random movement which is an effect of outside forces
As a pass is being completed, a strong wind may blow and knock the ball off of its intended course.<br>
slide20. Dead Reckoning Kinematics
If the object’s initial velocity is unknown, it can be computed from observation by plotting the curve of its position for an arbitrary interval and computing speed as the first derivative of the position curve.
Adding an estimate of its acceleration vector can help in estimating the object’s future trajectory.
P = P0 + v0t + 0.5at2<br>
slide21. Dead Reckoning Uses in sports games
Shooting a ball or puck
Passing a ball or puck
Dead reckoning is useful for planning the trajectory of players to determine if a player can make it to an open position to complete the pass.
Good examples of this can be found in soccer games
Players will often link passes together by passing to a teammate when faced with a defender and running past the defender to accept a return pass up the pitch<br>
slide22. Dead Reckoning Online play
Dead Reckoning can be used in games to minimize the effects of network latency
Each player periodically broadcasts a packet containing his avatar’s location, velocity, and acceleration
During the intervals between packets, each machine runs a dead reckoning algorithm to compute the approximate positions and orientations of all other players
When a new incoming packet from another player is received, the local state of the world is updated accordingly, and the process starts anew<br>
slide23. Dead Reckoning Inferring goals
Dead Reckoning can help to infer another players goals and try to intercept them
This can be seen as interceptions in football and soccer<br>
slide24. Interceptions<br>
slide25. Interceptions Interceptions occur in many sports
The interesting aspect of calculating interceptions is that the same theories apply as in Dead Reckoning, but the system is less planned
Meaning that, interceptions are not intentional
Games should include interceptions as incidental and unplanned from an AI perspective in order to accurately model a sports game<br>
slide26. Interceptions<br>
slide27. Interceptions An object is at a position Pb
It travels in a straight line with velocity Vb
Another object is at a Pp and wants to intercept the first object
The intercepting object has a set speed it can move at
A velocity to intercept, Vp, is calculated

This is a simplified model<br>
slide28. Interceptions For instance:
A basketball bouncing off of a rim has a path that is parabolic in shape
Break the model down into two submodels
Altitude of the ball
Motion in the ground plane
The ground plane motions are orthogonal to the altitude axis
These motions can be considered in isolation<br>
slide29. Interceptions Another simplification occurs in the previously described model
No turning radius
Infinite Acceleration
Indefinite travel at maximum velocity
Error isn’t always frowned upon…by developers
Passes are missed. It happens.
Other methods can be used to calculate for heading changes<br>
slide30. Interceptions<br>
slide31. Interceptions For an interception to occur, the position of the ball and the player must be the same at some time t
If Vp is known prior, then the function can look like
Pb + Vbt = Pp + Vpt
However Vp is the variable that needs to be solved for
Distance between the player’s initial position and the ball at time t:
|(Pb – Pp) + Vbt|
If the player can move a distance equivalent to how distant the ball is, the player can intercept the ball at time t
|(Pb – Pp) + Vbt| = sit<br>
slide32. Interceptions |P + Vt| = st

(P +Vt)*(P+Vt)=(st)2
P*P + 2P * Vt + V*Vt2 = s2t2
(V*V – s2)t2 + (2P*V)t + (P*P) = 0
Now the equation is a second-order polynomial of t
Now it’s time to use the quadratic equation<br>
slide33. Interceptions Category of solution is determined by the expression in the radical
b2 – 4ac
A better form to look at our equations from
b2-4ac = (2P*V)2 – 4(V*V-s2)(P*P)

(P*V)2 + (s2 – V*V)(P*P)<br>
slide34. Interceptions No Real Roots
The radicand(quantity with the radical) is negative
There are no real roots
The ball cannot be intercepted
This occurs when the ball travels at a speed greater than the maximum speed of the player
S2 – V*V must be negative
S<|V|
The player has to be able to move faster than the ball if he hopes to intercept it<br>
slide35. Interceptions One Real Root
Border case between whether or not the player can intercept the ball
Only one point in time for interception
The radicand must be zero
Two Special Cases
(P*V)<0
The ball’s velocity is toward the interceptor and can be caught
(P*V)>0
The ball’s velocity is not toward the receiver
This happens because the interception theoretically happened in the past<br>
slide36. Interceptions Two Real Roots
Does not require the speed of the player to be greater
Two positive roots
The player is close to the line of motion and able to catch the ball anytime
Two negative roots
Impossible interception. Negative time.
One positive and one negative root
The player is moving faster than the ball and can meet at any time to meet it in the positive direction<br>
slide37. Dead Reckoning<br>
slide38. Dead Reckoning Error correction
The translational error between the real position of an agent and the estimate provided by dead reckoning can become unbounded with time.
The agent will compute its own short-term map of its surroundings
The short-term map is compared with the a priori map using pattern recognition techniques
Small, incremental corrections are applied on the fly<br>
slide39. Agent Cooperation<br>
slide40. Agent Cooperation Coordination and communication are key amongst human teams and the same goes for the PS3, Xbox360, and Commodore 64
The first step is to define behaviors for the agents.
In the case of baseball:
Baserunning
Fielding
Hitting
Pitching<br>
slide41. Agent Cooperation Hitting and Pitching
Not too complex
Very much animation based
The pitch is thrown
It is hit, or not hit
The ball will have a determined path
Once the ball is hit, its initial velocity an angle are the only real factors of importance
These two factors in addition to existing baserunners directly affect how the ball is fielded
Ball hit and ball pitched act more like events
Prepare to field
Field
Prepare to run<br>
slide42. Agent Cooperation Fielding Behaviors
Assignments happen off of two main triggers (events)
Ball Hit
Ball Fielded
Players should react differently to these situations
Only one player fields a ball, so the other players watch, or prepare for other strategies<br>
slide43. Agent Cooperation<br>
slide44. Agent Cooperation Class Structure
Class BasicBehavior
{

void Entry(Cplayer*);
void Exit(Cplayer*);
void Process(Cplayer*);

}
Each derived behavior has a transition table to switch between behaviors and actions
Many times this can result in a similar behavior being performed
Transition tables do not always lead to a distinctly different behavior<br>
slide45. Agent Cooperation Initial Behavior Assignments
In the case of a ball hit event, once the initial angle and velocity are known, it is easy to determine where the ball will land, and what actions and behaviors to disperse
Determining the Hit Type and Hit Zone can be done using physics and trigonometry
The Hit Type and Hit Zone values can be used to control values across the entire field<br>
slide46. Agent Cooperation Hit Types
Ground ball
Fly ball
Line drive
Popup
Deep drive
In the case of a hit type ground ball Zone 7
The first baseman and right fielder should motion to the Behavior Field Ball
The rest of the infielders will move to Behavior Cover Base, with exception to the second baseman who will assume Cutoff or Field Ball depending on velocity
Left and Center Field are in Behavior Back Up<br>
slide47. Agent Cooperation Hit Zones<br>
slide48. Agent Cooperation Initial Behavior Assignments for Runners
Hit Types
Ground Ball – Behavior Go or Behavior Go Back
A runner on second, not forced will assume Behavior Go on any ball hit in a right-hand zone
Hit type fly ball will throw Behaviors Go Halfway, or Tag Up
The runners evaluate situations exactly like humans do
They check proximities of fielders to the ball, evaluate the actions of other runners and make a best decision on what to do<br>
slide49. Agent Cooperation<br>
slide50. Agent Cooperation Throw Determination
Fly balls
95 percent of the balls either go to second or home
Or throw to the cutoff man and let him decide
Rundowns
We have enough information to run the player down every time (100 percent success rate)
So the better approach to take is to make it interesting and allow the runner to fool with the window<br>
slide51. Real Time Strategy Development<br>
slide52. Real Time Strategy Development Sports games are confined to sets of rules and the development of strategies both team-wide and personal that confine themselves to the rules of physics and the rules of the game
This does not limit however the amount of work and planning that is done by each individual player, who has to model the abilities and limitations of his or her real-life component.
Team dynamic is equally important
Some teams have characteristically strong defense
Some players communicate better than others, and are more intelligent<br>
slide53. Real Time Strategy Development Soccer Games
Real time strategy in the sense of team control
Moving offense/defense forward and back
Controlling player motions
Many of the players use advanced AI techniques to predict good strategies to use with you
Games can allow you to change offense and defensive strategies on the fly.
Different players have different abilities
This skill set in some ways can become very detailed
Some famous players are known for their speed, shooting, defensive abilities and a knowledgeable player can exploit these to their own advantage<br>
slide54. Real Time Strategy Development Positions and zones are of extreme importance
Players have roles
Like in RTS games, some characters cannot perform well on certain terrain
The same goes for players playing in muddy conditions or snow
Teams have characteristics and players that make them more powerful against other teams
Not a division on race and inherent abilities
A division based on skill and communication
There are optimal configurations<br>
slide55. Real Time Strategy Development A new trend is also to give you manager control
This involves more long term planning regarding player trading, development, and economics
Played over a long period of time, your decisions affect your win percentages and offers you receive.
This kind of play rewards players who are very tied to the individual sport<br>
slide56. Real Time Strategy Development Skills Vs. Strategy
An interesting development in sports gaming is that of providing you with additional skills
Managing a team from the top level, while managing a player’s actions on a lower level are becoming increasingly common
FIFA 2008 included a new mode titled “Be a Pro” which allows the user to master skills such as dribbling and tackling at a level that goes beyond simply pressing A or B
This type of a game feature can almost be compared to some aspects of RPG gaming, where a player levels up and is rewarded with experience points and abilities<br>
slide57. Final Notes Sports games have the difficult task of being true to the sport and physics
Accurate player modeling
Robust physics engines
Sports games incorporate features from many different genres
Real-time strategy styles
RPG-type player development
Through the years sports games have advanced significantly to allow a deeper level of play<br>
slide58. Questions?<br>