A live ant colony that finds the shortest path between nest and seed using nothing but two pheromones, evaporation, and traffic — no planner, no map, no memory. This is how it was built.
FORMICARY is a fictional "stigmergy field station" — an instrument for watching an ant colony forage in real time. Its single job is to make one counter-intuitive idea legible in two seconds: a shortest path can appear with no one designing it. Two hundred near-blind agents lay scent, the ground forgets that scent at a fixed rate, and the route whose round trips close fastest is the one that survives. The visitor can drop crumb piles or wall off the direct line and watch the colony re-route.
Drawn straight from an ant's world: dug earth, the warm glow of a well-worn trail, foliage, and dry seed husk. The bright amber is reserved for the pheromone marks and hairline rules only; small type gets a darker amber-ink so it clears 4.5:1 on the soil.
Spectral is a screen-built serif with a naturalist, field-guide warmth — right for a subject that is half entomology, half computer science. IBM Plex Mono carries every instrument reading, label, and counter: it makes the telemetry feel like a real station panel and keeps numbers tabular. The one moment of bravery is the display line set in Spectral Light with an italic amber payoff — the path draws itself.
No frameworks and no libraries — the whole page is inline HTML, CSS, and one plain <canvas> 2D script. Entrance choreography is CSS transitions staggered by transition-delay, gated on document.fonts.ready with a 700 ms fallback so nothing sits invisible if fonts stall. The step glyphs are hand-drawn inline SVG. Everything is procedural; there is not a single raster asset.
The field runs a genuine agent simulation, not a scripted animation. Two Float32Array grids cover the canvas at 6-pixel cells: a home scent field and a food scent field. Each of ~210 ants is a position, a heading, and one bit of state — searching or laden. A searching ant follows the food field and drips home-scent; a laden ant follows the home field (nudged by a weak nest vector) and drips food-scent. Steering is the classic three-sensor sniff: sample the relevant field ahead-left, ahead, and ahead-right, turn toward the strongest, add a little wander. Deposit strength decays after each event, so scent is brightest near where a trip began. Every frame both grids diffuse slightly and evaporate by a fixed factor. That is the whole engine: because a shorter round trip re-deposits sooner than the ground forgets, its scent out-competes longer detours and the amber trail consolidates into the near-shortest route — decided by no planner. Obstacles are a Uint8Array that holds no scent and blocks movement, so a pebble wall forces the colony to re-route; dropped crumb piles are finite sources whose trail evaporates once emptied. The grids are rasterised to a small offscreen canvas and drawn twice — once soft for bloom, once crisp — with additive compositing over the soil.
Discipline around it: DPR capped at 2, canvas sized to its container with a debounced resize, the rAF loop paused on document.hidden, and a reduced-motion path that runs 520 steps synchronously then paints one settled frame — never a blank canvas. If a 2D context can't be acquired, a CSS fallback scene takes over.
--amber-ink #C9853A token for text and kept the bright amber for pheromone marks and hairlines only.clamp() scale and standardised every border to the same --sand alpha tokens so rules read as one system.