Skip to content
Naftali Lubin

Need a website? Let’s talk

Case study · 2026

Verticopolis

A browser-native homage to SimTower (1994), with a portable simulation engine.

Version
3.0.0
Rule-sets
Classic (1994 rules) or Modern, fixed per tower
Tower bounds
100 floors up, 10 basement levels
Saves
Opens the original SimTower’s .TDT files, keeping their building sizes, and writes them for Classic towers, plus its own .vctower
Engine
Rust compiled to WebAssembly, the only engine the game runs since 2.66.0
Runs on
Desktop and phone browsers; installable as a PWA, saves before updating. Not yet tested in Safari on Apple hardware
A 36-floor Verticopolis tower at night with offices, hotel floors and condos lit up, and the build tools panel on the left.
Actual screenshot A five-star tower at night, Classic rule-set. Art CC BY 4.0.

What it is

Build a vertical city floor by floor. Wire it with elevators, attract offices, condos and hotel guests, set the rents, and climb the star ratings toward TOWER. Classic mode follows the 1994 rules; Modern adds rentals, amenities and household variants. Every sprite is drawn in code.

What’s new in 3.0: the whole game now runs on the Rust engine, checked against hundreds of replayed games and the 1994 original’s rules. Classic mode follows the 1994 game more closely, from the shared elevator and stair limits to the rooms it keeps for good. The Map holds every tower view in one place: Eval, Pricing, Hotel, Traffic and Occupancy.

I documented where Classic departs from the original, and Modern adds variants like two-to-five-person condos. It’s built with TypeScript, Excalibur.js, lit-html, Tone.js, Rust, WebAssembly, Vite PWA.

Gameplay and the tower simulation

Tenants are routed one by one, with an aggregate congestion model underneath, and they ride elevators dispatched with a SCAN algorithm. Put a shaft in the wrong place and you get a lobby full of waiting people. Stars unlock at 300, 1,000, 5,000 and 10,000 people. TOWER also needs a Wedding Hall, a metro and a passed VIP inspection.

A crowded Verticopolis lobby at the morning rush, with tenants waiting for elevators.
Actual screenshot The morning rush. Art CC BY 4.0.

Evolution

My first commit, in February 2026, had three SimTower prototypes. I gave the same basic prompt to agents from ChatGPT, Copilot and Gemini. None of them was particularly good, so in June I rebuilt the project from scratch.

  • A dark, mostly empty grid with a build menu of room types: an early prototype from February 2026.
    Rebuilt from sourceFeb 2026 · One of three first prototypes, the ChatGPT agent’s attempt
  • A pixel-art tower under the Tower Tycoon name, with a tools panel.
    Actual screenshotJun 29, 2026 · Rebuilt from scratch as Tower TycoonView this version
  • A smaller pixel-art tower on the first Excalibur.js build.
    Actual screenshotJun 30, 2026 · First Excalibur.js buildView this version
  • A 40-floor tower in the Verticopolis interface.
    Actual screenshotJul 29, 2026 · 2.0: renamed Verticopolis, Modern rule-setView this version

Status timeline

  1. First prototypesShipped

    Three SimTower prototypes, each from a different AI agent.

  2. Rebuilt from scratchShipped

    A clean-room rebuild, renamed Verticopolis on July 1.

  3. 2.0 and 1994 savesShipped

    Import and export of the original game’s .TDT saves; 2.0.0 on July 29.

  4. Closer to SimTowerShipped

    1994 saves with their layout, Classic rules and sizes, a new metro station and wedding hall, and a faster Rust engine.

  5. 3.0Shipped

    The whole game on the Rust engine, Classic closer to 1994, and every tower view on one Map.

Architecture

The game is a TypeScript host on Excalibur.js. The simulation sits behind an engine boundary, so it doesn’t depend on any one frontend. The renderer, interface, audio and saves send it commands and read its state back.

Diagram

