DonationCoder.com Forum

Main Area and Open Discussion => Living Room => Topic started by: worstje on January 28, 2011, 09:43 AM

Title: Darwinism + geneticism + two-wheeled vehicles = ... awesomeness.
Post by: worstje on January 28, 2011, 09:43 AM
No clue what it is called but it is awesome. (http://megaswf.com/serve/102223/)

Just open it and let it run for as long as possible. Survival of the fittest will determine which cars survive. Lower the mutation rate to try more variations of successful cars from the previous generation, and crank it up to get some fresh mutations that are totally wacko. :)

It's surprising how awesome it is to just watch that thing crank out weird contraptions.

Edit: I can't remember where I found this link. I hope I didn't find it on DoCo or DoCo's IRC... if I did, I'm sorry for (double)posting someone elses find. :-[
Title: Re: Darwinism + geneticism + two-wheeled vehicles = ... awesomeness.
Post by: f0dder on January 28, 2011, 09:58 AM
It looks fun, but what's the parameter used to determine when a new car is generated?

Every contraption I've seen so far seems to "survive" for a mere couple of seconds :( - IMHO the stopping parameter should be "hasn't moved for n seconds", whereas it seems to currently be pretty much random.
Title: Re: Darwinism + geneticism + two-wheeled vehicles = ... awesomeness.
Post by: mouser on January 28, 2011, 10:08 AM
Love it -- great find.

For those who aren't familiar with this kind of work, check out Genetic Algorithm (http://en.wikipedia.org/wiki/Genetic_algorithm) or Genetic Programming (http://en.wikipedia.org/wiki/Genetic_Programming) research.
Title: Re: Darwinism + geneticism + two-wheeled vehicles = ... awesomeness.
Post by: worstje on January 28, 2011, 10:15 AM
Yeah, I agree, it restarts way quicker than it ought to imo. It seems to have to do with movement being around 0 and a part of the chassis touching the ground. Sadly I don't think you can change it. :(

Wait a couple of generations, till 5 or so, then you start to see actual progress being made.
Title: Re: Darwinism + geneticism + two-wheeled vehicles = ... awesomeness.
Post by: nudone on January 28, 2011, 10:26 AM
ooh, i like this. but, i agree. the little beasts are being exterminated too quickly.
Title: Re: Darwinism + geneticism + two-wheeled vehicles = ... awesomeness.
Post by: timns on January 28, 2011, 10:32 AM
Now if only the graphics were provided by nudone - an instant CT crossover :)
Title: Re: Darwinism + geneticism + two-wheeled vehicles = ... awesomeness.
Post by: timns on January 28, 2011, 10:39 AM
What sort of scores are people getting? I just had a lively little beach buggy score 166.9 in generation 4...
Title: Re: Darwinism + geneticism + two-wheeled vehicles = ... awesomeness.
Post by: timns on January 28, 2011, 10:54 AM
It looks fun, but what's the parameter used to determine when a new car is generated?

Every contraption I've seen so far seems to "survive" for a mere couple of seconds :( - IMHO the stopping parameter should be "hasn't moved for n seconds", whereas it seems to currently be pretty much random.

I think this is simply due to the physics engine running very quickly. Looking on my system, it's evaluating at around 500 fps, so the algorithm is looking well ahead of the graphics and simply knows the moment it's time to cull this machine while the animation is catching up.
Title: Re: Darwinism + geneticism + two-wheeled vehicles = ... awesomeness.
Post by: worstje on January 28, 2011, 11:23 AM
Scores are pretty meaningless, as everyone gets a random terrain. My terrain is an absolute pain - I ought to restart but I'm just curious to see if it ever passes its old record. :)
Title: Re: Darwinism + geneticism + two-wheeled vehicles = ... awesomeness.
Post by: timns on January 28, 2011, 11:26 AM
Scores are pretty meaningless, as everyone gets a random terrain. My terrain is an absolute pain - I ought to restart but I'm just curious to see if it ever passes its old record. :)

