Update README.md
Browse files
README.md
CHANGED
|
@@ -1,11 +1,80 @@
|
|
| 1 |
---
|
| 2 |
title: Digital Life Evolution Simulator
|
| 3 |
-
emoji:
|
| 4 |
-
colorFrom:
|
| 5 |
-
colorTo:
|
| 6 |
sdk: static
|
| 7 |
pinned: false
|
| 8 |
short_description: A self-evolving ecosystem that runs entirely in the browser
|
| 9 |
---
|
| 10 |
|
| 11 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
title: Digital Life Evolution Simulator
|
| 3 |
+
emoji: π§¬
|
| 4 |
+
colorFrom: blue
|
| 5 |
+
colorTo: red
|
| 6 |
sdk: static
|
| 7 |
pinned: false
|
| 8 |
short_description: A self-evolving ecosystem that runs entirely in the browser
|
| 9 |
---
|
| 10 |
|
| 11 |
+
# Digital Life Evolution Simulator
|
| 12 |
+
|
| 13 |
+
A self-evolving AI ecosystem where autonomous entities compete, reproduce, and adapt through neural networks and genetic algorithms. Watch digital life emerge and evolve in real-time.
|
| 14 |
+
|
| 15 |
+
## What It Does
|
| 16 |
+
|
| 17 |
+
This simulation creates a population of AI entities with unique genomes that control their behavior through neural networks. Each entity:
|
| 18 |
+
|
| 19 |
+
- **Perceives** its environment (food, energy, other entities)
|
| 20 |
+
- **Decides** actions based on neural network processing
|
| 21 |
+
- **Adapts** through natural selection - successful traits get passed to offspring
|
| 22 |
+
- **Evolves** over generations as mutations introduce variation
|
| 23 |
+
|
| 24 |
+
Four entity types exist:
|
| 25 |
+
|
| 26 |
+
- **Gatherers** - Collect food and energy efficiently
|
| 27 |
+
- **Predators** - Hunt and consume other entities
|
| 28 |
+
- **Builders** - Create structures and territorial markers
|
| 29 |
+
- **Explorers** - Scavenge and discover new resources
|
| 30 |
+
|
| 31 |
+
## Quick Start
|
| 32 |
+
|
| 33 |
+
```bash
|
| 34 |
+
# Start a local server
|
| 35 |
+
npx serve .
|
| 36 |
+
# or
|
| 37 |
+
python3 -m http.server 8000
|
| 38 |
+
|
| 39 |
+
# Open in browser
|
| 40 |
+
http://localhost:8000
|
| 41 |
+
```
|
| 42 |
+
|
| 43 |
+
## Features
|
| 44 |
+
|
| 45 |
+
- **Neural Network AI** - Each entity has a unique brain with 80+ configurable parameters
|
| 46 |
+
- **Genetic Algorithm** - Reproduction with crossover and mutation
|
| 47 |
+
- **Spatial Awareness** - Efficient spatial hashing for proximity detection
|
| 48 |
+
- **Real-time Stats** - Track population, generations, fitness, and neural activity
|
| 49 |
+
- **Visual Feedback** - See neural network activations while watching decisions
|
| 50 |
+
|
| 51 |
+
## Tech Stack
|
| 52 |
+
|
| 53 |
+
- Pure vanilla JavaScript (ES2022 modules)
|
| 54 |
+
- HTML5 Canvas rendering
|
| 55 |
+
- No build step, no dependencies
|
| 56 |
+
|
| 57 |
+
## Project Structure
|
| 58 |
+
|
| 59 |
+
```
|
| 60 |
+
js/
|
| 61 |
+
βββ ecosystem.js # Main loop, initialization
|
| 62 |
+
βββ world.js # Environment, resource spawning
|
| 63 |
+
βββ entities.js # Entity behavior logic
|
| 64 |
+
βββ entityManager.js # Lifecycle management
|
| 65 |
+
βββ genetics.js # Genome creation, reproduction
|
| 66 |
+
βββ neuralNetwork.js # AI decision-making
|
| 67 |
+
βββ particles.js # Visual effects
|
| 68 |
+
βββ stats.js # Performance telemetry
|
| 69 |
+
βββ ui.js # Controls, event logs
|
| 70 |
+
βββ utils.js # Math, object pools, spatial grid
|
| 71 |
+
```
|
| 72 |
+
|
| 73 |
+
## How Evolution Works
|
| 74 |
+
|
| 75 |
+
1. **Selection** - Entities with higher fitness are more likely to reproduce
|
| 76 |
+
2. **Crossover** - Two parents combine their neural network weights
|
| 77 |
+
3. **Mutation** - Random Gaussian noise introduces variation
|
| 78 |
+
4. **Survival** - Less fit entities die; successful traits propagate
|
| 79 |
+
|
| 80 |
+
Over time, you'll observe emergent behaviors as entities adapt to the competitive environment.
|