What it is
An ecosystem simulator, also called a predator-prey simulation. It's a living toy meadow with three things in it. Grass grows back slowly. Rabbits eat grass, breed when they're well fed, and run for their burrows when a fox gets close. Foxes hunt rabbits, raise cubs when they have their own territory, and starve when the rabbits run out. Nobody scripts the ups and downs: they come out of hundreds of animals each following those few simple rules.
- Click or drag to add rabbits, foxes, fresh grass, bare rock or new burrows anywhere on the meadow.
- Set off rain, drought, rabbit flu or fox mange, and change grass growth, rabbit breeding and fox hunting while it runs.
- A live graph of rabbits, foxes and grass, a running log of what happened, and the whole history as a CSV file.
- The challenge: keep both species alive as long as you can. Your best run is saved in this browser.
- The same seed and settings always play out the same way, so you can share a seed and compare.
Example
Leave everything on the defaults (Balanced meadow, 60 rabbits, 8 foxes, seed 2) and don't touch anything:
- With plenty of grass and few foxes, the rabbits boom to 986 on day 103. By then they've eaten the meadow down to 3% grass.
- The foxes have more food than ever, so they climb to 103 on day 170. Meanwhile the hungry rabbits crash.
- By day 218 only 10 rabbits are left, mostly near their burrows, and with little to eat the foxes starve. The last fox dies on day 256, so the score reads Both alive: 255 days.
- With no foxes left, the survivors breed back up to 1,033 rabbits by day 339, and the meadow is grazed bare again.
To beat 255 days, step in when the foxes start winning: a dose of fox mange, or more burrows for the rabbits, can stop the crash.
How to use Ecosystem Simulator
- Watch for a bit. The cream line is rabbits, the orange line is foxes, and the green area is how much grass is left.
- Pick a tool above the meadow and click or drag to add things. A burrow is a safe spot: a rabbit standing next to one can't be caught.
- Use the events and sliders to push nature around, then see how long it takes to recover.
- Pick another meadow, such as Island (grass ringed by rock) or Too many foxes, or roll a new seed, and press Restart.
- Press Data (CSV) to open the numbers in a spreadsheet, one row per day.
Why the numbers go round in circles
This is the pattern ecologists call a predator-prey cycle. In maths it's described by the Lotka–Volterra equations. More prey means more food for predators, so the predators increase, but only after a delay, because cubs take time to grow up. By the time the predators peak, they're eating prey faster than it can breed, so the prey falls, then the hungry predators fall, and the prey can recover. On the graph, the fox peak always comes after the rabbit peak. Grass adds a second layer: too many rabbits strip the meadow and starve themselves, even with no foxes.
A small meadow tends to overshoot, so one species often dies out. Real ecosystems survive partly because of hiding places, like the burrows here, and because animals spread out over far larger areas. Try adding burrows, or making foxes slightly worse hunters, and see whether the cycles become gentler.
Ecosystem Simulator FAQ
Is this a real scientific model?
It's an agent-based model: every rabbit and fox is simulated on its own, with hunger, age and a position, instead of being worked out from an equation. The rules are simplified, and the numbers aren't tuned to any real place, but it shows the same behaviour real populations do: booms, crashes, lags between predator and prey, and the danger of overgrazing. That makes it handy for a biology or ecology lesson.
Why did everything die?
Usually because the rabbits ate the grass bare and then the foxes caught the last few. Try a slower rabbit breeding setting, more burrows, or Rain at the moment the grass runs out. If both species die, the grass still grows back on its own, so you can drop in new animals and carry on.
Does the speed slider change what happens?
No. The simulation always moves in the same small steps (10 per day); the slider only changes how many steps run each frame. A seed plays out exactly the same at 1× or 30×, unless you add animals or set off events.
Is anything uploaded?
No. It all runs in your browser. Only your best score is saved, in this browser's local storage.