Offset 0x0000 to 0x0003 number of buildings
Offset 0x0004 to 0x0007 address of the buildings address map (file offset)
Offset 0x0008 to 0x01F3 tech map (496 bytes)
Offset 0x01F4 to 0x02E3 ignore list (240 bytes)
Offset 0x02E4 to 0x???? building data (n * 176 bytes)
Followed by address map (n * 4 bytes).
Structure of various sub-blocks
Tech map
Offset 0x0008 to 0x0009 number of buildings with biotech requirement
Offset 0x000A to 0x000B number of buildings with computer requirement
Offset 0x000C to 0x000D number of buildings with construction requirement
Offset 0x000E to 0x000F number of buildings with energy requirement
Offset 0x0010 to 0x0011 number of buildings with propulsion requirement
Offset 0x0012 to 0x0013 number of buildings with weapons requirement
Offset 0x0014 to 0x0015 number of buildings with All techs requirement
Offset 0x0016 to 0x0017 0x0000 (separator?)
Followed by: (offset 0x0018 to 0x01F3 - 476 bytes)
Code: Select all
For each tech requirement (7)
For each tech level (10)
address (4 bytes) of the first building with given tech req. and level
0x00000000 separator? (4 bytes)
For each tech level (10)
number of buildings with given tech req. and level (2 bytes)
0x00000000 separator? (4 bytes)
Code: Select all
For each empire (5)
bit mask of all the buildings (48 bytes == 384 bits)
If the bit is set to 1, this means the building is ignored. The way UE sets these is it checks if the building can be build by the empire and then sets the bit to 0 (if it can) or 1 (if it can't).
Building data
Each building takes up 176 bytes. The listed building need to be sorted by tech requirement and tech level.
Each building consists of:
Offset 0x0000 to 0x0027 Singular name (40 bytes)
Offset 0x0028 to 0x004F Plural name (40 bytes)
Offset 0x0050 to 0x0051 ID (2 bytes)
Offset 0x0052 to 0x0053 Upgrade For ID (2 bytes)
Offset 0x0054 to 0x0057 Unknown (4 bytes)
Offset 0x0058 to 0x005F Image prefix (8 bytes)
Offset 0x0060 to 0x0064 Unknown (5 bytes)
Offset 0x0065 to 0x0065 Tech req. type (1 byte)
Values:
0 - Biotech
1 - Computer
2 - Construction
3 - Energy
4 - Propulsion
5 - Weapon
6 - All
Offset 0x0066 to 0x0066 Tech level (1 byte)
Offset 0x0067 to 0x0067 Excluded empires mask (bit set to 1 means cannot by built by said empire)
Offset 0x0068 to 0x006F Race requirement (1 means race required)
Offset 0x0070 to 0x0070 Politic requirement (1 byte)
Values:
0 - Home system
1 - Native Member system
2 - Non-native member system
3 - Subjugated system
4 - Affiliated system
5 - Independent minor race system
6 - Conquered home system
9 - None
A - Rebel system
B - Empty system
Offset 0x0071 to 0x0071 System requirement (1 byte)
Values:
0 - Arctic planet
1 - Barren planet
2 - Desert planet
3 - Gas Giant
4 - Jungle planet
5 - Oceanic planet
6 - Terran planet
7 - Volcanic planet
8 - None
9 - Asteroid (not working)
A - Asteroid belt dilithium (not working)
B - Dilithium
C - Worm hole (not working)
D - Radio Pulsar (not working)
E - X-Ray Pulsar (not working)
Offset 0x0072 to 0x0072 bonus type (index from edifbnft.bst)
Offset 0x0073 to 0x0073 build limit
Values:
0 - None
1 - One per system
2 - One per empire
Offset 0x0074 to 0x0074 group
Values:
00 - Main Cardassian food
01 - Main Federation food
02 - Main Ferengi food
03 - Main Klingon food
04 - Main Romulan food
06 - Main Cardassian industry
07 - Main Federation industry
08 - Main Ferengi industry
09 - Main Klingon industry
0A - Main Romulan industry
0C - Main Cardassian energy
0D - Main Federation energy
0E - Main Ferengi energy
0F - Main Klingon energy
10 - Main Romulan energy
12 - Main Cardassian intel
13 - Main Federation intel
14 - Main Ferengi intel
15 - Main Klingon intel
16 - Main Romulan intel
18 - Main Cardassian research
19 - Main Federation research
1A - Main Ferengi research
1B - Main Klingon research
1C - Main Romulan research
1E - Scanners
22 - Other
Offset 0x0075 to 0x0075 Category
Values:
00 - Research
01 - Development
02 - Food
03 - Energy
04 - Defense
Offset 0x0076 to 0x0077 unknown (2 bytes)
Offset 0x0078 to 0x0079 build cost (2 bytes)
Offset 0x007A to 0x007B unknown (2 bytes)
Offset 0x007C to 0x007D energy cost (2 bytes)
Offset 0x007E to 0x007F unknown (2 bytes)
Offset 0x0080 to 0x0081 population cost (2 bytes) - either 00 or 0A
Offset 0x0082 to 0x0083 morale bonus (2 bytes)
Offset 0x0084 to 0x0085 unknown (2 bytes)
Offset 0x0086 to 0x0087 Cardassian bonus (2 bytes)
Offset 0x0088 to 0x0089 Federation bonus (2 bytes)
Offset 0x008A to 0x008B Ferengi bonus (2 bytes)
Offset 0x008C to 0x008D Klingon bonus (2 bytes)
Offset 0x008E to 0x008F Romulan bonus (2 bytes)
Offset 0x0090 to 0x0091 neutral bonus (2 bytes)
Offset 0x0092 to 0x0093 Cardassian unrest bonus ? (2 bytes)
Offset 0x0094 to 0x0095 Federation unrest bonus ? (2 bytes)
Offset 0x0096 to 0x0097 Ferengi unrest bonus ? (2 bytes)
Offset 0x0098 to 0x0099 Klingon unrest bonus ? (2 bytes)
Offset 0x009A to 0x009B Romulan unrest bonus ? (2 bytes)
Offset 0x009C to 0x009D neutral unrest bonus ? (2 bytes)
Offset 0x009E to 0x00AB unknown (14 bytes)
Offset 0x00AC to 0x00AF description address
All strings need to end with a 0x00 byte.
Address map
Consists of 4 byte addresses (file offsets) pointing to the start of a building's data entry. Addresses are sorted by building id.
To get the file offset of building with ID 0, you would look at the first address, for building with ID 30, you'd look at the 31st address.