Ecosystem // Field Sim

predator–prey–apex food-web β€” live model
Tick 0
FPS 60
Entities 0
grid-indexed spatial sim Β· click stage to interact
Click+drag: drop food   |   Shift+click: scare nearby   |   Space: pause

PREY EXTINCT

Population collapsed. Adjust parameters and reset to try again.

?   Quick-Start Guide

This is a live predator–prey ecosystem simulator. Creatures move, hunt, eat, reproduce, and die in real time on the canvas. Everything reacts to your slider adjustments immediately β€” no reset needed.

Press Reset to restart with the current initial-count sliders. The sim pauses automatically when it starts; hit Resume or press Space to begin.

Space Pause / Resume
Reset Restart sim
Speed Cycle 0.25Γ— β†’ 1Γ— β†’ 2Γ— β†’ 4Γ—

Each creature is an emoji with a small directional wedge beneath it showing which way it's heading. A coloured ring shows energy level β€” bright = well-fed, dim = hungry. A ☠️ skull appears when a creature's toxin load is dangerously high.

πŸ‡Prey β€” form flocks, eat food, flee predators
🦊Predator β€” chase nearest prey, starve without kills
πŸ¦…Third species β€” diet configurable (off by default)
🌿Fresh food β€” safe to eat, gives energy
πŸ„Toxic food β€” poisons prey; toxin travels up the chain

Grey pursuit lines show which prey each predator is targeting (toggle in Display section). The oscilloscope graph in the Population Trace panel shows population counts over time β€” watch for the classic Lotka–Volterra boom/bust cycles.

Use the Mouse Tool panel to pick what clicking/dragging on the canvas does:

Food Click or drag to scatter food pellets
Scare Pushes nearby creatures away in panic
Wall Click empty space to place an obstacle; click obstacle to remove it
Shift+click Scare regardless of active tool (desktop)

On mobile: tap ☰ to open the controls panel, pick a tool, then tap the canvas. Touch-drag drops food continuously.

The base sim is a classic prey β†’ predator two-species chain. Enable the Third Species section to add a configurable third player. Choose a preset, then customise freely:

πŸ¦…Apex predator β€” hunts predators only; creates a three-tier trophic cascade
🐻Omnivore β€” hunts both prey and predators; can cause competitive exclusion
🐺Competitor β€” hunts prey like a second predator; intensifies pressure on prey
πŸ¦‚Scavenger β€” eats food only (bonus rate); doesn't hunt, competes with prey for resources

Diet changes apply live β€” tick the prey/predator checkboxes and the food web updates instantly. Creatures that are now hunted will start fleeing immediately without a reset.

Food Toxicity β€” a configurable fraction of food spawns as toxic πŸ„ (red). When prey eat toxic food they accumulate a toxin load that drains their energy and impairs reproduction. When a predator eats a toxic prey, a fraction of the toxin transfers to the predator (trophic transfer). The third species inherits toxin from whatever it eats, at an even higher transfer rate β€” this is real-world biomagnification.

Environmental Toxicity β€” background pollution drains all species continuously. Each species has its own sensitivity slider; apex predators typically accumulate the most (set their sensitivity highest).

Ring colour Shifts from species colour β†’ yellow as toxin rises
☠️ overlay Appears when toxin load exceeds the heavy threshold
Lethal threshold Creatures above this level risk instant toxic death each tick

Tip: start with Toxic fraction 60–80%, Detox rate low (0.01–0.03), and run for 500+ ticks to see the trophic chain clearly.

A full day lasts 1200 simulation ticks, cycling through four phases shown by the icon top-left of the canvas.

πŸŒ…Dawn β€” low light, reduced vision and speed for all (75%). Creatures start stirring.
β˜€οΈDay β€” full activity. Hunting, foraging, and movement at 100% efficiency.
πŸŒ‡Dusk β€” same penalties as dawn. Prey begin clustering; predators slow down.
πŸŒ™Night β€” all movement slows sharply. Predators drop to 50% speed, prey to 40%. Vision halved. Prey herd tightly and drift toward cover. Stars appear on canvas.

Neither species has a night advantage β€” this is a realistic general model where darkness impairs everyone equally. Fewer hunts succeed at night simply because both sides move slowly. Toggle day/night off in the Display panel if you want a time-neutral sim.

Water bodies are the most dangerous terrain feature because prey must visit them regularly to survive. This predictability is exploited by predators.

Thirst mechanics β€” every creature's thirst rises ~0.06/tick. Above 60/100, they actively seek the nearest water. Above 80/100, dehydration drains extra energy each tick. At 88+ they will drink even alone, ignoring safety.


Waterhole ambush β€” when a predator is hungry (>60/100) but too exhausted to chase (stamina <45), it stops wandering and creeps to the water body edge in stalk mode. It waits there motionless until prey come to drink. A red danger glow appears around the water when a predator is lurking β€” watch for it.

