Skip to content

fulgidus/robo-dino

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

40 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

πŸ¦– Robo Dino

A neuroevolution sandbox built with Rust, WebAssembly, and TypeScript, where pixel dinosaurs learn to survive by jumping over obstacles. This simulation runs entirely in the browser and showcases how simple neural networks, mutation, and selection pressure can lead to emergent intelligence β€” one generation at a time.

Demo Screenshot

πŸš€ Live Demo

πŸ‘‰ Try it now on GitHub Pages

🎯 Features

  • Evolutionary AI powered by simple neural networks
  • Hidden layer support with customizable neuron count
  • Real-time visualization of neural activations and weights
  • Fitness history graph and weight heatmap
  • Swarm simulation of hundreds of dinos
  • Fully browser-based with zero dependencies or backend
  • Written from scratch in Rust with WebAssembly bindings

πŸ› οΈ Tech Stack

  • πŸ¦€ Rust for simulation logic and evolution
  • πŸ•Έ WebAssembly for performance in the browser
  • πŸ’» TypeScript + HTML5 Canvas for UI and visualization
  • πŸ“¦ Built and bundled with wasm-pack and vite

πŸ“¦ Getting Started

1. Build the Rust β†’ WebAssembly module

cd rust-dino
wasm-pack build --target web --out-dir ../frontend/src/rust

2. Run the frontend locally

cd ../frontend
npm install
npm run dev

Then open http://localhost:5173 in your browser.

🧠 How It Works

Each dinosaur is controlled by a small feedforward neural network:

  • Inputs: distance to next obstacle, relative speed, and score
  • Hidden layer: configurable (default 3 neurons)
  • Output: jump decision

Networks evolve through mutation and selection:

  • Best brains are cloned and slightly mutated
  • Poor performers are discarded
  • Fitness is based on score and time survived

Read more

πŸ§ͺ Development Notes

  • The simulation supports up to thousands of dinos, but is capped at 200 for performance.
  • Canvas layers include: simulation, neural net, heatmap, and fitness graph.
  • A pause button allows you to freeze evolution and inspect activations.

πŸ“œ License

MIT β€” use it, break it, fork it, evolve it.

πŸ‘¨β€πŸ’» Author

Built with love by @fulgidus β€” feel free to reach out or contribute!

Watching a dino learn to jump through nothing but failure and adaptation is surprisingly inspiring. πŸ¦•βœ¨

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published