In the previous post I wrote about the problems of adapting a genetic algorithm to work inside the constraints of a video game. In some cases it is possible, and quite easy, to reshape and reduce the "problem" at hand in order for the GA to be able to solve it and pretend to be an intelligent adversary.
During our tests at Urbino we built a couple of prototypes, one of which is Genetic RTS (yep, I know, not the most creative of titles
). It's essentially a simplified "Defense Grid" game where the player must build up the defense of his base while the computer attacks it and tries to overcome the defensive structures.
The game
Genetic RTS is limited to a little square terrain with the player's base at its center. At the start of the game, the player can place a certain number of defensive structures around the base (in the blue area):

The game terrain. Marked in blue, the area where defensive units can be placed.
You'll notice the base graphics are
stolentaken directly from "Dune II".

There are two different defensive structures: cannons, which shoot quickly but cannot target airplanes, and anti-air rockets, which are slower but of course only target planes. Each defensive tower has a limited range and a limited rate of fire, but never misses the enemy.
The objective of the computer is to destroy the player's base (which has 20 "health" points) by trying to get its units to touch the base (each hit costs one health point). When the base reaches 0 points the player loses. The player's goal instead is to place his defenses correctly and resist to the attack waves as long as he can.
The computer can generate a certain number of units, that will start on the edge of the map and then move towards the base. A unit can be either a land unit (a tank) or a flying unit (an airplane): each unit will be shot at by the corresponding defense tower type and not by the other. Moreover, each single unit can choose its "toughness" (the number of hits required to destroy it). A tougher unit will also be slower, so there's a trade-off to find, based on the number of defensive towers and their rate of fire.
More...