1 / 38

Racing Game A.I.

Racing Game A.I. By Austin Borden, Qihan Long, and Jim Pratt. Defining the Racetrack. Sectors Define on-track areas Interfaces Leading and trailing edges of a sector. Interfaces. Right/left edge Driving line nodes: Racing line Overtaking line. Overtaking.

leone
Download Presentation

Racing Game A.I.

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Racing Game A.I. By Austin Borden, Qihan Long, and Jim Pratt

  2. Defining the Racetrack • Sectors • Define on-track areas • Interfaces • Leading and trailing edges of a sector

  3. Interfaces • Right/left edge • Driving line nodes: • Racing line • Overtaking line

  4. Overtaking • When the A.I. car gets close to an opponent, it will change its driving line from racing to overtaking • Multiple overtaking lines possible • Burnout 1:15

  5. Sectors • Stores its distance from start, to finish line, and to other vehicles. • Path types • Terrain types • Walls • Hairpin turns • Brake-Throttle

  6. Path Types • Defines the type of route ahead • Normal • Shortcut • Long route • Weapon pick-up route • Winding road • Drag strip • A.I. chooses route depending on current situation

  7. Terrain Types • Adds another variable for A.I. to deal with • Rugged terrain • Slick • If a route is a shortcut and also rugged, only vehicles capable of traversing will choose this route • Terrain Traversing

  8. Racetrack Definition Conclusion • The more information we provide, the less complex the A.I. system has to be

  9. Racing A.I. Logic • Vehicles do not follow driving lines exactly, only guided by them • A.I. is supposed to emulate human input • Done by creating an A.I. controller

  10. Basic A.I. Framework • Finite State Machines • Allows decision making • Fixed Time-Step • Ensures that AI reacts quickly always • Controls • float dx; //-1.0 to 1.0 for left to right steering • float dy; //-1.0 to 1.0 for max brake to max acceleration

  11. Looking Ahead • Cars look ahead for obstacles and turns • The faster it’s moving, the further it looks to smooth path

  12. Wall Avoidance • Position is predicted by using the current velocity and scaled by how far in the future we are predicting (seconds) • Correction amount is then applied to steering depending on which wall car is closest to • If predicted position is outside of sector, brakes are applied

  13. Hairpin Turns • Looking too far ahead during a sharp turn will cause A.I. to cut corners • To fix this, car looks for hairpin flags and shortens the look ahead distance if flags are found

  14. Under/Over-Steer • With simple physics cars can spin out due to over steering • Cars can also miss turns due to under steering • Based on sideways velocities of wheels

  15. Steer Correction • Depending on over or under-steering, a correction value is added to the current steer value • Overcorrection is prevented by the understeer/oversteer range • Colin McRae Dirt 2

  16. Catch-Up Logic • If A.I. is winning… • Limit A.I.’s top speed in proportion to distance leading • Brake early for corners, accelerate slowly out of turns • Take long routes/ unstable terrain routes • Get worse weapons/ only target other A.I. • Opposite can be used if A.I. is trailing • Good way of making a race challenging for all skill levels • Diddy Kong Racing 1:45 • Shadows of the Empire 5:50

  17. Catch Up Logic Case Study:Pure

  18. The Rubber Band System

  19. Racing Grouping in Pure

  20. Difficulty Regulation • Powerful items • Intelligence modification • Similar Placing

  21. Tuning the Car Handling • If each car has different characteristics, tuning the code can be time consuming.

  22. Adjusting the Parameters • Assign each parameter with a minimum and maximum value. • Modify the parameter depending on whether the lap time decreases or increases. • Time for this process can be reduced by running the game as fast as possible.

  23. Real Time Editing • Real Time Track Modification • An important tool in AI creation is the ability the change the track in real time. • Allows problems in the track to be quickly modified and tested. • User Control Overriding AI • Allows tester to take control when AI becomes stuck or incapable of navigating a certain part of the track. • Can be used to test the AI on specific parts of the track.

  24. Layer Behavior • Reactionary system • Modular approach makes it easy • Multiple inputs for one output • Output contention system ultimately determines output • Layer Interactions: • Overriding • Internal states • Altering input for other layers

  25. Example of Layers

  26. Path Following Layer • Turning and speed dealt with separately • Attempt to keep car on line • Cornering regulation monitors speed • Corners and apex determined • Formulate max speed and braking zone distance • Dynamic according to current speed • Braking, cruise, full throttle

  27. Tactical Racing Layer • Makes competitive racing choices (driver into a racer) • Analyzes situation and races accordingly • Find optimum road position • Generates new paths • Safe guards in place

  28. Visual Perception • 8 eyes, 4 pairs • Determines speed and position of cars and environment • Determines desirability of current position based on environment and position of other cars

  29. Fine Grain Avoidance Layer • Priority • Needed when cars want to occupy same space • Relative car position determines who yields • Prevents collisions by overriding • For passing, steering is moderated • For linear, speed is moderated

  30. Determining Racing Lines • Problems with user made content • Track detail hard to take into account • Lines of minimum curvature are limiting, boring • Midway points across track • Forces used to smooth out sharp turns • Safe guards

  31. Competitive AI Racing Under Open Street Conditions • Allows an AI controlled vehicle to traverse an random network of roads. • Finding the correct route to destination. • Calculating steering brake and throttle values.

  32. Library Interface • RegisterRoute Interface • Holds a list of intersections and roads • Registers the path through the map • Called when entering a new route • DriveRoute Interface • Used on a lower level than the RegisterRoute interface • Calculates steering, throttle, and brakes • Used for driving forward, backing up, colliding, and stopping.

  33. Navigating the City • Find the current location • Update the road cache • When a road is fully traversed, loads a new road into the cache. • Emulate all possible routes • Finds possible routes through the road

  34. Avoiding obstacles • Check for obstacles after the route is calculated.

  35. References • Champandard, Alex J. "Paris Game AI Conference '09: Highlights, Photos & Slides." Game AI for Developers. Web. 24 Mar. 2010. <http://aigamedev.com/open/coverage/paris09-report/#session13>. • "Gamasutra - Features - The Pure Advantage: Advanced Racing Game AI." Gamasutra - The Art & Business of Making Games. Web. 24 Mar. 2010. <http://www.gamasutra.com/view/feature/3920/the_pure_advantage_advanced_.php>. • "Mario Kart Wii: Those Damn Powerups." GamerBunny Speaks. Web. 24 Mar. 2010. <http://gamerbunny.wordpress.com/2008/05/19/mario-kart-wii-those-damn-powerups/>. • Rabin, Steve. AI Game Programming Wisdom 2. Hingham, MA: Charles River Media, 2004. Print. • Rabin, Steve. AI Game Programming Wisdom. Hingham, Mass.: Charles River Media, 2007. Print. • Youtube. Web. 24 Mar. 2010. <http://youtube.com>.

  36. Questions?

More Related