top | item 2127367

Genetic Algorithm Car Physics

77 points| aerique | 15 years ago |reddit.com | reply

22 comments

order
[+] aikinai|15 years ago|reply
I think this might have been the original swf the Reddit one is based on: http://www.qubit.devisland.net/ga/index.html

I found this one years ago and have been meaning to try copying it one day myself to learn about genetic algorithms.

[+] sskates|15 years ago|reply
Lots of people on the Reddit thread are really into it: "It's heartbreaking when it spawns a totally sweet car, upside down." "my entire office is idle cheering nonentities on"

It's hard to imagine anyone getting as excited about the swf you just linked to.

It's interesting from a user experience perspective as the programs are doing almost the same thing.

There's the colorfulness of the one on Reddit, making the cars more personable. In contrast, the other program kills unsuccessful cars very quickly, without giving you time to think about why the car was unsuccessful/feel its pain. Also, the load bearing concept might be cool in theory, but I think it makes it more difficult for the viewer to process what's going on.

It's also interesting how both authors consciously chose to make their algorithms worse so that the program wouldn't converge to a solution as quickly.

[+] aerique|15 years ago|reply
Go for it! It's good fun & Friday, so lock yourself up and emerge victorious Monday morning.
[+] pavel|15 years ago|reply
It would be interesting to see how a car designed by a person would perform. Maybe make it a competition where two players design a car and then compete on some randomly generated terrain.
[+] stalf|15 years ago|reply
This is really great! After 5 generations, the algorithm gets the wheel positioning/size right. In a few more, it figures how the lower middle portion of the car should be.

I'm in the 9th and I've already seen it go past 150.

[+] jws|15 years ago|reply
Mine go further (230+) but I got a weird duncecap-like structure over the rear wheel that keeps cropping up, putting the center of gravity too far back and making them fall over backwards. Interestingly, instead of getting rid of the balance problem, my cars are evolving a wheely bar to prevent the backward flip at the expense of speed.

I wish the goal involved speed in combination with distance.

Update: stagnation after generation 10. I spun up another instance and it is amazing how different that one is evolving.

[+] iwwr|15 years ago|reply
Pretty slow, you need 20 or so generations to start getting interesting results.

Edit: after letting it run 30 generations, the best car went past 200.

[+] nervechannel|15 years ago|reply
That's not slow. In 20 generations, humans hardly change at all.
[+] Sephr|15 years ago|reply
I got one that went past 200 by the 3rd generation. You can't claim that you need any certain amount of generations before anything interesting happens, as the mutations are random.
[+] darkxanthos|15 years ago|reply
It can be very difficult watching someone fail a million different ways while they try to learn a new skill. ;)
[+] derwiki|15 years ago|reply
I hope it's keeping track of the results on the back end for each user that's doing this. In generation 20, I hit 400+ so mileage definitely varies.