↤ polis
polis · the next effort after mappa

Modeling urban economics across a city's life cycle

A procedural engine that grows the whole economic history of a city into a generated world — from the founding engine to the metropolis — deterministically, from a seed. The streets and quarters are how the economy writes itself onto the ground. It stands on mappa's planet and reuses two field solvers from hoop. The long arc is a 4X game.

These are the docs for polis — the live sim is the main page; theory + first proto. The full engine follows.
mappa answers where, once. It generates a deterministic planet and scatters plausible city sites. polis answers a harder question: how does a city grow an economy? What engine makes a settlement nucleate, and what keeps it growing past its founding reason? That economic life cycle — not the street grid — is the subject. The geometry follows.

00The thesis

Three things already exist in this repo, and polis is the missing middle:

LayerWhat it isWhat it gives polis
mappaa deterministic planet + one-shot city-site scatterthe substrate: terrain, rivers, coasts, fertility — the ground the economy stands on
polisthis projectthe economic history: founding engine → multiplier → diversification → regional hierarchy
hoopa game with two pure field solvers in its internalsthe geometry engines: a Physarum network-grower and a hypoxia/angiogenesis capillary-grower

mappa's placement answers where; it has no notion of a city growing an economy. A 4X needs cities with a legible economic history — a founding engine, a multiplier, a diversifying base, a place in a hierarchy. polis is that layer.

01The core economic engine — how cities start, and keep growing

This is the heart of polis, and the answer to how do cities start?

The big game in town — why a settlement nucleates

A city is not founded by spreading people evenly. It nucleates around one economic function strong enough to pull a surplus toward a point — and at the start, everything else is negligible against that one engine. The archetypes:

In every case the early city is one engine plus its support system — which is exactly why its earliest network is a star of routes to that engine (regime 1, below).

The first engine of growth — the economic-base multiplier

Economic-base theory (Sombart 1916 → Haig 1928 → Hoyt 1939; the export-base theory of regional growth, North, 1955) splits a city's economy in two:

If s is the local-serving share, each export dollar re-circulates locally and total activity is the geometric sum:

Total = Basic × M ,    M = 1 / (1 − s)

M is the base multiplier — the structural analogue of the Keynesian income multiplier, with s playing the role of the marginal propensity to spend locally. If non-basic is half the economy (s = ½), M = 2: every export job supports one local job. If s = ⅔, M = 3. This multiplier is the core economic engine that allows for growth: add one base job, the town grows by M.

The second engine — why a city outgrows its founding base

The base multiplier is linear: double the staple, double the town. It cannot explain a city that keeps growing after its founding engine fades (the portage that silts up, the mine that empties). Two mechanisms make growth self-reinforcing:

The growth engine, assembled. Founding export base → the multiplier M = 1/(1−s) spins up local services → agglomeration makes the place more productive as it grows → import-replacement turns local services into new export base → the multiplier acts on a bigger base → … A staple that merely serves becomes a city that generates. Past a threshold, Wilbur Thompson's urban size ratchet (1965) makes continued growth all but guaranteed — structural diversity insures the city against the death of any one sector.

02The economy as a forcing on one field — three regimes

A city is always solving a flow problem on a graph. Which problem is set by the shape of its economy, and that shape changes over the life cycle. Both hoop solvers are the graph Laplacian L with different forcing — and the forcing tracks how concentrated the economic base is. It evolves one point → uniform → many peaks, so Physarum bookends the cycle (a star at birth, a network at maturity) with the diffusion/coverage solver in the middle.

1 · Nucleus

Physarum (flux.js), μ high → tree

Economy: monoculture — one export engine; the multiplier barely started.

Forcing: a single dominant sink — the big game in town.

Form: spokes to the one engine; everything else barely on the map.

2 · Coverage

hypoxia (foam.js seize)

Economy: the base multiplier has spun up local-serving services.

Forcing: a roughly uniform source — serve everyone.

Form: capillary infill toward the under-served fringe — the town fills in.

