Difference between revisions of "Network Subfiles"

From SC4D Encyclopaedia
Jump to navigation Jump to search
sc4e>Jdenm8
m (small corrections)
 
(81 intermediate revisions by 5 users not shown)
Line 1: Line 1:
This page pertains to the format of the '''Network Subfiles''' within the [[Savegame]] files. These files have [[Type ID]]s 6A0F82B2 (Network Index), C9C05C6E (Network Subfile 1) and CA16374F (Network Subfile 2). They can be viewed using the [[SC4 Savegame Explorer]], but not edited. These subfiles were decoded by {{people|RippleJet}}
+
This page pertains to the format of the '''Network Subfiles''' within the [[Savegame]] files. These files have [[Type ID]]s ''6A0F82B2'' (Network Index), ''C9C05C6E'' (Network Subfile 1) and ''CA16374F'' (Network Subfile 2). They can be viewed using the [[SC4 Savegame Explorer]], but not edited. These subfiles were decoded by {{people|RippleJet}} and completed by {{people|smf_16}}.
 
 
  
 
= Network Index Subfile (6A0F82B2) =
 
= Network Index Subfile (6A0F82B2) =
== Description ==
+
==Description==
 
This index file contains a list of all network tiles, with links to the two network files where the records can be found.
 
This index file contains a list of all network tiles, with links to the two network files where the records can be found.
== Network Index Subfile Structure ==
+
 
=== Network Index Subfile Body ===
+
==Network Index Subfile Structure==
<pre>DWORD Subfile Size in bytes
+
===Network Index Subfile Body===
 +
<pre>
 +
DWORD Subfile Size in bytes
 
DWORD CRC
 
DWORD CRC
 
DWORD Memory address
 
DWORD Memory address
Line 20: Line 21:
 
       DWORD Count  (anything between 0-16. Number of byte blocks)
 
       DWORD Count  (anything between 0-16. Number of byte blocks)
 
         BYTE×8  Unknown block of bytes. Small numbers < 10
 
         BYTE×8  Unknown block of bytes. Small numbers < 10
 +
  DWORD        Count of pointers to follow
 +
      DWORD    Memory address of automata
 +
      DWORD    Type ID of automata. Seen 0x896e75af (cSC4Pedestrian), 0x4a416254 (cSC4TrainCard),
 +
                0x896e714a (cSC4Vehicle), 0xaa9f4a3d (cSC4Bus) and 0x4a5b69ed (cSC4TrailerVehicle).
 +
                Other automata might exist as well, refer to all Type ids in Savegames.
 
   BYTE Unknown  (always 0x00)
 
   BYTE Unknown  (always 0x00)
  DWORD Unknown  (always 0x00000000)
 
 
   DWORD Unknown  (Seen 0 and 2)
 
   DWORD Unknown  (Seen 0 and 2)
 
   DWORD Unknown  (Only seen 2)
 
   DWORD Unknown  (Only seen 2)
Line 46: Line 51:
 
   WORD Unknown  (0 or 1)
 
   WORD Unknown  (0 or 1)
 
   WORD Unknown  (always 0)
 
   WORD Unknown  (always 0)
   DWORD Unknown  (always 2)
+
   DWORD Count of blocks to follow
   DWORD Unknown  (always 1)
+
      DWORD   Block number
  FLOAT32 Unknown (Small values, < 1.0)
+
      FLOAT32  Unknown
  WORD Unknown  (always 0)
+
      WORD     Unknown (only seen 0x00)
  WORD Unknown (always 2)
+
DWORD           Count of network intersections (such as + and T intersections) in city
  WORD Unknown (always 0)
+
   DWORD       Link: Memory address
  FLOAT32 Unknown  (0.0 or 1.0)
+
   DWORD       Link: Subfile Type ID of a network subfile
  WORD Unknown  (always 0)
+
   BYTE         Unknown  (only seen 0x00)
DWORD Count of blocks  (0 for a new city)
+
   DWORD       Count of blocks to follow (only seen 0 or 1)
   DWORD Link: Memory address
+
      DWORD    Memory address
   DWORD Link: Subfile Type ID
+
      DWORD     Subfile Type ID (only seen 0x4c22ae53 Mass Transit Train)
   BYTE Unknown  (only seen 0x00)
+
 
   DWORD Unknown (only seen 0x00000000)
+
   # The values below seem to indicate what directions are enabled on this
  DWORD Unknown  (Either 0, 1, 2 or 3)
+
   # network. That's why they are repeated 4 times for west, north, east
  BOOLEAN Unknown  (Either 0 or 1, false or true)
+
   # and south.
   FLOAT32 Unknown  (small value)
+
      DWORD     Tentatively indicates how many of following floats are meaningful (0, 1, 2 or 3).
   FLOAT32 Unknown  (small value)
+
      BOOLEAN   Unknown (either 0 or 1)
   FLOAT32 Unknown  (small value)
+
      FLOAT32×3 Unknown (often small values such as 0.0, 1.2, 6.0, 8.0)
  DWORD Unknown  (Either 0, 1, 2 or 3)
+
 
  BOOLEAN Unknown (Either 0 or 1, false or true)
+
DWORD  Count of transit-enabled lot tiles to follow
  FLOAT32 Unknown (small value)
+
   WORD        Z tile
  FLOAT32 Unknown  (small value)
+
   WORD        X tile
  FLOAT32 Unknown  (small value)
+
   DWORD       Unknown (always 0x00000001)
  DWORD Unknown  (Either 0, 1, 2 or 3)
+
   DWORD        Memory address of network tile
  BOOLEAN Unknown  (Either 0 or 1, false or true)
+
   DWORD       Type ID of network (0xc9c05c6e)
  FLOAT32 Unknown  (small value)
 
   FLOAT32 Unknown  (small value)
 
   FLOAT32 Unknown  (small value)
 
   DWORD Unknown (Either 0, 1, 2 or 3)
 
   BOOLEAN Unknown  (Either 0 or 1, false or true)
 
  FLOAT32 Unknown  (small value)
 
  FLOAT32 Unknown  (small value)
 
   FLOAT32 Unknown  (small value)
 
DWORD Unknown  (only seen 0x00000000)
 
 
DWORD Unknown  (only seen 0x00000000)
 
DWORD Unknown  (only seen 0x00000000)
 
DWORD Unknown  (only seen 0x00000000)
 
DWORD Unknown  (only seen 0x00000000)
DWORD Tile X  (63, 127 or 255 for a new city, smaller for built up cities)
+
DWORD Tile X  (63, 127 or 255 for a new city, smaller for built up cities, probably max coordinate that ever has had a network)
DWORD Tile Z  (63, 127 or 255 for a new city, smaller for built up cities)
+
DWORD Tile Z  (63, 127 or 255 for a new city, smaller for built up cities, probably max coordinate that ever has had a network)
 
FLOAT32 Unknown  (Small value. 0.00 for a new city)
 
FLOAT32 Unknown  (Small value. 0.00 for a new city)
 
BOOLEAN Unknown  (always 1, true)
 
BOOLEAN Unknown  (always 1, true)
 
FLOAT32 Unknown  (Small value. 0.00 for a new city)
 
FLOAT32 Unknown  (Small value. 0.00 for a new city)
 
BOOLEAN Unknown  (always 1, true)
 
BOOLEAN Unknown  (always 1, true)
DWORD Unknown (Does not appear if version = 0x0003. Always 0x00000000 if version = 0x0007)</pre>
+
DWORD Count of blocks to follow (Does not appear if version = 0x0003)
<br/>
+
  DWORD        Memory address
 +
  DWORD        Type ID of network (seen 0xc9c05c6e and 0x49c1a034).
 +
  DWORD        Count of DWORDs to follow (only seen 0x00000000 though)
 +
      DWORD    Unknown (never seen, but assumed, see below)
 +
  WORD          Unknown (all kinds of values, change when saving without doing anything)
 +
  DWORD        Count of DWORDs to follow
 +
      DWORD    Unknown, might as well be 4 bytes
 +
  WORD          Unknown (all kinds of values, change when saving without doing anything)
 +
  DWORD        Count of DWORDs to follow
 +
      DWORD    Unknown, might as well be 4 bytes
 +
  WORD          Unknown (all kinds of values, change when saving without doing anything)
 +
  DWORD        Count of DWORDs to follow
 +
      DWORD    Unknown, might as well be 4 bytes
 +
  WORD          Unknown (all kinds of values, change when saving without doing anything)
 +
