Lorenz Cuno Klopfenstein

Posts tagged "Genetic Algorithms"

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):

Genetic RTS: The base construction mode.
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...

Posted on Tuesday, September 22, 2009
4025 Views
44 comments posted

A couple of months ago I started a short series of blog posts about genetic algorithms, which I originally intended to develop quickly, but never found the time to do so. Finally, here's the next chapter.  :)

During my time at the Computer Science institute (ISTI) of the University of Urbino, immediately after my graduation, my friends Alessandro, Piervincenzo and I dedicated some time to find possible applications of genetic algorithms to video games. A field that of course we did (and still do) find very interesting. We spent some time coming up with prototypes and developing them - one of which, "Genetic RTS", you'll see in a future post - and our work culminated with a seminary at the university and a short paper published at SECEVitA 2007.

More...

Posted on Thursday, September 17, 2009
11770 Views
24 comments posted

Yesterday I posted about genetic algorithms. Now it's time to put a GA to use and solve a very simple problem: in this case, generating boolean logic gates until one of them behaves exactly like a logic XOR gate.

XOR truth table Boolean logic gates take one or more boolean values as input (in our case, value A and B) and return a single boolean response value. Their behavior can be expressed by a so called truth table: in XOR's case, the gate will return True if the two input values are different, while it will return False if both are true or both are false.

More...

Posted on Saturday, May 09, 2009
21572 Views
125 comments posted

Double helix by ?mrhappy? I decided to write a couple of posts about a topic I have been working on a couple of years ago and I still find very interesting: Genetic Algorithms.

Genetic Algorithms are very general methods, based on the same mechanisms the biological theory of evolution is built upon, that can be successfully applied to solve optimization or search problems, without having to resort to a well known solution or a fully described algorithm.

Very generally speaking, genetic algorithms can be seen as a form of heuristic that approximates a possible solution for a problem by improving it step by step. Evolution in biology depicts how a population of simple organisms eventually can evolve in functioning complex life forms, whereas genetic algorithms apply the same incremental approach to the solution of mathematically defined problems.

Genetic Algorithms can also be made to mimic intelligent behavior and can be seen as a form of Artificial Intelligence. Even if the algorithm's process is basically "dumb" (and blind), its emergent behavior in response to changes in input can be easily mistaken as "awareness" by a human user.

More...

Posted on Friday, May 08, 2009
4328 Views
1726 comments posted
Back to Klopfenstein.net
Clemens Klopfenstein Serena Kiefer Lukas Tiberio Klopfenstein Lorenz Cuno Klopfenstein
English German