3 · Demand

Physarum (flux.js), μ = grid↔tree

Economy: diversified — many sectors (import-replacement, agglomeration).

Forcing: many peaked origin–destination currents.

Form: arterial hierarchy — the trading city.

1 · NUCLEUS one engine · spokes ★ 2 · COVERAGE services · fill in 3 · DEMAND many sectors · arteries multiplier diversify
The same graph-Laplacian solve; the forcing's concentration tracks the economy. 1 · a one-engine economy injects current to a single sink → a star (Physarum, μ high). 2 · the multiplier spreads local services → a near-uniform "serve everyone" source → capillary infill (angiogenesis). 3 · a diversified economy injects many peaked O–D currents → an arterial hierarchy (Physarum, μ tuned). Physarum bookends; coverage fills the middle.

This is not a metaphor we impose — it is what the kernels compute. flux.js's header notes the stationary flux of trips is the Laplace transform of the journey process (the graph's Green's function); foam.js's seize() is a multi-source BFS perfusion field plus angiogenesis toward the worst-served tissue. The third regime — the nucleus — is the same Physarum solver with current collapsed onto one sink, which is exactly the network of the earliest city: a few routes to the one place that matters, everything else barely on the map. A one-engine economy produces a one-hub network.

03The life cycle

The phases are not invented — they track Wilbur Thompson's five stages of urban growth (1965): export specialization → the export complex → economic maturation (import-replacement) → regional metropolis → technical-professional virtuosity. polis reads that economic succession spatially, with the three regimes as its geometry.

why herePhase 0 · Site & the founding engine

Score every candidate cell on two independent axes (site vs situation): site = local terrain (water, defensibility, buildable land); situation = betweenness on the route/river graph. Some terrain features are forced spawn points because they manufacture a founding engine — the fall line (rapids = head of navigation and water power; one escarpment seeds a string of cities — Richmond, Baltimore, Washington), the head of navigation, the lowest bridging point (river port), the harbour, the defensive hill/meander/island, the gap/pass town. The founding advantage is a one-time tie-break, not a permanent subsidy — which is what later lets the city outlive the reason it was founded.

regime 1 · single attractor · PhysarumPhase 1 · Nucleus

The economy is a monoculture: one basic sector (the founding engine), the multiplier barely started. The network is therefore a star — sparse routes from the scattered hinterland to the one place that matters. This is the Physarum solver with current injected to a single sink and μ high (the field collapses to a minimal tree/star, not a grid). This is the regime you identified, and it is economically exact: a one-engine economy produces a one-hub network.

regime 2 · coverage · hypoxiaPhase 2 · Town

The base multiplier M = 1/(1−s) spins up the non-basic economy — bakers, smiths, a parish, a market. The binding constraint flips from route-to-the-engine to serve-everyone: every dwelling within reach of the well, the market, the mill, the gate. This is the angiogenesis solver (foam.js seize()): grow capillary lanes toward the worst-served ("hypoxic") cell until all tissue is within reach. Its grain follows Conzen (streets → burgage plots → buildings, each plot aging through the burgage cycle); the first land-use gradient appears via von Thünen (R = Y(p−c) − Y·F·m, uses sorted by the upper envelope).

regime 3 · demand · PhysarumPhase 3 · City

Agglomeration and import-replacement diversify the base into many sectors. The flow problem becomes one of moving concentrated flows among many origins and destinations — the Physarum solver again, with a dense, peaked O–D current matrix (gravity demand T_ij ∝ P_i·P_j/d_ij², Reilly 1931). Conductance adapts, dD/dt = f(|Q|) − D (Tero et al., Science 2010); arteries are the superlevel set; μ dials grid↔tree. Bid-rent (Alonso) sorts land use — concentric rings (Burgess), sectors (Hoyt), or multiple nuclei (Harris–Ullman). History freezes as fringe belts under a morphological-frame constraint. The loop closes (Levinson & Xie): road → accessibility → development → demand → more road.

