Ai architecture for racing vehicle control
1 / 42

AI Architecture for Racing Vehicle Control - PowerPoint PPT Presentation

  • Uploaded on

AI Architecture for Racing Vehicle Control November 3, 2004 Upmanyu Misra Scope 8.1: Racing Vehicle Control using Insect Intelligence 8.2: Fast and Efficient Approximation of Racing Lines Downforce by Smartdog Alex Darby Alex Darby

I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
Download Presentation

PowerPoint Slideshow about 'AI Architecture for Racing Vehicle Control' - ivanbritt

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.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.

- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
Ai architecture for racing vehicle control l.jpg

AI Architecture for Racing Vehicle Control

November 3, 2004

Upmanyu Misra

Scope l.jpg

  • 8.1: Racing Vehicle Control using Insect Intelligence

  • 8.2: Fast and Efficient Approximation of Racing Lines

  • Downforce by Smartdog

  • Alex Darby

Alex darby l.jpg
Alex Darby

  • Joint Honors in AI, Psychology and CS from Univ. of Nottingham

  • Was senior developer at Smartdog, that developed PS2 futuristic racing game Downforce

  • Now works with FreeStyle Games Ltd.

Futuristic l.jpg

  • Video game titles in which players take control of not-yet-invented vehicles

  • Different from NFS

  • Similar to Star Wars, anyone??

Big deal eh l.jpg
Big Deal, eh?

  • Deformable car models

  • Off-the-wall additions to the F-1 racing genre

    • Thrust blasters

    • Super-engines

    • Insane speeds and stunts

Right intentions l.jpg
Right Intentions

  • Intelligent

  • Behavior must be intentional

  • Intentions ≡ Intelligence

Agent’s view

Player’s view

Simplify f 1 racing l.jpg
Simplify F-1 Racing

  • Speed is highest priority

  • Keep on track, preferably on optimal racing curve

  • Easy, yet realistic braking

  • Easy steering

  • Realistic throttle control

Overview l.jpg


Downforce Simulation

Data Representation

AI Framework

Track Spaces

Brooks’ Subsumption

Insect AI

The Four main layers of Downforce AI

Racing Lines



Data abstraction l.jpg
Data Abstraction

  • Need Data Abstraction and representation

    - For Downforce, concept is “track space”

    - Track space transforms 3-D position

    to 2-D position

Track space12 l.jpg
Track Space

  • Calculating <fWidthPos, fLengthPos> requires two vector normalizations per track position

  • Optimized by caching most common vectors

Disadvantage l.jpg

  • Unreliable for detecting fine-grain collisions

  • To avoid that …

    we transform the whole bounding box of the car to 2-D

Downforce ai l.jpg
Downforce AI

  • Used Rodney Brooks’ Subsumption Architecture [Brooks91] and Insect AI architecture [Porcino03]

  • Downforce AI is primarily reactive

Brooks subsumption architecture l.jpg
Brooks’ Subsumption Architecture

  • Intelligent behavior can be generated without explicit representations or abstract reasoning of the kind that symbolic AI proposes

  • Intelligence is an emergent property of certain complex systems. Each layer does its job, they don’t necessarily coordinate. But the result seems “Intelligent”

Insect ai l.jpg
Insect AI

  • Introduced by Nick Porcino

  • Ch. 6.2

  • It provides

    • Architecture

    • Notation

    • Design Methodology

As smart as a bug l.jpg
As smart as a Bug…

  • Insects demonstrate a wide variety of interesting and successful behaviors

    • Seek (pursuit of a target)

    • Flee

    • Steer (away/into)

  • Yet, their nervous systems are simple

  • Hence its possible to analyze, compute and create simulation of their behaviors

  • This is called Computational Neuroethology

Behaviors l.jpg

  • Each layer is composed of smaller sub-tasks called Behaviors

  • Each Behavior deals with a single aspect of the task(s) that the parent layer is responsible for

  • The overall behavior of the layer emerges from the interaction between constituent behaviors

Interaction between layers l.jpg
Interaction between Layers

  • Three main ways of interactions

    • Directly override the output of another layer,

    • Directly affect the internal state of another layer,

    • One layer alters the input data of another layer to achieve its own task

Output contention system l.jpg
Output Contention System

  • Based on three variables

    • Steering

    • Throttle

    • Braking

  • Every layer tries to manipulate them to achieve their goal

  • Contention system uses explicit priority system based on order of execution of layers and state dependent rules for situations that cannot be handled otherwise

Path following layer l.jpg
Path Following Layer

  • Generates correct controller input for vehicle to follow a specific path at max speed

  • Consists of two independent behaviors

    • Steering control

    • Speed Control

