From UFOpaedia
(Redirected from MISSION.DAT)
Jump to navigation Jump to search

This 170 byte file (172 for TFTD) is only used by tactical saves, and much of it is made up of two-byte signed integers. It comes in three flavours:


Initially created by the GeoScape engine and stored in the MISSDAT folder. Contains info required for Battlescape Map Generation.


Created along with a battlescape save, effectively a mirror of the original "MISSION.DAT".


Appears in the MISSDAT folder at the end of combat. Contains debreifing data (such as who won, what was recovered and what points were scored). The relevant offsets for this file are unused by the previous two versions.

Values are presented according to byte offset (0 to 169/171) followed by the equivalent hex offset (0x00 to 0xA9/0xAB) in bold. Let us know what else you can find!!


The first 20 bytes are a count up of the various recoverable tile types in the map. These two-byte integers are only set if you actually won the mission by eliminating all enemy forces. These offsets + 100 index into the respective BASE.DAT values that they'll be added to.

See Equipment Recovery for more information.

0-1 0x00-0x01 UFO Power Source (MCD[59] set to 02).
2-3 0x02-0x03 UFO Navigation (MCD[59] set to 03, not counted for alien bases).
4-5 0x04-0x05 UFO Construction (MCD[59] set to 04, no known tiles have this set).
6-7 0x06-0x07 Alien Food (MCD[59] set to 05).
8-9 0x08-0x09 Alien Reproduction (MCD[59] set to 06, no known tiles have this set).
10-11 0x0A-0x0B Alien Entertainment (MCD[59] set to 07).
12-13 0x0C-0x0D Alien Surgery (MCD[59] set to 08).
14-15 0x0E-0x0F Examination Room (MCD[59] set to 09).
16-17 0x10-0x11 Alien Alloys (MCD[59] set to 10).

The total is divided by 2 for a UFO mission or 30 for an alien base. The value stored here is further divided by 5 to get the result you see on the debriefing screen.

18-19 0x12-0x13 Alien Habitat (MCD[59] set to 11, no known tiles have this set).
20-21 0x14-0x15 Mission descriptor. Possible values:
UFO                              TFTD
0: UFO Site                      0: Alien Sub Site
1: Terror Site                   1: Port/Island Attack
2: Base Defence (X-COM Base)     2: Base Defense (X-COM Base)
3: Base Offense (Alien Base)     3: Colony Stage 1
4: Mars Stage 1                  4: T'leth Stage 1
5: Mars Stage 2                  5: T'leth Stage 2
                                 6: T'leth Stage 3
                                 7: Artefact Site Stage 1
                                 8: Artefact Site Stage 2
                                 9: Passenger/Cargo Ship Stage 1
                                10: Passenger/Cargo Ship Stage 2
                                11: Colony Stage 2
