Web and phone game · social policy
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.
- Role
- Timeline
- Stack
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
-
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.
-
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.
-
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.
Before and after
| Before | After | Source | |
|---|---|---|---|
| Policy preview cost per tick | 13.5 ms | 8 ms | Stated in commit 7425eda, after caching citizen cohorts; I did not re-measure it. |
What’s next
Choose a domain and deploy the web version.
Related by idea
Seeded randomness, so any run can be replayed
SWARMGEDDON, Invicto, Flawless, Conuco, Coherente, This site
Rules in a module with no UI imports
Difficulty checked by simulation before release
Invicto, Flawless, Coherente, SWARMGEDDON