Species Simulator
Real-time ecosystem simulator visualizing predator-prey dynamics with genetic algorithm evolution

Overview
A real-time ecosystem simulator that visualizes predator-prey dynamics on a grid world. Creatures hunt, forage, reproduce, and die based on energy levels, vision range, and environmental conditions, producing emergent population fluctuations over time. A genetic algorithm layer lets traits evolve across generations, revealing natural selection in action.
Simulating believable ecosystem behavior requires balancing dozens of interacting parameters — energy costs, reproduction thresholds, vision ranges, food regrowth rates — where small changes cascade into population booms or crashes. The simulation needed to run smoothly at high speed while rendering thousands of entities on canvas.
Built with TypeScript and HTML5 Canvas with zero runtime dependencies. Each creature type has configurable parameters (20+ settings) governing behavior, energy, and reproduction. A grass growth system and road placement mechanics shape the environment. Speed controls (1x–10x) allow fast-forward observation of long-term dynamics, and population history charts track species balance over time.
The simulator produces emergent predator-prey cycles matching classic Lotka-Volterra dynamics. The genetic algorithm visualization reveals how traits like speed and vision range evolve under selective pressure. Settings persist via localStorage for iterative experimentation.
Key Features
Gallery
