Racing Game A.I.
description
Transcript of Racing Game A.I.
Racing Game A.I.
By Austin Borden, Qihan Long, and Jim PrattRacing Game A.I.1Defining the RacetrackSectorsDefine on-track areasInterfacesLeading and trailing edges of a sector
2InterfacesRight/left edgeDriving line nodes:Racing lineOvertaking line
3OvertakingWhen the A.I. car gets close to an opponent, it will change its driving line from racing to overtakingMultiple overtaking lines possible
Burnout 1:15
4SectorsStores its distance from start, to finish line, and to other vehicles.Path typesTerrain typesWallsHairpin turnsBrake-Throttle5Path TypesDefines the type of route aheadNormalShortcutLong routeWeapon pick-up routeWinding roadDrag stripA.I. chooses route depending on current situation6Terrain TypesAdds another variable for A.I. to deal withRugged terrainSlickIf a route is a shortcut and also rugged, only vehicles capable of traversing will choose this route
Terrain Traversing7Racetrack Definition ConclusionThe more information we provide, the less complex the A.I. system has to be8Racing A.I. LogicVehicles do not follow driving lines exactly, only guided by themA.I. is supposed to emulate human inputDone by creating an A.I. controller9Basic A.I. FrameworkFinite State MachinesAllows decision makingFixed Time-StepEnsures that AI reacts quickly always
Controlsfloat dx; //-1.0 to 1.0 for left to right steeringfloat dy;//-1.0 to 1.0 for max brake to max acceleration10Looking AheadCars look ahead for obstacles and turnsThe faster its moving, the further it looks to smooth path
11Wall AvoidancePosition 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 toIf predicted position is outside of sector, brakes are applied
12Hairpin TurnsLooking too far ahead during a sharp turn will cause A.I. to cut cornersTo fix this, car looks for hairpin flags and shortens the look ahead distance if flags are found
13Under/Over-SteerWith simple physics cars can spin out due to over steeringCars can also miss turns due to under steeringBased on sideways velocities of wheels14
15Steer CorrectionDepending on over or under-steering, a correction value is added to the current steer valueOvercorrection is prevented by the understeer/oversteer rangeColin McRae Dirt 2
16Catch-Up LogicIf A.I. is winningLimit A.I.s top speed in proportion to distance leadingBrake early for corners, accelerate slowly out of turnsTake long routes/ unstable terrain routesGet worse weapons/ only target other A.I.Opposite can be used if A.I. is trailingGood way of making a race challenging for all skill levelsDiddy Kong Racing 1:45Shadows of the Empire 5:5017Catch Up Logic Case Study:Pure
18The Rubber Band System
19Racing Grouping in Pure
Difficulty RegulationPowerful itemsIntelligence modificationSimilar Placing
21Tuning the Car HandlingIf each car has different characteristics, tuning the code can be time consuming.
22
23Adjusting the ParametersAssign 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.24Real Time EditingReal Time Track ModificationAn 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 AIAllows 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.25Layer BehaviorReactionary systemModular approach makes it easyMultiple inputs for one outputOutput contention system ultimately determines outputLayer Interactions:OverridingInternal statesAltering input for other layers
26Example of Layers
Path Following LayerTurning and speed dealt with separatelyAttempt to keep car on lineCornering regulation monitors speedCorners and apex determinedFormulate max speed and braking zone distanceDynamic according to current speedBraking, cruise, full throttle
28Tactical Racing LayerMakes competitive racing choices (driver into a racer)Analyzes situation and races accordinglyFind optimum road positionGenerates new pathsSafe guards in place29Visual Perception8 eyes, 4 pairsDetermines speed and position of cars and environmentDetermines desirability of current position based on environment and position of other cars30Fine Grain Avoidance LayerPriorityNeeded when cars want to occupy same spaceRelative car position determines who yieldsPrevents collisions by overridingFor passing, steering is moderatedFor linear, speed is moderated31Determining Racing LinesProblems with user made contentTrack detail hard to take into accountLines of minimum curvature are limiting, boringMidway points across trackForces used to smooth out sharp turnsSafe guards
32Competitive AI Racing Under Open Street ConditionsAllows an AI controlled vehicle to traverse an random network of roads.Finding the correct route to destination.Calculating steering brake and throttle values.33Library InterfaceRegisterRoute InterfaceHolds a list of intersections and roadsRegisters the path through the mapCalled when entering a new routeDriveRoute InterfaceUsed on a lower level than the RegisterRoute interfaceCalculates steering, throttle, and brakesUsed for driving forward, backing up, colliding, and stopping.34Navigating the City
Find the current locationUpdate the road cacheWhen a road is fully traversed, loads a new road into the cache.Emulate all possible routesFinds possible routes through the road35Avoiding obstaclesCheck for obstacles after the route is calculated.
36ReferencesChampandard, 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. .
Questions?