How maxrobinsonthegreat/lifeengine works
Project type and purpose
• This is a client-side web application (a single-page simulation) called “The Life Engine.”
• Its purpose is to simulate biological evolution on a 2D grid (cellular automaton) in the browser.
File structure
• Top-level:
• package.json, webpack.config.js → build & bundling
• src/ → application source code (Controllers, Engine, Environments, Grid, Organism, Rendering, Stats, Utils)
• dist/ → compiled output (index.html, CSS, JS bundle, static JSON assets under dist/assets)
• Key directories & patterns:
• src/Controllers: UI controllers (Canvas, Load, Editor, ControlPanel, EnvironmentController, ControlModes)
• src/Engine.js: central simulation loop & tick orchestration
• src/Environments: environment abstractions (grid, organism editor, world environment)
• src/Grid & src/Organism: domain model for cells, organisms, anatomy, brain, perception
• src/Rendering: drawing logic (Renderer, ColorScheme)
• src/Stats: statistical tracking & charting components
• src/Utils: helper libraries (Perlin noise, serialization)
README for additional insights
• The simulation evolves organisms via reproduction, mutation, movement, perception, and selection.
• Assets (worlds, organisms, mods) are loaded as JSON from dist/assets.
• The UI exposes controls to start/stop, toggle modes, edit organisms and environments.
• Stats panel visualizes population, mutations, species over time.