Explanation
This is a modification of
this original page by
this guy (thanks!!) ...which is in turn based on
BoxCar2D.
"Cars" are randomly generated and put to compete against each other. Imitating what occurs in nature, the best car's characteristics will be passed on to the next "generation" while other aspects will be randomly mutated and so, over time, they will be better adapted to the environment.
What I added is the possibility of using a leap motion sensor to draw your own car which will compete against the randomly generated ones. Your car won't mutate like the others, it will stay the same over the generations while the others evolve.
The whole idea of this project is to prove the value of Iterative Random Design in a pretty graspable way... although you may at first think that it is useless and that you can do better with a little common sense, with Intelligent Design, your car will eventually be crushed by the blind random creations of the computer if you give it a little time.
Game by: Nicolas Earnshaw
Instructions
Using one finger over a Leap Motion sensor, draw the initial shape of your car. Keep in mind that all dots will be linked to the center (0,0) position. There is an imaginary touch-screen in the air above your leap sensor... you draw by pushing forward against it.
Click 'Change Draw Mode' to switch to an alternative way using multiple fingers. You will see all of your fingers over the sensor represented as circles, if you press any key these positions will be added to the vertex list.
When you're happy with the shape, you can choose on what vertexes to put wheels by clicking on "add wheels". You can also choose to skip this step and leave the wheel positions to chance by directly clicking "Submit BluePrint"
In the wheel mode, drawing works in a similar way by pushing against an imaginary touch screen. Point near one of the axis of your car to place a wheel on that spot. You can only place up to two wheels right now. The wheel size and density will be random.
That's it! Click on "Submit BluePrint" to create your car and see how it fails against random creations!
Optional controls:
Create new world with seed: The same seed always creates the same track, so you can agree on a seed with your friends and compete. :)
Mutation rate: The chance that each gene in each individual will mutate to a random value when a new generation is born.
Graph
Red: Top score in each generation.
Green: Average of the top 10 cars in each generation.
Blue: Average of the entire generation.
Genome
The genome consists of:
- Shape: (8 genes, 1 per vertex)
- Wheel size: (2 genes, 1 per wheel)
- Wheel position: (2 genes, 1 per wheel)
- Wheel density: (2 genes, 1 per wheel) darker wheels mean denser wheels