Verticopolis architecture todayThe TypeScript host runs the Excalibur.js renderer, the UI panels and inspector, Tone.js audio, saves and .TDT import and export, and a shared view reader. The host sends commands and steps to the Rust simulation engine compiled to WebAssembly through one port, and reads state and refusals back. The TypeScript engine implements the same port, but the shipped game does not run it. The Rust engine has no file, network or clock access and produces state digests. Conformance scenarios and a nightly fuzzer compare the TypeScript and Rust engines' digests.TypeScript hostExcalibur.js rendererUI panels, inspectorAudio (Tone.js)Saves, .TDT import/exportShared view readerRust engine (WebAssembly)Deterministic fixed stepPeople, transport, economyNo files, network, clockState digestscommands, stepsstate, refusalsConformance scenarios and a nightly fuzzer compare both engines
Illustration: how the TypeScript host and the Rust engine connect today.

From TypeScript to Rust

I ported the simulation to Rust and compiled it to WebAssembly. Since version 2.66.0 it is the only engine the game runs. If it fails to load or stops, the game shows a failure screen with a reason and a reload button. The TypeScript engine stays in the repository as a reference for the conformance tests until its code is deleted.

Why Rust

Rust compiles to WebAssembly, so the engine runs in the page the way the TypeScript one does. It has no file, network or clock access, and a test enforces that. It is also faster than the TypeScript engine was; the numbers are under Performance.

How the game talks to the engine

Until late October, the opt-in kept a TypeScript simulation running next to the Rust engine as a read model that was refreshed from it, and player commands ran there first before being relayed. That mirror is gone. My first plan for removing it put a facade (a SimPort, PR #1184) between the game and the engines. On Oct 28 I replaced that plan with a simpler one: the Rust engine itself is the interface. It is one synchronous, numeric port (EnginePort) with no JSON in between. The TypeScript engine implements the same port, so the renderer and panels read both through one shared view reader. Prices, refusals and decisions come from whichever engine is running, and the UI keeps no copy of them.

Determinism and conformance testing

A port is only good if it produces the same tower as the engine it replaces. The simulation runs on a fixed time step, so it gives the same result at any frame rate. A conformance suite pins state, crowd and event hashes for a library of scenarios and runs them against both engines. A nightly fuzzer feeds both the same random command streams and compares their digests. The port includes a Mulberry32 random generator rebuilt on wrapping 32-bit integers, so both engines draw the same numbers.

Saves from the 1994 game

Verticopolis opens the original SimTower’s .TDT save files, and it exports your tower back to .TDT. Load a tower you saved in 1994 and it’s here, with its population, elevators, lobbies and views. Build a Classic tower here and export it, and the original game can load it, as I tested in August (below). Modern towers can’t be exported, because SimTower can only load Classic ones.

The format was never published, so the importer is built from public reverse-engineering notes. It uses none of the original’s code. My own notes on it are in the repo’s .TDT format page.

Checked against the real game

In August I tested exports in retail SimTower, running in a Wine harness. A four-star tower I exported loaded with most of its elevators missing and its burned rooms drawn as static. I fixed four round-trip bugs (PR #741) and found a fifth in the game itself: every elevator shaft written after an express slot is lost. I can’t fix that from here, so the exporter writes express shafts last and warns when a second express won’t survive.

Both engines, same bytes

The Rust engine has its own importer and exporter. On Oct 28 I ran five real saves from the original game through both. The TypeScript and Rust importers gave the same tower with the same warnings, and their exports are byte-identical.

Three limits. None of my real saves has a cathedral, so the wedding hall’s import and export are unchecked against a real file. Neither exporter reproduces the original file byte for byte: the headers differ, and so do the file sizes. And I haven’t yet loaded those Oct 28 exports back into the original game, so that check is still to do.

Engineering challenges

Keeping two engines honest

The conformance suite found three places where the Rust port had drifted from the TypeScript engine.

The cost of hosting an engine

For a while, hosting Rust in the browser game cost more than stepping the simulation. The early WebAssembly host kept a TypeScript read model and synchronized state back into it, and profiling on my desktop showed that this overhead could dominate the total time. Removing that mirror is what the numbers under Performance reflect.

How it was built

AI coding agents wrote most of the implementation. I made the product and architecture calls and set the rules and review bar they work under.

Tools: Claude Code, the GitHub Copilot coding agent and Codex reviews, working inside the BMAD method, an open-source workflow for planning and reviewing work with AI agents.

Workflow, with a public example for each step

  1. DecideMe

    Product and design calls, written down with the options that were rejected.

    Example: A decision log
  2. SpecifyMe + agent

    Specs, requirements and stories written before code.

    Example: A spec-first change
  3. PlanMe + agent

    Larger changes get a written plan with stages and exit criteria.

    Example: A staged written plan
  4. DelegateMe

    Bounded tasks go to Claude Code or GitHub Copilot sessions, each claiming an issue first.

    Example: The claim-an-issue rule
  5. ImplementAgent

    Agents write the code for each task, following the repository’s written rules.

    Example: Commit history
  6. VerifyCI

    Typecheck, lint, tests with coverage floors, conformance and screenshot drift.

    Example: Conformance caught three Rust drifts
  7. ReviewAgents + me

    Adversarial review skills plus Copilot and Codex reviews, repeated until a pass finds nothing new.

    Example: A change reviewed in ten rounds
  8. TriageMe

    Each finding is fixed now or deferred to the backlog with a tracking issue.

    Example: A deferred finding
  9. Approve and mergeMe

    Pull requests merge under my account. Agents may arm auto-merge only after review sign-off and green CI.

    Example: The merge rules
  10. MeasureAgent + me

    Claims about speed are measured with reproducible, paired benchmarks before they are made.

    Example: The TypeScript vs WebAssembly benchmark
  11. Refine the rulesMe

    When something goes wrong, it becomes a written rule for the next session.

    Example: A rule added after an incident

Performance

In 3.0 the game feels smoother. Measured on Nov 10, 2026 on the 3.0.0 release against the last TypeScript build, a full in-game day takes a sixth to a seventh of the time to simulate on a big tower, and the stutters you can see while playing are about half as long. On a slower computer, a large tower runs at twice the frame rate and freezes about 70% less.

Medians of 10 runs on my PC. Lower is better, except for frame rate.
MeasureOld engineNew engine
A full in-game day, medium tower888 ms143 ms
A full in-game day, large tower955 ms136 ms
Longest stutters, large tower29 ms16 ms
Frame rate, slower computer, large tower21 FPS41 FPS
Time frozen, slower computer, large tower4.9 s1.5 s

What it costs: the game takes about 35 ms longer to start, a large saved tower loads in 86 ms instead of 77, and it uses 15 to 35% more memory on medium and large towers.

How it got here

It didn’t start out fast. On Oct 20, running inside the game, the Rust engine was about 5× slower than the old one on a large tower and used 2.7× the memory, because the game copied the whole simulation back into TypeScript after every step. Cutting that copy out is what turned it around.

The Rust engine on a large tower, same PC both times: time to simulate a full in-game day, frame rate on a slower computer, and memory. The old TypeScript engine took about 1 to 1.4 seconds and 74 to 80 MiB.
DateDayFPSMemory
Oct 207.6 s3.2201 MiB
Nov 10 (3.0)0.14 s41.092 MiB

How I measured. Both runs are on my Windows 11 desktop (Ryzen 5 5600X, 32 GB, RTX 3060) in headless Chromium 149: medians of 10 runs, each in a fresh browser with the engine order alternating, and each run’s validation checks passed. “Slower computer” means the CPU slowed down 4×. The Nov 10 run pits the 3.0.0 release against the last TypeScript build (app 2.77.5), so the two differ in app code as well as the engine, on towers of 729, 3,219 and 17,314 people. The Oct 20 run (app 2.38.0) compared both engines inside the same build. The measurement protocol is in the repo; the full reports are kept privately. Other hardware may perform differently.

Testing and quality gates

Every change goes through typecheck, lint, unit tests and a production build. Two engines that have to agree need more than that, so I run these too:

  • Conformance scenariosPinned state, crowd and event hashes, run against both engines
  • Nightly differential fuzzingRandom command streams; TypeScript and Rust digests must match
  • Engine independence testNo file, network, console or clock access inside the simulation
  • Coverage floors93–94% of the TypeScript (86% of branches) and 87% of the Rust
  • Screenshot drift gateThe screenshot gallery is rendered in a pinned Playwright container

Status

You can play it today at verticopolis.com (version 3.0.0), in the browser or installed as an app. New versions ship through release pull requests, so the version number moves with each release.

Last updated .

Contribute

I’m looking for contributors to Verticopolis. The code is open source, and the contributor guide covers setup, the quality gates and how changes get reviewed.

Receipts

The public pull requests and documents behind this page.