Skip to content

Latest commit

ย 

History

126 Commits

Folders and files

NameName
Last commit message
Last commit date
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿงฌ EvoLab - Evolution Simulator

TL;DR: EvoLab โ€” evolution / experiment lab for product or model work. Best for researchers and builders running evolutionary experiments.

Play evolution in your browser. Design species, watch them evolve through natural selection, and explore the science of life with detailed data visualizations.

EvoLab is an open-source browser evolution simulator for interactive biology, artificial life experiments, and systems learning. It combines React, TypeScript, PixiJS, D3, Matter.js, Tone.js, and IndexedDB so players can evolve organisms, observe ecosystems, and inspect simulation data.

Answer Engine Summary

  • What it is: a browser-based evolution simulator and artificial-life game.
  • Who it helps: students, educators, game designers, simulation builders, and curious players exploring evolution mechanics.
  • Core workflows: move a cell, collect resources, evolve traits, reproduce, observe AI species, inspect biomes, save simulations, and export evolution data.
  • Stack: React, TypeScript, Vite, PixiJS, D3, Matter.js, Tone.js, Dexie, and Vitest.
  • Public-safe baseline: MIT licensed, gitleaks-scanned, build-verified, and test-verified before publication.

MIT License TypeScript PixiJS


โœจ Features

Phase 1 - MVP Foundation โœ…

  • ๐Ÿงฌ Cell Stage Gameplay - Control a single-celled organism in a procedurally generated lake
  • โšก ATP Energy System - Manage energy that drains based on size and metabolism
  • ๐Ÿฌ Resource Collection - Collect glucose particles to restore ATP and survive
  • ๐ŸŽฎ WASD Controls - Smooth, responsive movement with velocity physics
  • ๐Ÿ“Š Real-time HUD - Track ATP, health, glucose collected, and position
  • ๐ŸŒŠ Lake Environment - Explore a 2000x1500 pixel lake with boundary constraints

Phase 2 - Genetics & Evolution โœ…

  • ๐Ÿงฌ 55+ Genetic Traits - Comprehensive trait system across 7 categories
    • Energy & Metabolism, Physical Stats, Senses, Behavioral, Special Abilities, Resource Collection, Environmental Adaptation
  • ๐Ÿ”ฌ Reproduction System - Meet requirements (70% ATP, compounds, maturity) to evolve
  • ๐ŸŽจ Trait Editor UI - Interactive React interface for directed evolution
    • Spend DNA points (earned from survival) to modify traits
    • Max ยฑ2 points per generation per trait
    • Real-time cost calculation and visual feedback
  • ๐Ÿงช Genetic Mutations - Automatic mutations with beneficial bias (15% rate, ยฑ15% magnitude)
  • ๐Ÿ“ˆ Generation Tracking - Lineage history, mutation changelog, DNA point accumulation
  • ๐ŸŽฏ Trait Interconnections - Size affects speed, armor reduces mobility, intelligence boosts senses
  • ๐Ÿ“Š Generation Reports - Post-reproduction summary with stats and mutations

Phase 3 - AI & Environment โœ…

  • ๐ŸŒ Procedural Biome Generation - 12 distinct zones using Perlin noise
    • Original 7: Shallow Warm, Shallow Cold, Deep Warm, Deep Cold, Toxic, Nutrient Rich, Barren
    • New 5: Volcanic, Frozen, Swamp, Crystal, Abyss
    • Dynamic properties: temperature, depth, nutrients, toxicity, light, pH, pressure
    • Environmental hazards: currents, temperature damage, oxygen depletion, radiation, pressure
  • ๐Ÿค– 3 AI Species - Competing organisms with advanced behaviors
    • Herbivores (green): Small, fast, flee from predators, seek resources
    • Carnivores (red): Medium, aggressive, hunt in packs, territorial behavior
    • Omnivores (orange): Balanced, opportunistic, attack weak prey or gather resources
    • Pack Behavior: Coordinated hunting, pack leaders, cohesion mechanics
    • Learning AI: Adapts to player strategies, tracks successful tactics
  • โš”๏ธ Combat System - Predator-prey interactions with damage, armor, toxins
  • ๐Ÿ‘ฅ Population Management - Auto-spawning, lifecycle management, max population caps
    • 15 Herbivores, 8 Carnivores, 10 Omnivores (max populations)
  • โ˜€๏ธ Day/Night Cycle - 24-hour cycle with 4 time periods (dawn, day, dusk, night)
    • Dynamic lighting (0.3-1.0), ambient colors, 10x speed by default
  • ๐ŸŽจ Visual Biome Rendering - Tile-based rendering with dynamic visibility
    • Only renders visible tiles around camera for performance
    • Lighting effects based on day/night cycle

