HomeCompanion pagesLayered Cellular Automata

Layered Cellular Automata

Langton's ants write a colored substrate that gates where Conway's Life is allowed to live. Three feedback layers — ants → substrate → life → substrate → ants — produce highways, colonies, and fractal boundaries. For a playable take on Conway's Life and 50+ other rulesets, see the sister site The Arcade of Life ↗.

Open the interactive lab Watch the video

Binary Coded Layered Autonoma

An interactive cellular automaton that combines Langton's Ant, multi-color substrates, and Conway's Game of Life into a single layered system. Multiple ants traverse a colored grid, encoding their movement rules in binary, while a selectively-activated life simulation evolves on top of the substrate they create.

Open layered_automata.html in a browser to run the simulation — no build step or dependencies required.

Concept

The system layers three interacting subsystems:

  1. Multi-Color Substrate (2–8 colors) — a grid of colored cells that ants modify as they move.
  2. Binary-Coded Ants — Langton-style ants whose turn behavior (Left/Right) is encoded as a binary string indexed by the substrate color underneath them.
  3. Selective Conway's Life — a Game-of-Life layer that only evolves on cells whose substrate color is enabled by an activation mask, with positive/negative modes that create or inhibit life.

The interplay between these layers produces highway structures, fractal boundaries, and emergent life colonies tuned to specific color patterns.

How It Works

Ant Movement

Each ant reads the substrate color at its current cell and consults its binary Ant Rule:

The ant then increments the cell's color (mod numColors), marks the cell, and steps forward. With numColors = 4 and rule 0101, this generalizes Langton's classic LRLR ant.

Life Activation Mask

A second binary string — the Activation Mask — determines which substrate colors are eligible to host life. Each color also has an Activation Mode:

Conway's Life Layer

Life evolves only on marked cells whose substrate color is mask-enabled and not inhibited. The rules are extended:

Negative-mode cells use slightly relaxed survival/birth thresholds, making them more fragile.

Multi-Ant System

Up to 8 ants can run simultaneously with configurable:

Controls

Control Description
Simulation Speed Delay between generations (1–2000 ms)
Number of Substrate Colors 2–8 colors (sets rule/mask length)
Number of Ants 1–8 simultaneous ants
Ant Spawn Mode How ants are initially placed
Ant Synchronization How rules are shared across ants
Ant Rule Per-color L/R turn instruction (clickable bits)
Life Activation Mask Per-color flag for life eligibility
Activation Mode Per-color +/− toggle (spawn vs. inhibit)
Life Search Radius Neighborhood radius for life rules
Birth / Survival Min / Survival Max Generalized Conway thresholds
Ant Activation Radius Radius around ants where life is seeded/inhibited
Activation Probability Per-cell chance of activation within radius
Grid Size 50×50 up to 500×500

Buttons

Stats Panel

Visualization

Tips for Interesting Patterns

Files

Implementation Notes