Values 22-73 (Hex: 16-49) primarily hold scoring information. As per the tile recovery indexes, these are only stored in the final "end-of-combat" MISSION2.DAT. For temporary storage mid-mission, some of these values are stored in WGLOB.DAT.
22-23 0x16-0x17 Aliens killed.
24-25 0x18-0x19 Aliens killed score.
26-27 0x1A-0x1B Alien corpses.
28-29 0x1C-0x1D Corpse score.
30-31 0x1E-0x1F Live aliens captured.
32-33 0x20-0x21 Live alien score.
34-35 0x22-0x23 Artefacts (unresearched alien items) recovered.
36-37 0x24-0x25 Artefacts score.
38-39 0x26-0x27 Alien base control destroyed. This flags if you win a base offense mission by killing all enemy forces, or if you destroy all 16 nav modules in the command center. If not zero, the base you were attacking will be removed from the world map at the end of combat.
40-41 0x28-0x29 Base control score.
42-43 0x2A-0x2B Civilians killed by aliens.
44-45 0x2C-0x2D Civilians killed by aliens score (typically negative).
46-47 0x2E-0x2F Civilians killed by X-COM.
48-49 0x30-0x31 Civilians killed by X-COM score (typically negative).
50-51 0x32-0x33 Civilians saved.
52-53 0x34-0x35 Civilians saved score.
54-55 0x36-0x37 X-COM troopers killed.
56-57 0x38-0x39 X-COM troopers killed score (typically negative).
58-59 0x3A-0x3B X-COM troopers "retired through injury" (never actually flags).
60-61 0x3C-0x3D X-COM troopers "retired through injury" score (never actually flags).
62-63 0x3E-0x3F X-COM troopers MIA.
64-65 0x40-0x41 X-COM troopers MIA score (typically negative).
66-67 0x42-0x43 Tanks lost.
68-69 0x44-0x45 Tanks lost score (typically negative).
70-71 0x46-0x47 X-COM craft lost (GeoScape ignores this if you actually lose a craft, Tactical sets it regardless).
72-73 0x48-0x49 X-COM craft lost score (GeoScape ignores this if you actually lose a craft, Tactical doesn't set it regardless).
74-75 0x4A-0x4B A value based on the time at the LOC.DAT location. References into a table stored in the executable in order to define the values in BGLOB.DAT.
76 0x4C For a UFO site, this is the LOC.DAT reference corresponding to the crash site. This is plausibly true for every mission type (with the possible exception of the Mars assault). Used to determine whether the alien ship crashed or not (and therefore whether to randomly detonate the power supply units). I seem to remember that tweaking this byte could have an effect on BGLOB.DAT, but I might've confused myself. - Bomb Bloke 03:45, 23 June 2008 (PDT)
77 0x4D Index into CRAFT.DAT pointing to the craft sent on this mission. In the case of base defence (see offset [79]), it indexes to the LOC.DAT record for the base in concern.
78 0x4E Victory status.
0: Mission aborted with some units in exit areas.
1: Mission won.
2: Mission lost.
3: Mission aborted with no units in exit areas.
79 0x4F 0 unless the mission is a UFO site, in which case it is 1. Determines use of [77] but doesn't seem to affect [16-17].
80-151 0x50-0x97 A list of 36 two-byte integers, used during base defence missions. In order, they represent each module in your base, reading from left to right, top to bottom.

At the end of battle, the tactical game engine tallies up the amount of "target" objects existing within each module, and stores the results in "MISSION2.DAT". If that figure is 0 for any given destructible facility, then the geoscape engine will remove it from your base (along with any other modules that relied on that section for passage to the Access Lift).

"Target objects" are tiles that have offset 60 set to 1 within their MCD record.

Bytes 152-167 (Hex: 0x98-0xA7) allow you to use the following equipment only if they are set to 1. X-COM produced equipment can be used even if it hasn't been researched (however, in order to get it into combat, you must build it - and that requires research). The last three entries in the list are item slots that were never used in the game. TFTD
152 0x98 Enables Heavy Plasma (ObData[34]) Vibroblade
153 0x99 Enables Heavy Plasma Clip (ObData[35]) Thermic Lance
154 0x9A Enables Plasma Rifle (ObData[36]) Heavy Thermic Lance
155 0x9B Enables Plasma Rifle Clip (ObData[37]) Sonic Cannon
156 0x9C Enables Plasma Pistol (ObData[38]) Sonic Cannon Clip
157 0x9D Enables Plasma Pistol Clip (ObData[39]) Sonic-Blasta Rifle
158 0x9E Enables Blaster Launcher (ObData[40]) Blasta Clip
159 0x9F Enables Blaster Bomb (ObData[41]) Sonic Pistol
160 0xA0 Enables Small Launcher (ObData[42]) Sonic Pistol Clip
161 0xA1 Enables Stun Bomb (ObData[43]) Disruptor Pulse Launcher
162 0xA2 Enables Alien Grenade (ObData[44]) Disruptor Ammo
163 0xA3 Enables Elerium-115 (ObData[45]) Thermal Shok Launcher
164 0xA4 Enables Mind Probe (ObData[46]) Thermal Shok Bomb
165 0xA5 Enables "null>>UNDEFINED <<" (ObData[47]) Sonic Pulsar
166 0xA6 Enables "null>> empty <<" (ObData[48]) null
167 0xA7 Enables "null>> empty <<" (ObData[49]) M.C. Reader
168-169 0xA8-0xA9 Determines the language in which the mission was initiated. If the game is saved and later loaded, this overrides whatever language was selected when the program started.
0 - English
1 - German
2 - French
170-171 0xAA-0xAB Only present for TFTD. Determines the depth level (that is, which battlescape palette to use, whether to render air bubbles around units, and which background noise to play):
0 - Surface
1 - Shallow Water
2 - Medium Depths
3 - Deep Sea

Values above 3 use the surface palette, but otherwise act as though the mission were underwater.

See Also