https://rednuht.org/genetic_cars_2/ 250 187 125 62 0 [View top replay] PayPal - The safer, easier way to pay online! * [Save Population] [Restore Saved Population] [Surprise!] [New Population] [Fast Forward] Create new world with seed [ ] [Go!] Generation Cars alive Distance Height Mutation rate: [5% ] Mutation size: [100%] Floor: [fixed ] Gravity: [Earth (9.81) ] Elite clones: [1 ] [Watch Leader] 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!) Controls Save Saves current population locally. Population Restore Saved Restore a previously saved population. Population Suprise Toggles drawing, makes the simulation faster. New Population Keeps the generated track and restarts the whole car population. Create new The same seed always creates the same track, so you world with can agree on a seed with your friends and compete. :) seed The chance that each gene in each individual will Mutation rate mutate to a random value when a new generation is born. Mutation size The range each gene can mutate into. Lower numbers mean the gene will have values closer to the original. Elite clones The top n cars that will be copied over to the next generation. View top Pause the current simulation and show the top replay 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 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 * Chassis density (1 gene) darker body means denser chassis 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. GitHub The code is now on a GitHub repository. Feel free to contribute! Originally written by this guy, now with contributions from patient people at GitHub.