</pre>
  
=== Appendix 1.1 ===
+
===Appendix 1.1===
<pre>  Tile numbering starts in the NW corner, which is tile number 0x00000000.
+
Tile numbering starts in the NW corner, which is tile number ''0x00000000''.
Tile number 0x00000001 is to the east of that tile.
 
In a small city, the first tile in the second row is 0x00000040.
 
In a medium city, the first tile in the second row is 0x00000080.
 
In a large city, the first tile in the second row is 0x00000100.
 
In a small city, the last tile in the last row is 0x00000FFF.
 
In a medium city, the last tile in the last row is 0x00003FFF.
 
In a large city, the last tile in the last row is 0x0000FFFF.</pre>
 
  
= Network Subfile 1 (C9C05C6E) =
+
*Tile number ''0x00000001'' is to the east of that tile.
== Structure ==
+
*In a small city, the first tile in the second row is ''0x00000040''.
=== Network Subfile 1 Body ===
+
*In a medium city, the first tile in the second row is ''0x00000080''.
<pre>DWORD Record Size
+
*In a large city, the first tile in the second row is ''0x00000100''.
 +
*In a small city, the last tile in the last row is ''0x00000FFF''.
 +
*In a medium city, the last tile in the last row is ''0x00003FFF''.
 +
*In a large city, the last tile in the last row is ''0x0000FFFF''.
 +
 
 +
 
 +
=Network Subfile 1 (C9C05C6E)=
 +
==Structure==
 +
===Network Subfile 1 Body===
 +
List of texture-based network tiles consisting of records of the form:
 +
<pre>
 +
DWORD Record Size
 
DWORD CRC
 
DWORD CRC
 
DWORD Memory
 
DWORD Memory
WORD Version Major  (0x0002)
+
WORD×2 Version (always 8, 4)
WORD Version Minor  (0x0003)
+
DWORD Appearance Flags (Always 0x05000000)  (See Appendix 2.2 for more information)
WORD Zot Bytes  (Always 0x0000)
 
BYTE 0x00
 
BYTE Appearance Flag (Always 0x05)  (See Appendix 2.2 for more information)
 
 
DWORD 0xC772BF98  (always the same)
 
DWORD 0xC772BF98  (always the same)
 
BYTE Min Tract X Coordinate  (normally between 0x40 and 0x7F)
 
BYTE Min Tract X Coordinate  (normally between 0x40 and 0x7F)
Line 119: Line 130:
 
WORD X Tract Size (power of 2)  (only seen 0x0002 ... 2² = 4 tiles)
 
WORD X Tract Size (power of 2)  (only seen 0x0002 ... 2² = 4 tiles)
 
WORD Z Tract Size (power of 2)  (only seen 0x0002 ... 2² = 4 tiles)
 
