Skip to content
After hours

Web and phone game · social policy

Private build

The Veil · El Velo

A Spanish-first game: set six social policies without knowing who you will be, then live fifteen random lives under them.

The Veil, rules screen: the Piso and Producción meters above the first four law sliders.
Role
Solo: design and code
Timeline
Jun 2026 to now
Stack
TypeScript, React, Zustand, Capacitor, Vitest

Private build. The code is private. I can walk you through it on a call. Status checked Oct 15, 2026.

By the numbers

55

tests in 6 files, including the tests of the game’s premise

15

lives per run under the rules you set

48

paired-seed batches behind each live policy preview

The idea

The Veil asks you to set the rules of a society before you know who you will be in it. You choose six social policies, then live fifteen randomly assigned lives under them, and the score depends on how those lives turn out, including the worst one.

What I built

The simulation is pure TypeScript with no imports from the interface or the state layer, so it runs headless in Node for a tuning harness. The harness searches the six policies with Monte Carlo batches and checks that balanced rules outscore both pure equality and pure laissez-faire, and that the best ruleset sits between the extremes. That validates this model, not a general claim about real societies.

There are two scoring modes: Velo scores the average minus a penalty for the gap to the worst life, and Velo de Hierro scores only the worst life. React and Zustand run a Spanish-first interface, and the shareable Constitution card is drawn as SVG with the app’s fonts embedded, then turned into a PNG.

The hard parts

  1. 01 Testing the premise in code

    The game argues that balanced rules beat both extremes. Unit tests check exactly that in both scoring modes, and check that the worst life does best at a middle level of redistribution, not at either end.

    Where in the code: src/engine/model.test.ts

  2. 02 A preview that agrees with itself

    While you move a slider, the screen previews how each policy changes the worst life. The preview runs 48 batches with the same seeds on both sides, so births cancel out and only the laws differ, and one shared sample feeds both meters and all six policy chips.

    Where in the code: src/engine/preview.ts

  3. 03 A daily that leaves births alone

    The daily challenge seeds from your local date and adds a recession or pandemic modifier. The modifier draws from its own random stream, so it does not change who is born.

    Where in the code: src/engine/daily.ts

Before and after

BeforeAfterSource
Policy preview cost per tick13.5 ms8 msStated in commit 7425eda, after caching citizen cohorts; I did not re-measure it.

What’s next

Choose a domain and deploy the web version.

The El Velo banner: the title and a Spanish line that means “write the rules of a society without knowing who you will be in it.”

Related by idea