CIG 2007 Car Racing Competition

Julian Togelius and Simon M. Lucas

This page contains instructions and source code for participating in the Car Racing Competition of the 2007 IEEE Symposium on Computational Intelligence and Games. The page was last updated March 27, and the following is the final version of instructions, rules and code. The competition is now finished, and no further submissions will be accepted. The final results were announced at CIG in Hawaii on April 5; the winner is Peter Burrow. The slides announcing the competition results are available here - live demos of the best controllers competing against each other were also shown. A continuation of this competition will be held for CEC 2007; the details are not yet final, and suggestions for improvements are welcome..


The aim of the competition is to produce the best controller for a simulated car racing task. How good a controller is is measured as how many waypoints it can pass within a set time limit (1000 timesteps). The waypoints are randomly distributed around a square area at the beginning of each race, and the car knows the position both of the current waypoint and the next waypoint after that.

To make things a little less straightforward the physics are reasonably detailed, allowing for skidding and car-to-car collisions. There are two cars on the track, meaning that a good controller will have to deal with not only how to get as quickly as possible to the next waypoint, but also when to recognize that the competing car will reach that waypoint first and instead go for the next waypoint.

Although the symposium is about Computational Intelligence and Games, there is no requirement that the controllers be based on computational intelligence techniques; in fact, one of the main objectives is comparing CI approaches to non-CI approaches, as well as comparing different CI approaches to each other.


The source code for the competition is written in Java, and one format for competition entries will be Java classes. However, we welcome submissions in any programming language as long as you do the work of interfacing your code to ours, and provide us with a simple, self-contained way of running your code. What follows below is a description of the most important interfaces in the package "simplerace" in the source code.

The interface you will extend when you write your own java controller is Controller. Its method public int control (SensorModel inputs) is called every timestep, supplying the controller with fresh information and expecting a, integer control command in return. The values of the control command are specified in Constants.

What's being passed to the controller is an object implementing the interface SensorModel. This provides a number of methods giving information on your car, the opponent car and the waypoints. The methods are divided into methods giving ego-centric / first-person information, and Newtonian / third-person information, and there is a lot of redundancy between the methods. Your controller can access as many or as few of these methods as you deem necessary.

If you want to evolve a controller from your own representation, you might want to implement the Evolvable interface. The two important methods here are mutate, which should change something in your controller, and copy, which should return a complete deep copy of your controller.


For studies of applying artificial evolution and co-evolution versions of a similar problem (actually, using partly the same codebase) take a look at our previous papers: Evolving controllers for simulated car racing, Evolving robust and specialized car racing skills, Arms races and car races, but be aware of the differences when compared to the competition problem, especially the absence of walls. A comparison of evolution and td-learning for what is essentially the solo-car version of this problem is made in a paper that will be presented at CIG, Point-To-Point Car Racing. More related papers can be found on Julian's home page.

Other people who have published papers on learning controllers for various car racing tasks include Ivan Tanev, Pieter Abbeel, Mototaka Suzuki and Benoit Chaperot - tell us if you want to be included in this list.

Comments / questions / bug reports / suggestions

Talk to Julian.

Hall of fame

Pete BurrowEvolved modular network18.2
Thomas HaferlachEvolved modular CTRNN network16.9
Hugo Marques and Julian TogeliusController based on evolved MLP and internal opponent simulation15.3
Matt SimmersonEvolved NEAT controller13.5
Aravind GowrisankarEvolved NEAT controller13.4
Julian TogeliusEvolved MLP-based controller11.0
Julian TogeliusHeuristic controller9.4

How to get started (it's easy!)

First of all, download the source code. Unpack, and go to the classes directory. To get a feel for how the code works, you can then try the following commands:

java simplerace.Play evolved.xml

Displays an evolved neural network controller going solo for the waypoints.

java simplerace.Play evolved.xml simplerace.HeuristicController

Pits the same evolved net against a simple hard-coded controller. Or try GreedyController for an even simpler controller.

java simplerace.Play evolved.xml simplerace.KeyboardControllerOne

Lets you race against the evolved controller. You are the blue car, and use the arrow keys for control. Can you beat the neural network? Can you design, or evolve, or learn, a controller that beats you?

java simplerace.Play simplerace.KeyboardControllerOne simplerace.KeyboardControllerTwo

Lets you race against a friend. Your friend, in the blue car, uses the a-s-w-d keys for control. Can you beat your friend? If not, can you create a piece of Java code that does it for you?

java simplerace.Stats evolved.xml<

Runs the evolved network controller on 100 tracks, silently, and displays mean fitness, standard deviation and other interesting statistics.

java simplerace.Stats evolved.xml simplerace.HeuristicController

Exactly what it looks like. Pits an evolved controller and a heuristic controller against each other 100 times, so you don't have to, and reports the results.

java simplerace.Evolve simplerace.MLPController

Evolves a new neural network controller from scratch.

java simplerace.CoEvolveOnePop simplerace.MLPController

Co-evolves a new neural network controller from scratch, with a single-population co-evolutionary algorithm.

java simplerace.Play simplerace.TCPControllerOne simplerace.TCPControllerTwo

Pits two remote controllers against each other. The Play class will wait for two clients to connect at TCP ports 6524 and 6525 before continuing. This remote control functionality is meant to facilitate the development of non-Java controllers, and is not necessary if you only work with Java. The specification of the network protocol is here. To connect some example clients, you can type the following into separate consoles:

java simplerace.Client simplerace.GreedyController


java simplerace.Client evolved.xml 2

After trying all this, your fingers are probably itching to get coding. Well then, do it! Take a look at how MLPController and HeuristicController are constructed, and write your own class, extending Controller and maybe also Evolvable. For those of you who use IntelliJ, project files are supplied, if you use another IDE the project structure should be simple enough.

One final thing before you get going, though: we would like to know approximately how many persons intend to participate, and also to have a list of mail addresses so we can notify competitors in the unlikely event of a change in rules or code. So please email Julian with your intention. Good luck!

Submitting your controller

Once you've evolved, trained, hard-coded or otherwise constructed a controller you're satisfied with, you should estimate its competition score. This is done with the class CompetitionScore, which takes your controller (as class name or WOX file) as its only input:

java simplerace.CompetitionScore YourController

This is the same command we will be using to establish your competition score, once we've received your controller. So mail your controller to Julian together with your estimation of its score, and we will rerun the scoring and put the controller in its proper place in the hall of fame (if it's good enough). You may resubmit your controller as many times as you want, but to keep the hall of fame of reasonable length we will only list the best controller of each type from each competitor, and might drop those that are clearly not in the competition if the list grows too long.

If we get enough good submissions we intend to run a live tournament between the four best submissions at CIG. Otherwise, the winner will simply be the highest scoring competitor at the time of the closing of the competition, which is not earlier than March 26.

We would prefer to recieve your controller as a Java class or as a WOX file (the standard XML format written by the simplerace package) - this is by far the simplest both for you and for us. But again, any sort of controller programmed in any language will do given that you provide us with a self-contained package that interfaces to an unmodified version of the simplerace package, and simple, unambiguous instructions as to how to run it. This could be e.g. a compiled c program that connects to the TCPControllerOne class on localhost, using the network protocol. We have access to standard Ubuntu, Mac OS X and Windows XP installations.
One more thing: we would like to make the submitted controllers public, and count on people being honest enough not to plagiarize each other. But if you don't want your controller linked from the hall of fame, we respect that; just tell us in the mail.