0% found this document useful (0 votes)
72 views1 page

SimCity Simulation Rule Diagrams

The document outlines the reverse diagrams for SimCity, translating the complex simulation rules into a more understandable format. It details the 16 steps involved in city simulation, including data flow and map processing, while explaining how various factors like population density, crime, and power coverage are calculated and managed. Additionally, it describes the mechanics of different zones and their interactions within the simulation, emphasizing the importance of historical data for user feedback.

Uploaded by

jwondy06
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
72 views1 page

SimCity Simulation Rule Diagrams

The document outlines the reverse diagrams for SimCity, translating the complex simulation rules into a more understandable format. It details the 16 steps involved in city simulation, including data flow and map processing, while explaining how various factors like population density, crime, and power coverage are calculated and managed. Additionally, it describes the mechanics of different zones and their interactions within the simulation, emphasizing the importance of historical data for user feedback.

Uploaded by

jwondy06
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

SimCity reverse diagrams

Chaim Gingold (2016)


These reverse diagrams map and translate the rules of a complex simulation
program into a form that is more easily digested, embedded, disseminated, and
and discussed (Latour 1986).
Simulate() Map Data Flow Maps
City simulation is broken down into 16 steps. Each SimCity's spatial data is modeled in
Bits 0…9
14 Population Density
revolution advances the city time by 1. Every frame of the multiple maps that can be
game, one of these 16 steps is performed. Smooth•3 CrimeAverage conceptualized as overlaid upon one
PopDenScan() another.

1:8 1:8 1:2 1:2 1:8


Valves Primary Map Data 1:1 Character
Fire Coverage & Disasters Update RCI Valves SetValves() ! 1/2 (twice monthly) Police Pop. Com. The main Map is 120x100 and
! FireAnalysis() Clear census data ClearCensus() Police St. Crime encodes seven different data layers.
ZONEBIT Character bits 16-bit tiles
DoDisasters() Advance CityTime Radius – + Density Rate The low 10 bits specify one of
PoliceMapEffect[] PoliceMap[] CrimeMem[] PopDensity[] ComRate[] SimCity's 956 characters. The high six ANIMBIT $
bits encode various tile properties:
Status bits Map

15 0 13 Police Coverage + + Smooth•3


whether this tile is a zone, it
animates, is bulldozable, burnable, a
conduit, and is powered.
BULLBIT #
Map[] $ # ! "
Population Density & Crime BURNBIT
sus

0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
! PopDenScan() CrimeScan()
Map Scan
clear cen

Find city center and 14 City Center


CONDBIT ! Each Map[] cell is 16 bits. The low 10 bits
specify the tile character, and the high six
map distance to it.
1 CCx, CCy PWRBIT " status bits can be conceptualized as six 1-bit
maps.

Police Coverage & Crime 13 2 Fire


15 Coverage
! CrimeScan() FireAnalysis()
3 1:8
1...8 Map
Fire MapScan() Scan Pollution and 1:2 Land Value
sus

4 revolutions are
12 4 Smooth•1
take cen

Pollution & Land Value a sim month. 48


make a sim year. Radius – + Land Value Pollution Terrain is a temporary buffer used in
! PTLScan()
FireRate[] – 1:4 Terrain
calculation of Land Value. It is a smoothed
representation of where nature is.
16-bit tiles 1:2 1:4
5 Land +
Map Terrain
Power Scan 11 1:8 + Value Power 1:1 Power
! DoPowerScan()
6 Map[] LandValueMem[] TerrainMem[]
Fire St.
8 7 Crime and Police 1:2 Crime Police St. records the locations of police
10
sus

FireStMap[]
Avg. Land Value stations during Map Scan, and is modulated

use cen

1:8 Police Radius and blurred to produce the Police Radius.


