[ODE] My brainless virtual creatures

Darabos Daniel cyhawk at sch.bme.hu
Tue Apr 22 04:50:02 2003


Hi!

Pete, I've done something very similar last week, only in 2D. The sine
function approach worked well for me, although I used them to adjust the
restlength of strings (muscles). The natural extension to it seems to me
to add further Fourier components, this way the function will be able to
approximate any kind of periodic function. I've tried
sin(x)+sin(2x)+sin(4x), but seemed like the search space got too large,
and I found it best to settle with sin(x)+sin(2x). Also I don't have
offset as a gene, it is fixed at the starting restlength. My creature has
4 muscles, so phase and amplitude make it to 16 genes (2 for every sine
function), and I have one more gene that sets the frequency of the system
(the increment of x if you wish).
I'm very satisfied with how my creatures evolve. For recombination I
choose a random number (alpha) between -0.25 and 1.25 for every gene and
get the resulting gene as alpha*father[i]+(1.0-alpha)*mother[i], this
should be much better I think then the simple interchanging of genes.
Here's a video of a creature evolved while writing this email:

	http://home.sch.bme.hu/~cyhawk/bukta/example1.avi

It's from the 23rd generation. I also have a system of subpopulations,
that supposedly makes convergence more certain, but I'm not sure how
effective it is.
My fitness function is the distance travelled right. I stop the simulation
once the creature falls. This way they learn to walk without falling, but
I don't kill off the braver creatures that fall after a few steps.
One part I think I could improve on is selection. For every new individual
I randomly choose the parents from among the top-N individuals with
uniform distribution. If the distribution would respect the fitness
function in some more sophisticated way (like a roulette wheel method or
SUS) convergence would probably be faster.
(I've found this pdf by one of my professors quite helpful in these
matters:

	http://info.sch.bme.hu/targyak/autrobrsz/lantos_fuzzy1-2.pdf

Just skip the first half about fuzzy systems.)

And yesterday I replaced the sine based function with the neural network I
stole from Rob's code. I am giving it all kinds of input, but I don't see
any improvement over when I only told it whether or not the feet are on
the ground. Anyway I get much better results than with the sine function.
Although before I had only 17 genes and now I have around 200, convergence
is faster, the walking is more stable, and they can learn more difficult
tasks. Check out the creature climbing stairs:

	http://home.sch.bme.hu/~cyhawk/bukta/example2.avi

You can have my code if you're interested (but it's Java).

If you have any advice on how to make a more articulated and capable body
of strings, please share it with me :) This little cube guy has for
example a hard time getting on his feet after a fall.
Also I don't really know what more input could the NN make use of. For the
stairs problem for example I'm letting it know how far the next step is,
but I didn't see it get much smarter with it.

Oh, and I didn't have anything to do with ODE... I'm sorry, but I think
many of you enjoy watching virtual creatures anyway :)

Good luck,

Daniel