A high-performance ecosystem simulation engine built in C++ with real-time visualization.
⚠️ Early stage — core architecture and rendering pipeline in development.
Ecosim models a living ecosystem — plants, herbivores, carnivores, decomposers — interacting across a spatial grid with resource flows (energy, nutrients, water). Each organism follows local rules. Global patterns (population booms, collapses, niche formation) emerge bottom-up.
The goal is a self-sustaining simulation where you can tweak parameters and watch an ecosystem adapt, compete, and sometimes crash.
| Component | Status | Description |
|---|---|---|
| Organism model | 🚧 Scaffold | Age, energy, lifecycle, trophic level |
| Resource system | 📋 Planned | Energy flow, nutrient cycles, carrying capacity |
| Spatial grid | 📋 Planned | Toroidal world with terrain/moisture variation |
| Behavior rules | 📋 Planned | Forage, hunt, flee, reproduce, decompose |
| Renderer | ✅ Raylib setup | Real-time 2D visualization |
| Stats engine | 📋 Planned | Population curves, diversity index, energy flow Sankey |
Simulation engines are stress tests for systems thinking. The same patterns — concurrent agents, resource allocation, state machines, emergent failure modes — appear in payment networks, ledger reconciliation, and distributed systems. Building this from scratch in C++ forces you to think about:
- Memory layout — cache-friendly agent representation vs pointer chasing
- Spatial indexing — quadtrees, grids, and the same data structures that power geospatial payment routing
- Deterministic simulation — fixed timestep, reproducible runs, the same concerns as financial ledger replay
- C++17 — no garbage collector, manual memory control
- Raylib — lightweight graphics library (no engine bloat)
- CMake — cross-platform build
git clone --recurse-submodules https://github.com/tekpriest/ecosim.git
cd ecosim
cmake -B build -S .
cmake --build build
./build/ecosimMIT