the regionPhase 4 · Metropolis & the system

04The wider model — three clocks, two territories, two doors, two axes

The phases are the shape. The engine runs on three clocks, spans two territories, opens two doors to the wider world, and is judged on two axes. This is where polis becomes a hinterland sim as much as a city sim, and where it pulls in two more assets the repo already has.

Three clocks

The tech tree — the master clock (and yes, we need one)

Technology is the one exogenous force that moves every other parameter: it raises the agricultural surplus ratio (freeing labour for the city), lowers transport cost (the master lever — as τ falls past a threshold it tips Krugman's core–periphery bifurcation: the dispersed equilibrium loses stability at the break point, agglomeration self-sustains past the sustain point), raises productivity, and cuts project costs. With general-purpose technologies (Bresnahan–Trajtenberg 1995), Schumpeter's creative destruction and Kondratiev's ~50-year long waves, it also rewrites which industries lead each era. Strip the tech tree out and the base multiplier just saturates against a fixed K — the city has no history. So a tech clock is structural.

Reuse, don't rebuild. The repo already has a 500-node technology DAG in cards (tech-pool.js) — 8 eras (prehistoric → ai) × 12 domains incl. agriculture, transportation, energy, finance; prerequisite depth 26. It is pure portable data but carries no effects field. The integration is exactly that missing layer — a per-tech effects map onto the economic levers: { agSurplus:+0.2, transportCost:−0.1, baseMultiplier:+0.05, projectCost:{road:−0.15}, K:×1.1 } — so an agriculture chain compounds the surplus that lifts K, and a transportation chain drives τ toward the break point.

Two territories — the hinterland coupling

A city and its hinterland are one coupled system — which is why polis is a hinterland sim as much as a city sim.

Two doors — the broader economy (central place vs gateway)

Two distinct external growth drivers, through which raw resources, agriculture and away-market access reach the city:

DoorLogicFormFed by
Central place (Christaller)endogenic — serve the local hinterland's threshold demandcentred, symmetric radial catchment, retail/serviceagricultural surplus of the near hinterland
Gateway (Burghardt 1971; Vance's mercantile model 1970)exogenic — reach distant away markets via a break-of-bulk nodeedge-located, asymmetric one-way hinterland, wholesalingraw-resource staples (Innis) + away-market access

So a polis city carries two size terms — a central-place term (local demand) and a gateway term (export-demand × break-of-bulk advantage). Raw-resource availability (where the staple sits on the mappa substrate), agricultural surplus (the hinterland), and away-market access (the gateway's reach) are the three inputs of the broader economy.

Two axes — scale and flourishing (the bloom and the dusk)

A city is judged on more than scale (population, GDP — the N^β laws). The second axis is flourishing, and it has two faces.

Livability (the floor). The civic-vitality model in hoop/econ — scoreSociety() → vitality 0–100 + tier on seven sub-signals (supply closure, multiplex thickness, social weave, Granovetter bridges, third-places, employment, resilience) — is the floor: is the city good to live in? Its framing already separates this from output: the loop closes, and "the real output is regard."

A structural edge (the bloom). But flourishing meant something sharper in Vienna 1900 (Schorske) — a cultural and technological efflorescence. Structurally that is the city's capacity to attract talent and generate technology, and it is the missing feedback that closes the growth loop: talent → human-capital externalities → innovation → import-replacement → new export base → scale → (more talent). Skilled people near skilled people produce more than the sum (Lucas: "what else is a city?"; Glaeser; Jacobs); Peter Hall's Cities in Civilization catalogues these golden ages; Florida names the levers Talent · Technology · Tolerance. And because technology diffuses, generating it first is a competitive edge — a lead-time that decays as it spreads. So flourishing is the city's tech-generation rate: it advances the tech clock for itself and leaks to laggards. Sassen's global cities are the limit case.

The dusk — the Owl of Minerva. Flourishing is non-monotonic, and its peak sits on the edge of collapse. Hegel: "the owl of Minerva spreads its wings only with the falling of the dusk" — Vienna's bloom was the eve of the empire's fall. The structural account is Tainter's declining marginal returns on complexity: a metropolis at peak complexity is at peak fragility, each added layer of coordination returning less until the margin goes negative (Thompson's ratchet has the same ceiling; Spengler's "megalopolis" the late form). So polis models flourishing with a complexity cost that eventually bites — bloom and dusk on one curve. (This resolves last pass's open question: flourishing does feed back into growth — via talent + tech — but the complexity cost can turn it negative at the top.)

05Financial flows — funding development at each phase

The economy above moves real goods and labour. Finance is the parallel system that moves claims on the future — it mobilizes surplus into investment, prices time and risk, and supplies the medium of exchange. It is not a garnish: it is how the lumpy projects get paid for and how the multiplier deepens, and its cost of capital is a master lever on par with transport cost — cheaper, deeper finance unlocks bigger projects sooner and is a decisive edge between cities.

What finance does — Levine's five functions

A financial system mobilizes savings · allocates capital · monitors its use · eases exchange · manages risk (Ross Levine). Schumpeter's slogan is the point: "the banker authorizes the entrepreneur" — credit creates the means for innovation before the returns exist (King & Levine, "Schumpeter Might Be Right," 1993). Financial deepening (Goldsmith's Financial Interrelations Ratio) tracks development; Patrick's supply-leading (built ahead of demand — the financial twin of Hirschman's permissive excess-SOC) vs demand-following finance names the two sequences. (Honest nuance: causation is contested — Robinson's "where enterprise leads finance follows," and the "too much finance" literature finds the effect turns negative at high depth — itself an Owl-of-Minerva point.)

Finance funds the three clocks

The per-phase ladder

PhaseFinancial regimeMechanism
Nucleusredistribution (pre-market)Polanyi: the temple/palace treasury & granary concentrates tithe/tribute and redistributes it; "investment" is the ruler's command of stored surplus. Trade summons money.
Towncoinage + merchant creditcoinage lubricates the multiplier (velocity ↑); the bill of exchange moves value across distance; the town taxes its own toll/market flow to fund the first walls/wells.
Citydeposit banking + funded debtthe city borrows for big SOC; the Financial Revolution — credible commitment (bind the sovereign → collapse the risk premium) lets it out-build & out-fight rivals. Land capitalizes the bid-rent gradient → mortgage finance; title turns land into collateral, not "dead capital."
Metropolisfinancial centre (finance is the export base)the trade entrepôt becomes a financial entrepôt; Kindleberger's succession Italy → Amsterdam → London → New York — capital follows trade, then leads it. Sassen's global city is a financial command node.

War, empire, tribute — the fiscal-military thread

Brewer's fiscal-military state (1989): war drove the mutually-reinforcing growth of taxation + public debt + bureaucracy. The polity that can borrow (capital-rich, credibly-committed) out-finances the one that can only tax or plunder — Tilly's capital↔coercion axis with a financial edge (Britain out-spent rivals while borrowing cheaper). Tribute is a forced periphery→core financial flow; conquest can repudiate the debt or seize the treasury — a financial shock.

The dark twin — financial crisis (the third discrete shock)

Finance has its own Owl of Minerva. Minsky: over a long prosperity the financing mix migrates hedge → speculative → Ponzi — "stability is destabilizing" — until a Minsky moment forces fire-sales. Kindleberger's anatomy fits 300 years: displacement → boom → euphoria → distress → panic/crash (Tulip 1637; Mississippi & South Sea 1720). The land cycle (Hoyt's ~18-year Chicago series) is the urban form. So finance adds a third discrete event-shock alongside conquest and plague — the financial crisis — and the flourishing financial centre is the most prone to it.

→ modeling rules. Finance is a flow network over the real economy: surplus → savings → a capital pool → allocated by the financial regime (redistribution / merchant / bank / market / state, set by phase + tech) → funds lumpy projects and capitalizes the base. A cost-of-capital ρ (the finance analogue of transport cost) falls as finance deepens → an edge. Build a project when NPV(ρ)>0 and tax + borrowing capacity ≥ lump; borrowing capacity = f(credible commitment, tax base, debt). Capitalize land as collateral (an ~18-yr cycle that can overshoot). Fire a crisis shock when the Ponzi/leverage share crosses a threshold — the third member of the event layer (conquest · plague · crisis).

06The political register — defense, empire, conquest

Everything above models the city as an economic growth machine. The full sweep — the eXterminate of a 4X — needs the city as a political-military actor too. Most of it falls out of the economics already built; one piece does not.

Defense — a founding engine and a standing cost

Defense belongs in the early running, including nucleation. Site-selection already prizes defensive sites (hilltop, river-meander, island); the political register adds defense as a founding function — the citadel/acropolis or garrison that seeds a town (you cannot accumulate a surplus you cannot hold), on the same footing as break-of-bulk, the staple, and the administrative seat. The frame is Tilly's capital↔coercion spectrum (1990): polities form along an axis from the capital-intensive pole (cities, trade — the engine of everything above) to the coercion-intensive pole (war, conquest, empire) — "war made the state, and the state made war." A settlement carries a coercion parameter on that axis; defense is both a founding engine and an ongoing security cost paid from surplus.

Empire — an emergent configuration, not a separate engine

Is there an imperial version of the narrative, or can it be done by managing inputs and outputs? Mostly the latter. Empire is what the machinery already built does at high extraction-reach + coercion:

So no separate "empire engine" is needed: empire is a configuration of the gateway, the hierarchy, path-dependence, and the coercion parameter.

Conquest — the one piece the clocks can't produce

Conquest is the exception: a discrete regime-change event, nothing the smooth growth curves, the lumpy projects, or the tech clock can generate. It is the city-scale cousin of hoop's removeImpact shock, with outcomes on a spectrum:

OutcomeWhat happensWhen
sack / raze (urbicide)sunk capital destroyed; the city can dierare — the city is the prize
tributecity kept, surplus redirected outward; flourishing dropsthe common case
elite-swapthe govern sector replaced; population continuesfrequent
absorptionchanges hands, carries onfrequent

The outcome is size-dependent — exactly the intuition that a metropolis loses little. Locational inertia (the Bleakley–Lin logic: sunk capital + agglomeration persist through regime change) means a great city survives conquest and just changes masters — Rome, Constantinople, Damascus, conquered repeatedly, carry on. A mono-functional nucleus can die when its single engine is taken. Conquerors usually preserve rather than destroy — the city is the tax base — so urbicide is the exception. In model terms: conquest applies a shock whose damage is f(size, diversity, conqueror intent, whether the base sector survives) — a diversified metropolis absorbs it, a one-engine town may collapse to ruin.

07How the pieces compose into one engine

Substrate (mappa). A seeded planet; per-cell water, rivers, relief, fertility, lithology.
Site & founding engine. Score sites on site×situation; pre-seed forced spawn points (break-of-bulk, fall line, harbour). Assign a founding basic sector — the big game in town.
The base economy. total = base × 1/(1−s), capped by agricultural surplus. Agglomeration multiplies base productivity by size^ε (ε ≈ 0.04–0.08).
Regime 1 → 2 (Physarum star → hypoxia). Grow spokes to the engine; as the multiplier spins up services, cross-fade to angiogenesis and fill the fabric in. Age plots through the burgage cycle.
Regime 3 (Physarum demand). Import-replacement promotes the largest non-basic sector into new export base; gravity demand → arterial network (μ = grid↔tree); bid-rent sorts land use; fringe belts freeze.
Co-evolution + system. Iterate; lock-in keeps the accidents; across many cities the central-place hierarchy, the Zipf line, and the N^β scaling emerge.