WORD Z Tract Size (power of 2)  (only seen 0x0002 ... 2² = 4 tiles)
DWORD Count of Properties (I've only seen 0x00000000)
+
DWORD Count of Properties
 
     SGPROP    SaveGame Properties, repeated Count times  (See Appendix 2.1 for more information)
 
     SGPROP    SaveGame Properties, repeated Count times  (See Appendix 2.1 for more information)
 
DWORD Group ID  (always 0x00000000)
 
DWORD Group ID  (always 0x00000000)
Line 125: Line 136:
 
DWORD Instance ID  (always 0x00000000)
 
DWORD Instance ID  (always 0x00000000)
 
BYTE Unknown Flag (0 or 1)
 
BYTE Unknown Flag (0 or 1)
FLOAT32 Unknown  (Normally 0, -1 or 1)
 
FLOAT32 Unknown  (Normally 0)
 
FLOAT32 Unknown  (Normally 0, -1 or 1)
 
FLOAT32 Unknown  (Normally 0)
 
FLOAT32 Unknown  (Normally 1)
 
FLOAT32 Unknown  (Normally 0)
 
FLOAT32 Unknown  (Normally 0, -1 or 1)
 
FLOAT32 Unknown  (Normally 0)
 
FLOAT32 Unknown  (Normally 0, -1 or 1)
 
FLOAT32 Xmax
 
FLOAT32 Ymax
 
FLOAT32 Zmax
 
FLOAT32 Xmin
 
FLOAT32 Ymin
 
FLOAT32 Zmin
 
FLOAT32 Unknown  (Normally 0)
 
FLOAT32 Unknown  (Normally 0)
 
DWORD Unknown  (Normally 0xFFDDDBDE)
 
 
FLOAT32 X Coordinate
 
FLOAT32 X Coordinate
 
FLOAT32 Y Coordinate
 
FLOAT32 Y Coordinate
 
FLOAT32 Z Coordinate
 
FLOAT32 Z Coordinate
FLOAT32 Unknown  (Normally 0)
+
 
FLOAT32 Unknown  (Normally 1)
+
    # Next follows 4 times a data structure that contains information for
DWORD Unknown  (Always 0xFFDDDBDE)
+
    # drawing a texture.
FLOAT32 X Coordinate
+
    3 x FLOAT32  (x, y, z) coordinates of the vertex
FLOAT32 Y Coordinate
+
    2 x FLOAT32  (u, v) coordinates for texture mapping
FLOAT32 Z Coordinate
+
    4 x BYTE    (r, g, b, a) values indicating a color (always #dedbddff).
FLOAT32 Unknown (Normally 1)
+
 
FLOAT32 Unknown (Normally 1)
 
DWORD Unknown  (Always 0xFFDDDBDE)
 
FLOAT32 X Coordinate
 
FLOAT32 Y Coordinate
 
FLOAT32 Z Coordinate
 
FLOAT32 Unknown  (Normally 1)
 
FLOAT32 Unknown  (Normally 0)
 
DWORD Unknown  (Always 0xFFDDDBDE)
 
 
DWORD TextureID / PathID
 
DWORD TextureID / PathID
BYTES×5 Unknown (Small values)
+
BYTE Wealth texture (See Appendix 2.6)
 +
DWORD Base texture  (See Appendix 2.7)
 
BYTE Orientation  (See Appendix 2.3 for more information)
 
BYTE Orientation  (See Appendix 2.3 for more information)
BYTES×3 Unknown  (Small values)
+
BYTES×2 Unknown  (Small values)
BYTE Network Type  (See Appendix 2.4 for more information)
+
Byte Flag for crossings (1 = crossings of two networks, 0 = single network)
BYTE Connection, West  (See Appendix 2.5 for more information)
+
    BYTE Network Type  (See Appendix 2.4 for more information)
BYTE Connection, North  (See Appendix 2.5 for more information)
+
    BYTE Connection, West  (See Appendix 2.5 for more information)
BYTE Connection, East  (See Appendix 2.5 for more information)
+
    BYTE Connection, North  (See Appendix 2.5 for more information)
BYTE Connection, South  (See Appendix 2.5 for more information)
+
    BYTE Connection, East  (See Appendix 2.5 for more information)
BYTES×4 Unknown  (Small values)
+
    BYTE Connection, South  (See Appendix 2.5 for more information)
 +
DWORD Number of blocks for retaining walls
 +
    DWORD Retaining wall texture IID (See Appendix 2.9)
 +
    # Followed by three vertex blocks of the form:
 +
        Float32×5    (x, y, z, u, v) coordinates
 +
        BYTE×4      (r, g, b, a) color
 
FLOAT32 Xmin
 
FLOAT32 Xmin
 
FLOAT32 Xmax
 
FLOAT32 Xmax
Line 177: Line 168:
 
FLOAT32 Zmin
 
FLOAT32 Zmin
 
FLOAT32 Zmax
 
FLOAT32 Zmax
BYTE Unknown  (1 or 2)
+
DWORD Construction states (See Appendix 2.8)
BYTE Unknown  (Always 160)
+
DWORD Alternate path ID (derived from AutoPathBase or TE-Lot), otherwise 0
BYTE Unknown  (Always 0)
+
DWORD×3 Unknown  (All 0)
BYTE Unknown  (Often 22)
+
DWORD Demolishing costs
DWORD×4 Unknown  (All 0)
+
DWORD Unknown  (0x00000000)
DWORD Unknown  (Always 2)
+
</pre>
DWORD Unknown  (0x00000000)</pre>
 
  
<br/>
+
===Appendix 2.1 - Structure of SGPROP (SaveGame Properties)===
 
+
<pre>
=== Appendix 2.1 ===
+
DWORD   Property Name Value
<pre>Structure of SGPROP (SaveGame Properties):
 
 
 
DWORD     Property Name Value
 
 
DWORD Property Name Value  (doubled for some unknown reason)
 
DWORD Property Name Value  (doubled for some unknown reason)
 
DWORD 0x00000000
 
DWORD 0x00000000
Line 197: Line 184:
 
WORD 0x0000
 
WORD 0x0000
 
DWORD Rep Count  (this one appears only if KeyType = 0x80)
 
DWORD Rep Count  (this one appears only if KeyType = 0x80)
     DATA Property Value (repeated Rep Count times, type according to Data Type)</pre>
+
     DATA Property Value (repeated Rep Count times, type according to Data Type)
 +
</pre>
  
<br/>
+
====SaveGame Properties====
 +
Properties known to appear on network tiles are listed below (See also the [[Prop Subfile#Savegame_Properties_.28SGProps.29|Prop Subfile]]).
 +
<pre>
 +
0x4835C6A6 (Boolean) = Unknown (1?)
 +
0x4835C6A7 (UInt32×2) = TE-Lot network flags:
 +
    DWORD - Unknown (0?)
 +
    DWORD - Flags (0xSSEENNWW) (0x00000000 if custom path is used)
 +
0x4835C6A9 (UInt32) = TE-Lot custom path IID
 +
0x4835C6AA (Byte) = Bitmask for Onewayroad directions:
 +
    0b00000001 - Edge West: direction West to East
 +
    0b00000010 - Edge West: direction East to West
 +
    0b00000100 - Edge North: direction North to South
 +
    0b00001000 - Edge North: direction South to North
 +
    0b00010000 - Edge East: direction West to East
 +
    0b00100000 - Edge East: direction East to West
 +
    0b01000000 - Edge South: direction North to South
 +
    0b10000000 - Edge South: direction South to North
 +
0x4835C6AB (UInt32) = Unknown (some flags related to puzzle pieces?)
 +
0xAA24AE57 (UInt32) = Unknown (0?)
 +
</pre>
  
=== Appendix 2.2 ===
+
===Appendix 2.2 - Appearance Flags===
<pre>Apperance Flag (offset 0x0013)
+
<pre>
 
+
     0x01000000 - Render the network shadow
     0x01 (00000001b) - Network that appears in the game (if this is off, the network has been deleted)
+
     0x04000000 - Render the network
     0x02 (00000010b) - ? (unused)
+
</pre>
    0x04 (00000100b) - ? (always on)
 
    0x08 (00001000b) - ? (unused)
 
    0x40 (01000000b) - The network is burnt
 
    0x80 (10000000b) - ? (unused)</pre>
 
 
 
<br/>
 
 
 
=== Appendix 2.3 ===
 
<pre>Orientation
 
  
 +
===Appendix 2.3 - Orientation===
 +
<pre>
 
     0x00 = North
 
     0x00 = North
 
     0x01 = East
 
     0x01 = East
Line 223: Line 223:
 
     0x81 = East, mirrored
 
     0x81 = East, mirrored
 
     0x82 = South, mirrored
 
     0x82 = South, mirrored
     0x83 = West, mirrored</pre>
+
     0x83 = West, mirrored
 +
</pre>
  
<br/>
+
===Appendix 2.4 - Network Type===
 +
<pre>
 +
    0x00 = Road
 +
    0x01 = Rail
 +
    0x02 = Elevated Highway
 +
    0x03 = Street
 +
    0x04 = Pipe
 +
    0x05 = Powerline
 +
    0x06 = Avenue
 +
    0x07 = Subway
 +
    0x08 = Lightrail
 +
    0x09 = Monorail
 +
    0x0a = Onewayroad
 +
    0x0b = Dirtroad
 +
    0x0c = Ground Highway
 +
</pre>
  
=== Appendix 2.4 ===
+
===Appendix 2.5 - Connections===
Network Type
+
The [[Network Flags]] are denoted in octal representation in RUL files:
<pre>   0x00 = ?
+
<pre>
    0x01 = ?
+
0x00 = 0o00 (no connection)
    0x02 = ?
+
0x01 = 0o01 (diagonal left)
    0x03 = ?
+
0x02 = 0o02 (orthogonal)
    0x04 = ?
+
0x03 = 0o03 (diagonal right)
    0x05 = ?
+
0x04 = 0o04 (median)
    0x06 = ?
+
0x09 = 0o11 (blend left)
    0x07 = ?</pre>
+
0x0b = 0o13 (blend right)
 +
0x11 = 0o21 (diagonal switch left)
 +
0x13 = 0o23 (diagonal switch right)
 +
...
 +
0x32 = 0o62 (wye)
 +
...
 +
</pre>
  
<br/>
+
===Appendix 2.6 - Wealth Textures===
 +
<pre>
 +
0 = default texture
 +
1 = grass/low density $
 +
2 = grass/low density $$
 +
3 = grass/low density $$$
 +
4 = medium/high density $
 +
5 = medium/high density $$
 +
6 = medium/high density $$$
 +
7 = I-ag/landfill
 +
</pre>
  
=== Appendix 2.5 ===
+
===Appendix 2.7 - Base textures===
Connections
+
<pre>
<pre>??</pre>
+
0x00000000 = None
 +
0x08100000 = Pavement $
 +
0x08200000 = Pavement $$
 +
0x08300000 = Pavement $$$
 +
0x08400000 = Dirt
 +
</pre>
  
= Network Subfile 2 (CA16374F) =
+
===Appendix 2.8 - Construction states===
== Network Subfile 2 Structure ==
+
This bitset encodes which networks are present on the tile, whether the tile has been fully constructed, as well as several other flags. Some dual-networks like HRW built by the over-click method can only be seen here.
=== Network Subfile 2 Body ===
+
<pre>
<pre>DWORD Record Size
+
0x00000001 = Road (bit 0)
 +
0x00000002 = Rail (bit 1)
 +
0x00000004 = Highway (bit 2)
 +
...  (see Appendix 2.4)
 +
0x00000800 = Dirtroad (bit 11)
 +
0x00001000 = Ground Highway (bit 12)
 +
---
 +
0x00002000 = matching path file exists (for TE tiles: set if fully connected to network)
 +
0x00004000 = network not fully constructed yet (always set for TE tiles?)
 +
0x00008000 = rendering state (set if tile has been displayed since last rotation of the map)
 +
---
 +
0x00040000 = bridge (...tentatively)
 +
0x00080000 = alpha off (for tunnel portal)
 +
0x00100000 = blue auto-place preview effect (set for all static puzzle pieces)
 +
0x00200000 = TE tile
 +
0x00400000 = anchored tile (static puzzle piece/tunnel portal)
 +
0x00800000 = tunnel portal
 +
0x01000000 = terrain triangles transposed
 +
0x02000000 = render western triangle of base and overlay, hole if 0
 +
            (set for texure-based tiles and for model-based tiles with wealth textures, not set for TE tiles)
 +
0x04000000 = render eastern triangle of base and overlay, hole if 0
 +
            (set for texure-based tiles and for model-based tiles with wealth textures, not set for TE tiles)
 +
0x08000000 = render terrain
 +
            (set for model-based network tiles and TE tiles, not set for purely texture-based tiles)
 +
0x10000000 = network fully constructed (for TE tiles: set if fully connected to network)
 +
0x20000000 = is lit
 +
0x40000000 = alpha off (for retaining wall/pillar)
 +
</pre>
 +
 
 +
===Appendix 2.9 - Retaining wall textures===
 +
<pre>
 +
0x00BB0000 - retaining wall
 +
0x00BB0200 - railing
 +
0x08080000 - pillar
 +
0x0912220E - concrete
 +
</pre>
 +
 
 +
=Network Subfile 2 (CA16374F)=
 +
This subfile contains network tiles related to the subway network and is similar to the [[Pipe Occupant Subfile]].
 +
==Network Subfile 2 Structure==
 +
List of records of the form:
 +
===Network Subfile 2 Body===
 +
<pre>
 +
DWORD Record Size
 
DWORD CRC
 
DWORD CRC
 
DWORD Memory
 
DWORD Memory
WORD Version Major  (0x0002)
+
WORD×4 Version (always 2, 3, 8, 4)
WORD Version Minor  (0x0003)
+
DWORD Appearance Flags (Always 0x05000000)  (See Appendix 2.2 for more information)
WORD Version ?  (0x0008)
 
WORD Version ?  (0x0004)
 
WORD Zot Bytes  (Always 0x0000)
 
BYTE 0x00
 
BYTE Appearance Flag (Always 0x05)  (See Appendix 3.2 for more information)
 
 
DWORD 0xC772BF98  (always the same)
 
DWORD 0xC772BF98  (always the same)
 
BYTE Min Tract X Coordinate  (normally between 0x40 and 0x7F)
 
BYTE Min Tract X Coordinate  (normally between 0x40 and 0x7F)
Line 265: Line 340:
 
WORD Z Tract Size (power of 2)  (only seen 0x0002 ... 2² = 4 tiles)
 
WORD Z Tract Size (power of 2)  (only seen 0x0002 ... 2² = 4 tiles)
 
DWORD Count of Properties  (I've only seen 0x00000000)
 
DWORD Count of Properties  (I've only seen 0x00000000)
     SGPROP    SaveGame Properties, repeated Count times  (See Appendix 3.1 for more information)
+
     SGPROP    SaveGame Properties, repeated Count times  (See Appendix 2.1 for more information)
 
DWORD Group ID  (always 0x00000000)
 
DWORD Group ID  (always 0x00000000)
 
DWORD Type ID  (always 0x00000000)
 
DWORD Type ID  (always 0x00000000)
Line 308: Line 383:
 
DWORD TextureID / PathID
 
DWORD TextureID / PathID
 
BYTES×5 Unknown  (Small values)
 
BYTES×5 Unknown  (Small values)
BYTE Orientation  (See Appendix 3.3 for more information)
+
BYTE Orientation  (See Appendix 2.3 for more information)
 
BYTES×3 Unknown  (Small values)
 
BYTES×3 Unknown  (Small values)
BYTE Network Type  (See Appendix 3.4 for more information)
+
BYTE Network Type  (See Appendix 2.4 for more information)
BYTE Connection, West  (See Appendix 3.5 for more information)
+
BYTE Connection, West  (See Appendix 2.5 for more information)
BYTE Connection, North  (See Appendix 3.5 for more information)
+
BYTE Connection, North  (See Appendix 2.5 for more information)
BYTE Connection, East  (See Appendix 3.5 for more information)
+
BYTE Connection, East  (See Appendix 2.5 for more information)
BYTE Connection, South  (See Appendix 3.5 for more information)
+
BYTE Connection, South  (See Appendix 2.5 for more information)
 
BYTES×4 Unknown  (Small values)
 
BYTES×4 Unknown  (Small values)
 
FLOAT32 Xmin
 
FLOAT32 Xmin
Line 327: Line 402:
 
BYTE Unknown  (Seen 16-21)
 
BYTE Unknown  (Seen 16-21)
 
DWORD×4 Unknown  (All 0)
 
DWORD×4 Unknown  (All 0)
DWORD Unknown  (Always 50)
+
DWORD Demolishing costs
 
DWORD Unknown  (0x00000000)
 
DWORD Unknown  (0x00000000)
 
WORD Unknown  (0x0000)
 
WORD Unknown  (0x0000)
 
FLOAT32 Unknown  (Normally 1)
 
FLOAT32 Unknown  (Normally 1)
 
DWORD Number of extra blocks  (0, 1, 2 or 3)
 
DWORD Number of extra blocks  (0, 1, 2 or 3)
DWORD Count  (Either 0 or 4. Each block is 24 FLOATS, total 96 BYTES)
+
 
   FLOAT32   X Coordinate
+
# Below follow 5 arrays defining the sides of the hole. If an array is empty, there is
  FLOAT32 Y Coordinate
+
# no texture to be rendered at that side (typically for straight sections). Order is
  FLOAT32 Z Coordinate
+
# west, north, east, south, bottom.
  FLOAT32 Unknown (Normally 0, 0.75 or 1)
+
DWORD Count  (Either 0 or 4)
   FLOAT32 Unknown (Normally 0, 0.75 or 1)
+
   3 x FLOAT32  (x, y, z) coordinates of the vertex
   DWORD Unknown  (Either 0x80FFFFFF or 0xFFFFFFFF)
+
   2 x FLOAT32  (u, v) coordinates for texture mapping (normally 0, 0.75 or 1)
DWORD Count  (Either 0 or 4. Each block is 24 FLOATS, total 96 BYTES)
+
   4 x BYTE    (r, g, b, a) values indicating a color (either #ffffffff or #ffffff80).
   FLOAT32 X Coordinate
+
DWORD Count  (Either 0 or 4)
  FLOAT32 Y Coordinate
+
   3 x FLOAT32  (x, y, z) coordinates of the vertex
  FLOAT32 Z Coordinate
+
   2 x FLOAT32  (u, v) coordinates for texture mapping (normally 0, 0.75 or 1)
  FLOAT32 Unknown (Normally 0, 0.75 or 1)
+
   4 x BYTE    (r, g, b, a) values indicating a color (either #ffffffff or #ffffff80).
   FLOAT32 Unknown (Normally 0, 0.75 or 1)
+
DWORD Count  (Either 0 or 4)
   DWORD Unknown  (Either 0x80FFFFFF or 0xFFFFFFFF)
+
   3 x FLOAT32  (x, y, z) coordinates of the vertex
DWORD Count  (Either 0 or 4. Each block is 24 FLOATS, total 96 BYTES)
+
   2 x FLOAT32  (u, v) coordinates for texture mapping (normally 0, 0.75 or 1)
   FLOAT32 X Coordinate
+
   4 x BYTE    (r, g, b, a) values indicating a color (either #ffffffff or #ffffff80).
  FLOAT32 Y Coordinate
+
DWORD Count  (Either 0 or 4)
  FLOAT32 Z Coordinate
+
   3 x FLOAT32  (x, y, z) coordinates of the vertex
  FLOAT32 Unknown (Normally 0, 0.75 or 1)
+
   2 x FLOAT32  (u, v) coordinates for texture mapping (normally 0, 0.75 or 1)
   FLOAT32 Unknown (Normally 0, 0.75 or 1)
+
   4 x BYTE    (r, g, b, a) values indicating a color (either #ffffffff or #ffffff80).
   DWORD Unknown  (Either 0x80FFFFFF or 0xFFFFFFFF)
+
DWORD Count  (Either 0 or 4)
DWORD Count  (Either 0 or 4. Each block is 24 FLOATS, total 96 BYTES)
+
   3 x FLOAT32  (x, y, z) coordinates of the vertex
   FLOAT32 X Coordinate
+
   2 x FLOAT32  (u, v) coordinates for texture mapping (normally 0, 0.75 or 1)
  FLOAT32 Y Coordinate
+
   4 x BYTE    (r, g, b, a) values indicating a color (either #ffffffff or #ffffff80).
  FLOAT32 Z Coordinate
+
 
  FLOAT32 Unknown (Normally 0, 0.75 or 1)
 
   FLOAT32 Unknown (Normally 0, 0.75 or 1)
 
   DWORD Unknown  (Either 0x80FFFFFF or 0xFFFFFFFF)
 
DWORD Count  (Always 4. Each block is 24 FLOATS, total 96 BYTES)
 
   FLOAT32 X Coordinate
 
  FLOAT32 Y Coordinate
 
  FLOAT32 Z Coordinate
 
  FLOAT32 Unknown (Normally 0, 0.75 or 1)
 
   FLOAT32 Unknown (Normally 0, 0.75 or 1)
 
   DWORD Unknown  (Either 0x80FFFFFF or 0xFFFFFFFF)
 
 
DWORD Unknown  (Always 0x00000000)
 
DWORD Unknown  (Always 0x00000000)
FLOAT32 Unknown  (Normally 0 or 1)
+
 
FLOAT32 Unknown  (Normally 0 or 1)
+
# Next follow 16 floats, representing the values of the transformation matrix for the model
FLOAT32 Unknown (Normally 0 or 1)
+
# | a b c d |
FLOAT32 X Coordinate
+
# | d e f g |
FLOAT32 Unknown (Normally 0 or 1)
+
# | h i j k |
FLOAT32 Unknown  (Normally 0 or 1)
+
# | l m n o |
FLOAT32 Unknown (Normally 0 or 1)
+
# d, g and k are the translation components and are set to the position *in the city*.
FLOAT32 Y Coordinate
+
16 x FLOAT32
FLOAT32 Unknown (Normally 0 or 1)
+
 
FLOAT32 Unknown  (Normally 0 or 1)
+
DWORD X Tile
FLOAT32 Unknown  (Normally 0 or 1)
+
DWORD Z Tile
FLOAT32 Z Coordinate
 
FLOAT32 Unknown  (Normally 0 or 1)
 
FLOAT32 Unknown  (Normally 0 or 1)
 
FLOAT32 Unknown  (Normally 0 or 1)
 
FLOAT32 Unknown  (Normally 0 or 1)
 
DWORD Unknown  (Small value, e.g. 62, 63)
 
DWORD Unknown  (Small value, e.g. 36, 38)
 
 
BOOLEAN Unknown  (Always 0)
 
BOOLEAN Unknown  (Always 0)
 
BOOLEAN Unknown  (Either 0 or 1, false or true)
 
BOOLEAN Unknown  (Either 0 or 1, false or true)
Line 395: Line 453:
 
FLOAT32 Y Coordinate
 
FLOAT32 Y Coordinate
 
DWORD 0xCA16374F  (Subfile ID)
 
DWORD 0xCA16374F  (Subfile ID)
DWORD 0x00000000  (always the same)</pre>
+
DWORD 0x00000000  (always the same)
 +
</pre>
  
<br/>
+
=Prebuilt Network Subfile (0x49c1a034)=
 
 
=== Appendix 3.1 ===
 
Structure of SGPROP (SaveGame Properties):
 
 
 
<pre>DWORD    Property Name Value
 
DWORD Property Name Value  (doubled for some unknown reason)
 
DWORD 0x00000000
 
BYTE Data Type, 01=UInt8, 02=UInt16, 03=UInt32, 07=SInt32, 08=SInt64, 09=Float32, 0B=Boolean
 
BYTE KeyType, 0x00 = 0 reps, 0x80 = more than 0 reps
 
WORD 0x0000
 
DWORD Rep Count  (this one appears only if KeyType = 0x80)
 
    DATA Property Value (repeated Rep Count times, type according to Data Type)</pre>
 
  
<br/>
+
The prebuilt network subfile contains all model-based network tiles with a prefabricated model, such as elevated highways and monorail.
  
=== Appendix 3.2 ===
+
==Structure==
Apperance Flag (offset 0x0017)
+
List of records of the form:
 
<pre>
 
<pre>
    0x01 (00000001b) - Network that appears in the game (if this is off, the network has been deleted)
+
DWORD    Size
    0x02 (00000010b) - ? (unused)
+
DWORD    CRC
    0x04 (00000100b) - ? (always on)
+
DWORD    Memory
    0x08 (00001000b) - ? (unused)
+
WORD×3  Version (always 4, 8, 4)
     0x40 (01000000b) - The network is burnt
+
DWORD    Appearance flags (0x05000000)  (See Appendix 2.2 for more information)
    0x80 (10000000b) - ? (unused)</pre>
+
DWORD    Unknown (always 0xc772bf98)
 +
BYTE Min Tract X Coordinate  (normally between 0x40 and 0x7F)
 +
BYTE Min Tract Z Coordinate  (normally between 0x40 and 0x7F)
 +
BYTE Max Tract X Coordinate  (normally between 0x40 and 0x7F)
 +
BYTE Max Tract Z Coordinate  (normally between 0x40 and 0x7F)
 +
WORD X Tract Size (power of 2) (only seen 0x0002 ... 2² = 4 tiles)
 +
WORD Z Tract Size (power of 2) (only seen 0x0002 ... 2² = 4 tiles)
 +
DWORD Count of Properties
 +
     SGPROP    SaveGame Properties, repeated Count times
 +
DWORD Group ID of Network Model Exemplar (see Appendix 4.1)
 +
DWORD Type ID of Network Model Exemplar (0x6534284a)
 +
DWORD Instance ID of Network Model Exemplar
 +
BYTE Matrix flag (1 = no matrix, 5 = matrix is present)
 +
    FLOAT32×9  Transformation matrix
 +
FLOAT32 X Coordinate
 +
FLOAT32 Y Coordinate
 +
FLOAT32 Z Coordinate
  
<br/>
+
    # Next follows 4 times a data structure that contains information for
 +
    # drawing a texture.
 +
    3 x FLOAT32  (x, y, z) coordinates of the vertex
 +
    2 x FLOAT32  (u, v) coordinates for texture mapping
 +
    4 x BYTE    (r, g, b, a) values indicating a color (always #dedbddff).
  
=== Appendix 3.3 ===
+
DWORD TextureID / PathID
Orientation
+
BYTE Wealth texture  (See Appendix 2.6)
<pre>    0x00 = North
+
DWORD Base texture  (See Appendix 2.7)
     0x01 = East
+
BYTE    Orientation
     0x02 = South
+
BYTES×2 Unknown  (Small values)
     0x03 = West
+
Byte Flag for crossings (1 for crossings of two networks, 0 for single network)
     0x80 = North, mirrored
+
    BYTE Network Type  (See Appendix 2.4 for more information)
     0x81 = East, mirrored
+
    BYTE Connection, West  (See Appendix 2.5 for more information)
     0x82 = south, mirrored
+
    BYTE Connection, North (See Appendix 2.5 for more information)
     0x83 = West, mirrored</pre>
+
     BYTE Connection, East (See Appendix 2.5 for more information)
 +
     BYTE Connection, South (See Appendix 2.5 for more information)
 +
DWORD Number of blocks for retaining walls (always 0 for model-based network tiles)
 +
     DWORD Retaining wall texture IID (See Appendix 2.9)
 +
     # Followed by three vertex blocks of the form:
 +
        Float32×5    (x, y, z, u, v) coordinates
 +
        BYTE×4      (r, g, b, a) color
 +
FLOAT32 Xmin
 +
FLOAT32 Xmax
 +
FLOAT32 Ymin
 +
FLOAT32 Ymax
 +
FLOAT32 Zmin
 +
FLOAT32 Zmax
 +
DWORD Construction states (See Appendix 2.8)
 +
DWORD Path ID derived from AutoPathBase, otherwise 0
 +
DWORD×3 Unknown (apparently always 0x00000000)
 +
DWORD Demolishing costs
 +
DWORD Unknown (always 0)
 +
FLOAT32×3  Unknown (usually 0 or very small -- seem to be related to matrix)
 +
BYTE×5 Unknown (apparently always 0x00)
 +
DWORD pillar ID (if non-zero, it is followed by a block):
 +
     FLOAT32 pillar rotation
 +
    FLOAT32 pillar offset X
 +
     FLOAT32 pillar offset Y
 +
     FLOAT32 pillar offset Z
 +
</pre>
  
<br/>
+
==Appendix 4.1 - Network Model Exemplars==
 +
For a list of Group IDs, see [[Model Exemplar]].
  
=== Appendix 3.4 ===
+
=Network Tunnel Subfile (0x8a4bd52b)=
Network Type
 
<pre>    0x00 = ?
 
    0x01 = ?
 
    0x02 = ?
 
    0x03 = ?
 
    0x04 = ?
 
    0x05 = ?
 
    0x06 = ?
 
    0x07 = ?</pre>
 
  
<br/>
+
==Structure==
 
+
List of records of the form:
=== Appendix 3.5 ===
+
<pre>
Connections
+
DWORD    Size
<pre>??</pre>
+
DWORD    CRC
 +
DWORD    Memory
 +
WORD×4  Version (always 2, 4, 8, 4)
 +
DWORD    Appearance flags (0x05000000)  (See Appendix 2.2 for more information)
 +
DWORD    Unknown (always 0xc772bf98)
 +
...
 +
...    # Same as Prebuilt Network Subfile structure
 +
...
 +
DWORD Demolishing costs
 +
BYTE×25 Unknown (apparently always 0x00)
 +
BYTE Unknown (always 0x01)
 +
DWORD Opposing tunnel portal memory address
 +
DWORD Opposing tunnel portal subfile TID (0x8a4bd52b)
 +
</pre>
  
 +
{{Navbox/SUBFILE}}
 
[[Category:Savegame/Subfiles]]
 
[[Category:Savegame/Subfiles]]
 
{{Navbox/SUBFILE}}
 

Latest revision as of 23:09, 8 September 2024

This page pertains to the format of the Network Subfiles within the Savegame files. These files have Type IDs 6A0F82B2 (Network Index), C9C05C6E (Network Subfile 1) and CA16374F (Network Subfile 2). They can be viewed using the SC4 Savegame Explorer, but not edited. These subfiles were decoded by RippleJet and completed by smf_16.

Network Index Subfile (6A0F82B2)

Description

This index file contains a list of all network tiles, with links to the two network files where the records can be found.

Network Index Subfile Structure

Network Index Subfile Body

DWORD	Subfile Size in bytes
DWORD	CRC
DWORD	Memory address
WORD	Major Version  (0x0007 for built cities, but 0x0003 for Maxis' own, unbuilt cities)
DWORD	City Tile Count  (4096, 16384 or 65536 depending on city size)
DWORD	Count of Network Tiles  (0 for a new city)
   DWORD	Tile Number  (See Appendix 1.1 for more information)
   DWORD	Link: Memory address
   DWORD	Link: Subfile Type ID
   DWORD	Count of blocks  (either 0 or 10)
      DWORD	Block Number (first one is 0, last one is 9)
      DWORD	Count  (anything between 0-16. Number of byte blocks)
         BYTE×8   	Unknown block of bytes. Small numbers < 10
   DWORD        Count of pointers to follow
      DWORD     Memory address of automata
      DWORD     Type ID of automata. Seen 0x896e75af (cSC4Pedestrian), 0x4a416254 (cSC4TrainCard),
                0x896e714a (cSC4Vehicle), 0xaa9f4a3d (cSC4Bus) and 0x4a5b69ed (cSC4TrailerVehicle).
                Other automata might exist as well, refer to all Type ids in Savegames.
   BYTE	Unknown  (always 0x00)
   DWORD	Unknown  (Seen 0 and 2)
   DWORD	Unknown  (Only seen 2)
   DWORD	Unknown  (Seen 0 and 4)
   FLOAT32	Unknown  (Small values, e.g. 0.0, 2.0, 5.0, 6.0, 8.0)
   WORD	Unknown  (0 or 1)
   WORD	Unknown  (0 or 1)
   WORD	Unknown  (0 or 1)
   WORD	Unknown  (0 or 1)
   FLOAT32	Unknown  (Small values, e.g. 0.0, 2.0, 5.0, 6.0, 8.0)
   WORD	Unknown  (0 or 1)
   WORD	Unknown  (0 or 1)
   WORD	Unknown  (0 or 1)
   WORD	Unknown  (0 or 1)
   FLOAT32	Unknown  (Small values, e.g. 0.0, 2.0, 5.0, 6.0, 8.0)
   WORD	Unknown  (0 or 1)
   WORD	Unknown  (0 or 1)
   WORD	Unknown  (0 or 1)
   WORD	Unknown  (0 or 1)
   FLOAT32	Unknown  (Small values, e.g. 0.0, 2.0, 5.0, 6.0, 8.0)
   WORD	Unknown  (0 or 1)
   WORD	Unknown  (0 or 1)
   WORD	Unknown  (0 or 1)
   WORD	Unknown  (0 or 1)
   WORD	Unknown  (always 0)
   DWORD	Count of blocks to follow
       DWORD    Block number
       FLOAT32  Unknown
       WORD     Unknown (only seen 0x00)
DWORD           Count of network intersections (such as + and T intersections) in city
   DWORD        Link: Memory address
   DWORD        Link: Subfile Type ID of a network subfile
   BYTE         Unknown  (only seen 0x00)
   DWORD        Count of blocks to follow  (only seen 0 or 1)
      DWORD     Memory address
      DWORD     Subfile Type ID (only seen 0x4c22ae53 Mass Transit Train)

   # The values below seem to indicate what directions are enabled on this
   # network. That's why they are repeated 4 times for west, north, east
   # and south.
      DWORD     Tentatively indicates how many of following floats are meaningful (0, 1, 2 or 3).
      BOOLEAN   Unknown (either 0 or 1)
      FLOAT32×3 Unknown (often small values such as 0.0, 1.2, 6.0, 8.0)

DWORD   Count of transit-enabled lot tiles to follow
   WORD         Z tile
   WORD         X tile
   DWORD        Unknown (always 0x00000001)
   DWORD        Memory address of network tile
   DWORD        Type ID of network (0xc9c05c6e)
DWORD	Unknown  (only seen 0x00000000)
DWORD	Unknown  (only seen 0x00000000)
DWORD	Tile X  (63, 127 or 255 for a new city, smaller for built up cities, probably max coordinate that ever has had a network)
DWORD	Tile Z  (63, 127 or 255 for a new city, smaller for built up cities, probably max coordinate that ever has had a network)
FLOAT32	Unknown  (Small value. 0.00 for a new city)
BOOLEAN	Unknown  (always 1, true)
FLOAT32	Unknown  (Small value. 0.00 for a new city)
BOOLEAN	Unknown  (always 1, true)
DWORD	Count of blocks to follow  (Does not appear if version = 0x0003)
   DWORD         Memory address
   DWORD         Type ID of network (seen 0xc9c05c6e and 0x49c1a034).
   DWORD         Count of DWORDs to follow (only seen 0x00000000 though)
       DWORD     Unknown (never seen, but assumed, see below)
   WORD          Unknown (all kinds of values, change when saving without doing anything)
   DWORD         Count of DWORDs to follow
       DWORD     Unknown, might as well be 4 bytes
   WORD          Unknown (all kinds of values, change when saving without doing anything)
   DWORD         Count of DWORDs to follow
       DWORD     Unknown, might as well be 4 bytes
   WORD          Unknown (all kinds of values, change when saving without doing anything)
   DWORD         Count of DWORDs to follow
       DWORD     Unknown, might as well be 4 bytes
   WORD          Unknown (all kinds of values, change when saving without doing anything)

Appendix 1.1

Tile numbering starts in the NW corner, which is tile number 0x00000000.

  • Tile number 0x00000001 is to the east of that tile.
  • In a small city, the first tile in the second row is 0x00000040.
  • In a medium city, the first tile in the second row is 0x00000080.
  • In a large city, the first tile in the second row is 0x00000100.
  • In a small city, the last tile in the last row is 0x00000FFF.
  • In a medium city, the last tile in the last row is 0x00003FFF.
  • In a large city, the last tile in the last row is 0x0000FFFF.


Network Subfile 1 (C9C05C6E)

Structure

Network Subfile 1 Body

List of texture-based network tiles consisting of records of the form:

DWORD	Record Size
DWORD	CRC
DWORD	Memory
WORD×2	Version (always 8, 4)
DWORD	Appearance Flags  (Always 0x05000000)  (See Appendix 2.2 for more information)
DWORD	0xC772BF98  (always the same)
BYTE	Min Tract X Coordinate  (normally between 0x40 and 0x7F)
BYTE	Min Tract Z Coordinate  (normally between 0x40 and 0x7F)
BYTE	Max Tract X Coordinate  (normally between 0x40 and 0x7F)
BYTE	Max Tract Z Coordinate  (normally between 0x40 and 0x7F)
WORD	X Tract Size (power of 2)  (only seen 0x0002 ... 2² = 4 tiles)
WORD	Z Tract Size (power of 2)  (only seen 0x0002 ... 2² = 4 tiles)
DWORD	Count of Properties
    SGPROP    	SaveGame Properties, repeated Count times  (See Appendix 2.1 for more information)
DWORD	Group ID  (always 0x00000000)
DWORD	Type ID  (always 0x00000000)
DWORD	Instance ID  (always 0x00000000)
BYTE	Unknown Flag (0 or 1)
FLOAT32	X Coordinate
FLOAT32	Y Coordinate
FLOAT32	Z Coordinate

    # Next follows 4 times a data structure that contains information for
    # drawing a texture.
    3 x FLOAT32  (x, y, z) coordinates of the vertex
    2 x FLOAT32  (u, v) coordinates for texture mapping
    4 x BYTE     (r, g, b, a) values indicating a color (always #dedbddff).

DWORD	TextureID / PathID
BYTE	Wealth texture  (See Appendix 2.6)
DWORD	Base texture  (See Appendix 2.7)
BYTE	Orientation  (See Appendix 2.3 for more information)
BYTES×2	Unknown  (Small values)
Byte	Flag for crossings (1 = crossings of two networks, 0 = single network)
    BYTE	Network Type  (See Appendix 2.4 for more information)
    BYTE	Connection, West  (See Appendix 2.5 for more information)
    BYTE	Connection, North  (See Appendix 2.5 for more information)
    BYTE	Connection, East  (See Appendix 2.5 for more information)
    BYTE	Connection, South  (See Appendix 2.5 for more information)
DWORD	Number of blocks for retaining walls
    DWORD	Retaining wall texture IID (See Appendix 2.9)
    # Followed by three vertex blocks of the form:
        Float32×5    (x, y, z, u, v) coordinates
        BYTE×4       (r, g, b, a) color
FLOAT32	Xmin
FLOAT32	Xmax
FLOAT32	Ymin
FLOAT32	Ymax
FLOAT32	Zmin
FLOAT32	Zmax
DWORD	Construction states (See Appendix 2.8)
DWORD	Alternate path ID (derived from AutoPathBase or TE-Lot), otherwise 0
DWORD×3	Unknown  (All 0)
DWORD	Demolishing costs
DWORD	Unknown  (0x00000000)

Appendix 2.1 - Structure of SGPROP (SaveGame Properties)

DWORD   Property Name Value
DWORD	Property Name Value  (doubled for some unknown reason)
DWORD	0x00000000
BYTE	Data Type, 01=UInt8, 02=UInt16, 03=UInt32, 07=SInt32, 08=SInt64, 09=Float32, 0B=Boolean
BYTE	KeyType, 0x00 = 0 reps, 0x80 = more than 0 reps
WORD	0x0000
DWORD	Rep Count  (this one appears only if KeyType = 0x80)
    DATA	Property Value (repeated Rep Count times, type according to Data Type)

SaveGame Properties

Properties known to appear on network tiles are listed below (See also the Prop Subfile).

0x4835C6A6 (Boolean) = Unknown (1?)
0x4835C6A7 (UInt32×2) = TE-Lot network flags:
    DWORD - Unknown (0?)
    DWORD - Flags (0xSSEENNWW) (0x00000000 if custom path is used)
0x4835C6A9 (UInt32) = TE-Lot custom path IID
0x4835C6AA (Byte) = Bitmask for Onewayroad directions:
    0b00000001 - Edge West: direction West to East
    0b00000010 - Edge West: direction East to West
    0b00000100 - Edge North: direction North to South
    0b00001000 - Edge North: direction South to North
    0b00010000 - Edge East: direction West to East
    0b00100000 - Edge East: direction East to West
    0b01000000 - Edge South: direction North to South
    0b10000000 - Edge South: direction South to North
0x4835C6AB (UInt32) = Unknown (some flags related to puzzle pieces?)
0xAA24AE57 (UInt32) = Unknown (0?)

Appendix 2.2 - Appearance Flags

    0x01000000 - Render the network shadow
    0x04000000 - Render the network

Appendix 2.3 - Orientation

    0x00 = North
    0x01 = East
    0x02 = South
    0x03 = West
    0x80 = North, mirrored
    0x81 = East, mirrored
    0x82 = South, mirrored
    0x83 = West, mirrored

Appendix 2.4 - Network Type

    0x00 = Road
    0x01 = Rail
    0x02 = Elevated Highway
    0x03 = Street
    0x04 = Pipe
    0x05 = Powerline
    0x06 = Avenue
    0x07 = Subway
    0x08 = Lightrail
    0x09 = Monorail
    0x0a = Onewayroad
    0x0b = Dirtroad
    0x0c = Ground Highway

Appendix 2.5 - Connections

The Network Flags are denoted in octal representation in RUL files:

0x00 = 0o00 (no connection)
0x01 = 0o01 (diagonal left)
0x02 = 0o02 (orthogonal)
0x03 = 0o03 (diagonal right)
0x04 = 0o04 (median)
0x09 = 0o11 (blend left)
0x0b = 0o13 (blend right)
0x11 = 0o21 (diagonal switch left)
0x13 = 0o23 (diagonal switch right)
...
0x32 = 0o62 (wye)
...

Appendix 2.6 - Wealth Textures

0 = default texture
1 = grass/low density $
2 = grass/low density $$
3 = grass/low density $$$
4 = medium/high density $
5 = medium/high density $$
6 = medium/high density $$$
7 = I-ag/landfill

Appendix 2.7 - Base textures

0x00000000 = None
0x08100000 = Pavement $
0x08200000 = Pavement $$
0x08300000 = Pavement $$$
0x08400000 = Dirt

Appendix 2.8 - Construction states

This bitset encodes which networks are present on the tile, whether the tile has been fully constructed, as well as several other flags. Some dual-networks like HRW built by the over-click method can only be seen here.

0x00000001 = Road (bit 0)
0x00000002 = Rail (bit 1)
0x00000004 = Highway (bit 2)
...  (see Appendix 2.4)
0x00000800 = Dirtroad (bit 11)
0x00001000 = Ground Highway (bit 12)
---
0x00002000 = matching path file exists (for TE tiles: set if fully connected to network)
0x00004000 = network not fully constructed yet (always set for TE tiles?)
0x00008000 = rendering state (set if tile has been displayed since last rotation of the map)
---
0x00040000 = bridge (...tentatively)
0x00080000 = alpha off (for tunnel portal)
0x00100000 = blue auto-place preview effect (set for all static puzzle pieces)
0x00200000 = TE tile
0x00400000 = anchored tile (static puzzle piece/tunnel portal)
0x00800000 = tunnel portal
0x01000000 = terrain triangles transposed
0x02000000 = render western triangle of base and overlay, hole if 0
             (set for texure-based tiles and for model-based tiles with wealth textures, not set for TE tiles)
0x04000000 = render eastern triangle of base and overlay, hole if 0
             (set for texure-based tiles and for model-based tiles with wealth textures, not set for TE tiles)
0x08000000 = render terrain
             (set for model-based network tiles and TE tiles, not set for purely texture-based tiles)
0x10000000 = network fully constructed (for TE tiles: set if fully connected to network)
0x20000000 = is lit
0x40000000 = alpha off (for retaining wall/pillar)

Appendix 2.9 - Retaining wall textures

0x00BB0000 - retaining wall
0x00BB0200 - railing
0x08080000 - pillar
0x0912220E - concrete

Network Subfile 2 (CA16374F)

This subfile contains network tiles related to the subway network and is similar to the Pipe Occupant Subfile.

Network Subfile 2 Structure

List of records of the form:

Network Subfile 2 Body

DWORD	Record Size
DWORD	CRC
DWORD	Memory
WORD×4	Version (always 2, 3, 8, 4)
DWORD	Appearance Flags  (Always 0x05000000)  (See Appendix 2.2 for more information)
DWORD	0xC772BF98  (always the same)
BYTE	Min Tract X Coordinate  (normally between 0x40 and 0x7F)
BYTE	Min Tract Z Coordinate  (normally between 0x40 and 0x7F)
BYTE	Max Tract X Coordinate  (normally between 0x40 and 0x7F)
BYTE	Max Tract Z Coordinate  (normally between 0x40 and 0x7F)
WORD	X Tract Size (power of 2)  (only seen 0x0002 ... 2² = 4 tiles)
WORD	Z Tract Size (power of 2)  (only seen 0x0002 ... 2² = 4 tiles)
DWORD	Count of Properties  (I've only seen 0x00000000)
    SGPROP    	SaveGame Properties, repeated Count times  (See Appendix 2.1 for more information)
DWORD	Group ID  (always 0x00000000)
DWORD	Type ID  (always 0x00000000)
DWORD	Instance ID  (always 0x00000000)
BYTE	Unknown  (Always 0x05)
FLOAT32	Unknown  (Normally 0, -1 or 1)
FLOAT32	Unknown  (Normally 0)
FLOAT32	Unknown  (Normally 0, -1 or 1)
FLOAT32	Unknown  (Normally 0)
FLOAT32	Unknown  (Normally 1)
FLOAT32	Unknown  (Normally 0)
FLOAT32	Unknown  (Normally 0, -1 or 1)
FLOAT32	Unknown  (Normally 0)
FLOAT32	Unknown  (Normally 0, -1 or 1)
FLOAT32	Xmax
FLOAT32	Ymax
FLOAT32	Zmax
FLOAT32	Xmin
FLOAT32	Ymin
FLOAT32	Zmin
FLOAT32	Unknown  (Normally 0)
FLOAT32	Unknown  (Normally 0)
DWORD	Unknown  (Always 0xFF000000)
FLOAT32	X Coordinate
FLOAT32	Y Coordinate
FLOAT32	Z Coordinate
FLOAT32	Unknown  (Normally 0)
FLOAT32	Unknown  (Normally 1)
DWORD	Unknown  (Always 0xFF000000)
FLOAT32	X Coordinate
FLOAT32	Y Coordinate
FLOAT32	Z Coordinate
FLOAT32	Unknown  (Normally 1)
FLOAT32	Unknown  (Normally 1)
DWORD	Unknown  (Always 0xFF000000)
FLOAT32	X Coordinate
FLOAT32	Y Coordinate
FLOAT32	Z Coordinate
FLOAT32	Unknown  (Normally 1)
FLOAT32	Unknown  (Normally 0)
DWORD	Unknown  (Always 0xFF000000)
DWORD	TextureID / PathID
BYTES×5	Unknown  (Small values)
BYTE	Orientation  (See Appendix 2.3 for more information)
BYTES×3	Unknown  (Small values)
BYTE	Network Type  (See Appendix 2.4 for more information)
BYTE	Connection, West  (See Appendix 2.5 for more information)
BYTE	Connection, North  (See Appendix 2.5 for more information)
BYTE	Connection, East  (See Appendix 2.5 for more information)
BYTE	Connection, South  (See Appendix 2.5 for more information)
BYTES×4	Unknown  (Small values)
FLOAT32	Xmin
FLOAT32	Xmax
FLOAT32	Ymin
FLOAT32	Ymax
FLOAT32	Zmin
FLOAT32	Zmax
BYTE	Unknown  (Always 128)
BYTE	Unknown  (Always 32)
BYTE	Unknown  (Always 0)
BYTE	Unknown  (Seen 16-21)
DWORD×4	Unknown  (All 0)
DWORD	Demolishing costs
DWORD	Unknown  (0x00000000)
WORD	Unknown  (0x0000)
FLOAT32	Unknown  (Normally 1)
DWORD	Number of extra blocks  (0, 1, 2 or 3)

# Below follow 5 arrays defining the sides of the hole. If an array is empty, there is
# no texture to be rendered at that side (typically for straight sections). Order is
# west, north, east, south, bottom.
DWORD	Count  (Either 0 or 4)
   3 x FLOAT32  (x, y, z) coordinates of the vertex
   2 x FLOAT32  (u, v) coordinates for texture mapping (normally 0, 0.75 or 1)
   4 x BYTE     (r, g, b, a) values indicating a color (either #ffffffff or #ffffff80).
DWORD	Count  (Either 0 or 4)
   3 x FLOAT32  (x, y, z) coordinates of the vertex
   2 x FLOAT32  (u, v) coordinates for texture mapping (normally 0, 0.75 or 1)
   4 x BYTE     (r, g, b, a) values indicating a color (either #ffffffff or #ffffff80).
DWORD	Count  (Either 0 or 4)
   3 x FLOAT32  (x, y, z) coordinates of the vertex
   2 x FLOAT32  (u, v) coordinates for texture mapping (normally 0, 0.75 or 1)
   4 x BYTE     (r, g, b, a) values indicating a color (either #ffffffff or #ffffff80).
DWORD	Count  (Either 0 or 4)
   3 x FLOAT32  (x, y, z) coordinates of the vertex
   2 x FLOAT32  (u, v) coordinates for texture mapping (normally 0, 0.75 or 1)
   4 x BYTE     (r, g, b, a) values indicating a color (either #ffffffff or #ffffff80).
DWORD	Count  (Either 0 or 4)
   3 x FLOAT32  (x, y, z) coordinates of the vertex
   2 x FLOAT32  (u, v) coordinates for texture mapping (normally 0, 0.75 or 1)
   4 x BYTE     (r, g, b, a) values indicating a color (either #ffffffff or #ffffff80).

DWORD	Unknown  (Always 0x00000000)

# Next follow 16 floats, representing the values of the transformation matrix for the model
#  | a b c d |
#  | d e f g |
#  | h i j k |
#  | l m n o |
# d, g and k are the translation components and are set to the position *in the city*.
16 x FLOAT32

DWORD	X Tile
DWORD	Z Tile
BOOLEAN	Unknown  (Always 0)
BOOLEAN	Unknown  (Either 0 or 1, false or true)
BOOLEAN	Unknown  (Either 0 or 1, false or true)
FLOAT32	Y Coordinate
FLOAT32	Y Coordinate
FLOAT32	Y Coordinate
FLOAT32	Y Coordinate
FLOAT32	Y Coordinate
DWORD	0xCA16374F  (Subfile ID)
DWORD	0x00000000  (always the same)

Prebuilt Network Subfile (0x49c1a034)

The prebuilt network subfile contains all model-based network tiles with a prefabricated model, such as elevated highways and monorail.

Structure

List of records of the form:

DWORD    Size
DWORD    CRC
DWORD    Memory
WORD×3   Version (always 4, 8, 4)
DWORD    Appearance flags (0x05000000)  (See Appendix 2.2 for more information)
DWORD    Unknown (always 0xc772bf98)
BYTE	 Min Tract X Coordinate  (normally between 0x40 and 0x7F)
BYTE	 Min Tract Z Coordinate  (normally between 0x40 and 0x7F)
BYTE	 Max Tract X Coordinate  (normally between 0x40 and 0x7F)
BYTE	 Max Tract Z Coordinate  (normally between 0x40 and 0x7F)
WORD	 X Tract Size (power of 2)  (only seen 0x0002 ... 2² = 4 tiles)
WORD	 Z Tract Size (power of 2)  (only seen 0x0002 ... 2² = 4 tiles)
DWORD	 Count of Properties
    SGPROP    	SaveGame Properties, repeated Count times
DWORD	 Group ID of Network Model Exemplar (see Appendix 4.1)
DWORD	 Type ID of Network Model Exemplar (0x6534284a)
DWORD	 Instance ID of Network Model Exemplar
BYTE	 Matrix flag (1 = no matrix, 5 = matrix is present)
    FLOAT32×9   Transformation matrix
FLOAT32	 X Coordinate
FLOAT32	 Y Coordinate
FLOAT32	 Z Coordinate

    # Next follows 4 times a data structure that contains information for
    # drawing a texture.
    3 x FLOAT32  (x, y, z) coordinates of the vertex
    2 x FLOAT32  (u, v) coordinates for texture mapping
    4 x BYTE     (r, g, b, a) values indicating a color (always #dedbddff).

DWORD	TextureID / PathID
BYTE	Wealth texture  (See Appendix 2.6)
DWORD	Base texture  (See Appendix 2.7)
BYTE    Orientation
BYTES×2	Unknown  (Small values)
Byte	Flag for crossings (1 for crossings of two networks, 0 for single network)
    BYTE	Network Type  (See Appendix 2.4 for more information)
    BYTE	Connection, West  (See Appendix 2.5 for more information)
    BYTE	Connection, North  (See Appendix 2.5 for more information)
    BYTE	Connection, East  (See Appendix 2.5 for more information)
    BYTE	Connection, South  (See Appendix 2.5 for more information)
DWORD	Number of blocks for retaining walls (always 0 for model-based network tiles)
    DWORD	Retaining wall texture IID (See Appendix 2.9)
    # Followed by three vertex blocks of the form:
        Float32×5    (x, y, z, u, v) coordinates
        BYTE×4       (r, g, b, a) color
FLOAT32	Xmin
FLOAT32	Xmax
FLOAT32	Ymin
FLOAT32	Ymax
FLOAT32	Zmin
FLOAT32	Zmax
DWORD	Construction states (See Appendix 2.8)
DWORD	Path ID derived from AutoPathBase, otherwise 0
DWORD×3	Unknown (apparently always 0x00000000)
DWORD	Demolishing costs
DWORD	Unknown (always 0)
FLOAT32×3  Unknown (usually 0 or very small -- seem to be related to matrix)
BYTE×5	Unknown (apparently always 0x00)
DWORD	pillar ID (if non-zero, it is followed by a block):
    FLOAT32	pillar rotation
    FLOAT32	pillar offset X
    FLOAT32	pillar offset Y
    FLOAT32	pillar offset Z

Appendix 4.1 - Network Model Exemplars

For a list of Group IDs, see Model Exemplar.

Network Tunnel Subfile (0x8a4bd52b)

Structure

List of records of the form:

DWORD    Size
DWORD    CRC
DWORD    Memory
WORD×4   Version (always 2, 4, 8, 4)
DWORD    Appearance flags (0x05000000)  (See Appendix 2.2 for more information)
DWORD    Unknown (always 0xc772bf98)
...
...     # Same as Prebuilt Network Subfile structure
...
DWORD	Demolishing costs
BYTE×25	Unknown (apparently always 0x00)
BYTE	Unknown (always 0x01)
DWORD	Opposing tunnel portal memory address
DWORD	Opposing tunnel portal subfile TID (0x8a4bd52b)