Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.


Genetic Algorithms help...

This topic is 5175 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

Hi there, Im studying Artificial Intelligence. I have a project where i am to create a strategy for a robot soccer player via a genetic algorithm. I am feeling kinda stuck on what to do for the following: - an effective fitness function; an easy one would be whether players win or not but i think thats not gonna be good enough - how to encode the chromosome - an effective cost function plus a lot of other stuff but that would be a good start. Any suggestions, or even suggestions of where i can get help would be most appreciated!! Cheers! Trace back the elements...

Share this post

Link to post
Share on other sites
For a fitness function I suppose it depends upon how complicated you want to get. I''d probably suggest something along the lines of a combination of the following factors: whether the robot can see the ball, the distance from the other players on the same team, distance from players on the opposing team.

Share this post

Link to post
Share on other sites
Length of time the ball is in the robot''s possession, Distance ball is kicked, Ability to hit a target, number of times a robot looses a challenge for ball possession?

Share this post

Link to post
Share on other sites
The cost needs to be a multiplication with the more important value having a greater multiplication value attached. i.e. if the accuracy of shooting is more important than ability to survive tackles give the cost of accuracy a higher mulitplication value. Of course you can then tailor the multiplication values for different sets of players. i.e. it is more important for a defender to be able to win tackles than shoot accurately, but the inverse for a striker.

I find that the easiest way to encode a genetic algorithm is to have numberic values that directly relate to performance. I suppose in this instance you could have encode a chromosome like this:


where the first three numbers reflect the players ability to
a: shoot accurately at goal
b: pass accurately
c: distance they can kick

second three are:
a: Ability to resist tackle
b: ability to tackle striker
c: ability to tackle defender


Of course you would have to link values so that a high accuracy at goal means that they have a low ability to resist tackles. Otherwise your players will make themselves out.

A possible cross between two chromosomes could therefore be:




Note the last value which has been lowered from 4 to 2 due to the fact that the first gene has a score of 4.

As if this wasn''t complicated enough don''t forget to include a mutation value, and you may want to look into elitism. If the population is small don''t use elitism and ramp up the mutation rate. For a large population lower the mutation rate and add elitism.



Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

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

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!