No description
Find a file
2025-12-08 22:27:29 -05:00
public feat: enable history by default 2025-12-03 00:08:47 -05:00
test test: add unit tests and ESLint configuration 2025-12-02 22:58:02 -05:00
.gitignore test: add unit tests and ESLint configuration 2025-12-02 22:58:02 -05:00
docker-compose.override.yml refactor: separate dev volume mount to override file (phase 4.4) 2025-11-25 19:50:07 -05:00
docker-compose.yml update compose 2025-11-26 00:48:44 -05:00
Dockerfile initial commit 2025-11-22 00:52:19 -05:00
eslint.config.js feat: add selection tool with copy/cut/delete 2025-12-02 23:44:59 -05:00
LICENSE add license 2025-11-25 22:27:15 -05:00
package-lock.json run after dependabot... 2025-12-03 10:07:08 -05:00
package.json run after dependabot... 2025-12-03 10:07:08 -05:00
README.md update readme 2025-12-08 22:27:29 -05:00
vitest.config.js test: add unit tests and ESLint configuration 2025-12-02 22:58:02 -05:00

Life Engine

A high-performance, infinite-grid implementation of Conway's Game of Life with a polished web UI.

🎮 Live Demo

Features

Core Simulation

  • Infinite grid: Sparse chunk-based storage allows exploration in any direction
  • SWAR optimization: Bitwise parallel computation for fast generation steps
  • Web Worker: Simulation runs in background thread, keeping UI responsive
  • Custom CA rules: 10 presets (Conway, HighLife, Seeds, Maze, etc.) + custom B.../S... rules

Time Control

  • Play/Pause with adjustable speed (0.1-60 FPS, including fractional speeds)
  • Single-step forward/backward
  • Generation jumping: Skip to any future generation instantly
  • History buffer: Step-backward with configurable buffer size (5-100 steps, enabled by default)

Visualization

  • Cell colors: Choose from 8 colors
  • Age gradient: Dynamic coloring based on cell age (newborn -> ancient)
  • Activity heatmap: Visualize birth/death frequency
  • WebGL renderer: Optional GPU acceleration for small cell sizes
  • Adjustable zoom (2-40px per cell)
  • Grid lines (auto-hidden at small zoom)
  • Viewport panning (drag with Move tool)
  • Population graph: Real-time history visualization
  • FPS counter: Actual vs target FPS with chunk/history stats

Tools

  • Draw: Click/drag to create cells
  • Erase: Click/drag to remove cells
  • Select: Rectangle selection with copy/cut/delete
  • Move: Pan the viewport
  • Paste: Place patterns from library (click to place)
  • Load: Load pattern directly to grid
  • Rotate: Rotate selected pattern 90°

Pattern Library

30+ built-in patterns organized by category:

  • Still Lifes (Block, Beehive, Loaf, Boat, etc.)
  • Oscillators (Blinker, Toad, Pulsar, Pentadecathlon, etc.)
  • Spaceships (Glider, LWSS, MWSS, HWSS)
  • Guns (Gosper Gun, Simkin Gun)
  • Methuselahs (R-pentomino, Acorn, Diehard, etc.)

Import/Export

Supports multiple formats:

  • RLE (Run Length Encoded): Standard Life pattern format, compatible with Golly and LifeWiki
  • Macrocell (.mc): Golly's compressed quadtree format for large patterns (import only)

Export produces standard RLE files with current rule.

Randomize

Fill viewport with random cells at configurable density (5-95%).

Usage

docker compose up -d

Access at http://localhost:8088

Local

cd public
python3 -m http.server 8088

Keyboard Shortcuts

Key Action
Space Play/Pause
Step forward
Step backward (requires History enabled)
C Clear grid
R Rotate pattern
[ / ] Decrease/Increase speed
Tab Toggle sidebar
Ctrl+/ Show help
Ctrl+C Copy selection as RLE
Ctrl+X Cut selection
Delete Delete selection
Esc Clear selection / Close modals
Scroll Zoom in/out

File Formats

RLE Import/Export

Standard format used by most Life programs:

#C Comment
x = 3, y = 3, rule = B3/S23
bo$2bo$3o!

Macrocell Import

Golly's quadtree format for large patterns.

Resources