Skip to content

codevalley/preylife

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

68 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Preylife Logo

๐ŸŒฟ Preylife

An evolutionary ecosystem simulation where complex behaviors emerge from simple rules.

๐ŸŽฎ Overview

Preylife is a digital ecosystem that demonstrates the emergence of complex evolutionary strategies through simple probabilistic rules. Watch as creatures evolve, adapt, and develop fascinating survival strategies in real-time.

For detailed information about the simulation, check out our comprehensive guide.

โœจ Features

  • ๐Ÿงฌ Real-time evolution simulation
  • ๐Ÿ”„ Complex emergent behaviors
  • ๐ŸŽฏ Natural selection and adaptation
  • ๐ŸŒ Dynamic ecosystem balance
  • ๐Ÿ“Š Population monitoring
  • ๐ŸŽจ Beautiful visual feedback
  • โš™๏ธ Customizable parameters
Preylife gameplay

๐Ÿš€ Getting Started

  1. Clone the repository
  2. Install dependencies:
    npm install
  3. Start the development server:
    npm run dev

๐Ÿ“– Documentation

๐Ÿ“„ License

This project is licensed under the BSD 2-Clause License - see the LICENSE.md file for details.

Attribution Requirements

If you use or modify this software, please provide appropriate credit by:

  1. Retaining the copyright notice in the LICENSE.md
  2. Including a reference to the original project (Preylife)
  3. Indicating if changes were made

๐Ÿค Contributing

Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.

๐ŸŽฎ Live Demo

[Add your demo link here]

Ecosystem Simulation in Action Screenshot: Blue circles represent prey, yellow pentagons are predators, and green dots are food resources. The UI shows simulation controls, population statistics, and creature attributes.

๐ŸŒŸ Key Features

๐Ÿงฌ Dynamic Evolution

  • Creatures evolve four key attributes that determine their survival strategy:
    • Strength (movement speed & combat)
    • Stealth (detection & evasion)
    • Learnability (adaptation speed)
    • Longevity (lifespan & metabolism)
  • Watch as populations naturally develop specialized traits:
    • Stealthy prey that excel at predator detection
    • Strong predators that dominate through raw power
    • Balanced generalists that adapt to changing conditions

๐ŸŒ Rich Environmental Dynamics

  • Seasonal Resource Blooms: Every 90 days, massive resource clusters appear
  • Adaptive Resource Generation: Environment responds to population pressures
  • Geographic Specialization: Limited movement speeds create distinct regional populations
  • Natural Decay: Resources and creatures age and expire naturally

๐Ÿงช Complex Interactions

  • Sophisticated Hunting: Multi-stage predator-prey encounters with stealth and strength checks
  • Social Learning: Creatures can learn from successful neighbors
  • Anti-Clumping Behavior: Natural territorial spacing
  • Energy Economics: Realistic metabolism and activity costs

๐Ÿ”„ Population Dynamics

  • Boom-Bust Cycles: Natural population fluctuations
  • Extinction Events: Populations can die out if they fail to adapt
  • Recovery Mechanics: Environmental responses help prevent complete ecosystem collapse
  • Species Conversion: Rare evolutionary jumps between predator and prey roles

๐Ÿ”ฌ Scientific Background

This simulation explores several key ecological and evolutionary concepts:

  • Natural selection and adaptation
  • Predator-prey population dynamics
  • Evolutionary arms races
  • Specialized vs. generalist strategies
  • Resource competition and territorial behavior
  • Population bottlenecks and recovery

๐ŸŽฏ Goals of the Project

  1. Educational Value: Demonstrate fundamental principles of ecology and evolution
  2. Research Platform: Provide a testbed for studying emergent evolutionary behaviors
  3. Visual Appeal: Create an engaging visualization of complex natural processes
  4. Computational Efficiency: Handle hundreds of entities with sophisticated AI in real-time

๐Ÿ›  Technical Implementation

  • Built with TypeScript and Three.js
  • Entity Component System (ECS) architecture
  • Spatial partitioning for efficient collision detection
  • Configurable simulation parameters
  • Real-time statistics and visualization

๐Ÿ“Š Observable Phenomena

Evolutionary Strategies

  • Development of "speed demons" vs "stealth masters"
  • Formation of territorial hunting grounds
  • Emergence of specialized survival strategies

Population Patterns

  • Predator-prey cycles
  • Geographic specialization
  • Extinction and recolonization events
  • Learning cascades through populations

Environmental Adaptation

  • Resource clustering effects
  • Seasonal migration patterns
  • Niche exploitation
  • Territorial boundaries

๐Ÿค Contributing

Contributions are welcome! Some areas for potential enhancement:

  • Additional creature attributes
  • New environmental factors
  • Enhanced visualization options
  • Performance optimizations
  • Data collection and analysis tools

๐Ÿ™ Acknowledgments

This project draws inspiration from:

  • Classic predator-prey models (Lotka-Volterra equations)
  • Modern ecological research
  • Various open-source evolution simulators

"In nature, nothing exists alone." - Rachel Carson

About

A simulation of prey-predator-resources dynamics, which reward evolution, mutation and diversity.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages