80 likes | 164 Views
Car AI System. Goals Design Implementation Improvements. AI: Goals. Have cars follow course AI drivers constrained by car performance Random element to make AI race against each other. *. 1. Node. NodeList. CarAI. name pos radius maxspeed next. first last current. car list
E N D
Car AI System Goals Design Implementation Improvements
AI: Goals • Have cars follow course • AI drivers constrained by car performance • Random element to make AI race against each other
* 1 Node NodeList CarAI name pos radius maxspeed next first last current car list mytimer NodeList( ) InsertNode(node) CheckCurrent(car) Node(name,pos,maxspeed) SetPointer(node) Check( ) GetGoal( ) CarAI(car) Compute( ) AI: Design
AI: Implementation • Waypoint navigation • Configurable waypoint speeds • Randomized use of waypoint speeds • Cyclic waypoint graph • Main AI loop controlled by Timer, easy to adjust the CPU time given to AI system
wp1 wp1 dir 1 2 wp1 wp1 dir dir 3 4 AI: Implementation
AI: Improvements • Layered AI system • Use appropriate method for situation • Strategy based AI system • Event driven AI strategy chooser • Based on waypoints • AI chosen waypoint determines speed factor, not random factor • May even use Fuzzy Logic to choose behavior, if more variables are assigned to each car
AI: Improvements EventDriven CarAI ConcreteAI WayPoints Chaser Blocker
Track Class • Encapsulate all track specific parameters in a class • Could contain: track model, start grid positions, waypoints. • Track implementations should inherit from TrackBase class • Easy to change tracks using TrackBase interface