About Pixel Cells

Overview

Pixel Cells is a massively-parallel artificial life simulation running on a 2D grid. Each pixel on the grid can host a cell with its own energy, genes, and behavior. Cells compete for space and energy, divide, mutate, and evolve over time. The simulation runs on the GPU for acceleration.

The Grid

The world is a rectangular grid (default 350×350, configurable). Each position is a pixel that can either be empty or contain a cell. Empty pixels still store environmental energy that cells can extract. The grid supports two boundary modes: cycled (toroidal wrap-around, default) and non-cycled (bounded edges where out-of-bounds actions fail).

Cell State

Each cell carries: energy (its life force), will (dominance in conflicts and the cost of each gene activation), max energy (cap), max energy to get (cap per action), a gene matrix defining its behavior, and a death mode flag. When a cell’s energy drops below the cost of executing all its genes in a frame, it enters death mode and executes suicide genes before being removed.

Gene System

Each cell has a gene matrix with per-cell dimensions. Width and height are randomly assigned from configurable min/max ranges (default 4–12) when the simulation starts. These dimensions are inherited by child cells during division and cannot mutate. The width is the number of genes in a genome, the height determines available gene sets. Standard genes: • Idle (0) — no action • Divide Up/Right/Down/Left (1–4) — create a copy of the cell in the adjacent pixel • Extract Field Energy (5) — take energy from the pixel’s field • Obtain Solar Energy (6) — absorb solar energy • Transfer Energy Up/Right/Down/Left (7–10) — send energy to a neighboring cell Suicide genes (activated in death mode): • Max Empty Energy +1/–1 (11–12) — permanently modify the pixel’s empty-cell energy cap (self) • Max Cell Energy +1/–1 (13–14) — permanently modify the pixel’s occupied-cell energy cap (self) • Sun Fee +1/–1 (15–16) — permanently modify the pixel’s sun fee (self) Directional suicide genes (activated in death mode, affect a neighbor in the specified direction): • Neighbor Max Empty Energy +1/–1 Up/Right/Down/Left (17–24) — modify a neighbor’s empty-cell energy cap • Neighbor Max Cell Energy +1/–1 Up/Right/Down/Left (25–32) — modify a neighbor’s occupied-cell energy cap • Neighbor Sun Fee +1/–1 Up/Right/Down/Left (33–40) — modify a neighbor’s sun fee • Ban Neighbor Container Up/Right/Down/Left (41–44) — permanently prevent a neighboring pixel from hosting any cell (shown as gray) • Unban Neighbor Container Up/Right/Down/Left (45–48) — restore a banned neighbor pixel’s ability to host cells

Energy Model

The system receives energy through “sunlight” each frame. Cells can extract energy from their pixel (gene 5), absorb solar energy (gene 6), or transfer energy to neighbors (genes 7–10). Each gene activation costs energy equal to the cell’s will value. Pixel energy is capped per-pixel (empty cell cap and cell cap are set separately in Controls). Division energy cost can be configured via two modes: Cell Energy (default) — the child receives a configurable percentage of the parent’s available energy; Max Cell Energy — the child receives a fixed amount equal to the configured percentage of the cell’s max energy cap. In Max Cell Energy mode, if a cell cannot afford all its division genes, only the last ones in the gene row will fire.

Sunlight

The sun provides energy to the grid each frame. Solar power is configured via a min/max range (default 0–5) and a day cycle duration in steps (default 100). Sun position modes control where sunlight reaches: • Full Canvas — uniform sun across all pixels • Island — elliptical sunlit area at center (configurable X/Y radius) • Gradient — 100% power at center, 10% at borders, linear falloff • 4 Islands — four identical ellipses at quadrant centers • Gradient + 4 Islands — gradient background with full-power islands • Gradient + Island — gradient applied within the central ellipse only Sun working modes: • Day/Night cycle — sinusoidal intensity oscillation (default) • Constant max — sun always at maximum power, no day cycle

Simulation Loop

Each frame consists of a sun pass and activation of all genes. Each gene activation has three phases: Intent (each cell declares its action based on its current gene), Resolve (conflicts — e.g. two cells want to divide into the same pixel — are won by the cell with higher will, then energy, then pixel energy; if all equal, by cell ID), and Apply (winning actions are executed and state is updated). This multi-pass approach ensures determinism in parallel execution.

Simulation Controls

The Run panel provides lifecycle controls: Start (seeds cells and begins the loop), Init (seeds cells in paused state), Pause (halts the loop and enables runtime tuning), Resume (continues from paused), Step (advances exactly one frame while paused), and Stop (terminates the simulation and clears the canvas). The current state — Running, Paused, or Stopped — is shown in the panel header.

Canvas & Scaling

The simulation renders on HTML canvas / WebGPU with pixelated image rendering. Five canvas scale options are available: 1×, 2×, 3×, 4×, and 5× — each pixel occupies N×N display pixels. The canvas header shows current canvas dimensions and simulation step counter. Cell JSON files can also be dragged onto the canvas to import.

Debug Overlays

Three toggleable overlays in the Run panel help visualize internal state: Sun overlay (shows solar energy distribution across the grid), Energy overlay (color-codes cells by their energy level), and Cell borders overlay (draws grid lines showing individual pixel boundaries). Additionally, the View mode selector switches the entire canvas rendering between Standard (normal lineage colors), Sun fee (per-pixel sun cost heatmap), Empty cap Δ (max empty cell energy delta), and Cell cap Δ (max occupied cell energy delta). In heatmap modes, green indicates positive values and red indicates negative values.

Cell Inspector

Click any pixel on the canvas to inspect it. The inspector shows: coordinate, cell presence, cell ID, energy, max energy, will, max energy to get, pixel energy, active gene set, death mode, and the full gene matrix. Two view modes are available: mapped text (human-readable gene names) and numeric (raw gene codes). Inspection updates live during simulation.

Cell Import & Export

The active or original state of an inspected cell can be exported as a JSON file via the kebab menu in the Run panel. Cells can be imported by selecting a JSON file or dragging it onto the canvas. Import is only available while paused and when the selected pixel is empty.

Runtime Tuning

While paused, three parameters can be adjusted and take effect immediately: mutation chance, solar power range (min/max), and day cycle duration. Skip renders (0 = none) controls how many simulation steps run between rendered frames, trading visual smoothness for speed. Language switching between English and Ukrainian is available in the top bar at any time.

Keyboard Shortcuts

The simulation page supports keyboard shortcuts for common actions: Space to start or pause, S to step (while paused), Escape to stop the simulation, and N to create a new simulation. Shortcuts only fire when no input field is focused.

Dark Mode

A dark color scheme can be toggled via the moon/sun icon in the top bar. The preference is saved in the browser. Dark mode reduces eye strain in low-light environments and makes the canvas colors stand out more.

Gene Settings

The Settings tab lets you ban specific genes. Each of the 49 genes can be toggled on or off and are grouped by category. Banned genes are replaced with Idle (gene 0) throughout the entire simulation — during initial cell generation, gene execution, and mutations. Gene 0 (Idle) cannot be disabled. Preferences are saved in the browser and only affect new simulations.