BASE.DAT
UFO Structure
Ripped from Hatfarm / Chris Voss's great pages
BASE.DAT: Each entry is 292 Bytes long
00-0E: Base Name, pretty obvious
0F: Presumably the Null character if the Base Name uses all 15 characters
10: Base's short range detection capability.
12: Base's long range detection capability.
14: Base's hyperwave detection capability.
11, 13, 15: These are probably the high bytes for the Short, Long, and Hyper-wave detections respectively. Should always be 0 as a value of 100 (hex: 64 00) is perfect detection.
Logical values for the detection capabilities:
10 short, 0 long: This base has small radar(s) only.
20 short, 20 long: This base has large radar(s) only.
30 short, 20 long: This base has small and large radar(s).
100 hyperwave: This base has a hyperwave decoder(s).
The radar values can be set to 100 for perfect short range detection (presumably -- it definitely makes UFOs appear more often), but these reset to the correct values any time you complete a build in that base.
Radar Module / Scan Type | Short | Long | Hyperwave |
Small Radar | 10 | 0 | 0 |
Large Radar | 20 | 20 | 0 |
Hyperwave | 0 | 0 | 100 |
Radar Combinations | |||
Sm + Sm | 10 | 0 | 0 |
Sm + Lg | 30 | 20 | 0 |
Sm + Hyp | 10 | 0 | 100 |
Lg + Lg | 20 | 20 | 0 |
Lg + Hyp | 20 | 20 | 100 |
Hyp + Hyp | 0 | 0 | 100 |
Sm + Lg + Hyp | 30 | 20 | 100 |
16-39: The next offsets are arranged so they're easier to understand. They are for facilities in the base:
16 | 17 | 18 | 19 | 1A | 1B |
1C | 1D | 1E | 1F | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 |
28 | 29 | 2A | 2B | 2C | 2D |
2E | 2F | 30 | 31 | 32 | 33 |
34 | 35 | 36 | 37 | 38 | 39 |
The possible values are as follows:
00 - Access Lift 01 - Living Quarters 02 - Laboratory 03 - Workshop 04 - Small Radar System 05 - Large Radar System 06 - Missile Defense 07 - General Stores 08 - Alien Containment 09 - Laser Defense 0A - Plasma Defense 0B - Fusion Ball Defense 0C - Grav Shield 0D - Mind Shield 0E - Psionic Laboratory 0F - Hyper-wave Decoder 10 - Hangar (Top Left) 11 - Hangar (Top Right) 12 - Hangar (Bottom Left) 13 - Hangar (Bottom Right) FF - Empty
3A-5D: The next offsets represent the days until a facility is completed. They're set up the same way:
3A | 3B | 3C | 3D | 3E | 3F |
40 | 41 | 42 | 43 | 44 | 45 |
46 | 47 | 48 | 49 | 4A | 4B |
4C | 4D | 4E | 4F | 50 | 51 |
52 | 53 | 54 | 55 | 56 | 57 |
58 | 59 | 5A | 5B | 5C | 5D |
Possible values are 00 to FF. Empty spaces must have a FF value in their corresponding offset.
If you destroy a facility or one is destroyed during a base defense mission, the value remains 00. This causes the paying for dirt bug, resulting in an upkeep of 80k per dirt square. Simply change the value of the destroyed/dismantled facility to FF to eliminate the bug.
The following are the rest of the offsets I know. There are holes in the numbering but I have no idea what they are. With the exception of scientists and technicians, which are one byte each, all values are 2-byte signed little-endian values (-32,768 to +32,767). Example: 05 00 should be read as 0005; FE FF should be read as FFFE (-2).
It should be noted that despite the range of values a two-byte signed field gives you, due to a known issue, you cannot have more than 9,999 units of a given item in storage at any given base, regardless of what item it is.
Here's the info for bytes 5E-11E. The Record Number (Rec#) is used for e.g. PRODUCT.DAT and RESEARCH.DAT:
Hex Dec Rec# Item ---- --- ---- ---- 005E 94 - Engineer 005F 95 - Scientist 0060 96 0 Stingray Launcher 0062 98 1 Avalanche Launcher 0064 100 2 Cannon 0066 102 3 Fusion Ball Launcher 0068 104 4 Laser Cannon 006A 106 5 Plasma Beam 006C 108 6 Stingray Missile 006E 110 7 Avalanche Missile 0070 112 8 Cannon Rounds 0072 114 9 Fusion Balls 0074 116 10 Tank/Cannon 0076 118 11 Tank/Rocket Launcher 0078 120 12 Tank/Laser Cannon 007A 122 13 Hovertank/Plasma 007C 124 14 Hovertank/Launcher 007E 126 15 Pistol 0080 128 16 Pistol Clip 0082 130 17 Rifle 0084 132 18 Rifle Clip 0086 134 19 Heavy Cannon 0088 136 20 HC-AP Ammo 008A 138 21 HC-HE Ammo 008C 140 22 HC-IN Ammo 008E 142 23 Auto Cannon 0090 144 24 AC-AP Ammo 0092 146 25 AC-HE Ammo 0094 148 26 AC-IN Ammo 0096 150 27 Rocket Launcher 0098 152 28 Small Rocket 009A 154 29 Large Rocket 009C 156 30 Incendiary Rocket 009E 158 31 Laser Pistol 00A0 160 32 Laser Rifle 00A2 162 33 Heavy Laser 00A4 164 34 Grenade 00A6 166 35 Smoke Grenade 00A8 168 36 Proximity Grenade 00AA 170 37 High Explosive 00AC 172 38 Motion Scanner 00AE 174 39 Medi-Kit 00B0 176 40 Psi-Amp 00B2 178 41 Stun Rod 00B4 180 42 Electro Flare 00B6 182 43 empty 00B8 184 44 empty 00BA 186 45 empty 00BC 188 46 CORPSE 00BE 190 47 CORPSE & ARMOUR 00C0 192 48 CORPSE & POWER SUIT 00C2 194 49 Heavy Plasma 00C4 196 50 Heavy Plasma Clip 00C6 198 51 Plasma Rifle 00C8 200 52 Plasma Rifle Clip 00CA 202 53 Plasma Pistol 00CC 204 54 Plasma Pistol Clip 00CE 206 55 Blaster Launcher 00D0 208 56 Blaster Bomb 00D2 210 57 Small Launcher 00D4 212 58 Stun Bomb 00D6 214 59 Alien Grenade 00D8 216 60 Elerium-115 00DA 218 61 Mind Probe 00DC 220 62 >>UNDEFINED << 00DE 222 63 >> empty << 00E0 224 64 >> empty << 00E2 226 65 Sectoid Corpse 00E4 228 66 Snakeman Corpse 00E6 230 67 Ethereal Corpse 00E8 232 68 Muton Corpse 00EA 234 69 Floater Corpse 00EC 236 70 Celatid Corpse 00EE 238 71 Silacoid Corpse 00F0 240 72 Chryssalid Corpse 00F2 242 73 Reaper Corpse 00F4 244 74 Sectopod Corpse 00F6 246 75 Cyberdisc Corpse 00F8 248 76 Hovertank Corpse 00FA 250 77 Tank Corpse 00FC 252 78 Male Civilian Corpse 00FE 254 79 Female Civilian Corpse 0100 256 80 UFO Power Source 0102 258 81 UFO Navigation 0104 260 82 UFO Construction 0106 262 83 Alien Food 0108 264 84 Alien Reproduction 010A 266 85 Alien Entertainment 010C 268 86 Alien Surgery 010E 270 87 Examination Room 0110 272 88 Alien Alloys 0112 274 89 Alien Habitat 0114 276 90 Personal Armour 0116 278 91 Power Suit 0118 280 92 Flying Suit 011A 282 93 HWP Cannon Shell 011C 284 94 HWP Rockets 011E 286 95 HWP Fusion Bomb
0120-0123: Mark the base as active. Bases which are dismantled or which have not been built have a value of 1 (32bit integer). Active bases have a value of 0. If a base is dismantled, the only change to the record is this value. A new base will overwrite the first slot with a value of 1. It is possible to restore a dismantled base (Access lift removed) by setting this value to 0. The game will 'restore' the base to the configuration just before the access lift was removed, including inventory. --SeulDragon 12:24, 11 July 2008 (PDT)
See Also
- ASTORE.DAT - Information on captured aliens at bases
- BPROD.DAT - Information on what bases are producing
- CRAFT.DAT - Information on crafts (both X-Com and Alien)
- FACIL.DAT - Information on the facilities you can build in bases
- LOC.DAT - Location Data for bases and crafts
- PROJECT.DAT - Information on current research
- SOLDIER.DAT - Information on soldiers at bases
- TRANSFER.DAT - Information on item/personnel being transferred to/from bases
- BASE.DAT (TFTD) - Terror From The Deep's base file
- Saved Game Files