Oh damn, so what's the point of that? There's a lot of potential for a "game" like this to become more competitive: one challenge, who can breed the best machine to stay the course?
Title: Re: Darwinism + geneticism + two-wheeled vehicles = ... awesomeness.
Post by: CWuestefeld on January 28, 2011, 11:33 AM
I was playing with this last weekend. I tried three times, for at least 8-10 hours each, and never was able to evolve something that could get past around 213.
Title: Re: Darwinism + geneticism + two-wheeled vehicles = ... awesomeness.
Post by: nudone on January 28, 2011, 11:56 AM
lots of potential, and spin-offs. you should put it together Tim  :Thmbsup:
Title: Re: Darwinism + geneticism + two-wheeled vehicles = ... awesomeness.
Post by: timns on January 28, 2011, 12:00 PM
I would love to do something like that sometime! I need to retire and dedicate myself to faffing about with fun coding projects. And weird websites.
Title: Re: Darwinism + geneticism + two-wheeled vehicles = ... awesomeness.
Post by: Deozaan on January 28, 2011, 12:38 PM
It looks fun, but what's the parameter used to determine when a new car is generated?

Every contraption I've seen so far seems to "survive" for a mere couple of seconds :( - IMHO the stopping parameter should be "hasn't moved for n seconds", whereas it seems to currently be pretty much random.

It seems to progressively last longer depending on how the previous generation scored. It seems the number in parentheses is the "goal" score. If the motorcycle reaches that score, it will consider it a success and generate a new one. At first the goal is really small because it's so random that it's probably not very helpful to allow one to go a long distance. That is, in the beginning, quantity is much more important than quality to help narrow down the mutations. I've charted what I think the UI represents in a screenshot:

[ You are not allowed to view attachments ]

The graph at the top appears to be as follows: The red line appears to be the goal (target) score and the black line appears to be the average score for that generation. Depending on how well each generation does, the goal score goes up or down to help improve each iteration. If no motorcycles reach (abot 50% of the) goal score, it will be lower next time so that it can iterate through more mutations faster.

EDIT: The above is all just a guess based on my observations. I could be wrong about any or all of it. :D

I was playing with this last weekend. I tried three times, for at least 8-10 hours each, and never was able to evolve something that could get past around 213.

I've had it running for about 20 minutes and I've already beat that. I wish it would display the best score somewhere on the UI...

Oh damn, so what's the point of that? There's a lot of potential for a "game" like this to become more competitive: one challenge, who can breed the best machine to stay the course?

Yeah, that would be awesome. I've had similar ideas while watching this thing go for a while.  :D
Title: Re: Darwinism + geneticism + two-wheeled vehicles = ... awesomeness.
Post by: nudone on January 28, 2011, 01:00 PM
i think i've been staring at it for too long as it keeps making me laugh when some of the mutations do back-flips and things.
Title: Re: Darwinism + geneticism + two-wheeled vehicles = ... awesomeness.
Post by: timns on January 28, 2011, 01:07 PM
Hey, my score just went down from 340-ish back to 230! I've devolving! Help meeee...
Title: Re: Darwinism + geneticism + two-wheeled vehicles = ... awesomeness.
Post by: Deozaan on January 28, 2011, 01:09 PM
Hey, my score just went down from 340-ish back to 230! I've devolving! Help meeee...

That's not your score. That's the "goal" or "target" score. See my post above for what I mean. :)
Title: Re: Darwinism + geneticism + two-wheeled vehicles = ... awesomeness.
Post by: nudone on January 28, 2011, 01:13 PM
It reminds me of watching those people that make their own (stupid) gliders and then throw the self of the end of piers. You hope that each one will get a bit further, or even fly, each time. But they always just flop right down into the sea.

edit:

maybe that would make a nice game: evolve your "cart", get it to race down a bumpy track and then at the end it fall of the track and you see how far it flies. well, not flies, just drops into oblivion.
Title: Re: Darwinism + geneticism + two-wheeled vehicles = ... awesomeness.
Post by: timns on January 28, 2011, 01:13 PM
This reminds me of those old black-and-white movies you see of inventors rolling out their ridiculous-looking planes with about 20 wings that collapse as soon as the engine starts, set to jaunty music.

edit: @nudone: ooh, synchronicity!
Title: Re: Darwinism + geneticism + two-wheeled vehicles = ... awesomeness.
Post by: nudone on January 28, 2011, 01:16 PM
This reminds me of those old black-and-white movies you see of inventors rolling out their ridiculous-looking planes with about 20 wings that collapse as soon as the engine starts, set to jaunty music.

that's pretty much what i was getting at. you should still make it. make it like that.
Title: Re: Darwinism + geneticism + two-wheeled vehicles = ... awesomeness.
Post by: CWuestefeld on January 28, 2011, 01:31 PM
@Deozaan - I'm pretty sure that your guess about "goal" score is incorrect. That's just not how genetic algorithms work. You can't pre-set an expected fitness level. The best you can do is to take the best specimens from the generation whatever they are.