Independent l.jpg

  • Throughout the Downforce system it is assumed that other behaviors will fulfill their responsibilities

  • This facilitates emergent nature

    reduced responsibilities

    reduced problem space

    reduced computational load per task

    overall reduction in execution time

Steering control l.jpg
Steering Control

  • Calculates steering input that makes vehicle follow racing line

  • Needs to look ahead along the racing line from its current position to generate the value

  • Hence data needs to be represented accordingly (remember track space?)

  • Intelligent steering using PID controllers (Ch. 2.8 pg 171, demo on CD)

Wicked speed control l.jpg
Wicked Speed Control

  • Only responsible for regulating speed wrt path

  • Uses Newtonian physics equations for bodies in circular motion (remember centripetal/centrifugal forces?) to calculate max speed for any given track section

  • Uses FSM based around corners

Corner identification l.jpg
Corner Identification

  • Start – point from where the current speed becomes unfeasible

  • Apex – first point after the start when the change in turn radius is opposite to that of the start of the corner (where the corner begins to “open out”)

Approaching a corner l.jpg
Approaching a Corner

  • Calculate difference between the calculated max speed for the corner and the current speed

  • Derive the braking distance based on maximum braking (using good ol’ Newtonian eqns.)

  • If vehicle is outside the braking zone simply keep accelerating

Round the corner l.jpg
Round the Corner

  • Once the braking zone is reached, apply maximum breaking

  • On reaching max acceptable speed for the corner, cruise to apex

  • By the time apex is reached, the system will be ready with another set of behaviors (hopefully!)

Tactical racing layer l.jpg
Tactical Racing Layer

  • Assesses the race conditions and changes the speed and racing line to gain racing advantage

  • Transforms an Expert Driver to an Expert Racer

  • Consists three behaviors

    • Optimum road position

    • New racing line

    • Collision avoidance speed control

Optimum road positioning l.jpg
Optimum Road Positioning

  • Visual perception

    • One pair of eyes facing in each direction

      • One eye responds to relative speed of other cars

      • Other responds to their proximity

    • Each eye stores a one-dimensional image that represents the entire track width and has a resolution of 20 “perceptual pixels” or percepcels.

Compound eye l.jpg
Compound Eye

  • Products of the proximity and relative speed is stored in an array

  • Finally, we add the effect of the racing line to the compound eye with a high weightage

  • The tuning of the parameters takes time and experimentation. Makes it essential to have a method of editing parameters at run-time, ideally real-time Scripting

Collision avoidance speed control l.jpg
Collision Avoidance Speed Control

  • Overrides the speed control set by the PF layer to avoid collision, primarily front to back

  • Collision test is performed using velocities measured in the track space domain

  • Its further refined by calculating the relative fWidthPos component of the track space velocity wrt that of the racing line

Fine grain avoidance layer l.jpg
Fine Grain Avoidance Layer

  • Deals with potential collision situations that were missed by previous layers

  • Consists of two behaviors

    • Race Priority/Racing Etiquette

      • Decides which car should back down

    • Fine Grain Collision Avoidance (they ran out of names!)

      • To avoid side-on collisions by restricting throttle and steering

Driving assist layer l.jpg
Driving Assist Layer

  • Controls problems such as wheel spin and brake locks

  • Consists of two behaviors

    • Traction Control

      • Minimizes wheel spin/slide

      • The slip/spin of the wheel is normalized between their corresponding min and max

      • Modifies throttle speeds set by other layers

    • Anti-lock Braking

      • Same as traction control except that the brake value is scaled instead of the throttle

Slide37 l.jpg


  • By Clint Hannaford

  • Based on Reynolds’ work on Autonomous Character Locomotion

Fixing racing lines l.jpg
Fixing Racing Lines

  • They are desirable

    • give AI vehicles a hint of realism

    • helps AI vehicles to present better challenge

  • Record path taken by an AI vehicle driven by a competent human player

    • fast and efficient

    • cannot be used for randomly generated or player created tracks

Fixing racing lines39 l.jpg
Fixing Racing Lines

  • Restrict random and player created tracks to being assembled from predefined segments with pre-computed racing lines

  • But

    • its not that much fun

    • racing line is context dependent and cannot be produced by plugging predefined sections

Approximating l.jpg

  • Ignore the physics of vehicle movement

  • Concentrate on minimizing curvature

  • Start with mid-points on the track

Sources l.jpg

  • AI Game Programming Wisdom 2


  • Rodney A. Brooks, “A Robust Layered Control System for a Mobile Robot”

  • Brian Beckman, “The Physics of Racing,”

Thanks l.jpg