Map Scan updates the whole map over LVAverage
the course of eight simulation frames. Crime map is a function of population
Police St. density, police radius, and land value.
9
Decay Traffic Map processes and objects are 1:2
Smooth•3
updated, and census data is tallied.
& Rate of Growth
Maps Taxes The locations of power plants, police, Pollution PollutionAvg
and fire departments are noted for Fire Coverage 1:8 Fire Radius Fire St. records the locations of police
! 1/5 DecROGMem() TakeCensus() ! 1/4 (monthly) use in power scan, and police and fire 1:2 PollutionMem[] Pollution Max stations during Map Scan, and is modulated
DecTrafficMem() TakeCensus2() ! 1/48 (yearly) coverage generation. Fire St. and blurred to produce the Fire Radius.
SendMessages() Traffic + PolMaxX, PolMaxY
CollectTax() ! 1/48 (yearly)
During the map scan, traffic and CityEvaluation() ! 1/48 (yearly) Density Smooth•2
rate of growth are accumulated. In TrfDensity[]
this step, these maps decay back Taxes are taken, and census data is periodically
towards zero. stored for historical purposes. This historical
data is used to show the user charts, and is 1:8 1-bit
12 Pollution
Land Value
& Traffic and
Population Density
1:2 Traffic Density
Population Density
also fed into the global RCI valve formulas.
PTLScan()
Rate of
TakeCensus() also updates NeedHosp and Power
NeedChurch, flags which indicate whether Growth Rate of Growth and 1:8 Rate of Growth
there are too few or too many hospitals or
RateOGMem[] PowerMap[] Commercial Rate measures nearness 1:1
churches. Commercial Rate Com. Rate
to the city center, and is normalized
to -64…64. 64 means at city center, 1:2

Slow Medium Fast !


10 Decay Traffic
& Rate of Growth
11 Power Scan
DoPowerScan() Temporary Maps
Mainly used as temporary buffers in
1:2 Temp
and -64 means >= 32 tiles away.
1:4
Temp 2 1:8
DoPowerScan() 1/2 1/4 1/5 To keep up with faster simulation speeds Maps smoothing operations.
PTLScan() 1/2 1/7 1/17 (selected by the player in the Speed menu), 1:1 Full 120 × 100 16 or 1 bit 1:4 Q.Temp
DecROGMem()
CrimeScan() 1 1/8 1/18 certain processes run less often. Maps come in four resolutions.
DecTrafficMem() 1:2 Half 60 × 50 8 bit 1:8 S.Temp Lower resolution data maps use
PopDenScan() 1 1/9 1/19 ! Some steps always run at a fixed, lower 1:4 Quarter 30 × 25 8 bit fewer cells to represent the same
FireAnalysis() 1 1/10 1/20 frequency. visible to player 1:8 Small 15 × 13 16 bit space.

The technique is inspired by the game designer Stone Librande’s one page
game design documents (Librande 2010).
1-bit
Animation Characters 827-851
Map Scan Power ! Make Traffic Make Traffic can be invoked when Map Scan evaluates Residential, Commercial,
and Industrial Zones. It returns either success (1: destination found), failure (0:
PowerMap[]
Power Plants MakeTraf() destination not found), or hard failure (-1: no perimeter road found).
The main tile map is scanned Zones/buildings are attended Zone cells read PowerMap[] and update Locations and tallies are noted
incrementally over eight simulation to by identifying cells with their powered status via SetZPower(), for Power Scan. Nuclear reactors
frames. One 15x100 column is ZONEBIT on. and increment the tally of powered randomly melt down. (Chance is
scanned at a time (1/8th of the (PwrdZCnt) and unpowered zones based on game level and whether Origin FindPRoad() Desination DriveDone() Power Outage
map). Tile map based processes and (unPwrdZCnt). This blinking animation is not
disasters are on). Coal plants To begin a trip, a road tile on the perimeter of the Each zone type attempts to make a trip to
objects tallies are updated. done through the tile character
turn on their smoke animation. originating zone must be located. The first tile found a particular set of destination tiles. On the
Non-RCI zones use RepairZone() to 827 LIGHTNINGBOLT substitution technique, but is
NuclearPop +1 in a clockwise search from the top left is used. trip, adjacent tiles are tested to see if they done while rendering the tiles
regenerate damaged component tiles. CoalPop +1
fall within a range of tile indices. The drive to the screen.
3x3 PushPowerStack() Any road or rail tile will be used in the search. e.g.: succeeds when one of these destination
tiles is found. Blinking lightning bolt
4x4 indicates a lack of power.
RoadTest()
1:8 1:8

Police
6x6 Fire St.
Radioactive decay St. source destination
PoliceMap[] FireStMap[]
1/2^12 chance of turning into
rubble. Drive TryDrive() Draw Bridge—Horizontal HBRDG1 HBRDG3
Fire and Police St. HBRDG0 … HBRDG3 1 3
Stations are marked in the police Bridges can open when boats
Fire FirePop +1
and fire maps, with a value 828 0 2 are nearby, and close when they
Fires are updated (with 1/4 chance) modulated by fund effects, road 423 COMBASE are far. BRWH bookmarks the

