Inspiration What it does
How we built it Inspiration I wanted to build something that actually shows intelligence emerging, not an AI wrapper calling an API. Evolution is the original example of complex behavior arising from dead-simple rules: survive, reproduce, repeat. I wanted to watch that happen in real time, in a browser, with nothing faked.
What it does Synapse Sim is a live neuroevolution simulator. Every creature on screen is controlled by its own tiny feedforward neural network (5 inputs, 6 hidden neurons, 2 outputs, 44 weights total) that decides how it moves. At the start, those weights are random, so creatures wander aimlessly. When a creature eats enough food, it reproduces, and its offspring inherits its weights with small random mutations. Creatures with better weights survive longer and have more children, so over generations, food-seeking behavior emerges without anyone programming it.
You can watch this happen live, inspect any individual creature's brain as a color-coded weight grid, track population-wide trait averages (speed, size, sense radius) over time, and see a Hall of Fame of the oldest and most prolific creatures. Sliders let you control simulation speed, mutation rate, and food scarcity, so you can run your own experiments.
How I built it Everything is vanilla JavaScript and HTML5 Canvas, no frameworks, no libraries, no backend. The genome encodes both physical traits and brain weights; the neural network forward-pass, mutation logic, energy system, and rendering are all written from scratch. The whole simulation runs client-side, deployed as a static site on GitHub Pages.
Challenges I ran into Balancing the energy system was harder than expected: under default settings I found the entire population could die out in generation zero before evolution had any chance to act. I stress-tested different energy-cost tunings across 15 trials each until I found a balance that reliably let evolution get going. I also ran an experiment with a much harsher setting, 30% mutation rate and scarce food, and recorded it: population fell from 84 to 34 creatures over 33,600 ticks, with deaths (826) consistently outpacing births (798) the whole way. That run is the basis of my demo video.
Accomplishments that I'm proud of Getting real emergent behavior out of a system with no hand-tuned AI logic at all, and catching that harsh conditions can genuinely outpace evolution within a bounded run, rather than assuming evolution always "wins" if you wait long enough.
What I learned How much of perceived intelligence is just selection pressure filtering out bad solutions over time, and how sensitive that process is to its starting conditions (a population can be wiped out before it ever gets the chance to adapt).
What's next for Synapse Sim Guided experiment presets so newcomers can reproduce interesting results (like the scarcity run in the demo) with one click, and CSV export of population/trait data for anyone who wants to analyze runs outside the browser.
Built With
- canvas-api
- css3
- genetic-algorithms
- github
- html5
- javascript
- neural-networks
- neuroevolution