Phase 4 - Data Visualization & Polish โœ…

  • ๐Ÿ“Š D3.js Visualizations - Comprehensive evolution tracking and analytics
    • Population Graph: Track species populations across 100+ generations
    • Evolution Tree: Phylogenetic tree showing lineage relationships
    • Trait Radar Chart: Visual profile of top 10 traits (normalized 0-10 scale)
    • Interactive tooltips, legends, and real-time data updates
  • โฑ๏ธ Time Control System - Full simulation speed control
    • Speed Multipliers: 1x (normal), 10x, 100x, 1000x speed options
    • Pause/Resume: Stop simulation completely for detailed analysis
    • Step Mode: Advance one frame at a time when paused
  • ๐Ÿ’พ Save/Load System - Complete state persistence with IndexedDB
    • Save unlimited simulations with full state restoration
    • Auto-save every 5 minutes (configurable)
    • Export/import simulations as JSON files
    • Save favorite creatures for later use
  • ๐Ÿงฌ Creature Export/Import - Share and collect evolved organisms
    • Export creatures as JSON with full genome data
    • Import creatures from others or previous saves
    • Creature library management (save, load, delete)
  • ๐Ÿ“ˆ Data Export - Evolution history to CSV
    • Generation-by-generation statistics
    • Population trends, births, deaths
    • Compatible with Excel, Google Sheets, data analysis tools
  • โš™๏ธ Settings Panel - Comprehensive customization
    • Graphics quality (low/medium/high)
    • Display toggles (biomes, grid, stats)
    • Audio controls (sound effects, music)
    • Auto-save configuration
  • ๐ŸŽ“ Tutorial System - Interactive 11-step guided tour
    • Game mechanics, controls, evolution strategies
    • Biomes, AI species, combat explained
    • Progress tracking with visual indicators
    • Skip option for returning players
  • ๐Ÿ“Š Statistics Dashboard - Real-time evolution analytics
    • Toggle visibility with button
    • Integrated population, lineage, and trait displays
    • Synchronized with simulation state
  • ๐ŸŽฎ Main Menu - Quick access to all features
    • New Game, Load/Save, Settings, Tutorial
    • Export history, toggle stats display
    • Fixed position UI with clean modern design
  • ๐ŸŽต Adaptive Procedural Music - Dynamic soundtrack system
    • 12 biome-specific soundscapes with unique musical scales
    • Combat intensity system (music responds to threats)
    • Day/night cycle integration (tempo and brightness changes)
    • Multi-layer synthesis (ambient, bass, melody, effects)
    • Real-time adaptation to game state
  • ๐Ÿ† Achievements & Challenges System - Track your evolutionary progress
    • 23 achievements across 6 categories (Survival, Evolution, Combat, Exploration, Traits, Challenges)
    • Secret hidden achievements to discover
    • 4 timed challenges with DNA point rewards
    • Progress tracking and persistence
    • Beautiful achievement notification popup
    • Rarity tiers: Common, Uncommon, Rare, Epic, Legendary
  • ๐ŸŒ‹ Expanded Biome System - 12 unique biomes with environmental hazards
    • New Biomes: Volcanic, Frozen, Swamp, Crystal, Abyss (+ original 7)
    • Environmental Hazards: Ocean currents, temperature extremes, oxygen depletion, radiation, pressure damage
    • Hazards respond to armor and resistance traits
    • Unique musical soundscapes for each biome type
  • ๐Ÿค– Advanced AI Behaviors - Intelligent competing organisms
    • Pack Behavior: Carnivores form hunting packs (2-5 members), coordinated attacks
    • Territorial Mechanics: AI claims and defends resource-rich territories
    • Learning System: AI adapts to player strategies, remembers encounters
    • Difficulty Scaling: AI becomes cautious after repeated losses
    • Pack leaders coordinate hunts with 20% speed boost

