Difference between revisions of "Building Subfile"
sc4e>Whatevermind m (→Savegame Properties (SGProps): section rename to follow standard of Lot file) |
m (14 revisions imported) |
||
(5 intermediate revisions by 2 users not shown) | |||
Line 15: | Line 15: | ||
WORD Zot Word (always 0x0000 for buildings) | WORD Zot Word (always 0x0000 for buildings) | ||
BYTE Unknown (only seen 0x00) | BYTE Unknown (only seen 0x00) | ||
− | BYTE Appearance Flag (Appendix 2) | + | BYTE Appearance Flag (see Appendix 2 below) |
DWORD 0x278128A0 (always the same) | DWORD 0x278128A0 (always the same) | ||
BYTE Min Tract X Coordinate | BYTE Min Tract X Coordinate | ||
Line 24: | Line 24: | ||
WORD Z Tract Size? (power of 2) (only seen 0x0002) | WORD Z Tract Size? (power of 2) (only seen 0x0002) | ||
DWORD Count of Properties (can be several of them) | DWORD Count of Properties (can be several of them) | ||
− | SGPROP SaveGame Properties, repeated Count times (Appendix 1) | + | SGPROP SaveGame Properties, repeated Count times (see Appendix 1 below) |
− | BYTE Unknown ( | + | BYTE Unknown (only seen 0x01) |
DWORD Group ID (from the Prop Exemplar) | DWORD Group ID (from the Prop Exemplar) | ||
DWORD Type ID (from the Prop Exemplar) | DWORD Type ID (from the Prop Exemplar) | ||
Line 37: | Line 37: | ||
FLOAT32 Max Z Coordinate | FLOAT32 Max Z Coordinate | ||
BYTE Orientation | BYTE Orientation | ||
− | FLOAT32 Scaffolding Height (Appendix 3) | + | FLOAT32 Scaffolding Height (see Appendix 3 below) |
</pre> | </pre> | ||
===Appendix 1: Structure of SGPROP (SaveGame Properties)=== | ===Appendix 1: Structure of SGPROP (SaveGame Properties)=== | ||
+ | This structure is used on the SGPROP entries. Known entries are listed further below. | ||
<pre> | <pre> | ||
DWORD Property Name Value | DWORD Property Name Value | ||
Line 53: | Line 54: | ||
===Appendix 2: Appearance Flag (offset 0x0013)=== | ===Appendix 2: Appearance Flag (offset 0x0013)=== | ||
− | + | The Appearance Flag can have any of the following values: | |
− | 0x01 (00000001b) - Building that appears in the game (if this is off, the building has been deleted) | + | |
− | 0x02 (00000010b) - ? (unused) | + | *0x01 (00000001b) - Building that appears in the game (if this is off, the building has been deleted). |
− | 0x04 (00000100b) - ? (always on) | + | *0x02 (00000010b) - ? (unused). |
− | 0x08 (00001000b) - Flora (not used for buildings) | + | *0x04 (00000100b) - ? (always on). |
− | 0x40 (01000000b) - Burnt (probably not used for buildings, as if they burn, they become replaced by a burnt prop) | + | *0x08 (00001000b) - Flora (not used for buildings). |
− | + | *0x40 (01000000b) - Burnt (probably not used for buildings, as if they burn, they become replaced by a burnt prop). | |
===Appendix 3: Scaffolding Height=== | ===Appendix 3: Scaffolding Height=== | ||
Line 71: | Line 72: | ||
Once the scaffolding enters the height of the final building, this field will get a value of 1.00. A finished building always has a value of 1.00 in this field. | Once the scaffolding enters the height of the final building, this field will get a value of 1.00. A finished building always has a value of 1.00 in this field. | ||
− | ==Savegame Properties (SGProps) for the Building Subfile | + | ==Savegame Properties (SGProps)== |
+ | Known entries for SGPROP for the Building Subfile are listed below. | ||
<pre> | <pre> | ||
0x899AFBAD - Custom Name | 0x899AFBAD - Custom Name | ||
Line 77: | Line 79: | ||
Rep Count = String Length | Rep Count = String Length | ||
Contains the customized name given to a building in the game | Contains the customized name given to a building in the game | ||
+ | </pre> | ||
− | + | <pre> | |
0x08D9763D - Utility Usage | 0x08D9763D - Utility Usage | ||
Type: UInt32/SInt32 | Type: UInt32/SInt32 | ||
Line 86: | Line 89: | ||
0x00000000 for newly plopped facilities | 0x00000000 for newly plopped facilities | ||
The actual amount of water and power produced (and used by the city). | The actual amount of water and power produced (and used by the city). | ||
+ | </pre> | ||
− | + | <pre> | |
0x2A58D350 - Actual Monthly Cost at full funding | 0x2A58D350 - Actual Monthly Cost at full funding | ||
Type: SInt64 | Type: SInt64 | ||
Line 93: | Line 97: | ||
Only for utility buildings, not for other civic buildings. | Only for utility buildings, not for other civic buildings. | ||
Takes into account "Funding percentage to decay rate multiplier response curve". | Takes into account "Funding percentage to decay rate multiplier response curve". | ||
+ | </pre> | ||
− | + | <pre> | |
0xEA54D284 - Budget Panel Identification | 0xEA54D284 - Budget Panel Identification | ||
Type: UInt32 | Type: UInt32 | ||
Line 100: | Line 105: | ||
Normally a link to the Building Exemplar's IID | Normally a link to the Building Exemplar's IID | ||
0x00000001 = Ambulance or School Bus | 0x00000001 = Ambulance or School Bus | ||
+ | </pre> | ||
− | + | <pre> | |
0xEA54D287 - Local Budget Funding in % | 0xEA54D287 - Local Budget Funding in % | ||
Type: Float32 | Type: Float32 | ||
Rep Count > 0 | Rep Count > 0 | ||
Funding percentage of those items set in 0xEA54D284 | Funding percentage of those items set in 0xEA54D284 | ||
+ | </pre> | ||
− | + | <pre> | |
0x0910BFCF - Accumulated Age Degradation | 0x0910BFCF - Accumulated Age Degradation | ||
Type: Float32 | Type: Float32 | ||
Rep Count = 0 | Rep Count = 0 | ||
+ | </pre> | ||
− | + | <pre> | |
0xE9244B2E - School Capacity (actual capacity, based on funding) | 0xE9244B2E - School Capacity (actual capacity, based on funding) | ||
Type: UInt32 | Type: UInt32 | ||
Rep Count = 0 | Rep Count = 0 | ||
+ | </pre> | ||
− | + | <pre> | |
0x09220161 - School Usage (actual number of students) | 0x09220161 - School Usage (actual number of students) | ||
Type: UInt32 | Type: UInt32 | ||
Rep Count = 0 | Rep Count = 0 | ||
0xFFFFFFFF if newly plopped | 0xFFFFFFFF if newly plopped | ||
+ | </pre> | ||
− | + | <pre> | |
0x49244B21 - Hospital Capacity (actual capacity, based on funding) | 0x49244B21 - Hospital Capacity (actual capacity, based on funding) | ||
Type: UInt32 | Type: UInt32 | ||
Rep Count = 0 | Rep Count = 0 | ||
+ | </pre> | ||
− | + | <pre> | |
0xC922015C - Hospital Usage (actual number of patients) | 0xC922015C - Hospital Usage (actual number of patients) | ||
Type: UInt32 | Type: UInt32 | ||
Rep Count = 0 | Rep Count = 0 | ||
0xFFFFFFFF if newly plopped | 0xFFFFFFFF if newly plopped | ||
+ | </pre> | ||
− | + | <pre> | |
0x292453C5 - School Grade? (between 0.00 and 1.00) | 0x292453C5 - School Grade? (between 0.00 and 1.00) | ||
0x2A976C20 - School Grade? (between 0.00 and 1.00) | 0x2A976C20 - School Grade? (between 0.00 and 1.00) | ||
Line 140: | Line 152: | ||
Rep Count = 0 | Rep Count = 0 | ||
One is probably the grade. What is the other one? | One is probably the grade. What is the other one? | ||
+ | </pre> | ||
− | + | <pre> | |
0x092453CB - Hospital Grade? (between 0.00 and 1.00) | 0x092453CB - Hospital Grade? (between 0.00 and 1.00) | ||
0xAA976BE7 - Hospital Grade? (between 0.00 and 1.00) | 0xAA976BE7 - Hospital Grade? (between 0.00 and 1.00) | ||
Line 147: | Line 160: | ||
Rep Count = 0 | Rep Count = 0 | ||
One is probably the grade. What is the other one? | One is probably the grade. What is the other one? | ||
+ | </pre> | ||
− | + | <pre> | |
0x48D71EE1 - Jail Usage (actual number of inmates) | 0x48D71EE1 - Jail Usage (actual number of inmates) | ||
Type: UInt32 | Type: UInt32 | ||
Line 154: | Line 168: | ||
0x00000000 if newly plopped | 0x00000000 if newly plopped | ||
For the Modd Squad Safety I had an inmate count of 19 in the query, but this property showed 20. | For the Modd Squad Safety I had an inmate count of 19 in the query, but this property showed 20. | ||
+ | </pre> | ||
− | + | <pre> | |
0x48D71ED7 - Police Station available(?) dispatches | 0x48D71ED7 - Police Station available(?) dispatches | ||
Type: UInt32 | Type: UInt32 | ||
Line 192: | Line 207: | ||
Thus, I cannot guarantee what this property is showing. | Thus, I cannot guarantee what this property is showing. | ||
However the values are the only ones that even somewhat match up to the total dispatches. | However the values are the only ones that even somewhat match up to the total dispatches. | ||
+ | </pre> | ||
− | + | <pre> | |
0x69B425DD - Fire Station available(?) dispatches | 0x69B425DD - Fire Station available(?) dispatches | ||
Type: UInt32 | Type: UInt32 | ||
Line 226: | Line 242: | ||
Thus, I cannot guarantee what this property is showing. | Thus, I cannot guarantee what this property is showing. | ||
However the values are the only ones that even somewhat match up to the total dispatches. | However the values are the only ones that even somewhat match up to the total dispatches. | ||
+ | </pre> | ||
− | + | <pre> | |
0x48D71ED8 - Police Station - Unknown property | 0x48D71ED8 - Police Station - Unknown property | ||
Type: UInt32 | Type: UInt32 | ||
Line 236: | Line 253: | ||
0x0000003F - DeLuxe Police Station | 0x0000003F - DeLuxe Police Station | ||
0x000FFFFF - Modd Squad Safety | 0x000FFFFF - Modd Squad Safety | ||
+ | </pre> | ||
− | + | <pre> | |
0x69B425DE - Fire Station - Unknown property | 0x69B425DE - Fire Station - Unknown property | ||
Type: UInt32 | Type: UInt32 | ||
Line 245: | Line 263: | ||
0x00000003 - Fire Landing Strip | 0x00000003 - Fire Landing Strip | ||
0x000FFFFF - Modd Squad Safety | 0x000FFFFF - Modd Squad Safety | ||
+ | </pre> | ||
− | + | <pre> | |
0x8A70A0B9 - Crimes and Arrests | 0x8A70A0B9 - Crimes and Arrests | ||
Type: UInt32 | Type: UInt32 | ||
Line 254: | Line 273: | ||
Rep 3 = Number of Crimes the previous month | Rep 3 = Number of Crimes the previous month | ||
Rep 4 = Number of Arrests the previous month | Rep 4 = Number of Arrests the previous month | ||
+ | </pre> | ||
− | + | <pre> | |
0xAC0B070E - Unknown - DeLuxe Police Station - Helicopter related? | 0xAC0B070E - Unknown - DeLuxe Police Station - Helicopter related? | ||
Type: UInt32 | Type: UInt32 | ||
Rep Count = 0 | Rep Count = 0 | ||
+ | </pre> | ||
− | + | <pre> | |
0xEC0B0709 - Unknown - DeLuxe Police Station - Helicopter related? | 0xEC0B0709 - Unknown - DeLuxe Police Station - Helicopter related? | ||
Type: UInt32 | Type: UInt32 | ||
Rep Count = 0 | Rep Count = 0 | ||
+ | </pre> | ||
− | + | <pre> | |
0x0C0AFF3F - Unknown - Fire Landing Strip - Fire Plane related? | 0x0C0AFF3F - Unknown - Fire Landing Strip - Fire Plane related? | ||
Type: UInt32 | Type: UInt32 | ||
Rep Count = 0 | Rep Count = 0 | ||
+ | </pre> | ||
− | + | <pre> | |
0xCC0AFDDB - Unknown - Fire Landing Strip - Fire Plane related? | 0xCC0AFDDB - Unknown - Fire Landing Strip - Fire Plane related? | ||
Type: UInt32 | Type: UInt32 | ||
Rep Count = 0 | Rep Count = 0 | ||
+ | </pre> | ||
− | + | <pre> | |
0x69DBEBE1 - Unknown | 0x69DBEBE1 - Unknown | ||
Data Type: Boolean | Data Type: Boolean | ||
Line 283: | Line 307: | ||
</pre> | </pre> | ||
− | NOTE: Just like ordinary police and fire stations, the Modd Squad Safety did not get the property 0xEA54D284 (Budget Panel Identification). Thus, | + | NOTE: Just like ordinary police and fire stations, the Modd Squad Safety did not get the property ''0xEA54D284'' (Budget Panel Identification). Thus, it is not currently known in which order the budget fundings given in ''0xEA54D287'' are to be read. That property did get three reps, all at 100%, probably for police funding, jail funding and fire station funding. |
{{navbox/SUBFILE}} | {{navbox/SUBFILE}} | ||
− | [[Category: | + | [[Category:MTS2]] |
[[Category:Savegame/Subfiles]] | [[Category:Savegame/Subfiles]] |
Latest revision as of 18:23, 4 August 2019
This page pertains to the format of the Building Subfile within the Savegame files. This file has Type ID A9BD882D. It can be viewed using the SC4 Savegame Explorer, but not edited. This particular subfile was decoded by RippleJet.
Contents
Description
This subfile contains data about all of the buildings in the city.
Structure
The structure of the Building Subfile follows the format below. Somebody should clarify which part of this repeats for each building.
DWORD Size DWORD CRC DWORD Memory WORD Major Version? (only seen 0x0002) WORD Minor Version? (only seen 0x0004) WORD Zot Word (always 0x0000 for buildings) BYTE Unknown (only seen 0x00) BYTE Appearance Flag (see Appendix 2 below) DWORD 0x278128A0 (always the same) BYTE Min Tract X Coordinate BYTE Min Tract Z Coordinate BYTE Max Tract X Coordinate BYTE Max Tract Z Coordinate WORD X Tract Size? (power of 2) (only seen 0x0002) WORD Z Tract Size? (power of 2) (only seen 0x0002) DWORD Count of Properties (can be several of them) SGPROP SaveGame Properties, repeated Count times (see Appendix 1 below) BYTE Unknown (only seen 0x01) DWORD Group ID (from the Prop Exemplar) DWORD Type ID (from the Prop Exemplar) DWORD Instance ID (from the Prop Exemplar) DWORD Instance ID (the value given when the building appeared) FLOAT32 Min X Coordinate FLOAT32 Min Y Coordinate FLOAT32 Min Z Coordinate FLOAT32 Max X Coordinate FLOAT32 Max Y Coordinate FLOAT32 Max Z Coordinate BYTE Orientation FLOAT32 Scaffolding Height (see Appendix 3 below)
Appendix 1: Structure of SGPROP (SaveGame Properties)
This structure is used on the SGPROP entries. Known entries are listed further below.
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, 0C=String 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)
Appendix 2: Appearance Flag (offset 0x0013)
The Appearance Flag can have any of the following values:
- 0x01 (00000001b) - Building that appears in the game (if this is off, the building has been deleted).
- 0x02 (00000010b) - ? (unused).
- 0x04 (00000100b) - ? (always on).
- 0x08 (00001000b) - Flora (not used for buildings).
- 0x40 (01000000b) - Burnt (probably not used for buildings, as if they burn, they become replaced by a burnt prop).
Appendix 3: Scaffolding Height
Depending on the height of the finished building, the scaffolding height is divided into a number of (let's call it F) fractions. During construction, if the building is growable (or LotConfigPropertyDoConstruction = True), the scaffolding will jump up in steps equal to 1/F of the final height.
The height of the current scaffolding is given in this field. Checking several buildings under construction of different heights, the following values have been found:
1/2, 1/3, 2/3, 3/5, 4/5, 2/7, 4/7, 4/9, 8/17, 7/20
Once the scaffolding enters the height of the final building, this field will get a value of 1.00. A finished building always has a value of 1.00 in this field.
Savegame Properties (SGProps)
Known entries for SGPROP for the Building Subfile are listed below.
0x899AFBAD - Custom Name Type: String Rep Count = String Length Contains the customized name given to a building in the game
0x08D9763D - Utility Usage Type: UInt32/SInt32 Rep Count = 0 UInt32 for Water Pumps SInt32 for Power Plants 0x00000000 for newly plopped facilities The actual amount of water and power produced (and used by the city).
0x2A58D350 - Actual Monthly Cost at full funding Type: SInt64 Rep Count = 0 Only for utility buildings, not for other civic buildings. Takes into account "Funding percentage to decay rate multiplier response curve".
0xEA54D284 - Budget Panel Identification Type: UInt32 Rep Count > 0 Normally a link to the Building Exemplar's IID 0x00000001 = Ambulance or School Bus
0xEA54D287 - Local Budget Funding in % Type: Float32 Rep Count > 0 Funding percentage of those items set in 0xEA54D284
0x0910BFCF - Accumulated Age Degradation Type: Float32 Rep Count = 0
0xE9244B2E - School Capacity (actual capacity, based on funding) Type: UInt32 Rep Count = 0
0x09220161 - School Usage (actual number of students) Type: UInt32 Rep Count = 0 0xFFFFFFFF if newly plopped
0x49244B21 - Hospital Capacity (actual capacity, based on funding) Type: UInt32 Rep Count = 0
0xC922015C - Hospital Usage (actual number of patients) Type: UInt32 Rep Count = 0 0xFFFFFFFF if newly plopped
0x292453C5 - School Grade? (between 0.00 and 1.00) 0x2A976C20 - School Grade? (between 0.00 and 1.00) Type: Float32 Rep Count = 0 One is probably the grade. What is the other one?
0x092453CB - Hospital Grade? (between 0.00 and 1.00) 0xAA976BE7 - Hospital Grade? (between 0.00 and 1.00) Type: Float32 Rep Count = 0 One is probably the grade. What is the other one?
0x48D71EE1 - Jail Usage (actual number of inmates) Type: UInt32 Rep Count = 0 0x00000000 if newly plopped For the Modd Squad Safety I had an inmate count of 19 in the query, but this property showed 20.
0x48D71ED7 - Police Station available(?) dispatches Type: UInt32 Rep Count = 0 For some reason this is usually not accurate though, compared to the building property Police Station, Total Dispatches, e.g: Station Total SGPROP plopped: Dispatches Dispatches Police Kiosk 0 1 Small Police Station 2 1 Large Police Station 4 3 DeLuxe Police Station 6 7 Modd Squad Safety 20 21 Thus, I cannot guarantee what this property is showing. However the values are the only ones that even somewhat match up to the total dispatches.
0x69B425DD - Fire Station available(?) dispatches Type: UInt32 Rep Count = 0 For some reason this is usually not accurate though, compared to the building property Fire Station, Total Dispatches, e.g: Station Total SGPROP plopped: Dispatches Dispatches Small Fire Station 1 1 Large Fire Station 2 2 Fire Landing Strip 2 4 Modd Squad Safety 20 21 Thus, I cannot guarantee what this property is showing. However the values are the only ones that even somewhat match up to the total dispatches.
0x48D71ED8 - Police Station - Unknown property Type: UInt32 Rep Count = 0 0x00000000 - Police Kiosk 0x00000003 - Small Police Station 0x0000000F - Large Police Station 0x0000003F - DeLuxe Police Station 0x000FFFFF - Modd Squad Safety
0x69B425DE - Fire Station - Unknown property Type: UInt32 Rep Count = 0 0x00000001 - Small Fire Station 0x00000003 - Large Fire Station 0x00000003 - Fire Landing Strip 0x000FFFFF - Modd Squad Safety
0x8A70A0B9 - Crimes and Arrests Type: UInt32 Rep Count = 4 Rep 1 = Number of Crimes this month (as reported by the query) Rep 2 = Number of Arrests this month (as reported by the query) Rep 3 = Number of Crimes the previous month Rep 4 = Number of Arrests the previous month
0xAC0B070E - Unknown - DeLuxe Police Station - Helicopter related? Type: UInt32 Rep Count = 0
0xEC0B0709 - Unknown - DeLuxe Police Station - Helicopter related? Type: UInt32 Rep Count = 0
0x0C0AFF3F - Unknown - Fire Landing Strip - Fire Plane related? Type: UInt32 Rep Count = 0
0xCC0AFDDB - Unknown - Fire Landing Strip - Fire Plane related? Type: UInt32 Rep Count = 0
0x69DBEBE1 - Unknown Data Type: Boolean Rep Count: 0 Values seen: always False (never True) This is rare, but has been found in the Prop subfile, the Flora subfile and the Building subfile
NOTE: Just like ordinary police and fire stations, the Modd Squad Safety did not get the property 0xEA54D284 (Budget Panel Identification). Thus, it is not currently known in which order the budget fundings given in 0xEA54D287 are to be read. That property did get three reps, all at 100%, probably for police funding, jail funding and fire station funding.
|