Jump to content
  • Advertisement
Sign in to follow this  
Bailey

Genetic Programming.....Help, tips & tricks

This topic is 4075 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I am a 2nd year student and I am comming to the end of my second year in games dev. For my 3rd year project I have decided to make a game that uses geneitic algorithms for the A.I. I have so far done a litriture survey on the subject, but i was wondering if any of you had any tips aboout genetic algorithms. For example, is there one programming language better than another for this sort of thing, any good books or links. Basically im mainly looking for a starting point. From my understaning it is a set of programs which evolve each generation by using the fitness level and then recreating a number of the programs using mutation/crossover/reproduction.

Share this post


Link to post
Share on other sites
Advertisement
For my final year project I chose "Computational Evolution". We were given complete freedom to design our project around this concept.

Our program simulated artificial creatures with a simple genetic make up comprising of 5 factors that controlled their behaviour. The creatures lived in a simple, flat, world where food was spread out and would slowly grow if it wasn't being eaten.

In the end we explored a range of things in our write-up such as the emergence of stable populations, catastrophic events (such as them going on a feeding frenzy then starving themselves off, emergent behaviour etc...

This isn't quite the same as a normal genetic algorithm however there are similarities. When the population stabilised on a certain gene they had effectively found a solution to exist in the environment. I guess this is what your AI enemies would want to do as well although their lives may be considerably shorter.

Consider a set of parameters that define their behaviour. It could range from the simple such as wait 50% time, hunt 50% time and all variations, to a series of events (wait for 5 seconds, scan area, move to high ground, wait 5 seconds, move on to next area), to the extreme where you evolve a basic program that hooks in to inputs and outputs to control them.

In terms of language I'd write it in whatever you comfortable in. It's not incredibly tricky to implement these kind of things in any language unless you're going down the very complicated route and seeing as you're just starting out here I doubt that.

Also check out AI-Depot

Share this post


Link to post
Share on other sites
Cheers for the reply, that sounds like a very interesting project u did by the way. I am going to be doing it in c++ as this is the language ive used most of the way through my course, At least i know that i wont have to learn another language before i start the project.

Again thanks for the input

Share this post


Link to post
Share on other sites
Make sure to distinguish between "genetic algorithms" (a class of stochastic optimization algorithms) and "genetic programming" (the use of genetic algorithms to optimize code). You seem to be using the terms interchangeably, but a lot of the GA stuff isn't relevant to GP, and there's a fair amount of GP-specific stuff to know.

Share this post


Link to post
Share on other sites
Oh thanks i didnt know that, that clears a lot of things up. I'm looking at genetic algorithms, incase anyone else has any input

Share this post


Link to post
Share on other sites
You might want to check this out: http://www.spiderland.org/

I haven't had a chance to try it out myself yet, but it does look interesting.

Share this post


Link to post
Share on other sites
Genetic Algorithms are merely an optimisation method for blind search problems: that is, search problems where you only have objective function evaluations at distinct points available and no information about the actual surface (so you cannot estimate gradients).

If your project is to investigate GAs and their potential application in games, then focus on the GA first and consider what it offers you. Then ask yourself if and how this might be useful in a game. Of course, this is NOT the right way to go about making better games (starting with a hammer and looking for a nail to hit... everything looks like a nail), but you're doing a project, not making a top-selling title, so you get to create a game environment that IS appropriate for a GA. So what would that be like? Well, anything that requires optimisation. The common application of optimising bot controllers is not, in my opinion, a good use of GAs. There are better tools for such a simple job. However, optimising control parameters for an artificial economy would be an excellent application of a GA.

Alternatively, you could take a completely different perspective. How about GAs as part of the game design process. Take a single level for a game (side-scroller, FPS, dungeon in an RPG, etc.) and encode the design features in a GA population. For example, the number and connectivity of rooms in an FPS along with numbers and types of bots, placement of bonuses, etc. Have a number of people play a set of levels and rate each for its quality over a variety of measures (say 'fun', 'challenge', etc). Then apply a GA to the population of initial levels and try and evolve better levels. Your final report could include some analysis of what makes a good level for your test group!

Cheers,

Timkin

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!