← Back to Projects
🦁

AI Predator Simulation

Complex multi-agent survival simulation where predators and prey learn, adapt, and exhibit emergent behaviors in a dynamic ecological environment.

Status: v1 Complete Completed: Nov 2025 Lead: Charlie Han

🎯 The Problem

Understanding emergent behavior in multi-agent systems is crucial for AI research, game development, and ecological modeling. Traditional simulations use rigid rules that don't capture the complexity of real predator-prey dynamics.

Scripted Behaviors

Most simulations hard-code behaviors, missing emergent complexity.

Unrealistic Ecosystems

Simplified models don't capture resource competition, hunger, and adaptation.

Limited Research Tool

Few accessible tools exist for studying multi-agent emergence in survival contexts.

👥 Users & Impact

Open
Source for research use
Emergent
Group hunting behaviors
Dynamic
Ecological balance

Target Users

  • AI researchers studying multi-agent emergence
  • Game developers designing realistic NPCs
  • Ecology students modeling predator-prey dynamics
  • Anyone curious about autonomous agent behavior

🎬 Demo

🌐
Web demo coming soon

Run the AI Predator simulation in your browser — no install required. We're building it.

Video Walkthrough

▶️

Demo video coming soon

Emergent hunting behaviors in action

Screenshots

Ecosystem
Hunt
Stats Panel
Evolution

🚀 How to Run

Quick Start
🛠️Development

Quick Start

# Clone the repository
git clone https://github.com/charlie2233/AI-predator-simulation.git
cd AI-predator-simulation

# Install dependencies
pip install -r requirements.txt

# Run the simulation
python main.py

# Or with custom parameters
python main.py --predators 10 --prey 50 --world-size 800

Requires Python 3.9+ and pygame for visualization.

🏗️ Architecture

┌─────────────────────────────────────────────────────────────┐
│                  AI Predator Simulation                     │
├─────────────────────────────────────────────────────────────┤
│                                                             │
│  ┌──────────────┐    ┌──────────────┐    ┌──────────────┐  │
│  │   World      │───▶│   Agent      │───▶│   Decision   │  │
│  │   State      │    │   Manager    │    │   Engine     │  │
│  └──────────────┘    └──────────────┘    └──────────────┘  │
│         │                                       │          │
│         ▼                                       ▼          │
│  ┌──────────────┐    ┌──────────────┐    ┌──────────────┐  │
│  │   Resource   │    │   Neural     │◀───│   Behavior   │  │
│  │   System     │    │   Network    │    │   Tree       │  │
│  └──────────────┘    └──────────────┘    └──────────────┘  │
│                                                             │
│  Agent States: Hungry │ Hunting │ Fleeing │ Resting │ Dead │
├─────────────────────────────────────────────────────────────┤
│  Visualization: Pygame │ Config: YAML │ Logging: JSON      │
└─────────────────────────────────────────────────────────────┘
                            

Tech Stack

Python Pygame NumPy Neural Networks Behavior Trees

✨ Key Features

🧠

Neural Decision Making

Agents use small neural networks trained on survival outcomes to make decisions.

🐺

Pack Hunting

Predators naturally form groups and coordinate attacks without explicit programming.

🌿

Resource Ecosystem

Plants grow, prey eat plants, predators eat prey—full food chain simulation.

📈

Evolution Over Time

Successful strategies propagate. Watch behaviors emerge across generations.

👁️

Sensory Systems

Agents have vision cones, proximity detection, and energy awareness.

📊

Real-time Stats

Track population dynamics, hunt success rates, and ecosystem balance live.

📊 Metrics & Results

100+
Concurrent agents
60fps
Simulation speed
~Gen 50
Pack hunting emerges
Open
Source on GitHub

Interesting Findings

After ~50 generations, predators consistently develop flanking behaviors and prey form defensive clusters. Neither behavior was programmed—they emerged from survival pressure alone.

🗺️ Roadmap

v1.0 — Core Simulation

Basic predator/prey agents, resource system, visualization

v1.1 — Neural Networks

Add learning component, emergent behavior tracking

v2.0 — 3D Version

Unity port for richer environments and behaviors

v2.1 — Web Demo

Browser-based version for easy experimentation

🙏 Credits

Project Lead

Charlie Han

Development

Atrak Team

Visualization

Pygame

Inspiration

Boids, NEAT, Ecological Models

Inspired by Craig Reynolds' Boids, the NEAT algorithm, and classic predator-prey ecological models. Built as an exploration of emergent AI behavior.