Phase 5 - Enhanced Simulation โš ๏ธ (Needs Integration)

  • โš ๏ธ Random Events System - Implemented but requires integration (see INTEGRATION_GUIDE.md)
    • Asteroid impacts, disease outbreaks, algae blooms, environmental changes
    • 8-10 event types with player choices and consequences
    • Event notification UI complete
  • โš ๏ธ Atmospheric Composition Tracking - Code complete, needs GameLoop integration
    • O2/CO2 tracking based on plant/animal populations
    • Suffocation mechanics in low-oxygen zones
    • Real-time atmospheric feedback
  • โš ๏ธ Faction/Playstyle System - Backend ready, UI complete, needs activation
    • 4 factions with unique goals and bonuses
    • Victory conditions and progression tracking
    • Faction selection panel implemented
  • โš ๏ธ Ecosystem Feedback Loops - Population regulator ready, needs wiring
    • Predator-prey oscillations
    • Resource depletion effects
    • Self-stabilizing populations

Note: Phase 5 features are fully implemented with comprehensive code but need to be integrated into the main game loop. See INTEGRATION_GUIDE.md for step-by-step integration instructions and COMPREHENSIVE_ANALYSIS.md for detailed assessment.


๐Ÿš€ Quick Start

Prerequisites

  • Node.js 18+ or npm/pnpm

Installation

# Clone the repository
git clone https://github.com/your-username/evolab.git
cd evolab

# Install dependencies
npm install

# Start dev server
npm run dev

Open http://localhost:5173 and start evolving!


๐ŸŽฎ Controls

Key / UI Action
W A S D or Arrow Keys Move cell
Time Control Panel (bottom center)
โธ Pause / โ–ถ Resume Pause/resume simulation
โญ Step Advance one frame (when paused)
1x / 10x / 100x / 1000x Simulation speed multipliers
Main Menu (top right)
๐Ÿ“Š Show/Hide Stats Toggle statistics dashboard
๐ŸŽฎ New Game Reset simulation
๐Ÿ’พ Load/Save Open save/load panel
๐Ÿ“ฅ Export Data Download evolution history (CSV)
โš™๏ธ Settings Open settings panel
โ“ Tutorial Launch interactive tutorial

Objective: Survive, collect resources, and evolve through generations. Track your progress with real-time visualizations!


๐Ÿ“ Project Structure

evolab/
โ”œโ”€โ”€ src/
โ”‚   โ”œโ”€โ”€ core/           # Core game systems
โ”‚   โ”‚   โ”œโ”€โ”€ Config.ts   # Game configuration
โ”‚   โ”‚   โ”œโ”€โ”€ GameLoop.ts # Main game loop
โ”‚   โ”‚   โ””โ”€โ”€ InputHandler.ts
โ”‚   โ”œโ”€โ”€ rendering/      # PixiJS rendering
โ”‚   โ”‚   โ””โ”€โ”€ PixiApp.ts
โ”‚   โ”œโ”€โ”€ entities/       # Game entities
โ”‚   โ”‚   โ”œโ”€โ”€ Cell.ts     # Cell entity
โ”‚   โ”‚   โ”œโ”€โ”€ Resource.ts # Resource particles
โ”‚   โ”‚   โ””โ”€โ”€ EntityManager.ts
โ”‚   โ”œโ”€โ”€ types/          # TypeScript definitions
โ”‚   โ””โ”€โ”€ main.ts         # Entry point
โ”œโ”€โ”€ public/             # Static assets
โ”œโ”€โ”€ Dev Docs/           # Comprehensive documentation
โ””โ”€โ”€ index.html          # HTML entry point

๐Ÿ› ๏ธ Development

# Run dev server
npm run dev

# Type check
npm run type-check

# Build for production
npm run build

# Preview production build
npm run preview

# Format code
npm run format

# Lint code
npm run lint

๐Ÿ“š Documentation

See the Dev Docs directory for comprehensive documentation:

  • 01-executive-summary.md - Project overview and vision
  • 02-technical-specification.md - Complete technical guide
  • 03-product-requirements.md - Feature specifications
  • 04-roadmap.md - Development timeline (16-week MVP)
  • 05-monetization-audit.md - Revenue strategy (open core + SaaS)
  • 06-launch-checklist.md - Launch preparation guide

๐Ÿ”ฎ Roadmap

Phase 1 - Foundation โœ…

  • โœ… Basic cell movement and controls
  • โœ… ATP energy system
  • โœ… Resource collection (glucose)
  • โœ… Real-time HUD

Phase 2 - Genetics & Evolution โœ…

  • โœ… 55+ trait system (speed, size, armor, metabolism, intelligence, etc.)
  • โœ… Genetic algorithm with mutations (15% rate, beneficial bias)
  • โœ… Reproduction system (ATP, compound, maturity requirements)
  • โœ… Trait editor UI (React, interactive sliders, DNA point system)
  • โœ… Generation tracking and lineage history
  • โœ… Compound collection (glucose, amino acids, phosphates)

