Hacker News new | past | comments | ask | show | jobs | submit login
Genetic Algorithm Car Physics (reddit.com)
77 points by aerique on Jan 21, 2011 | hide | past | favorite | 22 comments



Why is this linking through Reddit? Link directly to the source: http://ycombinator.com/newsguidelines.html


Reddit is the source. equalRightsForRobots created it, and is writing about it in that post.


That is indeed why I linked through Reddit. I had pasted a direct link first in the submit form but changed my mind because the creator was commenting in the Reddit thread.


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.


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.


I think the reason behind this is struggle. The original killed cars as soon as they started struggling (the load hits the ground). The latest allows you to watch bad implementations struggle to traverse the landscape.

That's all. There's probably a deep lesson in there somewhere.


Go for it! It's good fun & Friday, so lock yourself up and emerge victorious Monday morning.


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.


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.


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.


You can also up the mutation rate to knock it out of a rut


I'm experimenting with 'intelligent mutations' - when the cars look promising I reduce the mutation rate and when it looks stuck in a rut I increase it again.


Very similar to an item from nearly two months ago:

http://news.ycombinator.com/item?id=1949947


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.


That's not slow. In 20 generations, humans hardly change at all.


If you take a population of humans, put them on an island, and only allow those that grow tall to breed, after 20 generations you will notice a huge difference in the average height of your population.

You might already be aware of this, but it is important not to confuse the slow mutation rate, with a slow response to selection pressure.

Nor is it appropriate to generalise that because the modern day selection pressures are mild, humans somehow evolve 'intrinsically' slowly.

The 'cars' are evolving fast, because those with a low fitness are ruthlessly culled. Human populations can change fast when comparably strong selection pressure is applied.


The 'cars' population is pretty small too. Generic algorithm needs large population to have a good result.


It plateaus around 195 distance after about 15 generations.


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.


It can be very difficult watching someone fail a million different ways while they try to learn a new skill. ;)


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.


Finally, a use for Web Snippets.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: