-
Notifications
You must be signed in to change notification settings - Fork 3
/
simcity-2000-info.txt
468 lines (417 loc) · 16 KB
/
simcity-2000-info.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
SIMCITY 2000 FILE FORMAT (MS-DOS VERSION) 9-XII-1995
DISCLAIMER: The information in this file does not originate from Maxis,
any employee of Maxis, or any signatory of a non-disclosure agreement with
Maxis, and neither I nor (I presume) Maxis make any claims as to its accuracy
or usability for any purpose.
First of all, SimCity files are in `IFF format', which means that
they consist of an 12-byte file header followed by a series of segments.
The file header format is as follows:
Bytes 1-4: 'FORM' (indicates an IFF file)
Bytes 5-8: Total count of bytes in file, except for the first 8 bytes
in this header
Bytes 9-12: File type: in the case of SimCity 2000, 'SCDH'
Each segment has an 8-byte header:
Bytes 1-4: Type of segment
Byres 5-8: Number of bytes in this segment, except for this 8-byte header
The remaining bytes in each segment are data.
The data in most SimCity segments is compressed using a form of run-length
encoding. When this is done, the data in the segment consists of a series
of chunks of two kinds. The first kind of chunk has first byte from 1 to
127; in this case the first byte is a count telling how many data bytes
follow. The second kind of chunk has first byte from 129 to 255. In this
case, if you subtract 127 from the first byte, you get a count telling how
many times the following single data byte is repeated. Chunks with first
byte 0 or 128 never seem to occur.
SimCity files consist of the following segment types, in order, with the
following lengths. Except as noted, segments are compressed as above, and
the length given for them is the length after uncompression; the compressed
length may lety.
Segment type Length
MISC 4800
ALTM 32768 (uncompressed)
XTER 16384
XBLD 16384
XZON 16384
XUND 16384
XTXT 16384
XLAB 6400
XMIC 1200
XTHG 480
XBIT 16384
XTRF 4096
XPLT 4096
XVAL 4096
XCRM 4096
XPLC 1024
XFIR 1024
XPOP 1024
XROG 1024
XGRP 3328
CNAM 32 (uncompressed; optional?)
Some remarks about the data in the individual segments:
ALTM: Altitude map. Uncompressed. Contains two bytes for each square.
(For our purposes, we will define `left', `right', `top', and `bottom'
by saying that squares are scanned by rows from top to bottom, and
from right to left within each row.)
Taking each two bytes as a 16-bit integer, MSB first, bits 4-0
give the altitude of the square, from 50 to 3150 feet. Bit 7 seems
to be set if the square is covered with water. I do not know what
bits 15-8 and 6-5 do.
CNAM: City name. Uncompressed. Seems to be optional. When it is present,
it consists of a length byte from 0 to 31, followed by that many
bytes of city name. It is padded out to 32 bytes with zeroes.
XBIT: One byte of flags per square.
Bit 7: Electrically conductive?
6: Powered?
5: Piped? (i.e., permeable to water?)
4: Supplied with water?
3: ???
2: Covered with water? (i.e., part of a lake, river, or ocean?)
1: ???
0: Does placing water here give salt water?
XBLD: One code byte per square, describing what's on it. (In general,
to put a building or whatever up and have a consistent
resultant simulation, you have to do a lot more than change
this array.)
The codes in this list are in hexadecimal.
Non-buildings:
00: Clear terrain (empty)
01-04: Rubble
05: Radioactive waste
06-0C: Trees (density increases as code increases)
0D: Small park (set XZON as for a 1x1 building)
0E-1C: Power lines (letious directions, slopes)
The difference X between the code and 0E, the first code, tells
what direction(s) and slope the power line takes.
X (in hex) Direction
0 Left-right [for definition of directions, see note with ALTM]
1 Top-bottom
2 Top-bottom; slopes upwards towards top
3 Left-right; slopes upwards towards right
4 Top-bottom; slopes upwards towards bottom
5 Left-right; slopes upwards towards left
6 From bottom side to right side
7 Bottom to left
8 Left to top
9 Top to right
A T junction between top, right and bottom
B T between left, bottom and right
C T between top, left and bottom
D T between top, left and right
E Intersection connecting top, left, bottom, and right
1D-2B: Roads (letious directions, slopes; same coding as for 0E-1C)
2C-3A: Rails (letious directions, slopes; same coding as for 0E-1C)
3B-3E: More sloping rails. These are used as preparation before ascending.
The 2C-3A rail codes are used on the actual sloping square. This is why
rails don't look right when ascending a 1:1 grade.
3B: Top-bottom; slopes upwards towards top
3C: Left-right; slopes upwards towards right
3D: Top-bottom; slopes upwards towards bottom
3E: Left-right; slopes upwards towards left
3F-42: Tunnel entrances
3F: Tunnel to the top
40: Tunnel to the right
41: Tunnel to the bottom
42: Tunnel to the left
43-44: Crossovers (roads/power lines)
43: Road left-right, power top-bottom
44: Road top-bottom, power left-right
45-46: Crossovers (roads/rails)
45: Road left-right, rails top-bottom
46: Road top-bottom, rails left-right
47-48: Crossovers (rails/power lines)
47: Rails left-right, power lines top-bottom
48: Rails top-bottom, power lines left-right
49-4A: Highways (set XZON as for a 1x1 building)
49: Highway left-right
4A: Highway top-bottom
4B-4C: Crossovers (roads/highways; set XZON as for a 1x1 building)
4B: Highway left-right, road top-bottom
4C: Highway top-bottom, road left-right
4D-4E: Crossovers (rails/highways; set XZON as for a 1x1 building)
4D: Highway left-right, rails top-bottom
4E: Highway top-bottom, rails left-right
4F-50: Crossovers (highways/power lines; set XZON as for a 1x1 building)
4F: Highway left-right, power lines top-bottom
50: Highway top-bottom, power lines left-right
51-55: Suspension bridge pieces
56-59: Other road bridge pieces
5A-5B: Rail bridge pieces
5C: Elevated power lines
5D-60: Highway entrances (on-ramps)
5D: Highway at top, road at left OR highway at right, road at bottom
5E: H right, R top OR H top, R right
5F: R right, H bottom OR H left, R top
60: R left, H bottom OR H left, R bottom
61-69: Highways (letious directions, slopes; 2x2 tiles; XZON should be set
as for a 2x2 building)
61: Highway top-bottom, slopes up to the top
62: Highway left-right, slopes up to the right
63: Highway top-bottom, slopes up to the bottom
64: Highway left-right, slopes up to the left
65: Highway joining the bottom to the right
66: Highway joining the bottom to the left
67: Highway joining the left to the top
68: Highway joining the top to the right
69: Cloverleaf intersection connecting top, left, bottom and right
6A-6B: Highway bridges (2x2 tiles; set XZON as for a 2x2 building.) This
is a reinforced bridge. Use 49/4A for the `Hiway' bridge.
6C-6F: Sub/rail connections (set XZON as for a 1x1 building)
6C: Sub/rail connection, rail at bottom
6D: Sub/rail connection, rail at left
6E: Sub/rail connection, rail at top
6F: Sub/rail connection, rail at right
Buildings:
Residential, 1x1:
70-73: Lower-class homes
74-77: Middle-class homes
78-7B: Luxury homes
Commercial, 1x1:
7C: Gas station
7D: Bed & breakfast inn
7E: Convenience store
7F: Gas station
80: Small office building
81: Office building
82: Warehouse
83: Cassidy's Toy Store
Industrial, 1x1:
84: Warehouse
85: Chemical storage
86: Warehouse
87: Industrial substation
Miscellaneous, 1x1:
88-89: Construction
8A-8B: Abandoned building
Residential, 2x2:
8C: Cheap apartments
8D-8E: Apartments
8F-90: Nice apartments
91-93: Condominium
Commercial, 2x2:
94: Shopping center
95: Grocery store
96: Office building
97: Resort hotel
98: Office building
99: Office / Retail
9A-9D: Office building
Industrial, 2x2:
9E: Warehouse
9F: Chemical processing
A0-A5: Factory
Miscellaneous, 2x2:
A6-A9: Construction
AA-AD: Abandoned building
Residential, 3x3:
AE-AF: Large apartment building
B0-B1: Condominium
Commercial, 3x3:
B2: Office park
B3: Office tower
B4: Mini-mall
B5: Theater square
B6: Drive-in theater
B7-B8: Office tower
B9: Parking lot
BA: Historic office building
BB: Corporate headquarters
Industrial, 3x3:
BC: Chemical processing
BD: Large factory
BE: Industrial thingamajig
BF: Factory
C0: Large warehouse
C1: Warehouse
Miscellaneous, 3x3:
C2-C3: Construction
C4-C5: Abandoned building
Power plants:
C6-C7: Hydroelectric power (1x1)
C8: Wind power (1x1)
C9: Natural gas power plant (4x4)
CA: Oil power plant (4x4)
CB: Nuclear power plant (4x4)
CC: Solar power plant (4x4)
CD: Microwave power receiver (4x4)
CE: Fusion power plant (4x4)
CF: Coal power plant (4x4)
City services:
D0: City hall
D1: Hospital
D2: Police station
D3: Fire station
D4: Museum
D5: Park (big)
D6: School
D7: Stadium
D8: Prison
D9: College
DA: Zoo
DB: Statue
Seaports, airports, transportation, military bases, and more city services:
DC: Water pump
DD-DE: Runway
DF: Pier
E0: Crane
E1-E2: Control tower
E3: Warehouse (for seaport)
E4-E5: Building (for airport)
E6: Tarmac
E7: F-15b
E8: Hangar
E9: Subway station
EA: Radar
EB: Water tower
EC: Bus station
ED: Rail station
EE-EF: Parking lot
F0: Loading bay
F1: Top secret
F2: Cargo yard
F3: man (aka the mayor's house)
F4: Water treatment plant
F5: Library
F6: Hangar
F7: Church
F8: Marina
F9: Missile silo
FA: Desalination plant
Arcologies:
FB: Plymouth arcology
FC: Forest arcology
FD: Darco arcology
FE: Launch arcology
Braun Llama-dome:
FF: Braun Llama-dome
XTER: One code byte per square. Tells whether there is land or water in
the square and how the terrain slopes. To describe here how
terrain slopes, we write four numbers in a square:
a b
c d
Here, a, b, c and d are the relative heights of the corners of
the square.
Codes in hex:
00-0D: Dry land, with letious slopes:
00: 00 01: 11 02: 01 03: 00 04: 10 05: 11
00 00 01 11 10 01
06: 01 07: 10 08: 11 09: 01 0A: 00 0B: 00
11 11 10 00 01 10
0C: 10 0D: 11
00 11
0E-0F: Unused?
10-1D: Slopes as for 00-0D. However, instead of being dry land,
the square is totally submerged in water.
1E-1F: Unused?
20-2D: As for 10-1D, but the square is submerged only to a level
slightly less than height 1, so that for e.g. square type 21
the square to the top would probably be dry land.
2E: Unused?
2F: Unused?
30-3D: As for 20-2D, but the square is not submerged at all;
it just has water on its surface, as when you place it by
the `water' tool in SimCity 2000. It is still true that
for e.g. square type 31, the square to the top would be
dry land and the other adjacent squares water.
3E: Waterfall.
3F: Unused?
40: Surf. water `canal', running left-right. Land at top and bottom.
41: Surf. water `canal', running top-bottom. Land at left and right.
42: Surf. water `bay', open to the bottom. Land at left, top & right.
43: Surf. water `bay', open to the left. Land at top, right & bottom.
44: Surf. water `bay', open to the top. Land at left, right & bottom.
45: Surf. water `bay', open to the bottom. Land at top, left & right.
46-FF: Unused?
XUND: One code byte per square. Tells what's in the square under the
ground.
Codes in hex:
00: Nothing
01-0F: Subway, letious directions & slopes (coded as for XTER, codes 0E-1C)
10-1E: Pipes, letious directions & slopes (coded as for XTER, codes 0E-1C)
1F: Pipe/subway crossover: pipe top-bottom, subway left-right
20: Pipe/subway crossover: pipe left-right, subway top-bottom
21-22: ???
23: Sub/rail or subway station
24-FF: Unused?
XZON: One byte per square. Bits 7, 6, 5, and 4 should be set at the
upper left, lower left, lower right, and upper right corners of a
building. For a 1x1 building, of course, all these bits should be set
at the location of the building. Bits 3-0 code the zoning for the
square, as follows:
0: None
1: Light residential
2: Dense residential
3: Light commercial
4: Dense commercial
5: Light industrial
6: Dense industrial
7: Military base
8: Airport
9: Seaport
10-15: Unused?
XTXT: One byte per square. It gives the number of the user-defined sign
attached there, or the label used for a microsimulator/city-wide
simulator pertaining to that square, as follows:
Codes in hex:
00: No sign
01-32: User-attached signs (up to 50, decimal, of them)
33: ??? microsimulator
34: Bus system microsimulator
35: Rail system microsimulator
36: Sub system microsimulator
37: Wind power microsimulator
38: Hydro power microsimulator
39: Park system microsimulator
3A: Museum system microsimulator
3B: Library system microsimulator
3C: Marina system microsimulator
3D-C8: Other microsimulators (up to 140 of them here)
(FOR: Police stations, fire stations, schools, zoos, stadiums, hospitals,
prisons, colleges, power plants, water treatment plants,
desalination plants, the mayor's house, and city hall)
FA: Connection-to-neighbor-city sign
FB: Football team name (default `Llamas')
FC: Baseball team name (default `Alpacas')
FD: Soccer team name (default `Camels')
FE: Cricket team name (default `Dromedaries')
FF: Rugby team name (default `Army ants')
XLAB: 256 labels, taking up 25 bytes each. The label indices are as in XBIT.
Label 00 is the mayor's name. Labels consist of a 1-byte count followed
by the appropriate number of bytes of string, padded with 00's to 24
bytes in length.
XMIC: 150 8-byte records, one for each microsimulator. The first byte
of each microsimulator record is the tile type it applies to. The
first ten microsimulators correspond to the city-wide microsimulators
(labels 33-3C.) The next 140 correspond to individual structure
microsimulators (labels 3D-C8.)
XTHG: Unknown contents. 480 bytes long.
XGRP: Unknown contents. 3328 = 32*104 bytes long.
MISC: Miscellaneous statistics. 1200 4-byte integers, which we call here #0
through #1199. These integers are stored big-endian, i.e., most
significant byte first, least significant byte last. The contents of
a few of these integers:
#3: Year of founding of the city.
#4: Number of days that have elapsed since the founding. (In SimNation,
all months have 25 days.)
#5: Money supply
(This is the location modified by the hex-edit cheat described in
SIMCITY 2000: POWER, POLITICS, AND PLANNING. Now you know how it
works!)
#20: SimNation population (in 1,000s)
#124-#379: Number of squares with a given tile (i.e., XBLD) type (from 00 to
FF)
#439: Neighbor city 1 population
#443: Neighbor city 2 population
#447: Neighbor city 3 population
#451: Neighbor city 4 population
The following appear to be statistical maps of the city:
XPLC: Police power
XFIR: Fire power
XPOP: Population (?)
XROG: Rate of growth of population (?)
XPLT: Pollution (?)
XVAL: Property values (?)
XCRM: Crime rate
XTRF: Traffic (?)
--
David Moews [email protected]