It appears that in this implementation, brand new specimens are ONLY generated at generation 0. Thereafter, everything comes from either

I believe that the graph's two curves show (a) the best specimen of the generation in red, and (b) the average specimen in the generation.

That said, I've got no idea what that parenthetic value really does mean. But it regularly shows an absurdly high value -- far higher than any of my cars have ever reached. And in the succeeding generation, it is *not* the case that my cars that all scored lower than this are discarded. They continue to evolve (generally) forward, using the rules I listed.
Title: Re: Darwinism + geneticism + two-wheeled vehicles = ... awesomeness.
Post by: Daleus on January 28, 2011, 01:40 PM
Okay, stoppit!

I'm at work and was just mezmerized for 30 minutes.

grumble grumble...eye candy...grumble
Title: Re: Darwinism + geneticism + two-wheeled vehicles = ... awesomeness.
Post by: Stoic Joker on January 28, 2011, 01:43 PM
^^^ I'll 2nd That! ^^^

Mutating Motorcycle Mayhem? ...I have got to play with this when I get home - There goes Friday night...

 :D
Title: Re: Darwinism + geneticism + two-wheeled vehicles = ... awesomeness.
Post by: Deozaan on January 28, 2011, 01:47 PM
That said, I've got no idea what that parenthetic value really does mean. But it regularly shows an absurdly high value -- far higher than any of my cars have ever reached. And in the succeeding generation, it is *not* the case that my cars that all scored lower than this are discarded. They continue to evolve (generally) forward, using the rules I listed.

I think you're right about everything, except that I think my "goal" score idea is correct. I just might not be very clear in my description of what a "goal" score is. Let me try to clarify:

Basically, if a motorcycle reaches the "goal" score, it doesn't bother simulating it any further and just moves on to the next mutation. Thus, it has reached its "goal" and is considered the cream of the crop for its particular generation.

Ideally the algorithm should favor those motorcycles which scored the highest, but there's really no way of knowing how exactly a vehicle that reaches the goal affects the next generation compared to the others that don't.

What I do know is that when none of the vehicles get close to the "goal" score, then the number goes down. But if just one makes it or gets about half way, it goes up (doubles?).
Title: Re: Darwinism + geneticism + two-wheeled vehicles = ... awesomeness.
Post by: Deozaan on January 28, 2011, 04:05 PM
I've been watching for a while now and it appears to me as though the number in parentheses is twice the previous generation's highest score.
Title: Re: Darwinism + geneticism + two-wheeled vehicles = ... awesomeness.
Post by: Eóin on January 28, 2011, 05:46 PM
Saw this link on Reddit, apparently it's the latest version http://www.boxcar2d.com/.
Title: Re: Darwinism + geneticism + two-wheeled vehicles = ... awesomeness.
Post by: timns on January 28, 2011, 06:11 PM
On that new version I keep getting cars with no wheels at all!  :mad:
Title: Re: Darwinism + geneticism + two-wheeled vehicles = ... awesomeness.
Post by: Stoic Joker on January 28, 2011, 06:27 PM
I've been watching for a while now and it appears to me as though the number in parentheses is twice the previous generation's highest score.

I'm with you on the "goal" theory. It seems that the expectations for the current generation are based on the achievements (/aspirations) of the previous generation.

It's also interesting to watch how the mutations follow a pattern as they try to "learn" their surroundings.

A backward flip over (early gens) results in either wheels on top or a forward weight bias.

Forward flips result in more centered weight distribution.

High centering gets a shorter wheel base.

etc, etc.

Title: Re: Darwinism + geneticism + two-wheeled vehicles = ... awesomeness.
Post by: worstje on January 28, 2011, 07:09 PM
I like the new version. I'm running it non-stop with the 8-wheels-max setting - it is hilarious.

I am annoyed through that only some of the wheels seem to be 'powered'. Some touch the ground at times but don't propel it at all, making me slide back down on ramps after a few amusing flips. :(
Title: Re: Darwinism + geneticism + two-wheeled vehicles = ... awesomeness.
Post by: Stoic Joker on January 28, 2011, 07:23 PM
I like the new version. I'm running it non-stop with the 8-wheels-max setting - it is hilarious.

