Last week’s developer discussion covered a controversial topic: the applicability of computational intelligence techniques in games, specifically neural networks. This week, the topic is genetic algorithms (GA) and evolutionary strategies.
Remember, you can win an AiGameDev.com T-Shirt for posting interesting comments this month! Click here to join in the discussion.
Evolutionary algorithms (EA) fall into the category of general optimization strategies, which can be used to find approximate solutions to problems given a measure of fitness. Approaches based on artificial evolution rarely perform as well as specific optimization techniques on known problems, but they tend to provide satisfactory solutions generally for reasonably-sized problems.
Modern game developers certainly uses specific optimization techniques heavily, in particular for character animation, evolutionary algorithms still haven’t found a regular place in the development process — including for game AI.
Are there simply too few problems in games for GA/EA to become widely applied?
Do you think applying GA/EA in game design and development requires a specific skillset?
Is the evolutionary approach less useful than specific optimization techniques that are already used?
Certainly, the independent game development scene seems less reluctant to apply EA/GA into gameplay and AI…
Be sure to contribute to the discussion by posting a comment below!









Comments
Comment on this article. | Show full forum thread.if any one can help with the understanding or coding of neural network of even point me to the relevant resources id be very grateful! lol
I think there are scenarios in games, certainly in the more complex games, where this sort of AI would certainly be beneficial and would result in much better gameplay. Im sure other gamers, like myself, have grown a little bored of the predictable AI that is produced using tradional FSM and the likes, although it has to be said that the tradional methods can be coded to cover just about any situation - which is probably why developers are reluctant to learn/introduce new unknown techniques.
True if these techniques are used in run-time they use much more resources than current techniques however the results would be very interesting - imagine an enemy that knows as much as you about the environment, and learns from its mistakes and from watching you + other npc play. At first it may keep running into your territory or put itself in your firing line but pretty soon it would learn not to and start avoiding such actions. I think this will pick up in the near future with the dual core cpu now fast becomming mainstream. Also as graphics cards are getting better there is less load on the cpu therby leaving more time to process the AI. Currently only 10% of available cpu time is used by the AI!!! if this was doubled imagine the results...
(its my first post - sorry about the length guys! )
naz
However, and this is the caveat with any such silver bullets: it takes knowledge and creativity to properly build one. I would suggest that people should read any of Richard Dawkin's books on evolution, in particular "The Blind Watchmaker".
Thanks to that book, I actually have an understanding of some of the processes of how evolution works, and its easy to see how to apply them to EA/GA.
The first issue is that evolution in nature is a slow process, but not necessarily continual. It may or may not work in fits and starts. And for GA/EA's to work, you need to make hundreds, thousands of them, have them "compete" which is on the order of O(n) at least.
As well, multiple iterations of the same GA/EA will not produce the same solution due to the random mutation factor. Unless of course you seed your rng with a known number. ;)
Then there is the actual design of the dna strand. Do you make it so that there is a specific range and function for each "gene"? Or do you make it more deterministic? Those are both valid questions, with their own degree of difficulty and effort required.
In my view, GA/EA are an inefficient means by which to produce an AI due to their unpredictability, general lack of surprising changes, and difficulty to make a good GA/EA. For indie game devs, its simply too much effort, for too little of a result.
Another problem that i see could arise from using such systems is that they can be susceptible to miss-training. Allowing users to cheat :P so care must be taken when deciding what to assimilate and what not to.
Speed is not such a problem with todays technology, new gfx cards coming up, dual core processors, the universal shader model etc, soon (if not already) there will be enough CPU cycles to spare in the AI systems.
Implementation isn't a problem ether since there are tons of free open source AI toolkits around the net for people to play with. That of course if you are lazy or cant be bothered to make your own.
I think for now a solution could be to some sort of experts system like Bayesian networks based on probabilistic data (not too hard to implement). That way you could allow each monster to have a specific behavior within his life time according to his own experiences (players he has fought etc.) and still have some control over the monsters reactions etc. Over time the seeds for the network could evolve based on gathered data.
Id like to hear what you guys think.
But if it was in real-time, that would be ignoring the whole 'evolution' foundation of these methods. In a way, they are MEANT to take long in real life (forgetting modern genetics research for the moment).
I think that there are several very worthwhile offline uses for Evolutionary Algorithms in games, namely in terms of procedural content generation during loading periods between levels.
For example: evolving a population of enemies or other characters (represented in terms of specific 'personality'/emotional traits, physical features, behavioural characteristics, etc).
Although the basic models may be limited and pre-built to a large degree, you could use EAs to create a wide range of different 'masks' for these models.
I have also read a recent article that used EAs to evolve soccer strategies for AI opponents: http://www.gamasutra.com/view/feature/1901/using_genetic_programming_to_.php?page=3
So there is definitely a place of GAs in game development, particularly where there are no known optimal solutions to a particular problem.
And, contrary to some comments, I think it could be very useful in games, as we can see in Nero: http://nn.cs.utexas.edu/NERO/about.html
It's a kind of RTS game where the units evolve in real-time using genetic algorithms (combined with neural networks, resulting in the NEAT approach).
Again, agreeing with Walker, I think that evolving monsters in MMOG's would be very cool (both AI and appearance), and I have already a project on it.
Another approach would be to evolve entire stages/maps. The more difficult is it to the player to complete the stage -> more fitness it has (it's a form of competitive coevolution). So the difficult level would grow naturally.
The project is 8 years old and abandoned, but the website is still up. It's pretty fun to tinker with the values and try to get a really killer bot AI working with it. I've played with this thing alot and only ever got 2 AI's that really gave me a run for my money out of hundreds of attempts of letting them evolve 20-100 thousand generations. My best results came when I broke down and learned the Q2 coding to edit how the inputs are entered by the game.
Here's a link to the site
http://homepages.paradise.net.nz/nickamy/neuralbot/nb_about.htm
Possibilities are endless ...
D?afar Sadik