RIVER

BRWH
RIVER
HBRDG0 HBRDG2
via DoFire(), which extinguishes access, and power. open bridge.
and spreads them. Residential
FireStPop +1
PolicePop +1

CHANNEL
Flood Full Stadium s_sim.c/DoBridge() structures
RIVER RIVER
this logic as a toggle between
DoFlood(). Like Fire, it spreads to Stadiums randomly switch
source two state configurations of a U
burnable tiles, but only while between full and empty. (They
shaped tile layout.
FloodCnt > 0. Otherwise, flood can only become full if the power HBRIDGE
tiles turn to rubble with 1/2^4 is on). 816 NUCLEAR
chance. StadiumPop +1 destination Airport Radar
road or rail 249 LHTHR
Clear Animation Commercial
RCI Zones After finding an origin, a random route using any
832
Rubble Residential, Commercial, and
The last four frames of animating Industrial zones grow and decay combination of road and rail is tried. At every fork, a RADAR0 … RADAR7
rubble tiles (SOMETINYEXP… based upon algorithms defined in: random turn is made.
LASTTINYEXP) are converted into • DoResidential()
plain old RUBBLE that the player • DoCommercial()
can bulldoze and build on. • DoIndustrial() At each step, adjacent tiles are tested to 698 PORT
or FreePop()
ResZPop +1 ResPop +RZPop() see if they constitute valid destination
ComZPop +1 ComPop +CZPop() tiles for the source zone type.
IndZPop +1 IndPop +IZPop()
249 LHTHR
Industrial Airport radar spins when
Hospital, Church A stack is used to remember every the airport has power.
DoHospChur() transforms a
Seaport PortPop +1
hospital or church back into an
other step of the path under Park Fountain
consideration.
The seaport generates a ship if it empty Residential zone if there
has power. Seaport does not are too many hospitals or If a dead end is encountered, then the Placed parks have a 1 in 5
actually need to be near water. churches per capita. 840
search backtracks by popping the stack. 423 COMBASE chance of being an animating
HospPop +1
FOUNTAIN fountain, and a 4 in 5 chance
ChurchPop +1
At most 30 steps will be taken before of being WOODS.
giving up. Each dead end encountered
Airport APortPop +1 Power Conduit costs an additional 3 steps.
If power is on, the radar If the Power map has been
animation is turned on, and an updated (NewPower flag), and
airplane and helicopter are the tile is a conduit (CONDBIT),
generated. Create Traffic SetTrafMem()
then PWRBIT is updated with
PowerMap[] (via SetZPower()).
1:2
Telecommunications
• +50 • +0 • s_traf.c/FindPTele(void) /* look for telecommunication on edges of zone */
Traffic INDBASE2, TELEBASE 851 TELELAST
Density Added by Don Hopkins to
Road Rail +50 • +0 • 844
OLPC SimCity/Micropolis.
TrfDensity[]
> 240
DoRoad() randomly deteriorates RoadTotal +1 +2 +5 +6 DoRail() randomly deteriorates CdestX
roads if road infrastructure isn't No/low High Bridge High rail if road infrastructure isn't CdestY
traffic traffic traffic
fully funded. Bridges open and 1:2
bridge
fully funded. Generates a train. If a trip is successfully completed, the Each road tile in the stack adds 50 to If accumulated traffic exceeds
close when the ship is nearby, and RoadTotal tallies note road Traffic RailTotal +1 path stored in the path stack—which traffic density. Rail tiles add 0. Note 240, then the helicopter (if
tiles are changed to reflect the infrastructure upkeep cost. recorded every other step— will that the traffic map is at 1/2 scale, so there is one) will come to the
Density
Traffic Density map. TrfDensity[] contribute to the traffic density map. four road tiles correspond to one high traffic tile's location.
traffic density entry.

If we merge the reverse diagram with an interactive approach—e.g. Bret Victor’s Nile Visualization
(Victor 2013), such diagrams could be used generatively, to describe programs, and interactively,
to allow rich introspection and manipulation of software.
Latour, Bruno (1986). “Visualization and cognition”. In: Knowledge and Society 6 (1986), pp. 1– 40.
Librande, Stone (2010). “One-Page Designs”. Game Developers Conference. 2010.
Victor, Bret (2013). “Media for Thinking the Unthinkable”. MIT Media Lab, Apr. 4, 2013.

You might also like