Artificial Intelligence for Games Lecture 2.  2D sports simulation (no interactive player)  2 teams (“red” and “blue”)  5 autonomous agents per team.

Slides:



Advertisements
Similar presentations
STRUCTURES & STRATAGIES
Advertisements

Wide Cones Start in the corner and go wide around each cone. Shoot on goalie between the last two cones. Diagonal Cones Start in the corner and go around.
LAW 14 THE PENALTY KICK. 8 TOPICS 1. When to award a penalty kick 2. Before kick is taken 3. Kicker 4. Keeper 5. Other players 6. What if ….? 7. Extending.
Forward Split Drills: “Creating Habits & Identity”
© 2011 U.S. Soccer1 U.S. Soccer Referee Department 2012 Grade 8 – Law 14 Penalty Kick.
FLOOR HOCKEY WILLIAMSBURG PHYSICAL EDUCATION MR. WITTE.
Positions Goalkeeper: Keeps the ball out of the goal and organizes team defense. Uses hands and arms within the penalty area. Possesses sure hands to.
Marshall Youth Soccer Coaching Guide U6/U Coaching Support Shannon VandeVere In-Town Coordinator Coaching.
Field Setup Field Setup (5 stations) Separate large field into three equal “stations” using cones, and small field into two equal “stations” using cones.
Soccer Study Guide.
Soccer Notes. Field Diagram: Penalty area Center circle Sideline Goal line Goalie Backs MidfieldersForwardsCorner area Goal area Goal
Assistant Referee Course
SOCCER.
The “Routine” In Action A Typical Practice Be Punctual –Arrive Early –Have the Field Set Up and Ready to go Before Players Arrive.
Frank Augustus Miller Middle School Physical Education
SOCCER.
When you see a soccer ball, jump and hit it in the air with your head.
Please see this weeks session overleaf; themed this week around receiving, retaining, releasing and regaining the ball. You may (if you haven’t already)
Clubs Formation U9 age group. S WW CD GK Formation Wide CM.
Hockey Terminology & Strategy Basics for Parents.
5/18/20151 Team Sport AI CIS 479/579 Bruce R. Maxim UM-Dearborn.
1 Law 12 Fouls The 2 Types of Fouls 1.DFK Fouls 2.IFK Fouls.
Field Setup Field Setup (6 stations) Separate large field into four equal “stations” using cones, and small field into two equal “stations” using cones.
Please see this weeks session overleaf; themed this week around Marking & Intercepting. You may (if you haven’t already) want to consider: 1.The game (in.
Elwood City Junior Football Club Key Information Registration period: Feb/March 2014 Preseason training: Commences March 6 th 2014 Home and Away.
European Handball.
Click to add text You Make the Call Questions from the FIFA Q & A, 2005 ed.
Field Setup Field Setup (5 stations) Separate large field into three equal “stations” using cones, and small field into two equal “stations” using cones.
Warm-ups (15-20 min) Setup:
Some of the Basic Rules of Girl's Lacrosse The Game: Girls' lacrosse combines individual skills and team performance. Keeping possession is integral to.
Raven Robin Burke GAM 376. Soccer standings Burke, 7 Ingebristen, 6 Buer, 6 Bukk, 6 Krishnaswamy, 4 Lobes, 3 Borys, 2 Rojas, 2 Bieneman, 2.
TEAM HAND BALL.
1 GK Power/Finesse Set up is a goalkeeper protecting a full size goal, a coach with a supply of balls on the goal line, and a line of shooters behind a.
Simple Soccer GAM 376 Robin Burke Fall 2006.
Team Handball.
Soccer Springboro Junior High School. The Field SIDELINE ENDLINEENDLINE When the ball goes out of bounds at the sideline, the other team performs a THROW.
LEGEND: Run Pass Dribble GIVE & GO Organization: Circles pass ball out to triangles and move on a different line than the ball to get it back. Triangles.
Shaping Game Play in Handball
Artificial Intelligence in Game Design Cooperative Movement.
This drill is a slight variation of a standard 4 v 2 keep a way game. Start with a 12 x 12 grid and 6 players. Have two wear red, two wear blue and two.
Playing.. Place equally skilled players together in the same group. Have 2 groups per grid so one group is resting while the other group is active. Place.
Artificial Intelligence in Game Design Complex Steering Behaviors and Combining Behaviors.
U9/10 Winter Training Week 7 Attacking 1v1 DiagramOrganizationCoaching Points 4v4 Scrimmage Unrestricted Free play first minutes Everyone with a.
Guidelines for Assistant Referees Topics Duties and Responsibilities Positioning & Team work − Kick-off − Goal kick − Penalty kick − Goal situations.
Lacrosse 101. What is lacrosse? Lacrosse is a full contact sport played using a stick with a net on the end, called a crosse, which consists of usually.
Restarts 1. Topics Kick-Off Throw-In Goal Kick Corner Kick Dropped Ball Free Kick – Direct – Indirect – Penalty 2 Restarts when ball is out of play Restarts.
Coaching Pack 9 – 11 Years. What Am I Coaching Today? What Might the Players Learn or Get Better at? TechnicalPsychological example PhysicalSocial example.
TEAM HAND BALL.
J. seiler 12/20021 Tournament Rules that seem note worthy to mention. 7 V 7 games. 45 Minute Games – No half time? Kick off can be played in any direction.
Soccer Drill Practice Cards This PowerPoint contains 16 soccer drill practice cards. Once printed and cut out, each 3X5 card contains detailed instructions.
Artificial Intelligence in Game Design Lecture 8: Complex Steering Behaviors and Combining Behaviors.
CSCI 4310 Lecture 5: Steering Behaviors in Raven.
Football. The Field *Regulation football field (without end zones) = 100 yards *Length of end zone = 10 yards *Distance between yard lines = 5 yards *Regulation.
Baseball Challenge! Team Sports Final Exam Practice.
Defending When Outnumbered How to defend when your opponents counter attack.
NETBALL – Chest Pass  Technique  Flat pass  Both hands behind the ball in ‘W’ shape  Elbows down and push ball directly and hard at team mate  When.
SESSION PLAN PRESENTATION
SESSION PLAN PRESENTATION
Soccer Most popular game in the world. Oldest known team sport.
Law 8 - Start & Restart of Play
Law 14 The Penalty Kick.
Law 14 The Penalty Kick.
Law 14 The Penalty Kick.
Simple Soccer GAM 376 Robin Burke Winter 2008.
Player Development Initiative: Referee Implementation
AYSO National Referee Program
Chasing Cars How to play Players are in pairs – “cars”
Field Diagram: Sideline
Law 12 The 2 Types of Fouls DFK Fouls IFK Fouls Fouls 2017.
Soccer.
Presentation transcript:

Artificial Intelligence for Games Lecture 2

 2D sports simulation (no interactive player)  2 teams (“red” and “blue”)  5 autonomous agents per team ◦ 4 field players ◦ 1 goal keeper  1 field (“pitch”)  2 goals  1 ball

 Red Team: BucklandTeam  Blue Team: WindTeam  Keyboard controls ◦ P for pause/resume ◦ R for reset (new match)  Frame (update) rate ◦ default 60 Hz (FrameRate in Params.ini) ◦ can slow down to study behavior more closely  Match ◦ default 5 min (TimeLimit in Params.ini) ◦ scoring bonus for using less CPU time (details later)

 Geometry and Physics ◦ steering ◦ navigation  Tiered AI ◦ overall team state machine ◦ each player has state machine ◦ each player has (changing) role in team  e.g., pass receiver ◦ messaging between players  e.g., “pass me the ball”

Like many other genres (e.g., FPS), AI opponents in sports simulations must be beatable AI’s may have inherently weak strategies (e.g,. no defensive plays in Simple Soccer) Inaccurate (approximate) physics modeling saves compute time, but causes AI’s to make mistakes e.g., circles instead of ellipses to calculate interception in Simple Soccer

ball rebounds off walls no corners or throw-ins no off-side rules No “head” moves

 As aid to implementing strategies, pitch divided into 18 regions (numbered 0-17 as above)  Each player has a “home region” starting point for match may change during play

 Three elementary kinematic equations ◦ v = u + at(speed) ◦ d = ut + ½ at2(distance)  Dynamics: F = ma  Acceleration (a) is Friction in Params.ini  Soccer ball only checks for collision with pitch boundaries ◦ angle of incidence equals angle of reflection ◦ ball moves freely through players “feet” This Page is Read-Only

 In reality: ◦ player swings foot toward moving ball ◦ force on ball at moment of collision with foot changes velocity of ball  Approximation in game: ◦ pretend ball stopped at moment of kick ◦ player gives ball fixed initial velocity ◦ easier to calculate ◦ looks ok

 Receiving Player ◦ waiting to receive kicked ball ◦ may be null  Closest Player to the Ball ◦ updated every tick ◦ never null  Controlling Player ◦ more contextual: passer, receiver, attacker ◦ may be null  Supporting Player ◦ works with controlling player ◦ always defined when controlling player defined ◦ May need to extend these to improve team strategy!

 possible destinations for supporting player in opposing half-pitch (default 13x6)  each rated for (weights in Params.ini): ◦ safe passing (Spot_PassSafeScore) ◦ goal scoring potential (Spot_CanScoreFromPositionSc ore) ◦ distance from controlling player ◦ (Spot_DistFromControllingPlay erScore)

 The spots are scored by examining each one in turn and scoring them for a particular quality, such as whether or not a goal is possible from the spot's position or how far away from the controlling player the spot is situated.  The scores for each quality are accumulated and the spot with the highest score is marked as the best supporting spot.

 Non-agent entities: ◦ Soccer pitch ◦ Goal ◦ Soccer ball ◦ Support spot calculator ◦ Main loop

 entered ◦ start of match ◦ after goal scored  sends all players to (defending) home regions  “waits” until all players are home  transitions to Defending state

 change home regions to blue (defending) set  steers all field players to homes  if team gets control, transition to Attacking

 change home regions to red (attacking) set  choose supporting player / spot  if team loses control, transition to Defending

 handles all messages between players ◦ Msg_SupportAttacker ◦ Msg_GoHome ◦ Msg_ReceiveBall ◦ Msg_PassToMe ◦ Msg_Wait  no messages between team and players in this implementation

 turn on “seek” steering to ball’s current position  if in kicking range, transition to KickBall  if no longer closest player, ReturnToHomeRegion  turn off “seek” when exiting

 hold position at current steering target  if upfield of teammate in control, send Msg_PassToMe to controlling player  if closest to ball and no current receiver (and goalie does not have ball), transition to ChaseBall

 entered in response to Msg_ReceiveBall ◦ telegram contains target location of ball ◦ at most one player on team in this state  choose between “arrive” vs. “pursuit” steering towards ball ◦ always use “arrive” if close to goal or threatened ◦ otherwise, random variation  if close enough to ball or team loses control, transition to ChaseBall

 if max kicks/sec exceeded or goalie has ball, transition to ChaseBall  if CanShoot (see later), Ball()->Kick() ◦ transition to Wait ◦ assign supporting player and send Msg_SupportAttacker  else if threatened and CanPass (see later) ◦ assign receiver and send Msg_ReceiveBall  otherwise, transition to Dribble ◦ assign supporting player and send Msg_SupportAttacker

 turn upfield if necessary (maintaining control of ball)  repeat ◦ kick ball short distance ◦ transition to ChaseBall ◦ which will transition to KickBall ◦ which will transition to Dribble

 steer (“arrive on”) to selected support spot ◦ support spot re-evaluated every update  if CanShoot and not threatened, then send Msg_PassToMe to controlling player (attacker)  if cannot request pass, then remain at support spot and “track” (face) ball  if team loses control, transition to ReturnToHomeRegion

 always faces ball  steering behaviors use velocity-aligned heading  so moving and facing directions can be different

 handles two messages ◦ Msg_GoHome ◦ Msg_ReceiveBall

 using “interpose” steering to keep body between ball and rear of goal  if ball comes within control range, transition to PutBallBackInPlay  if ball comes within intercept range, transition to InterceptBall

 send Msg_ReturnHome to all field players (including opponents!)  pass to teammate  transition to TendGoal

 steer towards ball using “pursuit”  if close enough to trap ball transition to PutBallBackInPlay  if move too far from goal ◦ unless goalie is closest player to ball ◦ transition to ReturnHome

 isPassSafeFromAllOpponents  CanShoot  FindPass  GetBestPasstoReceiver

 direct pass ◦ assume kicked ball speed > max player speed ◦ then any player “behind” kicker is safe ◦ how to calculate “behind” ?

 transform to local coordinates of kicker  all opponents (e.g., W) with negative x coordinate are “behind” kick (i.e., safe)

 how about opponents beyond receiver (x coordinate > B), e.g., Q ?  if distance to receiver (BQ) is greater than pass distance (AB), then safe

 how to eliminate remaining opponents?  compute closest intercept point (e.g, Xp, Yp)  compare time for ball vs. opponent to reach intercept point ◦ adjustment for ball size and capture distance ◦ ignoring time for opponent to rotate

 choose random points along back of goal  call isPassSafeFromAll Opponents

 call GetBestPassToReceiver on each teammate beyond MinPassingDistance  choose teammate who can safely receive pass that is furthest upfield

 eliminate if receiver too far ◦ doesn’t consider receiver running toward passer  consider “side passes”

 compute range (dotted circle) of receiver within time duration of pass  side pass targets are ip1 and ip2 ◦ check that inside pitch ◦ call isPassSafeFromAllOpponents

minimum distance a player must be from the goalkeeper before it will pass the ball GoalkeeperMinPassDistance 50.0 the distance the keeper puts between the back of the net and the ball when using the interpose steering behavior GoalKeeperTendingDistance 20.0 when the ball becomes within this distance of the goalkeeper he changes state to intercept the ball GoalKeeperInterceptRange how close the ball must be to a receiver before he starts chasing it BallWithinReceivingRange 10.0

scoring values for support spots Spot_CanPassScore 2.0 Spot_CanScoreFromPositionScore 1.0 Spot_DistFromControllingPlayerScore 2.0 when an opponent comes within this range the player will attempt to pass (the higher the value, the more often players tend to pass) PlayerComfortZone 60.0 minimum distance a receiving player must be from the passing player MinPassDistance 120.0

 Please run the soccer game now …  Take a look at Params.ini and try different settings (don’t change the order, only the values …!)

50  The playing rules  The game architecture  Raven map en map editor  Raven weapons and triggers  AI design  AI implementation  At this moment: Please try playing this game

51

 Right click to select bot ◦ to observe internal state  Possess selected bot by right clicking ◦ left click to shoot ◦ right click on map to navigate to point (AI path planning assist) ◦ mouse position determines direction of firing ◦ change weapons with 1, 2, 3, 4 keys ◦ X key to release

 Please run the raven game now …

54 The practice will be:  Running and modifying the Soccer Program from Buckland Preparation:  See C++ sources at Blackboard, a slightly different version from Buckland!!

55  Homework  Study and play Chapter 4 Soccer  Read and play Chapter 7 Raven  See Blackboard for instructions and the sources (Course Materials)