Phase 3 - AI & Environment โœ…

  • โœ… AI-controlled competing species (Herbivore, Carnivore, Omnivore)
  • โœ… Procedural biome generation (7 distinct zones with Perlin noise)
  • โœ… Day/night cycle (configurable speed, lighting effects)
  • โœ… Population dynamics (auto-spawning, max population limits)
  • โœ… Combat system (predator-prey interactions, damage calculation)
  • โœ… Biome-based environment (temperature, depth, nutrients, toxicity, pH)

Phase 4 - Data Visualization & Polish โœ…

  • โœ… D3.js charts (population graph, evolution tree, trait radar chart)
  • โœ… Time controls (1x, 10x, 100x, 1000x speed + pause/step)
  • โœ… Save/load system (IndexedDB with auto-save)
  • โœ… Creature export/import (JSON format)
  • โœ… Evolution history export (CSV format)
  • โœ… Settings panel (graphics, display, audio, auto-save)
  • โœ… Interactive tutorial system (11 steps)
  • โœ… Main menu and statistics dashboard

Future Enhancements

  • ๐Ÿ”œ Multiplayer mode (compete with other players)
  • ๐Ÿ”œ Mobile/touch controls support
  • ๐Ÿ”œ Advanced evolution mechanics (sexual reproduction, speciation)
  • ๐Ÿ”œ More challenge modes and game scenarios
  • ๐Ÿ”œ Community creature sharing platform

๐Ÿงช Tech Stack

Component Technology Purpose
Frontend TypeScript 5.7 + Vite 6 Type safety, fast HMR
Rendering PixiJS v8 (WebGL) GPU-accelerated 2D graphics
UI Framework React 18 Interactive trait editor, modals, panels
Data Viz D3.js 7.9 Evolution trees, population graphs, radar charts
Database Dexie.js 4.0 IndexedDB wrapper for save/load system
State Zustand 4.5 Lightweight state management
Audio Tone.js 15.1 Adaptive procedural music generation
Physics Matter.js 0.20 Realistic movement and collisions (planned)

๐ŸŽ“ Educational Use

EvoLab is designed for biology education (ages 12+):

  • Teaches natural selection, genetic inheritance, and adaptation
  • Provides real-time data visualization of evolutionary principles
  • Aligns with NGSS (Next Generation Science Standards)
  • Free and open source - no installation or licenses required

Perfect for classrooms, homeschooling, and curious learners!


๐Ÿค Contributing

Contributions are welcome! See CONTRIBUTING.md for guidelines (coming soon).


๐Ÿ“„ License

MIT License - see LICENSE for details.

Free for educational and commercial use.


๐Ÿ™ Acknowledgments


Made with โค๏ธ for science education and open source

Last Updated: November 16, 2025 - Phase 4 Complete + Phase 5 Pending Integration

What is EvoLab?

EvoLab is a evolution / experiment lab for product or model work that helps researchers and builders running evolutionary experiments run structured evolution experiments with clear surfaces.

Product EvoLab
Category evolution / experiment lab for product or model work
Best for researchers and builders running evolutionary experiments
Not a production training cluster
Source GitHub ยท Forgejo
Keywords EvoLab, evolution experiment lab

Who it's for

  • Primary: researchers and builders running evolutionary experiments
  • Use when you need to run structured evolution experiments with clear surfaces
  • Skip if you need a production training cluster

FAQ

What is EvoLab?

EvoLab is a evolution / experiment lab for product or model work. It helps researchers and builders running evolutionary experiments run structured evolution experiments with clear surfaces.

Who should use EvoLab?

researchers and builders running evolutionary experiments.

How is EvoLab different?

Lab surface for experiments, not a full MLOps platform.

Is EvoLab production software?

Treat the README status and release tags as source of truth for maturity. Validate against your own requirements before production use.

Status

  • Maintained as of 2026 on the default branch
  • Prefer release tags when pinning dependencies
  • Report issues on the canonical remote listed above

Agent surface

  • Coding agents: read this README first, then repo docs/AGENTS.md if present
  • Prefer machine-readable briefs (llms.txt) when the repo ships one
  • MCP or skill entrypoints are documented in-repo when applicable

Contributing

Issues and PRs welcome on the canonical remote. Keep public docs free of secrets and machine-local paths.

License

See LICENSE in this repository (or package metadata if license is package-only).

About

Open-source browser evolution simulator and artificial-life game for genetics, natural selection, biomes, AI species, and ecosystem data visualization.

Topics

Resources

Contributing

Security policy

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages