Skip to content
simhood

How it works

Inside the simulator

simhood is a small simulation kernel with the town built on top as plugins, made to scale to very large towns. It runs as its own program; the game you see is a client that watches it and sends it your decisions.

01 · Architecture

A kernel, plugins and a wire

The kernel knows nothing about towns. It keeps the clock, the world's state, random numbers, the ledger, markets, the map and the people, and it checks the rules every step. Everything that makes it a town comes from plugins.

Plugins never call each other. They meet through shared state, markets, the ledger and events, and declare what they provide and need as named capabilities. That is what lets one be swapped for another: the goods markets have two interchangeable providers today, and both pass the same conformance kit of small test markets.

Clients

  • 3D game (Godot)
  • Web dashboard
  • Headless runs and research tools

The wire

One WebSocket: commands and control messages as Protocol Buffers, views of the town as Apache Arrow tables. Every player action is a logged command.

Plugins in the town

  • town-genstreets, blocks, parcels and buildings
  • terrain-genrelief, sea, rivers, biomes and woods
  • populationhouseholds from Census templates
  • mobilityday plans and trips by foot or car
  • traffic-volume-delayroads slow as they fill
  • market-clearingthe goods markets, cleared daily
  • labourjob openings, matching and wages
  • housingtenancies, landlords and rent
  • commercefirms, stock and posted prices
  • rest-of-worldimports, pensions and benefits
  • city-budgetcouncil tax, sales tax, services
  • environmentair pollution from roads and heating
  • wellbeingmood, distress and the price index
  • place-namesstreet, address and shop names

Kernel, bottom to top

  1. sim-contractthe wire's types, usable by a client alone
  2. sim-coreworld, clock, scheduler, random streams, snapshots
  3. sim-ledgerdouble-entry accounts with a reason on every transfer
  4. sim-marketmarkets with pluggable matching and price rules
  5. sim-spaceroads, parcels, footprints and grid fields
  6. sim-networkrouting and travel-time tables
  7. sim-agentspeople, households, firms and their needs
  8. sim-metricsmetrics recorded to Parquet
  9. sim-protocolcontrol messages and views
  10. sim-hostthe server and the command line

Each layer may only use the layers beneath it; a check fails the build otherwise.

02 · Scale

Built for very large towns

Every resident is simulated on their own: their home, their job, their day, their money. The goal is to do that for a metro of about a million people on an ordinary laptop, at a speed you can play at, and to go past a million by running several big cities side by side.

It isn't there yet. A city of 100,000 already runs a day in 20 seconds on one core and in under 5 GB of memory, well inside the fastest game speed on average, though the midnight planning step still pauses it for about 11 seconds. A million residents run too, but a day takes over two minutes on 16 cores and far too much memory. Making that fit a laptop is the biggest engineering job ahead.

One simulated day takes

0.01 s0.1 s1 s10 s1 min10 min1k10k100k1MResidentsFast speed: a day every 20 minFastest speed: a day every 2 minGoal: 1M on a laptop0.05 s2.4 s20 s142 s (16 cores)
  • Goal

    A million on a laptop

    A metro of about a million residents, every one simulated, in a laptop's memory alongside the game, keeping up with the fast speed (a day every 20 minutes) without the clock stalling.

  • Goal, to be designed

    Many cities, one region

    Run several large cities side by side. The city you're in simulates every resident; the ones you've left carry on as whole-town models, with their people, jobs, prices, budget and trade as totals, and wake back up in full detail when you return.

  • Planned

    Past a million in one city

    One city beyond a million keeps every firm and samples residents: each simulated person stands for a few real ones.

Getting faster

2 s5 s10 s20 s50 s100 sFirst measuredFaster routingContraction hierarchiesTodayOne simulated day, one core119.3 s72.1 s8.98 s5.33 s3.35 s2.4 s
100,000 residents20,000 residents

Memory at its peak

  1. 1,900 residents0.1 GB
  2. 19,700 residents1.5 GB
  3. 101,500 residents4.6 GB
  4. 995,000 residents51–63 GB

A 16 GB laptop (log scale)

6×
faster at 100,000 residents than the first measurement, three weeks earlier
15 µs
to find a resident's route across the 20,000-person town
1 core
does nearly all of a day's work, so a laptop's memory matters more than its core count

Measured on 28 October 2026 on a 16-core Apple M4 Max, except the metro: its day is from 12 October on 16 threads under heavy load, its memory from earlier runs, and both need re-measuring. The routing speed-ups changed no result (every run's fingerprint stayed the same); today's figures also include other work on the game since.

03 · A simulated day

86,400 ticks, most of them skipped

One tick is one simulated second, so a day is 86,400 ticks. Nothing runs every second, though: each system says how often it runs, and the scheduler jumps straight to the next thing that is due, such as a resident arriving at work or the markets opening at midnight.

Inside a step the order is always the same: the player's queued commands apply, scheduled events are delivered, the systems run, reactions follow, and then read-only checks look for anything that breaks the rules. A breach is recorded, never ignored.

One step, in order

  1. 01Your commands
  2. 02Scheduled events
  3. 03Systems
  4. 04Reactions
  5. 05Rule checks
As it happens
Residents leave, travel and arrive; each trip's time is set by yesterday's traffic on every road it takes.
Daily
Markets clear, shops produce and reprice, jobseekers and openings are matched, moods update, plans for tomorrow are made.
Weekly
Pensions and jobseeker payments arrive from outside the town.
Monthly
Rent, wages, council tax, the services budget and shop dividends move through the ledger.

Time can be compressed: one simulated day can stand for one, seven or 28 calendar days, so a year of town life passes in an evening.

How long commutes take

  1. 0–5 minutes64%
  2. 5–10 minutes33%
  3. 10–15 minutes4%

Every trip to work over a year of the test town, seed 1: 364,508 of them. It's a small town, so nobody's far from work yet.

04 · Same seed, same town

It replays to the bit

With the same seed, settings and decisions, a run is identical on any machine, with any number of threads, whatever the camera is looking at. That makes every change you make measurable: replay the town without it and compare.

  • Whole numbers

    Money is counted in whole pennies, prices in ten-thousandths of a penny, and positions in whole centimetres. Rounding happens once per transaction, by one rule, and splits never create or lose a penny.

  • Named random streams

    Every random draw comes from a stream named after the seed, the plugin, the system and the tick, so adding threads or reordering work can't change who gets which number.

  • Stable order

    Anything whose order matters is sorted by a stable ID first. Hash maps are never iterated, and the engine's own iteration order is never trusted.

  • A fingerprint a day

    The whole world is hashed into one 64-bit fingerprint. Two worlds with the same fingerprint save to byte-identical files.

The gate run

As one of the project's checks, the test town runs a full simulated year three times, on one thread, three threads and every thread, each in its own process, and all 365 daily fingerprints must match. A save from day 196 is then loaded in a fresh process and run on to day 365, and it must land on the same final fingerprint.

1 thread3 threadsall threadsrestoredday 196 savesame fingerprintday 0day 365

05 · Money

Every penny goes somewhere

All money moves through one double-entry ledger, and every transfer carries its reason: a wage, a rent payment, a basket of groceries, a council tax bill. The books always balance, so the money in the town at the end of a year is exactly the money at the start plus what came in from outside, minus what left.

Numbers you see in the game, such as a price, a rent or a mood, are built up from labelled contributions: a base, then each plugin's offsets and factors. That record is what the why panel shows, so you can see that groceries went up 10% because you raised the sales tax, or that a flat is cheaper because the air outside it is bad.

A year of money in the test town

  1. Sales in the markets£138.8M
  2. Wages£55.2M
  3. Firms' profits paid out£15.6M
  4. Pensions and benefits£11.2M
  5. Rent£4.7M
  6. Council tax£2.4M
  7. Council spending£2.4M
  8. Housing support£1.4M

Every transfer in the ledger over a year of seed 1, by reason, leaving out the one-off opening balances.

The town's ledger

Where money goes
FromToFor
HouseholdsShopsshopping
ShopsHouseholdswages
HouseholdsLandlordsrent
HouseholdsCouncilcouncil tax
ShopsCouncilsales tax
CouncilHouseholdspublic-service wages
HouseholdsOutside worldhousehold goods (imports)
Outside worldOfficesbusiness services (exports)
Outside worldHouseholdspensions and benefits

Unaccounted for£0.00

06 · Beyond the town

Neighbours, the nation and trade

A town doesn't live alone. Today everything outside it is one account, the rest of the world, standing for the whole country: it sells the town household goods, buys the business services its offices export, and steps in with produce only after a shortage has lasted three weeks, at a 25% markup. It also pays the national benefits: the state pension, jobseeker and income support and the child element, at the UK's 2025 to 2026 rates.

Money only enters or leaves the town through that account, so the books still close to the penny. No one crosses the boundary yet: every job is filled by a resident.

  1. Now

    The rest of the world

    One outside account trading at fixed prices, a shortage backstop, and national pensions and benefits.

  2. Next

    A road out of town

    A highway to the map edge. People commute both ways through it, and households move in when there are jobs and homes and leave when there aren't, so the town can grow and shrink.

  3. Designed

    Neighbour, nation, world

    Three outside regions, each a small set of totals rather than people: prices, wages and jobs, interest rates, pools of would-be migrants and visitors. People become individuals only when they cross into town.

  4. Designed

    Trade through gateways

    Export demand that rises and falls with the economy outside, imports split between local and foreign suppliers, and goods arriving through motorway junctions, rail yards and ports with their own capacity.

  5. Goal

    Neighbours that react

    Other cities that grow and shrink, compete for residents and firms and trade with yours, then agreements between them, up to running several cities of your own.

Trade with the rest of the world

0£1M£2M£3M£4M£5M£6M£7Mmonth 1month 3month 6month 9month 12Each month
Imports: household goodsExports: business services

Imports and exports each month for a year of the test town, seed 1. Household goods come in; business services go out.

07 · Research tools

A game you can run experiments on

The same simulator runs without a screen, for anyone who wants to study a town rather than play it.

  • Runs

    A headless run writes its settings, its command log, a fingerprint per checkpoint and every metric as a Parquet table.

  • Exports

    A finished run replays itself to export daily panels of every person and household, plus every event, with versioned schemas. It refuses a run this build doesn't reproduce.

  • Seed ensembles

    Run dozens of seeds at once and judge each against calibration bands, the ranges a healthy town should stay inside.

  • Sweeps

    Try a grid of policies across seeds, such as four sales-tax rates raised on day 90, and get a ranked report.

08 · Sources

What it's built on

Designing simhood meant reading a lot: the reference library holds 546 papers, datasets and docs, each with a note on what the design takes from it and where it's cited. These are the ones the current build's rules and starting data come from, plus those behind the outside world now being designed.

Traffic and travel

Residents drive real routes, and roads slow down as they fill up with cars.

Work and wages

Jobseekers and employers are matched every day, so unemployment comes from real gaps in the town.

Homes and rent

Households rent homes at rents that follow real English market levels and income.

Shops and prices

Firms post prices, sell what they stock and nudge prices up or down as stock and demand shift.

Council budget

The council raises council tax by property band and spends on public services.

Air and wellbeing

Traffic and heating spread pollution over the town, and money, jobs and air shape how people feel.

People and households

Residents are born, age, form households and die at rates taken from English statistics.

Land and streets

Terrain, rivers and street layouts are generated from the seed, with streets bending to the land.

Determinism and engine

The same seed and choices always give the same town, on any machine.

  • Bevy 0.19

    Bevy Contributors, 2026

    The entity-component system the simulated world is stored in.

  • bevy_ggrs pitfalls guide

    bevy_ggrs developers

    Why the sim sorts entities before using them, since query order is not stable.

  • Rust RFC 3514: float semantics

    Rust project, 2023

    Why money, geometry and terrain use whole numbers, not floating-point.

Beyond the town

The outside world pays today's UK benefit rates; the neighbours, commuting and trade being designed rest on the rest.