- π§ Overview
- πΌοΈ Demo Snapshot
- 𧬠Species Overview
- π¦οΈ Environment Dynamics
- βοΈ Energy Flow
- π§ͺ Scent Diffusion System
- π§ Emergent Phenomena
- 𧬠Reproduction & Inheritance
- π Death & Decay
- πΉοΈ Interactive Controls
- π¨ Visual Feedback
- π Long-Term Dynamics
- βοΈ Installation & Setup
βΆοΈ Running the Simulation- π Test Ecosystem Resilience
- π§ Study Hive Learning
- π§© Custom Scenarios
- π Reporting
- π Summary
Evolving AI Biosphere (formerly AI Ecosphere) is a self-evolving artificial life simulation where three species β plants, herbivores, and predators β interact in a dynamic, learning-based ecosystem.
Unlike static simulations, organisms here use neural networks and reinforcement learning to evolve emergent behaviors β adapting, learning, and surviving across generations.
A digital petri dish where machine learning meets natural selection.
π§© Technical Documentation:
Basically, how it all comes together β visit the full docs at
π https://alwaysvivek.github.io/evolving-ai-biosphere/
Generation 100 β stabilized biosphere (plant dominance phase):
Description:
A dynamic view of the AI Ecosphere at Generation 100. The dark, textured terrain is populated by three species: Plants (Green), Predators (Red), and sparse Herbivores (Blue), alongside Nutrient Deposits (Yellow).
Notice the emergence of distinct territories: a dense central Plant Forest protected by clustered, actively hunting predators, and areas of high Plant Scent (green halos) indicating concentrated resources.
The top-left overlay confirms the critical environmental balance: a high population (277) but a low, yet stable, Diversity Score (0.71).
π View raw simulation log:
logs/sample_output.txt
Sessile organisms that generate energy via photosynthesis and reproduce asexually when conditions allow.
Life Cycle:
- Gain energy from light; reproduce at 130+ energy (splitting energy with offspring)
- Die from old age (350+ cycles), overcrowding, low light, or herbivore consumption
- Emit scent signals to attract herbivores
Key Stats:
- Max Energy: 150
- Photosynthesis: +3.5 energy/cycle
- Metabolism: -0.4 energy/cycle
- Death in low light (< 0.18 intensity)
Mobile agents that eat plants and flee predators using their own LSTM neural networks.
Behavior Systems:
- Foraging: Seek plant-rich areas via scent gradients
- Predator Avoidance: Escape zones with predator presence
- Energy Management: Balance eating, resting, and reproducing
- Reproduction: At 90+ energy (with mutated neural weights)
LSTM Inputs (8):
- Nearby plant count
- Herbivore count
- Predator count
- Nutrient count
- Energy level
- Age factor
7β8. Random noise (exploration)
Outputs: Reproduce, move/hunt, rest, or idle.
Apex hunters governed by a collective LSTM Hive Mind β all predators share one evolving neural brain.
Life Cycle:
- Feed on herbivores (+120 energy per kill)
- Reproduce at 100+ energy
- Die from starvation or old age (600+ cycles)
Hive Mind Learning:
- All predators share experiences (observations, rewards, actions)
- Every 20 generations, the Hive trains via REINFORCE
- Collective intelligence leads to evolved group strategies (e.g., flanking, trapping prey)
- Varies across the map (bright β plant-rich, dark β barren)
- Affects plant growth and energy efficiency
- Fluctuates between 0.0β1.0
- Alters metabolism and photosynthesis efficiency
- Varies between 0.3β1.0 to simulate day/night cycles
- Random nutrient deposits boost local ecosystem growth
Energy drives survival β all species gain and spend it differently:
| Flow | Source β Target | Description |
|---|---|---|
| βοΈ | Light β Plants | Photosynthesis |
| πΏ | Plants β Herbivores | Foraging |
| π©Έ | Herbivores β Predators | Hunting |
| π₯ | All | Metabolism & movement drain |
Balance:
Overgrowth in one level causes cascading effects β predator crashes, herbivore booms, plant depletion, etc.
Chemical scent fields create indirect perception:
| Scent Type | Emitted By | Function |
|---|---|---|
| πΏ Plant Scent | Plants | Attracts herbivores |
| πΎ Herbivore Scent | Herbivores | Attracts predators |
Each scent diffuses outward over 3 steps, creating gradient maps for navigation.
The AI-driven evolution leads to realistic ecological dynamics:
- BoomβBust Cycles: Natural oscillations in population sizes
- Spatial Clustering: Territory and colony formation
- Behavioral Evolution: Learned evasion and hunting strategies
- Extinction Events: Permanent loss of species reshapes balance
- Monoculture Dominance: Single-species takeovers causing fragility
| Species | Inheritance Type | Mutation |
|---|---|---|
| π± Plants | Asexual cloning | None |
| π Herbivores | Neural weight mutation | Β±0.01 (2% chance) |
| π¦ Predators | Hive-mind training | Collective evolution |
| Cause | Description |
|---|---|
| Starvation | Energy depletion |
| Old Age | Beyond max lifespan |
| Predation | Eaten by higher species |
| Overcrowding | Excess neighbors (plants) |
| Light Starvation | Insufficient local light |
| Random Events | Manual extinction events |
| Key | Action |
|---|---|
| SPACE | Play/Pause simulation |
| C | Clear all organisms |
| R | Generate statistical report |
| T | Toggle Hive training |
| F | Spawn flower pattern |
| S | Spawn spiral formation |
| O | Predator swarm |
| N | Nutrient field |
| K | Kill all predators |
| L | Kill all herbivores |
| P | Kill all plants |
| E | Scarcity event |
| Q | Quit simulation |
- Colors: Green=Plant, Blue=Herbivore, Red=Predator
- Brightness: Indicates energy level
- Scent Halos: Faint green/red glows show chemical concentrations
- Background: Noise-based soil texture that shifts with temperature and light
- HUD Overlay: Displays population stats, generation count, diversity, temperature, and hive experience
| Phase | Description |
|---|---|
| 0β50 generations | Unstable bursts and population crashes |
| 50β200 generations | Evolved equilibrium and specialization |
| 200+ generations | Stable biomes, learned behaviors, and possible extinctions |
Each major extinction or scarcity event permanently alters ecosystem balance.
- Python 3.7+
- Basic GPU/CPU for 800Γ800 rendering (30 FPS)
- Clone or Download Repository
git clone https://github.com/<your-username>/evolving-ai-biosphere.git cd evolving-ai-biosphere
- Install dependencies
pip3 install -r requirements.txt
- Run simulation
python3 main.py
Then press:
- SPACE β Start simulation
- R β View stats report periodically
- Watch the populations evolve for 50β100 generations
- Let the world stabilize
- Press K β Wipe predators
- Observe herbivore explosion and eventual plant collapse
- Press T β Disable predator training (baseline)
- Press T again β Re-enable and wait 20+ generations
- Compare predator coordination and efficiency
- C β Clear world
- F β Add plants
- O β Add predators
- SPACE β Begin evolution
Press R anytime to generate:
- Generation count
- Total and per-species population
- Temperature and light levels
- Diversity score (Shannon entropy)
- Total births and deaths
- Hive training status
Evolving AI Biosphere creates a sandbox of digital evolution, where:
- Neural agents adapt and learn
- The Hive Mind evolves collectively
- Natureβs balance unfolds through machine learning
A glimpse into how life might look when evolution is powered by AI.
