GOL-023 · technical companion

Open Compass

Organisms coast until blocked, then seek sparse sight lines with private rotating compasses. Crowded sight lines activate configurable Life births and survival.

At a glance

geometry
Square lattice with inertial mobile organisms
neighborhood
Eight finite straight sight rays
states
Occupancy + lifetime rotation sense + compass/travel headings + birth streams
update
Frozen sight-gated Life, inertial movement and no-winner collisions
renderer
Canvas 2D

What to explore

Make traversal, blocked replanning and conditional Life observable without tuning for a promised flocking outcome. Preserve a causal explanation of both organism fate and a grid site's next occupancy.

Rules, update order and replay

Square 80/120/160 lattice, toroidal by default or bounded. Engine dimensions must be at least 25, so the maximum range-12 wrapped rays are distinct. Directions 0–7 are N, NE, E, SE, S, SW, W, NW. Each organism owns a rotating compass heading, permanent rotation sense, compass timer, and independent travel heading (-1 means choose at the next movement opportunity). Sites own seeded birth streams.

Every Step freezes the complete board. Count living cells at distances 1 through sightDistance on each of eight straight rays, through intervening life, excluding self and off-axis positions. Sum those eight counts. If and only if the total is strictly greater than lifeThreshold, apply the configured B/S mask to the ordinary eight immediate Moore neighbors. Equality disables Life. The gate is evaluated independently at every site every Step, even between movement opportunities: active living sites use survival; active empty sites may birth. With the gate off, organisms survive and empty sites stay empty. B/S counts never use the ray total.

An organism that fails survival dies without proposing a move. A survivor acts on global Step multiples of movementInterval. With a stored travel heading it keeps that heading regardless of changed ray counts or compass turns. Without one, it chooses the least-populated ray; tied minima use nearest angular distance from the current private compass, then the organism's permanent rotation sense. All eight equal chooses the compass heading. Select the direction before testing its path; there is no fallback to a more crowded ray or retry this turn.

The configured movementDistance requires every traversed site, including landing, to be empty in the frozen board. Even an organism that will die or depart blocks this Step. Off-field targets and two or more claims on one destination cancel movement. Crossing paths are allowed; swaps and following into newly vacated sites are not. Any path/edge/claim failure clears travel heading, so the next scheduled movement reconsiders sparse rays. Waiting for cadence does not clear inertia. All accepted movements commit together. A surviving arrival overrides a planned birth at that site. Departed living sites stay empty this Step. Other qualifying frozen-empty sites birth fresh organisms, which first move on the next Step.

Each surviving organism ticks its compass after acting, even when blocked/waiting. Compass turns never change a stored travel heading. Interval zero holds the compass; 1–15 ticks it after that many private Steps. Stride is 1–4 compass points. Heading, timer, sense and travel heading move with the organism. Newborns and painted additions receive fresh seeded compass/sense, timer zero and no travel heading. Each assignment draws heading and sense from the site's private stream; streams stay at sites and are part of replay. No randomness resolves movement.

clockwisePercent (0–100, default 50) controls the chance at creation; the remainder is counterclockwise. Changes affect later births/painting and the next Reset, never existing organisms' permanent senses. Rule edits preserve the world and travel headings; compass interval edits restart timers. Topology edits clear only old evidence. Reset recreates the selected opening and all hidden state from independent cell/compass seeds. Clear recreates empty sites and seeded birth streams. Painting clears evidence and explicitly adds/removes organisms. Replay includes occupancy, compass/travel headings, senses, timers, birth streams, Step and all prior input/proposal/outcome arrays, plus dimensions/topology/rules.

Reading the simulation

Lime life/waiting, cyan arrivals, coral contested survivors, amber blocked survivors, cream newborns; death is written evidence rather than painted life. Color off simplifies occupancy. Inspector shows separate compass and travel headings, permanent sense, next turn, whether the proposal uses inertia or chooses a ray, eight ray counts, total versus strict threshold, ordinary Moore count, birth/survival decision, claims/block reason and exact organism/site outcomes. Gold indicates the rotating compass; a blue arrow indicates stored travel. Rays are dashed violet. Keyboard, transport, seeded Reset, painting and the mobile randomize/play shortcut retain their shared behavior. Text explains every color.

Reproduce an opening

Download the example above, open the simulation, expand the controls, then use Share & reproduce → Import JSON. The example uses authored rules and a fixed seeded starting field; it is independent of the site’s editable default composition. Import starts paused at Step zero.

Share links and JSON reproduce the configured starting conditions, including hidden layers rebuilt by Reset. They do not save an evolved board, hand-painted cells, speed or display preferences. Determinism applies to the same rule version and Step sequence; real-time playback rates vary by device.

Larger fields and more involved rules can reduce playback speed. Read the configuration format and automated-access guide for compatibility details.