Genetic Tanks
The plan: make a simple environment with simple rules and populate it with entities that compete with each other. Hopefully better robots would evolve, and their genetics would dominate the pool until even better robots evolved.
Two versions to download (Windows) — they need a long time to run, but exhibit genuine learning and behavioural evolution: GeneticTanks.exe and GeneticTanks2.exe.
Ten robots are put into an arena. Each may face up, down, left or right, move forward, or fire its gun. A hit damages the target. When two robots are left they mate and repopulate the arena, each parent contributing 50% of the genetic code. Fitness is defined only as survival.
Each robot needs a 'mind' that can be passed to its children and evolve. The first approach was based on how humans perceive the world — a kind of spatial memory hologram. I gave each robot a 2D mind-map grid and placed objects into it, modelled on how I sense my own surroundings:
For each square, the robot holds six probabilities — one per action — totalling 100%. To decide, it picks a random action and a random number 0–100; if the number is below that action's probability it acts, otherwise it rolls again. A well-trained killer vs a poorly-evolved one, both facing a threat directly above:
| Face up | 50% |
| Face down | 0% |
| Face left | 0% |
| Face right | 0% |
| Move forward | 0% |
| Fire gun | 50% |
| Face up | 5% |
| Face down | 2% |
| Face left | 42% |
| Face right | 51% |
| Move forward | 5% |
| Fire gun | 20% |
The robots evolved for two weeks on a P166 at IBM Hursley (state of the art back then). The results surprised me.
Gen 0 — all random, shooting each other by accident.
Gen 500 — reasonable killers at point-blank range, useless at distance.
Gen 1000 — a second breed appeared: robots that fled at close range, dominating in bursts until
the killers wiped them out.
Gen 2000 — highly evolved killers and prey both dominant; the screen looked exciting.
Gen 2500 — the prey were becoming dominant. Odd.
Gen 3000 — killers had vanished entirely. A peaceful utopia: few deaths, long generations.
Gen 4000 — stupid robots creeping back; running away no longer mattered.
Gen 4500 — stupid random robots completely dominant.
Gen 5000 — good close-range killers re-emerging. Evolution had gone full circle — the utopia
de-evolved, its primitive sons wiping out the peaceful forefathers.
The precursors were primitive. The next generation rotated instead of facing four ways, and their brains became short programs controlling the left wheel, right wheel and gun in parallel — so a tank could turn, reverse and fire at once. Threats are read by quadrant around the tank's facing:
| Quadrant | L R F |
| 1 (ahead) | 0 0 1 |
| 2 | 1 0 1 |
| 3 | 1 −1 0 |
| 4 | −1 1 0 |
| 5 | −1 1 0 |
| 6 | −1 0 1 |
Choosing a quadrant by screen X/Y is easy until the tank faces another way — then a threat "ahead" and a threat "to the right" both look like quadrant 1. So targets are selected by angle: a normal projects from the tank's facing, checked against screen vertical to get the offset.


Run for a week, the tanks developed gun-turret characteristics: moving back and forth randomly while firing constantly at the nearest threat. Then a happy accident — because of how the minds worked, you could teach them. Let a human drive a robot, and instead of reading the relevant memory, write the human's responses to it: the baby robots quickly picked up the human's style of play, even inheriting personality — a tendency to turn left, or the instinct to run when damaged. I tried it while at EA, and it worked. Converting the same system from a robot to, say, outlining and counting human faces wouldn't be hard — I just wanted to see if it would work.