Presentation is loading. Please wait.

Presentation is loading. Please wait.

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

Similar presentations

Presentation on theme: "By Austin Borden, Qihan Long, and Jim Pratt Racing Game A.I."— Presentation transcript:

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

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 Burnout

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 its 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


16 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

17 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 Diddy Kong Racing Shadows of the Empire 5:50 Shadows of the Empire

18 Catch Up Logic Case Study: Pure

19 The Rubber Band System

20 Racing Grouping in Pure

21 Difficulty Regulation Powerful itemsitems Intelligence modification Similar Placing

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


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

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

26 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

27 Example of Layers

28 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

29 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

30 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

31 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

32 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

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

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

35 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

36 Avoiding obstacles Check for obstacles after the route is calculated.

37 References Champandard, Alex J. "Paris Game AI Conference '09: Highlights, Photos & Slides." Game AI for Developers. Web. 24 Mar. 2010.. "Gamasutra - Features - The Pure Advantage: Advanced Racing Game AI." Gamasutra - The Art & Business of Making Games. Web. 24 Mar. 2010.. "Mario Kart Wii: Those Damn Powerups." GamerBunny Speaks. Web. 24 Mar. 2010.. 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..

38 Questions?

Download ppt "By Austin Borden, Qihan Long, and Jim Pratt Racing Game A.I."

Similar presentations

Ads by Google