My name is Jean-Francois Gallant , aka Pyroevil. After getting some fun to code Molecular , I starting to playing with Neural Network and Genetic Algorithm. It’s my brother , a game developper , it’s give me this idea. I reading a lot about this and start some experiment. Coded and compiled with Cython in a fast C python extension. Here I want to share my progress and hope you have fun to watch little creature evolve by itself like me:
I’m curious, how are you deciding which traits propagate (Move on to next generation)
For example, maybe the traits of whichever creature walks farthest gets added to next generation.
I expect that evolution is the future of effective AI, for some game genres at least.
Not sure I understand you question but the way it’s work for the quatruped video:
More a creature go far , more points it’s get
4 ( or the numbers you want ) best creatures is keep for the next generation without modification (call elite members)
all others creatures of the next generation is made by crossover: Parent of the previous generation are randomly choose with “roulette wheel” game. More creatures have points , more you get chance to be choose and make childs togethers.
small amount childs of the next generation have chance of mutation: some chromosome is randomly regenerated.
With all this , if you give the rights inputs to your network, good crossover rate, good mutation rate and choose the good way to award them , it’s evolve and converge toward the solution you want.
I currently working on a biped sims too Videos coming when I get nice result of it.
Yes , cython make more easy to create compilated python module and it’s loaded has any other module you use with python. For genetic algorithm and neural network , my best website is http://www.ai-junkie.com/ A old but good website to learn the basic. Most of my code is base on this turorial.
In the tank video there is a plateau effect at generation 250 - why?
Because it’s reach the maximum of what they can do with it’s capacity. When you are learn a skill and you master it and most of time you make no errors , you reach a plateau. After 250 generation all tank master it’s skill to catch points and be equal.
That’s really amazing! I’ve been studying genetic algorithms lately. And they’re just too complicated! for me, creating a simulation like this was like, the furthest thing I can think of. Really great job!
Very cool stuff Jean-Francois! It reminds me of this guy http://www.strandbeest.com/
He did a similar thing making creatures that could walk (on the computer) and letting them evolve based on their performance. Now he’s creating them in real life
Really impressive. I take time to take a closer look on the thing. I think he don’t use neural network , only genetic algorythm to find the best configuration of it’s mechanics for it’s strandbeest. Really impressive. NASA use genetic algorythm to find the best configuration for a antenna to catch radiowaves if I remember ( see this on wikipedia I think ).
The library is really useful for me! I’ve already begane to understand it from the samples you’ve provided. Really appreciate your work!
Edit: after leaving the pacman test overnight now the pacmans tend to move in “groups”, this is amazing
Happy to hear that ! If you are be able to do somethings new with it , it’s will be appreciated to shared some video with us
I currently working on a bipped version. I make my network " recurrent" , I put “ouputs” in variables that I put back in “inputs” at the next iterations. It’s a kind of short-term memory. I get really better result with biped … but not with quadruped strangely. I not test it on others samples files I give on my website.
Long time without posting or making new video … sorry , too busy.
It upload a new video with a biped. This biped learn with a new type of neural network I did without modify the compiled code but only the python BGE code. I put the current tic (frame) outputs in the next tic (frame) intputs. This give a Jordan recurrent network type. That’s simulate a kind of short-term memory.