Controls
Suprise: Toggles drawing, makes the simulation faster.
New Population: Keeps the generated track and restarts the whole car population.
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.
Elite clones: The top n cars that will be copied over to the next generation.
View top replay: Pause the current simulation and show the top performing car. Click a second time to resume simulation.
Graph
Red: Top score in each generation.
Green: Average of the top 10 cars in each generation.
Blue: Average of the entire generation.
But what is it?
The program uses a simple genetic algorithm to evolve random two-wheeled shapes into cars over generations. Loosely based on
BoxCar2D, but
written from scratch, only using the same physics engine (
box2d).
seedrandom.js written by
David Bau. (thanks!)
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
Blurb
This is not as deterministic as it should be, so your best car may not perform as well as it once did. The terrain gets more complex with distance.
I'm not in the mood to deal with checking if all scripts have loaded before running, so refresh the page if things seem whack.
Send me food.