Cite as
Micropolis (SimHacker/micropolis)
Original
https://github.com/SimHacker/micropolis
Pinned
SimHacker/micropolis @ c98f6b08519887b450d9be198bfca5237aab6d0c
Accessed
2026-10-21
Licence
GPL v3 or later (micropolis-activity/COPYING and each file's header, “Copyright (C) 1989 - 2007 Electronic Arts Inc.”), with additional terms under section 7 that grant no right to the SimCity trademark. The name Micropolis is licensed separately (MicropolisPublicNameLicense.md).
Credit
SimCity was designed and written by Will Wright at Maxis. Don Hopkins ported it to Unix, wrote the TCL/Tk interface “for DUX Software under license from Maxis”, and adapted it for the One Laptop per Child project, for which Electronic Arts released it under the GPL as Micropolis in 2008 (micropolis-activity/README). Comments marked “-Don” are his.
Notes
The atlas reads micropolis-activity/src/sim/, the C simulator of the TCL/Tk version, which is the code closest to the original; MicropolisCore is a later C++ rewrite of it. The README traces the code's line as “C64 => Mac => SunOS/NeWS/HyperLook => Unix/X11/TCL/Tk”, and the file headers date the Unix release to “in or about 1990”. Comments marked `post`, `post rel`, or `post release` flag changes made after the original release, so the 1989 Macintosh, Amiga, and DOS versions may differ at those lines; claims say where they rest on one.

Cited on

Claims (23)

Electronic Arts released the SimCity engine under the GPL, version 3 or later, as Micropolis, on 10 January 2008.micropolis-activity/README L37–44Wikidata
SimFrame runs one step of the simulation on every call at speed 3, on every third call at speed 2, and on every fifth call at speed 1; at speed 0 (paused) it runs none.micropolis-activity/src/sim/s_sim.c L94–108Code
The simulation runs as a 16-step cycle, one phase per step (Fcycle & 15). Phase 0 advances the city clock and, every second cycle, recomputes the demand valves; phases 1 to 8 each process one eighth of the 120 map columns; phase 9 takes the census every 4 clock ticks and collects tax every 48; phase 10 decays traffic; phases 11 to 14 rebuild the power, pollution and land value, crime, and population density maps; phase 15 rebuilds fire coverage and rolls for disasters.micropolis-activity/src/sim/s_sim.c L108micropolis-activity/src/sim/s_sim.c L126–138micropolis-activity/src/sim/s_sim.c L158–172micropolis-activity/src/sim/s_sim.c L182–201micropolis-activity/src/sim/headers/sim.h L156–157micropolis-activity/src/sim/headers/sim.h L222–223Code
The map rebuilds in phases 11 to 15 skip cycles at higher speeds. At speed 1, power and pollution run every second cycle and crime, population density, and fire coverage every cycle; at speed 2, every 4th, 7th, 8th, 9th, and 10th cycle; at speed 3, every 5th, 17th, 18th, 19th, and 20th. The disaster roll in phase 15 runs every cycle.micropolis-activity/src/sim/s_sim.c L115–123micropolis-activity/src/sim/s_sim.c L182–201Code
The city clock advances once per 16-step cycle, and the date shown divides it by 4 for the month and by 48 for the year, so a month is 64 steps.micropolis-activity/src/sim/s_sim.c L126–132micropolis-activity/src/sim/w_graph.c L710–711Code
Every second cycle, SetValves projects each zone type's population. Residential: the current figure (ResPop / 8) plus migration, that figure times (jobs per resident − 1), where jobs are the commercial and industrial populations at the previous census, plus 2% births. Commercial: (residential + commercial + industrial) / 3.7, times the labor base, residents per job at the previous census, held to 0–1.3. Industrial: the industrial population times the labor base times 1.2, 1.1, or 0.98 at game levels 0, 1, and 2 (starting funds $20,000, $10,000, $5,000), and at least 5. Each projection over the current population, capped at 2, is the type's ratio.micropolis-activity/src/sim/s_sim.c L440–449micropolis-activity/src/sim/s_sim.c L451–477micropolis-activity/src/sim/s_sim.c L479–488micropolis-activity/src/sim/s_sim.c L578–582micropolis-activity/src/sim/w_util.c L177–192Code
Each ratio becomes a step: (ratio − 1) × 600 plus TaxTable[tax rate + game level] (index capped at 20), which at game level 0 runs from +200 at 0% through 0 at 7% to −600 at 20%; each higher level shifts the index up one. The step is added to the type's valve, which is held to ±2000 for residential and ±1500 for commercial and industrial.micropolis-activity/src/sim/s_sim.c L416–418micropolis-activity/src/sim/s_sim.c L490–494micropolis-activity/src/sim/s_sim.c L496–514Code
A valve is held at zero or below while the city lacks a building it needs: residential once the raw residential count (ResPop, eight times the figure the demand projection uses) passes 500 with no stadium, industrial past 70 with no seaport, and commercial past 100 with no airport. The check runs once every 64 clock ticks, one type at a time.micropolis-activity/src/sim/s_msg.c L92–94micropolis-activity/src/sim/s_msg.c L120–141micropolis-activity/src/sim/s_sim.c L516–518Code
When the simulation visits a zone, a residential zone tries a trip if its population exceeds a random 0–35, a commercial or industrial zone if its population exceeds a random 0–5. If none of the 12 tiles bordering its 3×3 footprint (corners excluded) is a road or rail tile, the trip fails at once and the zone declines.micropolis-activity/src/sim/s_zone.c L239–246micropolis-activity/src/sim/s_zone.c L200–207micropolis-activity/src/sim/s_zone.c L169–175micropolis-activity/src/sim/s_traf.c L93–104micropolis-activity/src/sim/s_traf.c L160–178micropolis-activity/src/sim/s_sim.c L1195–1205Code
From the road found beside the zone, TryDrive walks up to 30 steps (MAXDIS), each step trying the four directions in turn from a random one and never straight back. The trip succeeds once the current tile borders a destination: tiles 423–816 (commercial zones through the nuclear plant) for a residential trip, 249–698 (houses through the seaport) for a commercial one, and 249–423 (houses to the first commercial tile) for an industrial one.micropolis-activity/src/sim/s_traf.c L68micropolis-activity/src/sim/s_traf.c L206–219micropolis-activity/src/sim/s_traf.c L231–238micropolis-activity/src/sim/s_traf.c L277–278micropolis-activity/src/sim/headers/sim.h L351–389Code
At a dead end TryDrive drops its last saved position and adds 3 to the step count, but it doesn't move back: the next try starts from the same tile, still barred from the way it came, so it fails again until the steps or the saved positions run out, and the trip fails.micropolis-activity/src/sim/s_traf.c L211–216micropolis-activity/src/sim/s_traf.c L233–244Code
A successful trip adds 50 to the traffic density of the 2×2 block under every second road tile on its path (rail tiles aren't counted). A sum above 240 is set to 240 one time in six, which also sends the helicopter there; otherwise it's stored in a byte, so a sum above 255 wraps around to 0–49. Each cycle, density above 200 falls by 34, density from 25 to 200 by 24, and density of 24 or less drops to 0.micropolis-activity/src/sim/s_traf.c L239–240micropolis-activity/src/sim/s_traf.c L113–134micropolis-activity/src/sim/headers/sim.h L475micropolis-activity/src/sim/w_sprite.c L470micropolis-activity/src/sim/s_sim.c L256–268Code
One visit in eight (every visit, for an empty residential zone), a zone takes a score: its type's valve plus a local term. The residential term is (land value − pollution) × 32, held to 0–6000, minus 3000; the commercial term is its 8×8 block's ComRate, 64 minus 4 × the block's distance from the city center, so from 64 down to −64; the industrial term is 0. An unpowered zone scores −500 whatever its valve.micropolis-activity/src/sim/s_zone.c L248–251micropolis-activity/src/sim/s_zone.c L209–212micropolis-activity/src/sim/s_zone.c L177–179micropolis-activity/src/sim/s_zone.c L569–600micropolis-activity/src/sim/s_scan.c L529–539micropolis-activity/src/sim/s_scan.c L277–296Code
A zone grows if its score is above −350 and (score − 26380) exceeds a random signed 16-bit number; failing that, it declines if its score is below 350 and (score + 26380) is under a second one. The numbers are uniform over −32768 to 32767, so growth comes with chance (score + 6388) / 65536 per evaluation, about 10% at a score of 0 and 17% at a residential zone's highest, 5000. An unpowered zone declines with chance 6887 / 65536, about 10.5%. A commercial zone whose trip failed can't grow; one that made no trip can.micropolis-activity/src/sim/s_zone.c L253–264micropolis-activity/src/sim/s_zone.c L214–222micropolis-activity/src/sim/s_sim.c L1216–1223micropolis-activity/src/sim/rand.c L44–48Code
Growth adds one level at a time and stops at each type's top: a residential zone below 40 population (levels 16, 24, 32, 40), commercial below 5, industrial below 4. A residential zone doesn't grow where its block's pollution is above 128, and a commercial zone grows only while its population is at most its block's land value / 32, so it can reach one level past that figure. An empty residential zone builds single houses until it has 8, then fills in at level 16 only where population density is above 64.micropolis-activity/src/sim/s_zone.c L300–346micropolis-activity/src/sim/s_zone.c L428–453micropolis-activity/src/sim/s_zone.c L605–618Code
A zone's new building takes one of four value classes from its block's land value minus pollution: below 30, below 80, below 150, and 150 or more.micropolis-activity/src/sim/s_zone.c L287–297Code
Over the 120×100-tile city, the simulation keeps population density, traffic, pollution, land value, and crime in 2×2-tile blocks (60×50), terrain in 4×4 blocks (30×25), and fire coverage, police coverage, commercial location, and growth rate in 8×8 blocks (15×13).micropolis-activity/src/sim/headers/sim.h L156–167micropolis-activity/src/sim/headers/sim.h L474–488Code
A 2×2 block holding any developed tile (a road or anything numbered above it) gets land value 4 × (34 − its distance from the city center, capped at 32), plus its 4×4 block's terrain value, minus its pollution, minus 20 more where its crime is above 190, held to 1–250. A block with nothing developed gets 0.micropolis-activity/src/sim/s_scan.c L184–215micropolis-activity/src/sim/s_scan.c L277–296Code
A 2×2 block's pollution sums its tiles, held to 255, then is smoothed: heavy-traffic road 75, light-traffic road 50, fire 90, radiation 255, built industrial tiles 50, and seaport, airport, and coal plant tiles 100. Houses, commercial buildings, and the nuclear plant add nothing.micropolis-activity/src/sim/s_scan.c L257–273micropolis-activity/src/sim/s_scan.c L191–202Code
Crime in a 2×2 block with land value is 128 − land value + population density, held to 300, minus its 8×8 block's police coverage, held to 0–250; a block without land value has none.micropolis-activity/src/sim/s_scan.c L313–323Code
Each police station adds the police funding effect, 1000 × spending / requested funds (1000 when nothing is requested), to its 8×8 block, halved if unpowered and, by a change after the original release, halved again if no road touches it. Fire stations fill the fire coverage map the same way. Each map is then smoothed three times, every pass setting a block to half its value plus an eighth of its four neighbours' sum.micropolis-activity/src/sim/s_sim.c L1040–1069micropolis-activity/src/sim/s_sim.c L678–688micropolis-activity/src/sim/s_scan.c L307–309micropolis-activity/src/sim/s_scan.c L81–83micropolis-activity/src/sim/s_scan.c L515–520Code
Once per cycle, unless disasters are switched off (a switch added after the original release), a random disaster strikes with chance 1 in 481, 241, or 61 at game levels 0, 1, and 2. It is a fire or a flood with 2 chances in 9 each, a plane crash, tornado, or earthquake with 1 in 9 each, and with the last 2 in 9 a monster, but only if average pollution is above 60.micropolis-activity/src/sim/s_disast.c L76–113micropolis-activity/src/sim/s_sim.c L1195–1205Code
Each nuclear plant, on each cycle's visit and unless disasters are off, melts down with chance 1 in 30,001, 20,001, or 10,001 at game levels 0, 1, and 2.micropolis-activity/src/sim/s_sim.c L1016micropolis-activity/src/sim/s_sim.c L1029–1033Code