bullet – the megastructure development blog http://blog.megastructure.org tracking construction of megaprojects Sun, 23 Dec 2018 15:54:33 +0000 en-US hourly 1 https://wordpress.org/?v=5.0.2 Genetic Creatures http://blog.megastructure.org/2011/11/genetic-creatures/ http://blog.megastructure.org/2011/11/genetic-creatures/#comments Mon, 07 Nov 2011 20:22:31 +0000 http://blog.megastructure.org/?p=507 EDIT: fixed Dropbox link to sources & PDF. Thanks Mike!

As an elective course taken in order to fulfill requirements to complete my B.Sc., I took the course Introduction to Computational Physics, taught by Professor Karliner at Tel Aviv University. The course was a mash-up of many interesting computational techniques, most of which are used to perform approximations of physical systems.

The course included a short practical project chosen by the student. I decided to use a genetic algorithm to “breed” a kind of simulated life-form. The plan was elaborate, and I considered many complex ideas, but eventually stayed with the simplest creature I could come up with. It took form as a 3D box with four boxy “paddle” appendages. I used the Bullet physics engine, and I made the rest with C++ in Visual Studio.

Videos of the wild creatures in action after the jump.

Here is Generation Zero of a random batch:

After many unsuccessful attempts at tweaking the breeding algorithm, damping was added to the simulation, and the populations began to converge after only a few generations…

Afterwards, to up the ante, I changed the plane to accept different inclines. This demanded that the creatures climb up, instead of just in any arbitrary direction.

Finally, here is a video of the creatures reacting and adapting to an erroneous fitness function. This function mistakenly demands that the creatures go as far as possible to their right (roughly in the direction of the camera). This leads to some strange and lopsided behavior.

All the code and some binaries are available for download. You can also find a more formal writeup in .PDF format.

]]>
http://blog.megastructure.org/2011/11/genetic-creatures/feed/ 3