Group drink safety β€” prey won't approach water alone while a predator is nearby. They wait until at least 3 group members can drink together, or until desperation overrides caution. A lone thirsty prey approaching solo is the predator's opportunity.

Drinking distraction β€” while actively drinking, prey detection drops to 45% of normal. A drinking prey shows the πŸ’§ icon. Predators can spot distracted drinking prey from further than usual β€” this is the attack window.

Wading penalty β€” moving through water slows all creatures to 55% speed, creating a genuine terrain disadvantage for anyone crossing.

Cover features reduce how far away a creature can be detected. This affects both prey hiding from predators and predators stalking prey.

🌲Trees β€” dense canopy, very dark. Creatures inside are detectable at only 22% of normal range. Prey love trees; predators use tree edges for stalking approaches.
πŸ«›Bushes β€” partial cover at 52% detection range. Predators actively position in nearby bushes before launching an ambush. Kill chance rises by +30% when attacking from cover.

For prey β€” when a predator is spotted, prey immediately pathfind toward the nearest bush or tree (strong attraction vector). At night, even without a threat, prey slowly drift toward cover to rest. A πŸƒ leaf icon appears over hiding prey.

For predators β€” stalking state (πŸ‘οΈ icon) activates when a predator is in cover with prey visible in the distance. It creeps slowly at 35% speed, invisible to prey at close range. When prey enters burst range (~140px), the predator explodes into a sprint with a 55% speed burst for the first few ticks β€” the ambush launch. This mirrors real lion/leopard hunting technique.

Tip β€” watch the canvas for predators stationary in dark bush patches near water. They are not idle β€” they are waiting.

Intraspecific Competition (Third Species panel) β€” in nature, individuals of the same species compete for territory, mates, and food. When enabled here, third-species individuals within ~55px of each other drain each other's energy each tick, scaled by the Intensity slider.

At low intensity this is a mild carrying-capacity limit. At high intensity it can prevent the third species from ever reaching large numbers even when prey is abundant β€” exactly like territorial carnivores (lions, wolves) that defend exclusive ranges. This is independent of how much food exists; it's purely social competition.

Practical effect β€” enabling intraspecific competition at moderate intensity (0.4–0.8) tends to produce a more stable third-species population that oscillates slowly rather than booming and crashing. If the third species always overpopulates and collapses, try enabling this.


Extinction notifications β€” a banner pulses on canvas when a species dies out. If only one species remains it pulses repeatedly as a persistent alert. Hit Reset to restart. Tip: if predators always collapse, lower their metabolism or raise prey reproduction energy. If prey always collapse, raise food spawn rate or lower predator kill distance.

Population
πŸ‡ Prey
0
🦊 Pred
0
πŸ¦… Third
0
🌾 Food
0
Population Trace
prey predator food
Run Control
Initial prey120
Initial predators14
Initial third species0
Obstacles5
Third Species enable
Identity preset
Emoji
Diet β€” hunts:
Also scavenges food

Speed2.4
Reproduction energy260
Metabolism (drain/tick)0.09
Kill distance8
Diet determines who this species hunts and who flees from it. Changes apply live β€” no reset needed.
Intraspecific Competition enable
Intensity0.4
Models territorial rivalry among the third species β€” nearby conspecifics drain each other's energy. Higher intensity = stronger competition for space/resources.
Environmental Toxicity enable
Pollution level0.3

Species sensitivity
Prey sensitivity0.6
Predator sensitivity1.0
Third sp. sensitivity1.6
Affects all three species proportional to sensitivity. Higher trophic levels typically accumulate more environmental toxins (biomagnification).
Food Toxicity enable
Toxic food fraction30%
Toxin per meal18
Drain (per unit/tick)0.12
Detox rate (per tick)0.08

Trophic transfer factor0.55
Apex transfer factor0.70

Heavy load threshold (☠️)30
Lethal threshold80
πŸ„ = toxic food (red), 🌿 = fresh food (green). Toxin transfers up the food chain on each kill. ☠️ overlay appears above heavy-toxin threshold.
Mouse Tool
Food mode: click/drag to scatter food. Scare: pushes nearby creatures away. Wall: click to place a circular obstacle, click an obstacle to remove it.
Sound
Sound enabled
Volume40%
Each species has a distinct birth/eat/death sound. Sounds are throttled and pitch-varied so dense scenes don't turn to noise.
Flocking Weights
Separation2.0
Alignment1.0
Cohesion1.0
Flee (from hunters)5.0
Prey Biology
Speed2.2
Reproduction energy130
Metabolism (drain/tick)0.05
Max population2500
Predator Biology
Speed2.6
Reproduction energy200
Metabolism (drain/tick)0.10
Kill distance7
Food
Spawn rate (per tick)0.5
Energy per food40
Display
Show vision/sense radius
Show pursuit lines
Show spatial grid
Energy-tinted ring
πŸŒ™ Day / Night cycle