

Genetic Algorithm Used to Build Car With Box2D - solipsist
http://megaswf.com/serve/102223/

======
aothman
Cool demo, but from a practical perspective there's absolutely no reason to
use GAs to solve a non-linear optimization problem. I know people like them
because they have a really pleasing and intuitive backstory, but as a grad
student in AI I can tell you that they suck at actually solving anything.
Mostly this is due to the fact that GAs take what is already a difficult, non-
linear problem (the problem you're trying to solve) and immediately,
explosively, complicate it (what's your mutation rate? what are the
chromosomes? how are crossovers handled? how are you deciding the answers to
these questions?)

~~~
Vivtek
Didn't I read relatively recently about a patent filed on something discovered
using a GA? Maybe for lens design?

~~~
stipes
I believe Koza has several patents for things he has discovered using Genetic
Programming / Algorithm techniques.

------
reitzensteinm
I recently built a game with similar mechanics
(<http://www.bigblockgames.com/games/goblin/>), and this is basically what my
first day of development looked like, just sped up between takes.

Except at least this doesn't create many cars unstable enough that the
structure starts oscillating before shooting off to infinity. So I guess GA 1,
Michael 0.

~~~
Vivtek
I don't normally get into video games, but dear Lord I like that one.

~~~
reitzensteinm
Cheers dude :)

Our philosophy is basically to make flash games that don't suck! Goblin seems
to have gotten quite a bit of attention over the past 72 hours or so.

~~~
aerique
Sorry for the perhaps silly question, but do you make money off it and if so:
how?

I'm asking because I've been on an iPhone since this was posted and won't have
access to a real machine until tomorrow so I cannot check the game out.

~~~
reitzensteinm
Currently, it just attracts people to the site (which it's done in a pretty
extreme way). We'll probably follow it up with a level pack that's for sale,
though.

In other words, we lose a little on each hit, and make up for it with volume!

~~~
aerique
Thanks for the answer!

------
solipsist
I've let it run for 10 generations in the background, and keep coming back to
be entertained. It's fun to see the cars tackle the course. I've already
gotten attached to a few of them - I cheer them on when they make it over a
hill and cry with despair when they don't. =)

Here is one car that I got in generation 10: <http://i.imgur.com/J0kdV.png>

It didn't do too well, but it reminded me of a [update] _penny-farthing_. This
should be familiar to people living in Palo Alto:
[http://www.paloaltoonline.com/news/show_story.php?id=11781%3...](http://www.paloaltoonline.com/news/show_story.php?id=11781%3Cbr%20/%3E)

~~~
templaedhel
I let it run overnight, getting up to 60 generations. I cannot tell if the
cars are actually improving that much, but the graph says they are. I saw one
get to 245, but I missed that screenshot. Unfortunately a lot of the good cars
spawn with their wheels upside down, or rotated, I wonder if spawn orientation
is evolving along with the car. It would appear not. Here is the best car of
the 62 gen.

<http://i.imgur.com/H1Rrw.png>

~~~
solipsist
I did that too and got it up to the 114th generation. Unfortunately, the car
has gotten stuck and the game seems to be going nowhere. So I'll never see the
115th generation...

<http://i.imgur.com/bAnmY.png>

------
solipsist
1st generation

    
    
      #0  : 6
      #1  : 1.7
      #2  : 0.5
      #3  : 0.4
      #4  : 0.9
      #5  : 0
      #6  : 2.6
      #7  : 0
      #8  : 0
      #9  : 0
      #10 : 0.4
      #11 : 6.1
      #12 : 0.2
      #13 : 0.7
      #14 : 1.7
      #15 : 0
      #16 : 0
      #17 : 1.4
      #18 : 0
      #19 : 1.3
    
      Average : 1.2
    
      One of the cars from generation 43: http://i.imgur.com/95QvW.png
    

43rd generation (after hours of waiting!)

    
    
      #0  : 146.3
      #1  : 211.6
      #2  : 237
      #3  : 235.8
      #4  : 0
      #5  : 128.4
      #6  : 0
      #7  : 0
      #8  : 204.4
      #9  : 137.7
      #10 : 85.9
      #11 : 208
      #12 : 211.1
      #13 : 36.3
      #14 : 0
      #15 : 202.8
      #16 : 247
      #17 : 239
      #18 : 230.2
      #19 : 139.5
    
      Average : 145.1
    
      One of the cars from generation 43: http://i.imgur.com/WZtZq.png
    

Now that's what I call _evolution_!

------
RevRal
Might enjoy this: <http://www.youtube.com/watch?v=mcAq9bmCeR0> .

~~~
Vivtek
I've seen that before - there doesn't seem to be anywhere that you can see his
code, especially his selection function. I'd find that pretty interesting.

------
sorbus
Link to the Reddit discussion: <http://news.ycombinator.com/item?id=2127367>

------
mambodog
I previously submitted this similar (old) demo:
<http://www.qubit.devisland.net/ga/>

~~~
huherto
This was very nice. I remember this, we spend a lot of time just watching it.

------
keyle
That's so funny I spilled my coffee.

