Robot Evolution Lab: evolve your own walking robots
Robots that teach themselves to walk, in a physics simulation on your own laptop.
In the videos, robots with 2, 4, 6 and 8 legs start out flailing and, generation after generation, teach themselves to walk. Then they climb stairs, cross ice, and even evolve their own body shape. This is the exact code, cleaned up so you can run those experiments yourself.
What you get
- evolve.py: one command evolves a robot. Choose 2/4/6/8 legs, flat ground, stairs or ice, and whether the body shape evolves too.
- watch.py: a live 3D viewer for any generation. You can also record an MP4 or race several robots side by side.
- plot.py: learning curves for all your runs.
- Pre-evolved champions you can watch the minute you install it.
- A plain-English README: how the sine-wave "brain", the fitness test and CMA-ES evolution work, plus five experiments to try.
How it works in 20 seconds
Each joint follows amplitude · sin(2π·f·t + phase) + offset. A 4-legged robot has 25 numbers like that: its genes. Each generation, 24 variations are tested in a real MuJoCo physics simulation, and the evolution strategy (CMA-ES) moves toward the ones that walked farthest. Nobody programs the gait. It gets discovered.
$ python evolve.py --legs 6 --terrain stairs --seconds 8 Evolving 6-legged robot on stairs | 37 genes | pop 24 gen 10 best 0.52 m ... gen 300 best 4.91 m ... $ python watch.py runs/6legs_stairs_seed1.json
Requirements
- Windows, macOS or Linux with Python 3.9+. Everything installs with one
pip install. - No GPU. A normal laptop evolves a walker in about 5–20 minutes.
- Beginner-friendly: you only need to be able to run a command in a terminal. About 350 lines of commented Python if you want to go deeper.
FAQ
Is this AI-generated video? No. Every video on our channel is rendered from a real physics simulation, and this is the code that runs it.
Can I use it for my own videos or a school project? Yes, for personal and educational projects, including your own videos. Please don't resell or re-upload the package itself.
Refunds? If it doesn't run on your machine and we can't fix it together, you get a full refund.