03 · Simulation
Predator–Prey Simulation
An experimental flocking environment for studying emergent behavior, pursuit, and avoidance through simple local rules.
Selected outcomes
- Combined separation, alignment, and cohesion rules
- Added predator pursuit and prey evasion behavior
- Experimented with 2D and 3D representations
- Used visual tuning to inspect emergent group behavior
Emergence from local rules
A convincing flock does not require a central controller. Each agent only needs a small neighborhood and a few competing impulses: avoid crowding, align with nearby motion, and stay close to the group.
Adding a predator changes the system from a visual effect into a simple behavioral experiment. The flock stretches, fragments, reforms, and sometimes produces strategies that were never explicitly programmed.
System design
- Vector-based steering forces
- Configurable perception and avoidance radii
- Predator targeting and prey threat response
- Debug overlays for direction, range, and velocity
Where it goes next
Future experiments could compare hand-authored steering with learned policies, add energy constraints, or measure survival under different flock parameters. The project is a useful sandbox because every new rule produces an immediately visible consequence.