Oh yeah, that's insane!  :D
Title: Re: Darwinism + geneticism + two-wheeled vehicles = ... awesomeness.
Post by: timns on January 28, 2011, 07:24 PM
I like the new version. I'm running it non-stop with the 8-wheels-max setting - it is hilarious.

I am annoyed through that only some of the wheels seem to be 'powered'. Some touch the ground at times but don't propel it at all, making me slide back down on ramps after a few amusing flips. :(

Every time that happens, in my mind I hear the muted trumpet of disappointment: wah-wah-waaaahhh
Title: Re: Darwinism + geneticism + two-wheeled vehicles = ... awesomeness.
Post by: Deozaan on January 28, 2011, 09:08 PM
This seems to make a great case for Intelligent Design. ;) I'm sure after a few minutes of manually tweaking I could get my motorcycle to fare a lot better than it's doing after hours of evolutionary genetic mutations. :P
Title: Re: Darwinism + geneticism + two-wheeled vehicles = ... awesomeness.
Post by: Eóin on January 28, 2011, 11:27 PM
True, but could you design a better motorcycle than one resulting from 1 million+ years of evolving 8)
Title: Re: Darwinism + geneticism + two-wheeled vehicles = ... awesomeness.
Post by: Deozaan on January 29, 2011, 06:56 AM
True, but could you design a better motorcycle than one resulting from 1 million+ years of evolving 8)

Show me a motorcycle that's been evolving for 1+ million years and I'll let you know. :P
Title: Re: Darwinism + geneticism + two-wheeled vehicles = ... awesomeness.
Post by: Eóin on January 29, 2011, 08:59 AM
I am annoyed through that only some of the wheels seem to be 'powered'. Some touch the ground at times but don't propel it at all, making me slide back down on ramps after a few amusing flips. :(

To me it does seem all the wheels are powered, but inertia, friction, gravity, etc mean some times a wheel doesn't seem to cut for a slope. Personally I'd like to see them being given more time to recover after sliding back down a hill. I've seen a few look like they were about to start motoring up the hill but a killed off because the inertia from the previous slide down it still lingered just a bit.

I imagine though the author was careful to avoid any loops where a car never actually progressed, but also never got killed off.
Title: Re: Darwinism + geneticism + two-wheeled vehicles = ... awesomeness.
Post by: AndyM on February 01, 2011, 10:17 PM
I think the angle of the shock absorbers makes a difference.
Title: Re: Darwinism + geneticism +walkers = The Walking Zed!
Post by: Deozaan on February 11, 2015, 01:36 AM
NECRO THREAD, ARISE FROM YOUR GRAVE!

I recently came across this, from the same guy who did the first one.

[ You are not allowed to view attachments ]
Genetic Algorithm Walkers (http://rednuht.org/genetic_walkers/)

How is the score calculated?
In order to promote upright walking, each creature receives points based on how high the head is in relation to its feet, and how much it advances while upright. Bonus points are given for each proper step forward.

I don't find it nearly as fun to watch as the genetic cars (http://rednuht.org/genetic_cars_2/), but it's still pretty spiffy.

As an aside, after playing around with the Genetic Cars again, I was unsatisfied with how some things worked. I saw that the source was available, so I've been referring to it to make something similar in Unity. Here are some screenshots of my progress (click to embiggen):

Here's one of my earliest screenshots after getting the basic (though still somewhat incomplete) car generation working:

[ You are not allowed to view attachments ]

Here's one that wins the award for BEST PROCEDURALLY CREATED CAR EVAR!!!!111:

[ You are not allowed to view attachments ]

And here's a rather sporty little car that was doing great compared to its peers, but my timing on the screenshot was poor. It's doing a little nosedive after coming down off a hill:

[ You are not allowed to view attachments ]
Title: Re: Darwinism + geneticism + two-wheeled vehicles = ... awesomeness.
Post by: mouser on February 11, 2015, 04:50 AM
As an aside, after playing around with the Genetic Cars again, I was unsatisfied with how some things worked. I saw that the source was available, so I've been referring to it to make something similar in Unity.

Fantastic!  There are few things as enjoyable as writing code that surprises you, and these kinds of experiments can be so enjoyable.
Title: Re: Darwinism + geneticism + two-wheeled vehicles = ... awesomeness.
Post by: cranioscopical on February 11, 2015, 01:05 PM
There are few things as enjoyable as writing code that surprises you
When Last did you do so?  ;)