1 min readFree

Genetic Cars

Watch a genetic algorithm turn random shapes on wheels into cars that drive further with every generation.

// at a glance

Is Genetic Cars free?
Free. Yes. Genetic Cars is free to use, with no paid plan.
Category
#Others
Website
rednuht.org ↗
Genetic Cars website

What is Genetic Cars?

Genetic Cars, full name 'HTML5 Genetic Algorithm 2D Car Thingy', is a simulation of evolution you can watch in your browser. It starts with a batch of random two-wheeled shapes that mostly flip over or get stuck. The ones that travel furthest pass on their 'genes', and over the generations the cars start to look and drive like real vehicles.

It was written by Rafael Matsunaga (red42 on GitHub), loosely based on the older BoxCar2D and built from scratch on the same Box2D physics engine. Each car's genome covers its body shape, wheel sizes, wheel positions and densities. It has been a long-running favourite on Reddit and Hacker News, and the open source code has been forked many times.

What You Can Do

  • Watch cars evolve over generations in real time
  • Change the mutation rate, mutation size and elite clones
  • Switch gravity from the Moon to Jupiter
  • Share a world seed so friends race on the same track
  • Save and restore a population
  • Follow progress on a live score graph

How to Play Genetic Cars

  1. Open rednuht.org/genetic_cars_2 in your browser.
  2. Let the first generation run and watch most cars fail.
  3. Adjust mutation, gravity or elite clones to see what changes.
  4. Use 'View top replay' to see your best car so far.

Is Genetic Cars Free?

Genetic Cars is free and open source with no account. There is an optional PayPal donate button.

Who Will Enjoy It?

  • Students learning about genetic algorithms or evolution
  • Teachers who want a visual demo of natural selection
  • Programmers curious about simple AI techniques
  • Anyone who enjoys watching something slowly get better

Websites Like Genetic Cars

Frequently Asked Questions

Is Genetic Cars free?

Yes. It is free to use and open source, with an optional donate button.

How does Genetic Cars work?

Each car has genes for its shape and wheels. The best cars of each generation are copied and mutated to make the next one.

Can I race friends in Genetic Cars?

Yes. Use the same world seed and you will all get the same track.