The Darwin Game 2.0

Movies

Darwin 2.0 is a game that features artificial intelligence creatures (i.e., virtual robots) competing to either control a map or be the first to complete a task. You play by programming your own species of creature in Java. Darwin 2.0 is a lab assignment in CS136 at Williams College. Students create creatures for specific tasks, which then compete against each other during lab.

Creatures are programmed in regular Java. Six actions allow them to interact with the simulation world: look, turnLeft, turnRight, move, attack, delay. Each action has its own specified time cost. A successful attack destroys its target and then spawns a new instance of the attacker's creature type. This allows creatures to reproduce and eventually take over the map. This and the tournament rules create a kind of natural selection among species, hence the `Darwin' name.

The API is extremely simple. Below is the source code for a robot rover that moves in a straight line until it is obstructed, and then turns to the left. It attacks any enemy that it runs into.

public class Rover extends Creature {
    public void run() { while (true) {

        if (! moveForward()) {
            attack();
            turnLeft();
        }
     

    }}
}

The simulator can be run in text mode or graphical mode. In graphical mode it offers top-down and 3D views and can be paused or set at one of three speeds: debug, normal view, and fast tournament mode. The 3D view is shown at the top of this page. To customize your creature's 3D appearance, draw four PNG images. Searching for `3D sprite' or `isometric sprite' yields many good results on Google. For example, the rover above uses a tweaked Pig Tank from Duke Nukem 3D. The maps themselves are created using a simple ASCII format. They support walls, food, and up to 10 competing creatures.

Download

The Darwin 2.0 simulator and documentation are below. You may use them for free, with attribution, in a course or for your own entertainment.

DescriptionFileDateContents
Darwin 2.0 Beta 15darwin2.zip2008-05-05Simulator, Darwin viewer, sample Creatures, map pack, sprites, source
Programmer Guideguide.pdf2008-04-16How to make a creature, file format descriptions, advanced topics
APIOnline JavaDoc2008-05-05JavaDoc for all necessary classes

I am interested in receiving contributions of new sprite graphics and maze maps by e-mail, and in hearing if you use Darwin 2.0 in a course. Please do not send unsolicited creature subclasses or suggestions for the API. I don't have the resources to evaluate and integrate them.

History

Darwin Game 2.0 was designed by Morgan McGuire. It was inspired by Steve Freund's Darwin assignment, in which students implemented in Java an interpreter for a concurrent assembly language. That assignment was based on the Darwin's World interpreter game invented by Nick Parlante and implemented in C and Pascal. Darwin 2.0 emphasises Java concurrency programming and AI over the interpreter and assembly aspects of the earlier assignments.