Genetic Algorithm used to build a car with the Box2D physics library.

Seba

DR. BIG FUCKER, PHD
aa
Jun 9, 2009
2,364
2,728
http://megaswf.com/serve/102223/ Shit's intense.

dQxta.png
 

Trotim

aa
Jul 14, 2009
1,195
1,045
Why does it always reset so quickly? I've seen many versions that could've gone on a lot longer but were simply reset due to a slight bump.
 

Jakkarra

L4: Comfortable Member
Aug 26, 2009
167
36
It seems to reset when the thing stops moving entirely for a moment.
 

Zhan

L5: Dapper Member
Dec 18, 2010
208
244
This is really neat, thanks for sharing the link. Did you write this yourself?
 

Seba

DR. BIG FUCKER, PHD
aa
Jun 9, 2009
2,364
2,728
Heh, I did not. Someone in chat posted it an hour or two ago.
 

nik

L12: Fabulous Member
Aug 14, 2009
987
564
so you're stealing their thunder?
 

Exist

L6: Sharp Member
Oct 31, 2009
306
136
Really erks me, flash designer with an iPhone, tricking blows I can't view my own animations with out converting them. Anyway, box2d is an easy library to work with in flash. Adobe created a program that converts the source code of a library (I think it supports C++, hAxE and someother can't remember.) to AS3. Box2D has a component based physics engine for the FlashIDE. This means, you can create a shape, define it as a component, pick it's properties, and it will automatically obtain physic attributes. You can also hinge oobjects together making it easy to create cars and such.

The game Fantastic Contraption uses Box2D, allowing for the very flexible gameplay experience.
 

Dr. ROCKZO

L8: Fancy Shmancy Member
Jul 25, 2009
580
159
These are what mine are looking like, and they work quite well, the spike keeps them from wheelie-ing, but jagged areas sort of stump them. I'll be interested to see what it develops to conquer that. I love this game.

ss20110124210102.png


EDIT: For a few generations it started to develop an annoying habit of getting stuck on the back wheel and stumbling through, it still worked but could have been so much faster. I guess it worked that out, because it's back to normal Dump Trucks now.

It'd be interesting to have the option to design our first car, and let it evolve from there, to see if evolution could make any improvements on what we decided to be perfection.
 

Ravidge

Grand Vizier
aa
May 14, 2008
1,544
2,818
I left it running while I was in school. It's on generation 64 and has not made any progress since gen 4.
It's still getting stuck in the same place. And anything it tries that could potentially get past that gets stuck on some earlier obstacle or flips over.

The area of doom:
SS-2011.01.26-15.52.50.png
 

Zhan

L5: Dapper Member
Dec 18, 2010
208
244
I guess Ravidge's have just been underachieving, several of mine from each generation are hitting the 220-230 range. Has anyone had one that passed 230 yet?

gacars.png


One thing that occured to me is that perhaps the problem with the selective pressures in this simulation that cause a species of cars to get stuck at one point and never evolve past it is that the track is the same every time. With a track that's randomized, the evolution of the cars would probably be more robust: able to handle a wider range of terrain instead of just selecting for cars that all fail at one point in the track. The downside with a randomized track would be, of course, that any significant evolution would take much longer since a good mutation that increases fitness would only produce a better result on some tracks.
 

A Boojum Snark

Toraipoddodezain Mazahabado
aa
Nov 2, 2007
4,775
7,669
The track just needs better generation code. Having it be the same each run would be fine if it didn't have segments that are virtually impossible to pass with the available components. My track (I'm not sure if the track is the same all the time, or generated new at each initialization of the app) had one point at 205 that was literally a /\/\ shape with all four angles at about 50 degrees, immediately after a big hill. So everything would either crash headfirst into the slope because it went fast down the hill, or get hung up on the peak when the first wheel passed.
 

drp

aa
Oct 25, 2007
2,273
2,628
leave it running. it will learn to fly to get passed those peaks
 

Whated

L2: Junior Member
Jul 23, 2010
89
26
Excuse me what does the mutation rate do? :S
 

Bermuda Cake

L9: Fashionable Member
Feb 20, 2009
679
480
how much variation there will be between cars - it's the same with genetic mutation in living things
Didn't realise I wasn't controlling the car until generation 3 :/