About Pixel Cells · Ecosystem

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

Every pixel has immutable fertility, renewable nutrient, persistent toxin and shade material, and optional structure durability. Light is recomputed each frame and reduced by shade; it is never stored as terrain energy.

Cell State

A cell has a body size and a fixed allocation among collector, weapon, defense, and builder modules. Each genome row carries an inherited body profile; a division stamp selects the child's row and body, while later row switches change behavior without rebuilding the body.

Gene System

Ecosystem supports gene matrices up to 60 × 30 and uses codes 0–75 for resources, transfer, defense, construction, attacks, predation, conditional row switching, toxin, shade, and nutrient replenishment. Division and conditions consume following metadata slots for row and threshold stamps; metadata is not executed as genes. Larger matrices increase GPU memory use for every world pixel.

Energy Model

Maximum cell energy is body size × energy-capacity density. Sunlight and natural nutrient regeneration are external sources; transfers and replenishment conserve their transferred amount. Division pays metabolism, the child's full body construction, and its stored birth energy. Death recycles remaining energy plus body material.

Sunlight

Sunlight is recomputed every frame from the sun settings. It is transient: unused light is not stored in the field and disappears at the end of the frame.

Simulation Loop

Each frame regenerates nutrient and computes shaded light, applies metabolism, builds defense before toxin exposure, then resolves each gene column by target conflict. Scheduled row switches and death recycling happen after actions. Toxin and shade created by actions affect environmental processing on the next frame.

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. Use Fullscreen to focus on the canvas, drag with the mouse to pan around larger grids, and use Ctrl + scroll or a trackpad pinch to zoom. Cell JSON files can also be dragged onto the canvas to import.

Debug Overlays

Ecosystem thematic views are isolated maps. Nutrient, fertility, toxin, and shade show only the selected per-pixel quantity. Structures shows only structure durability on a gray ramp. Body specialization shows only living cells, colored by their strongest module: green collector, red weapon, blue defense, or yellow builder. Sun and energy overlays work only in Standard view. Every thematic map has its own matching legend.

Cell Inspector

Click any pixel on the canvas to inspect it. The inspector shows: coordinate, cell presence, cell ID, energy, max energy, division type, division energy cost, 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.

Simulation Statistics

The Statistics tab has independent family and environment collectors, both enabled by default. Either can be disabled before starting or enabled from the current step during a pause; once started, it remains active until that simulation ends. Pause to open four chart tabs: 100% family shares, absolute family area, Shannon diversity, and environment statistics. The environment tab tracks blocked pixels plus the signed sums of sun-fee, empty-limit, and occupied-limit deltas. GPU reductions read back only compact aggregates; sparse family history stays within 16 MiB, environmental history is progressively thinned, and neither is uploaded with scenes.

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 actionable gene can be toggled on or off and is grouped by category. Initial generation and mutations first choose one semantic action group with equal base weight, then choose an enabled target or direction within that group. Unchecked variants are excluded before selection, and a group with no enabled variants receives no probability. An unchecked gene already present in a genome is treated as Idle when executed. Gene 0 (Idle) cannot be disabled and keeps its separate base probability. When Balance seed is enabled, each original Ecosystem cell receives photosynthesis, nutrient extraction, and—when available—a division gene in its active row; it affects only new simulations. Preferences are saved in the browser and only affect new simulations.