AI Coding Tools

Command Palette

Search for a command to run...

Ecosystem Evolution Simulator

Single-file artificial-life simulator with predator/prey/food energy dynamics, a round rotating 3D map, cute animated agents, live controls, and real population graphs.

<brief>
Create an artificial-life ecosystem simulator: a living petri-dish world where plant food, prey-like creatures, and predator-like creatures interact through energy, scarcity, reproduction, and movement.

This is an educational ecology sandbox, not a combat or harm simulation. Keep the creatures non-human, cute, abstract, and non-graphic. Think biology classroom, toy world, living map, and animated data story.

The goal is to make the world feel genuinely alive. The user should be able to change the environment, press play, watch populations rise and fall, and understand what happened through live graphs and summary stats.
</brief>

<creative-freedom>
You have freedom to choose the implementation details, visual style, layout, algorithms, and interaction model that best serve the experience.

Use the sections below as product direction, not as a rigid checklist. If you find a better way to express the same idea, take it. The important part is that the simulation behaves honestly, the world is readable, and the user can steer the ecosystem.
</creative-freedom>

<core-experience>
The user is watching a small living world from above, like a magical petri dish or tabletop ecosystem map.

They can adjust a few meaningful ecological forces:

- Food abundance: how quickly edible growth appears.
- Reproduction tendency: how easily creatures convert surplus energy into offspring.
- Predator pressure: how effectively predator-like creatures find and capture prey-like creatures.

The interesting behavior should emerge from those forces:

- More food lets prey populations grow.
- More prey lets predators recover.
- Too much predator pressure pushes prey down.
- When prey become scarce, predators lose energy and decline.
- Delayed food regrowth helps create boom-and-bust cycles.
- Balanced settings can produce long-running predator-prey oscillations.
- Extreme settings can produce collapse, recovery, or extinction events.
</core-experience>

<energy-economy>
Make energy the heart of the simulation.

Each living creature should have energy. Moving and staying alive costs energy. Eating restores energy. Reproduction uses energy rather than creating free population growth.

Food should take time to regrow after it is eaten. This delay matters because it creates the ecological feedback that makes populations oscillate instead of simply filling the screen.

Prey-like creatures should seek food, avoid danger, spend energy, eat after a short pause, reproduce when they have enough surplus energy, and disappear when they run out of energy or are captured.

Predator-like creatures should seek prey, spend energy, gain energy after a successful capture and short feeding/digesting pause, reproduce only when they have enough surplus energy, and disappear when they run out of energy.

The simulation should not fake the outcome. Population booms, crashes, extinction events, and recoveries should come from the energy economy.
</energy-economy>

<world-and-visual-style>
The world should feel like a round 3D/isometric map rather than a flat field of dots.

Good direction:

- A circular raised petri-dish map.
- Click or drag interaction that lets the user rotate or inspect the map.
- Trees, bushes, or plants carrying visible green food.
- Cute glossy oval/bean-shaped creatures with simple faces.
- Clear species identity, such as blue/cyan prey and red/pink predators.
- Little signs of life: blinking, bouncing, leaning, squash/stretch, fear, curiosity, feeding, and attention.
- Depth cues, soft shadows, scale, and draw ordering so the canvas feels dimensional.

Food should look like it belongs on trees or plants, not like random dots. When food is eaten, the plant should visibly change and later recover.

The creatures should feel like tiny animated mascots. They can be simple, but they should have personality and readable intent.
</world-and-visual-style>

<eating-and-feeding>
Eating should have a visible moment.

Prey should not instantly vacuum food. When they reach food, they should pause, chew, glow, bounce, or otherwise show a short eating action before receiving energy.

Predators should also have a short non-graphic feeding or digesting moment after a capture. Use abstract visual language: a pop, sparkle, energy transfer, satisfied pulse, or brief pause. Avoid gore, injury, or realistic harm.

These moments should matter to the simulation. A creature that is eating or digesting should not immediately chain into another action at full speed.
</eating-and-feeding>

<controls>
Give the user enough controls to feel like they are steering an ecosystem, without turning the interface into a spreadsheet.

Prioritize controls for:

- Food growth and carrying capacity.
- Food regrowth delay.
- Prey metabolism, speed, vision, reproduction, and eating time.
- Predator metabolism, speed, hunt range, capture chance, reproduction, feeding time, and energy gain.
- Starting populations.
- World size or map radius.
- Random seed.
- Simulation speed, pause, step, reset, randomize, and presets.

Useful presets include:

- Balanced ecosystem.
- High predator pressure.
- Prey paradise.
- Fragile equilibrium.
- Low food / ice age.

Control changes should feel live. When the user drags a slider, the world should respond soon enough that the relationship between cause and effect is obvious.
</controls>

<charts-and-story>
The graphs are the payoff. They show the story that emerged.

Show a live population history chart with food, prey, and predators together on the same graph and same time axis. Make all three visible even if their counts have different scales, using normalization, labels, or another readable design.

The chart must reflect real recorded simulation history. Do not draw decorative waves.

Add any extra views that make the ecosystem easier to understand:

- A predator-vs-prey phase-space plot.
- Trait charts if evolution exists.
- Histograms of speed, vision, or energy.
- A summary panel after a run.

The run summary should tell the user what happened in plain language: stable coexistence, prey boom, predator decline, low-food collapse, extinction event, recovery, or oscillating equilibrium.
</charts-and-story>

<inspection>
Let the user click a creature and inspect it.

Useful details:

- Species.
- Energy.
- Age.
- Current behavior.
- Eating or feeding state.
- Speed.
- Vision or hunt range.
- Metabolism.
- Lineage or traits if evolution is included.

The selection should help the user connect the big graph to the tiny individual decisions happening inside the map.
</inspection>

<optional-evolution>
If it improves the app, add simple evolution.

Creatures can inherit traits such as speed, vision, size, and metabolism, with small mutations on reproduction. Traits should have tradeoffs. For example, faster creatures may spend more energy, and better sensing may come with a cost.

If evolution is present, make it visible with average-trait charts or distribution views so the user can see selection pressure over time.
</optional-evolution>

<quality-bar>
The simulation should be able to demonstrate:

- A balanced run where prey and predators oscillate out of phase.
- A high predator-pressure run where prey collapse first and predators decline afterward.
- A low-food run where prey struggle even with little predator pressure.
- Carrying-capacity behavior where populations self-regulate instead of growing forever.
- If evolution is present, a visible drift in average traits under selection pressure.

Choose the technical approach that best achieves this. The result should be easy to run, responsive, inspectable, and honest about the data it shows.
</quality-bar>

<safe-tone>
Keep the experience safe, educational, and non-graphic.

Use neutral ecology language:

- predator pressure
- prey population
- capture chance
- energy transfer
- starvation pressure
- population decline
- ecosystem collapse
- recovery
- extinction event

Avoid making the experience feel like realistic violence. These are abstract creatures in a simulated ecology, and population changes should be shown with clean, playful, non-graphic animation.
</safe-tone>