Advertisement

A case for genetics?

Started by January 23, 2007 07:39 AM
5 comments, last by IADaveMark 17 years, 10 months ago
I've never done any work in the "cool" fields of neural nets or genetic algorithms, though I've read about them a reasonable amount. If I have an agent in a simple virtual world with easily quanitifiable measures of how well the agent is doing , and the agent's behaviour is controlled by several parameters, is this a good place to use genetics? As I understand it, the set of values for these parameters would be the 'gene'.
Don't confuse genetic algorithms with genes in humans. The analogy is misleading as people often think they need to encode some sort of lifecycle, with each agent carrying a set of genes which can then be carried forward. It's far simpler than that - genetic algorithms use a numerical method based somewhat on biological evolution to create potential solutions to a problem. It's essentially a kind of search method. There may not even be any notion of agents involved at all.

The question therefore becomes one of whether the problem you're trying to solve lends itself to the genetic algorithm search method. This depends on the nature of the search space (ie. how the values of how well the agent is doing are distributed, relative to the agent's behaviour) and how well you understand the problem. Usually, there are better ways to find good parameters for the situation, though GAs benefit from being quite simple to implement and usually good enough for the task in my experience.
Advertisement
Yes, at a core level you have a situation you could apply a GA. The two major components you spoke of - behavior based solely on parameters and a very quantifiable test to use for a fitness function - are really the only things you need. Oh... lots of time. It will take many generations of agents to filter down from random behavior to something that is optimized.

You can do it in two major ways. One, each gen is seperate. The game is over and you see who the best ones are - then after letting them procreate, you start a new game with new agents. Two, there is continuous birth and death in the game. As agents die, they are evaluated and placed into the "gene pool" if they measure up. If not, you discard them. Each birth, therefore, is hacked together from members of the "gene pool" as the agent is created. Either way will take a long time.

Also, if the agents are playing against each other only, they will take the other agents "sub-optimal" behavior early on into their own behavior. That is, they will be reacting unnaturally to the unnatural behavior. That's a good case for actually starting with reasonably pre-programmed agents that are at least not completely pathetic. It will save time getting to that point.

Dave Mark - President and Lead Designer of Intrinsic Algorithm LLC
Professional consultant on game AI, mathematical modeling, simulation modeling
Co-founder and 10 year advisor of the GDC AI Summit
Author of the book, Behavioral Mathematics for Game AI
Blogs I write:
IA News - What's happening at IA | IA on AI - AI news and notes | Post-Play'em - Observations on AI of games I play

"Reducing the world to mathematical equations!"

OK, that sounds promising. I can't discuss it any further as it's for a competition where collaboration isn't allowed - hence the general question about domain of genetic algorithms.

It's is a really cool programming contest hosted by www.topcoder.com. It's just coming up for the end of the first week (it's a two week contest but plenty of time left); this particular problem being essentially AI may interest members here. Look under the "Marathon matches->Active contests" menu option, the contest is "DiscetizedContinuousPacMan". If you register, can you put me as your referrer if you get the option - and post here. Anyone interested?
Think of a GA as nothing more than a randomized search with feedback.
i.e it saves me having to try EVERY combination of parameters, hopefully finding near optimal combinations?
Advertisement
Yeah, that's a decent way of putting it.

Dave Mark - President and Lead Designer of Intrinsic Algorithm LLC
Professional consultant on game AI, mathematical modeling, simulation modeling
Co-founder and 10 year advisor of the GDC AI Summit
Author of the book, Behavioral Mathematics for Game AI
Blogs I write:
IA News - What's happening at IA | IA on AI - AI news and notes | Post-Play'em - Observations on AI of games I play

"Reducing the world to mathematical equations!"

This topic is closed to new replies.

Advertisement