# Genetic Algoritihm used to build a car using the Box2D engine.



## SilverBehemoth (Jan 26, 2011)

This is a semi-interactive flash (Only thing interactive about it is changing the mutation rate percentage.)

http://megaswf.com/simple_serve/102223/


----------



## LizardKing (Jan 26, 2011)

Currently on generation 14. They started working around generation 5, and now most of them are at least have the wheels on the bottom.

It's quite fun to watch.


----------



## ~secret~ (Jan 26, 2011)

This is pretty cool. My guys made what looks like an F-1 racing car at gen 13.


----------



## CaptainCool (Jan 26, 2011)

oh cool... in generation 0 one of the cars was a tall tower on one wheel with the other wheel inside the main structure. it got very war because it was so top heavy and now the game decided to build all of them like that and nothing works anymore XD


----------



## Xenke (Jan 26, 2011)

All of my cars are based off some stupid incredibly front heavy design that keeps front-flipping whenever there's a big enough bump.

/sadface


----------



## LizardKing (Jan 26, 2011)

I'm up to generation 86. Around generation 70 there appears to have been a nuclear war and now the average distance is only 50% of what it was :c


----------



## Seas (Jan 26, 2011)

-get perfectly fine car
-upside down


----------



## SilverBehemoth (Jan 26, 2011)

Mine keep coming out retarded and attempts to drag themselves with one wheel...


----------



## LizardKing (Jan 26, 2011)

Oh well, time for bed. I might leave this running tomorrow in Chernobyl mode (100% mutation rate). It's been fun to watch.


----------



## Xenke (Jan 26, 2011)

Yea, totally restarted, with 10% mutation rate.

Shit's much better now, and no more ridiculously front heavy cars

At generation 7, non-retarded cars go about 150 units of distance.


----------



## Valence (Jan 26, 2011)

I was getting some good distance with my creatures.  Around gen. 15 or so, I slowly turned up the mutations from 5% to 21% at level 21.  Then more quickly from 21 to 35 to 49 and all the way up to 75, letting it run only one generation at 75%.  I found its good to have it spitting out either working cars or jumbled garbage as you're doing this.  After one gen at 75, I turned it down over about one or two gens back to 10%, and then back to 3%, and finally to 1% where I'm going to let it run all night.

At first, after turning the mutations back down, I thought I killed whatever good traits I managed to develop because one or two gens were nothing but pure garbage.  But sure enough, after another couple of generations, this was the result:







It started creating these things only, and they get to distances of 175 consistantly!  It seems they kept all the good traits, and all the bad traits got concentrated into the jumbled things that were coming out during the mutation and short duration afterward.  I'm very pleased with these creatures!  I'm going to let this run all night and see what improvements (if any) will be made to these running all night at a low mutation.


----------



## SilverBehemoth (Jan 27, 2011)

I decided to start all over again with my cars since the last batch was completely unsuccessful in getting into the 100+ area, The current batch though took at least until the 8th gen to reach 202, mostly because it started to either make cars like these, or attempted variations of cars with high arches mostly either big wheels or small wheels, which most of the time were bent in a way that it would be easy to roll over certain hills without flipping over...unfortunately that did not prove to always work due to most still managing to flip over or get caught at a very sharp ridge at 118, they were either to low or too high...

But after a while two generations of them managed to hit 212.5, though that didn't come without the vehicles either doing a flip in mid-air or getting caught between a wedge due to a very steep fall and a rounded out hill. I'll probably end up trying again tomorrow with a new batch.


----------



## LizardKing (Jan 27, 2011)

Hahaha.

Fun tip: Don't bother leaving it on 100%. It was generation after generation of total failures, even after 80 generations. Not particularly surprising in hindsight.


----------



## Xenke (Jan 27, 2011)

I've noticed something strange whenever I start off with the mutation at 0%.

It tries to make unicycles. :I

And now I have an armada of unicycles that all go 22.7. TIME FOR MUTATIONS.


----------



## LizardKing (Jan 27, 2011)

It only managed this by _flipping through 360 degrees_ at that bastard ditch at ~200.

Haven't seen anything beat that distance yet. At generation 57 most of them are getting past the hill at 100. Still a few non-starters though.


----------



## Xenke (Jan 27, 2011)

So, after mutations they figured out that a little decorative wheel on top of the vehicle is less efficient than actually having a second working wheel.

This is the design that goes the farthest. http://img51.imageshack.us/img51/8492/ughhk.png

It can't get up that hill thought because there are a series of momentum breaking bumps right before, and that hill is too steep for it to power itself over.

Needs more torques.


----------



## LizardKing (Jan 27, 2011)

They usually make it okay with slightly smaller wheels.


----------



## Xenke (Jan 27, 2011)

I wasn't watching an one of my cars went 270.8

Which means it got past the hill and the treacherous bump at the top of it.

OMG, just barely caught the tail-end of one getting to 276.3. Jesus it's nasty back there.


----------



## ~secret~ (Jan 27, 2011)

Someone make a competitive mode for multiplayer. We can fine tune the mutation rate to see who wins first. If you can win at all, that is.

Add a goal line.


----------



## Xenke (Jan 27, 2011)

It made a gnome car.





I win.


----------



## ~secret~ (Jan 27, 2011)

Xenke said:


> It made a gnome car.
> 
> 
> 
> ...


 
We shall see.

For I knows evolution >O>


----------



## LizardKing (Jan 27, 2011)

Xenke said:


> It made a gnome car.
> 
> 
> 
> ...


 
I have to admit, that is pretty fantastic.


----------



## sunandshadow (Jan 27, 2011)

There's no way to change the paramaters of this is there?  Like tell it to use 3 wheels and wait longer before rejecting individual 'cars'?


----------



## SilverBehemoth (Jan 27, 2011)

sunandshadow said:


> There's no way to change the paramaters of this is there?  Like tell it to use 3 wheels and wait longer before rejecting individual 'cars'?



Not directly, all you can do is experiment with adjusting the mutation rate between each generation.


----------

