Ruin Guide · how it was made

Field notes · Generative Assets

Building Ruin

A study in gambler's ruin: one stake bets even money until it hits zero or its target, drawn inside a hundred-path cloud of the futures it never took. This page is how the walk, the fan, and the two ruin probabilities were built.

The concept

Ruin is a fictional teaching piece for a probability studio — a single, unhurried demonstration that a fair-looking game with a small edge ends in ruin almost every time. Its one job: make the invisible drift of a house edge visible as a leaning fan of paths, with the exact probability of ruin printed and the ensemble converging on it.

The resting state is deliberately mid-story: one bold walk is already part-way down inside the ghost cloud, so a still capture reads as a live game, never a blank waiting for input.

Palette — argued from the felt

Felt
#122019
The table. A deep green-black so the walks read as chalk on baize.
Walk · line/mark
#8FB08A
Sage green for the ghost cloud strokes — bright enough as line, never used for body text.
Bold walk
#C4E1BC
A lifted tint so the one watched path lifts clear of its hundred ghosts.
Ruin barrier
#C24A3A
The absorbing wall at zero. The only warm colour on the table — it means the end.
Cloth-ink
#DDE4D6
Body ink. Derived light off the felt for ≥4.5:1 — the mark green stays lines-only.
Barrier-ink
#E4917F
A lightened red for the few words that carry ruin — legible where #C24A3A would not be.

Following the collection's ink/line split: the bright mark green (#8FB08A) draws strokes only; copy sits in cloth-ink (#DDE4D6) and its dimmed variants, all cleared for contrast on the felt.

Type

Archivo
Display · 800 / 700
IBM Plex Mono
Readouts · 400 / 500

Archivo — a grotesque with tight, confident caps — carries the wordmark and headlines; its condensed energy suits a subject about odds and edges. IBM Plex Mono runs every number: the live stake, the step count, and the two ruin probabilities. A monospace makes converging figures sit still enough to read while they tick.

Technique — the signature

Everything is one canvas 2D layer; no libraries. The signature is one doomed walk inside a fan of every path it could have taken, built from an ensemble of independent random walks:

Each walk holds a running stake and its full history of steps. Every frame it takes one even-money bet — +1 with probability p, −1 otherwise — and is absorbed the instant it touches 0 (ruin) or N=100 (target). Eighty ghost walks run continuously at low alpha, respawning the moment they are absorbed, so the cloud is always full and shimmering. One bold walk is drawn thick and bright on top; its head warms from sage toward barrier-red as it nears zero. When it is absorbed the barrier flashes, holds, and a fresh stake begins.

Two numbers tell the story. The theoretical ruin probability comes straight from the classic formula — for an unfair coin, P(ruin) = 1 − (1−r^i)/(1−r^N) with r=(1−p)/p, i the stake. The empirical figure is just ruined ÷ absorbed across the whole ensemble, and it visibly crawls toward the theoretical value as walks pile up — chance becoming law on the far side of the noise. The three house-edge chips re-seed the ensemble and re-tilt the entire fan.

Canvas discipline throughout: DPR capped at 2, sized to its container with a debounced resize that remaps step/stake space to pixels (no data lost), the rAF loop paused on document.hidden, and a prefers-reduced-motion path that warms the ensemble to steady state and paints a single settled frame instead of animating.

Iteration log

Pass 1
Craft

Spacing, scale, contrast

Tuned the type scale so the hero U accent and the mono readouts share one rhythm. Pulled the HUD panels onto a solid scrim (rgba(12,22,16,.82)) after the mono figures dropped near 3:1 over the busy fan — text now clears 4.5:1 everywhere. Demoted the mark green to lines only and set all copy in cloth-ink. Rewrote the three explainer columns to name the mechanism (even money, absorbing walls, drift) instead of describing it.

Pass 2
Depth

Enriching the signature

Added the head-colour lerp — the bold walk's tip warms toward red as its stake falls, so ruin is legible before it lands. Introduced the empirical-vs-theoretical convergence as the second-read detail: the two numbers drift together the longer you watch. Added the absorption flash ring (red for ruin, green for escape) and the faint top/bottom tint bands so the two barriers read as meaning, not decoration.

Pass 3
Harden

375px, motion, focus, perf

Collapsed the bottom-right readout grid to a single labelled column under 640px and hid the masthead tag so the wordmark and nav stay within 375px. Verified the reduced-motion settled frame renders a full fan with a mid-descent bold walk. Confirmed :focus-visible rings on chips and nav, DPR-cap and debounced resize remap cleanly, and the loop pauses when the tab is hidden. Applied the Chanel rule to the tint bands: dropped the symmetric green escape-glow at the top and kept only the red ruin tint bleeding up from the floor — the target line already reads as escape, so the second band was noise fighting the ghost cloud's colour.