A browser app that evolves vehicles using genetic algorithms, written in Rust and Bevy
A browser app that evolves vehicles using genetic algorithms, written in Rust and Bevy
This is a simulation that uses AI (to be specific: genetic algorithms) to try to build better and better vehicles. The vehicles have to overcome an obstacle course, starting with some slight hills, followed by steeper hills, and finally some jumps. The vehicles are made out of panels and wheels, connected together, similar to the game Besiege, except in 2D.
Try the live web demo here. (needs a fast computer, on mobile browsers it'll run really slow, although Fennec seems faster than Chrome)
I made an in-depth video explaining how it works here. See the section below for a short summary.
A quick rundown of how it works:
Ideally, after repeating these steps often enough, the fitness of the population should increase, and many vehicles should make it to the finish line. Although, due to the low population size, good solutions may not always be found. And, due to non-determinism (see Known Issues), the fitness may actually decrease over time.
This program uses Rust, so ensure you have rustup and cargo installed, and cargo-make to allow for easy compilation to both native and WASM targets, so ensure you have that installed too. Also, if you want to build the web version, ensure you have the WASM target installed: rustup target add wasm32-unknown-unknown.
To run natively:
cargo make run -p releaseTo run for web: (connect to localhost:4000 in your browser after it's done compiling)
cargo make serve -p releaseMIT for now, although the program is based on bevy_webgl2_app_template, which doesn't have a license yet... so keep that in mind.
No open issues yet, or sync has not completed.