Sign in to follow this  
declique

Tips for an AI for a 2D racing game

Recommended Posts

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

[[i]Details[/i]] 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.

[[i]Questions[/i]] 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?

Share this post


Link to post
Share on other sites
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!

Share this post


Link to post
Share on other sites
[quote name='declique' timestamp='1298324978' post='4777239']
[[i]Intro[/i]] I have a school project to build an AI for a 2D racing game in which it will compete with several other AIs.

[[i]Details[/i]] 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.

[[i]Questions[/i]] 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?
[/quote]

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?

Share this post


Link to post
Share on other sites
[quote name='willh' timestamp='1298695088' post='4779219']
Not sure if this violates board rules, since it involves homework.. Dave?
[/quote]
Homework questions and stuff we don't/won't do. However, helping someone research a school project is permissible I would say.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this