Advertisement

Tips for an AI for a 2D racing game

Started by February 21, 2011 09:49 PM
2 comments, last by IADaveMark 13 years, 8 months ago
[Intro] I have a school project to build an AI for a 2D racing game in which it will compete with several other AIs.

[Details] We are given a black and white bitmap image of the racing track, we are allowed to choose basic stats for our car (handling, acceleration, max speed and brakes) after we receive the map. The AI connects to the game's server and gives to it several times a second numbers for the current acceleration and steering. The language I chose is C++, by the way.

[Questions] The question is - [1] What is the best strategy or algorithm (since I want to try and win)? I currently have in mind some ideas on the net and one or two of my own, but I would like before I start to code that my perspective is one of the best.
Besides, [2] What good books are there on that matter?
There are some recommended books here:
http://www.gamedev.net/topic/592473-recommended-ai-books-and-sites/

I just finished reading the book "Artificial Intelligence for Games" - Ian Millington.

A very good book and lots of info about the car racing game can be found in it.

Enjoy!
Advertisement

[Intro] I have a school project to build an AI for a 2D racing game in which it will compete with several other AIs.

[Details] We are given a black and white bitmap image of the racing track, we are allowed to choose basic stats for our car (handling, acceleration, max speed and brakes) after we receive the map. The AI connects to the game's server and gives to it several times a second numbers for the current acceleration and steering. The language I chose is C++, by the way.

[Questions] The question is - [1] What is the best strategy or algorithm (since I want to try and win)? I currently have in mind some ideas on the net and one or two of my own, but I would like before I start to code that my perspective is one of the best.
Besides, [2] What good books are there on that matter?


1. The best strategy to win is to get the finish line faster than everyone else. (sorry, couldn't resist. hehe)
2. The only winning move is to not play. How about a nice game of chess? (harhar)

The optimal answer will require more details about the server and how it handles the car. Are the phsyics complex? Can the car slide/fishtail? Can it bounce off of walls? Does it take damage? Are there other cars? Can you cheat (reverse behind the finish line and then drive over it?) If you answered no to all of those questions then it's probably a cost minimization problem that you can solve in near realtime.

Not sure if this violates board rules, since it involves homework.. Dave?

Not sure if this violates board rules, since it involves homework.. Dave?

Homework questions and stuff we don't/won't do. However, helping someone research a school project is permissible I would say.

Dave Mark - President and Lead Designer of Intrinsic Algorithm LLC
Professional consultant on game AI, mathematical modeling, simulation modeling
Co-founder and 10 year advisor of the GDC AI Summit
Author of the book, Behavioral Mathematics for Game AI
Blogs I write:
IA News - What's happening at IA | IA on AI - AI news and notes | Post-Play'em - Observations on AI of games I play

"Reducing the world to mathematical equations!"

This topic is closed to new replies.

Advertisement