SimCity Simulation Rule Diagrams
SimCity Simulation Rule Diagrams
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
! PopDenScan() CrimeScan()
Map Scan
clear cen
4 revolutions are
12 4 Smooth•1
take cen
FireStMap[]
Avg. Land Value stations during Map Scan, and is modulated
–
use cen
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.