Path dependence — the through-line. The founding engine breaks the initial tie; increasing returns amplify the lead; sunk infrastructure does not decay when the founding feature dies. The proof: portage cities, founded at fall-line sites, kept concentrating population after river navigation became obsolete (~6% lower density per 10% farther from the dead portage; Bleakley & Lin, 2012). The lock-in test for polis: delete a city's founding engine mid-run — agglomeration + sunk capital should keep it growing.

08Determinism, and the road to a 4X

Everything is seeded. (worldSeed, siteCell) → a city's entire economic history, identical on every machine, freezable to an ATProto record. No Date.now(), no unseeded Math.random() in generation. A city permalink (and, later, a 4X save) is only meaningful if the history reproduces.

polis is the economic map-and-history layer a 4X needs. Once a city has a legible economic history — a founding engine, a multiplier, a diversifying base, a place in a Zipf hierarchy — the 4X verbs act on something real: eXplore the mappa world, eXpand along the site-score field, eXploit the surplus and the export base, eXterminate over the central-place catchments. The phases are, deliberately, also the economic-era progression of such a game.

Next passes (as the theory hardens into code): a substrate.js mappa-reader; a site.js two-axis scorer with the forced spawn points and the founding-sector assignment; an economy.js carrying the base, the multiplier, agglomeration and import-replacement; vendored network.js (from flux.js) and coverage.js (from foam.js), re-synced not forked; and a deterministic history.js driving the regime cross-fades and emitting a replayable chronicle.

09Sources

Assembled from the canonical urban-economics, economic-geography, and complexity-science literature. Full reading list:

The economic engine

Economic base analysis & the multiplier M=1/(1−s) · North, export-base theory, JPE 1955 · Cooley, "break in transportation," 1894 · Innis / Watkins staples thesis

Self-reinforcing growth

Marshall's agglomeration trinity (1890) · Rosenthal & Strange (3–8% elasticity) · Krugman, core–periphery, JPE 1991 · Jacobs, The Economy of Cities (1969) · import-replacement

The life cycle

Thompson, five stages + the size ratchet (1965) · Vernon, product cycle / filtering-down (1966) · Childe's urban revolution (surplus)

Dynamics — curves, projects, tech

Verhulst logistic · Gompertz curve · carrying capacity (K rises) · Hirschman SOC/DPA (1958) · Rosenstein-Rodan big push (1943) · Bresnahan & Trajtenberg GPTs · Kondratiev waves

Hinterland & away markets

von Thünen hinterland rings · Boserup intensification · Burghardt, gateway cities (1971) · Vance mercantile model (1970)

Borrowed repo assets

cards — 500-node tech DAG · hoop/econ — civic vitality · hoop flux + foam solvers · mappa substrate

Financial flows

Levine, five functions (1997) · King & Levine (1993) · Goldsmith deepening · Polanyi modes · North & Weingast (1989) · Gerschenkron (1962) · Henry George · Hoyt land cycle · Minsky · Kindleberger

Flourishing — edge & decline

Peter Hall, golden ages · Schorske, Vienna 1900 · Florida, creative class · Glaeser, Triumph of the City · Sassen, global city · Hegel, owl of Minerva · Spengler · Tainter, complexity collapse

Defense, empire & conquest

Tilly, capital↔coercion (1990) · Wallerstein, world-systems · Jefferson, primate city (1939) · Kennedy, imperial overstretch · urbicide

Site & situation

Site & situation · Fall line · Break-of-bulk point

Networks (the solvers' grounding)

Tero et al., Physarum / Tokyo rail, Science 2010 · Reilly's law (1931) · Levinson & Xie, co-evolution

Land use & morphology

Von Thünen rent R=Y(p−c)−YFm · Alonso bid-rent · Conzen burgage cycle / fringe belts · Burgess / Hoyt & Harris–Ullman

System & scaling

Christaller central place theory · Gabaix, Zipf for cities (1999) · Bettencourt et al., scaling, PNAS 2007 · David, path dependence · Bleakley & Lin, portage (2012)