Skip to content

A Typescript-based simulation involving agents competing to collect food in the least amount of time. The project features genetic algorithms and neural networks to evolve agent behavior and decision-making over time.

License

Notifications You must be signed in to change notification settings

CodeByBryant/Evo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

๐Ÿงฌ Evo

Experience the emergence of complex behaviors from simple rules, just like nature intended.

CI Deploy License: MIT TypeScript React

๐ŸŽฎ Play Online โ€ข ๐Ÿ“ฅ Download โ€ข ๐Ÿ“– Documentation


๐ŸŒŸ About Evo

Evo is an advanced neural network-based evolutionary sandbox where AI agents evolve through natural selection.

Agents navigate an infinite 2D world, sense their environment using raycasting, and make decisions through neural networks that evolve over generations. Watch species emerge, compete for resources, and evolve complex behaviors in real-time!

const evo = {
    type: "Neural Evolution Sandbox",
    features: ["Genetic Algorithms", "Neural Networks", "Infinite World", "Species Tracking"],
    inspiration: ["Cell Lab", "Thrive", "The Life Engine", "Bionic Chaos Evolution"],
    goal: "Watch AI evolve complex behaviors from simple rules ๐Ÿงฌ"
};

๐Ÿš€ Quick Start

Play Online (No Installation Required)

Play Now

๐Ÿ“ฅ Download Desktop App


โœจ Features

๐Ÿงฌ Evolution & Genetics

  • Full Genetic Algorithm: Reproduction, crossover, mutation, and natural selection
  • Generational Evolution: Watch populations evolve over hundreds of generations
  • DNA Visualization: Beautiful animated double helix showing agent genomes
  • Species Tracking: Automatic species identification with color coding
  • Configurable Evolution: Adjust mutation rates, selection pressure, and more

๐Ÿง  Advanced Neural Networks

  • Multi-Layer Perceptron: Configurable architecture with modern activation functions
  • Crossover Reproduction: Genetic combination from two parents
  • Adaptive Mutation: Gaussian and uniform mutation strategies
  • Weight Initialization: Xavier and He initialization methods
  • Activation Functions: Swish, ELU, Leaky ReLU, Tanh

๐ŸŒ Infinite World

  • Infinite Scrollable Map: Pan and zoom through an endless 2D world
  • Camera Controls: Middle/Right mouse to pan, scroll to zoom
  • Smooth Navigation: Explore the ecosystem from different perspectives
  • Dynamic Grid: Visual grid that adapts to zoom level

๐Ÿ“Š Evolution Tracking

  • Real-Time Charts: Population and fitness graphs over generations
  • Live Statistics: Generation, species count, avg/max fitness
  • Performance Metrics: FPS counter and simulation status
  • Historical Data: Track evolution progress over 50+ generations

๐Ÿ’ป Tech Stack

TypeScript React Electron Vite Node.js


๐ŸŽฎ Controls

Action Control
Select Agent Left Click
Pan Camera Middle Mouse / Right Mouse / Ctrl+Click
Zoom Mouse Wheel
Deselect Click Empty Space

Simulation Controls

  • Start/Pause: Toggle simulation execution
  • Reset: Start fresh with new random population
  • Speed Slider: Adjust simulation speed (0.1x - 3.0x)

Evolution Settings

  • Generation Time: How long each generation lasts
  • Selection Rate: Percentage of top performers that survive
  • Mutation Rate: Probability of genetic mutations
  • Population Size: Target number of agents

๐Ÿงฌ How Evolution Works

graph LR
    A[๐ŸŒฑ Birth] --> B[๐Ÿƒ Life]
    B --> C{Energy?}
    C -->|High| D[๐Ÿ”„ Reproduce]
    C -->|Low| E[๐Ÿ’€ Death]
    D --> F[๐Ÿงฌ Crossover & Mutation]
    F --> A
    E --> G[๐Ÿ“Š Selection]
    G --> A
Loading

The Evolution Cycle

  1. ๐ŸŒฑ Life Cycle - Agents consume food, expend energy, and age
  2. ๐Ÿ”„ Reproduction - Fit agents reproduce through crossover and mutation
  3. ๐Ÿ“Š Natural Selection - Top performers survive, weak are eliminated
  4. ๐ŸŒˆ Speciation - Species naturally emerge with unique colors

๐Ÿ› ๏ธ Development

Prerequisites

  • Node.js (v18 or later)
  • npm or yarn

Installation

# Clone the repository
git clone https://github.com/CodeByBryant/Evo.git
cd Evo

# Install dependencies
npm install

# Start web development server
npm run dev:web

# (Optional) Run as Electron desktop app
npm run dev

Available Scripts

# Web
npm run dev:web      # Start Vite dev server
npm run build:web    # Build for production

# Desktop
npm run dev          # Start Electron app
npm run build:win    # Build for Windows
npm run build:mac    # Build for macOS
npm run build:linux  # Build for Linux

# Code Quality
npm run lint         # Lint code
npm run format       # Format with Prettier
npm run typecheck    # TypeScript checking

๐Ÿ”ฎ What Makes Evo Special

Feature Description
๐ŸŒ Infinite World Unlike bounded simulations, agents exist in endless space
๐Ÿ”ฌ Real Genetics True crossover and mutation, not simplified rules
๐ŸŒˆ Species Emergence Natural speciation without manual intervention
โšก Performance Handles 100+ agents at 60 FPS

๐Ÿค Contributing

Contributions are welcome! Feel free to:

  • ๐Ÿ› Report bugs via GitHub Issues
  • ๐Ÿ’ก Submit feature requests
  • ๐Ÿ”ง Create pull requests with improvements
  • ๐Ÿงฌ Share your evolved populations

๐Ÿ“„ License

This project is licensed under the MIT License. See the LICENSE file for details.


๐Ÿ‘จโ€๐Ÿ’ป Author

Developed with โค๏ธ by Bryant Ejorh (@CodeByBryant)

Portfolio GitHub


๐Ÿ’ญ "Watch evolution in action! Experience the emergence of complex behaviors from simple rules."

โญ Star this repo if you find it interesting!

Made with โค๏ธ and lots of โ˜•

About

A Typescript-based simulation involving agents competing to collect food in the least amount of time. The project features genetic algorithms and neural networks to evolve agent behavior and decision-making over time.

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages