Project
Roulette

Predator and Prey

Foxes eat rabbits, rabbits eat grass, and the populations oscillate.

AdvancedWeb appCreative14–28hAI-buildable 3/5no setup

An agent-based ecosystem where individuals hunt, eat, reproduce and die. The population graph shows the classic predator-prey oscillation emerging from individual behaviour, and finding parameters that don't collapse to extinction is a genuine balancing challenge.

UI
Logic
Useful

Hosting · Free forever

Deploys free on GitHub Pages, Cloudflare Pages or Vercel Hobby.

Deploy it and share a link.

Core features · 7

  • Agents of several species with distinct behaviours
  • Agents seek food, reproduce when fed and die when starved
  • A population graph plots each species over time
  • Starting populations and rates are adjustable
  • The simulation runs indefinitely without slowing down
  • Extinction events are reported clearly
  • Simulation speed is adjustable and pausable

The interesting part

  • Balancing so populations oscillate rather than collapsing immediately
  • Efficient nearest-food searching for hundreds of agents
  • Keeping a long-running simulation from degrading over time

Once it works

  • Add inheritable traits with mutation
  • Add terrain that affects movement and food growth
  • Add a parameter search for stable configurations

Suggested stack

reacttypescripttailwindcanvas-apirecharts

Track it