Difference between revisions of "MISDATA.DAT"

From UFOpaedia
Jump to navigation Jump to search
 
(13 intermediate revisions by 5 users not shown)
Line 1: Line 1:
This 170 byte file (172 for TFTD) is only used by tactical saves. It comes in three flavours:<br><br>
+
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:<br><br>
  
 
*<b>MISSION.DAT</b><br>
 
*<b>MISSION.DAT</b><br>
Line 10: Line 10:
 
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.<br><br>
 
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.<br><br>
  
Values are presented according to byte offset (0 to 169/171) followed by the equivalent hex offset (00 to A9/AA) in <b>bold</b>. Let us know what else you can find!!
+
Values are presented according to byte offset ([[#0|0]] to [[#169|169]]/[[#171|171]]) followed by the equivalent hex offset ([[#0x00|0x00]] to [[#0xA9|0xA9]]/[[#0xAB|0xAB]]) in '''bold'''. Let us know what else you can find!!
  
 
== Structure ==
 
== Structure ==
  
The first 20 bytes are a count up of the various recoverable tile types in the map. They're only set if you actually won the mission by eliminating all enemy forces. These offsets + 100 index into the respecitve [[BASE.DAT]] values that need to be updated.
+
{| class="wikitable"
 +
|-
 +
!Offset<br>(Decimal)
 +
!Offset<br>(Hex)
 +
!Usage
 +
|-
 +
|colspan="3"|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.
 
See [[Equipment Recovery]] for more information.
 +
|- valign="top"
 +
!<span id="0-1"></span>0-1
 +
!<span id="0x00-0x01"></span>0x00-0x01
 +
|[[UFO Power Source]] ([[MCD#59|MCD[59]]] set to 02).
 +
|- valign="top"
 +
!<span id="2-3"></span>2-3
 +
!<span id="0x02-0x03"></span>0x02-0x03
 +
|[[UFO Navigation]] ([[MCD#59|MCD[59]]] set to 03, not counted for alien bases).
 +
|- valign="top"
 +
!<span id="4-5"></span>4-5
 +
!<span id="0x04-0x05"></span>0x04-0x05
 +
|[[UFO Construction]] ([[MCD#59|MCD[59]]] set to 04, no known tiles have this set).
 +
|- valign="top"
 +
!<span id="6-7"></span>6-7
 +
!<span id="0x06-0x07"></span>0x06-0x07
 +
|[[Alien Food]] ([[MCD#59|MCD[59]]] set to 05).
 +
|- valign="top"
 +
!<span id="8-9"></span>8-9
 +
!<span id="0x08-0x09"></span>0x08-0x09
 +
|[[Alien Reproduction]] ([[MCD#59|MCD[59]]] set to 06, no known tiles have this set).
 +
|- valign="top"
 +
!<span id="10-11"></span>10-11
 +
!<span id="0x0A-0x0B"></span>0x0A-0x0B
 +
|[[Alien Entertainment]] ([[MCD#59|MCD[59]]] set to 07).
 +
|- valign="top"
 +
!<span id="12-13"></span>12-13
 +
!<span id="0x0C-0x0D"></span>0x0C-0x0D
 +
|[[Alien Surgery]] ([[MCD#59|MCD[59]]] set to 08).
 +
|- valign="top"
 +
!<span id="14-15"></span>14-15
 +
!<span id="0x0E-0x0F"></span>0x0E-0x0F
 +
|[[Examination Room]] ([[MCD#59|MCD[59]]] set to 09).
 +
|- valign="top"
 +
!<span id="16-17"></span>16-17
 +
!<span id="0x10-0x11"></span>0x10-0x11
 +
|[[Alien Alloys]] ([[MCD#59|MCD[59]]] set to 10).
  
  <b>0-1/00-01:</b> [[UFO Power Source]]   (tiles with MCD[59] set to 02).
+
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.
  <b>2-3/02-03:</b> [[UFO Navigation]]     (tiles with MCD[59] set to 03).
+
|- valign="top"
              Not counted for alien bases.
+
!<span id="18-19"></span>18-19
  <b>4-5/04-05:</b> [[UFO Construction]]   (tiles with MCD[59] set to 04).  
+
!<span id="0x12-0x13"></span>0x12-0x13
              No known tiles have this set.
+
|[[Alien Habitat]] ([[MCD#59|MCD[59]]] set to 11, no known tiles have this set).
  <b>6-7/06-07:</b> [[Alien Food]]          (tiles with MCD[59] set to 05).
+
|- valign="top"
  <b>8-9/08-09:</b> [[Alien Reproduction]]  (tiles with MCD[59] set to 06).
+
!<span id="20-21"></span>20-21
              No known tiles have this set.
+
!<span id="0x14-0x15"></span>0x14-0x15
<b>10-11/0A-0B:</b> [[Alien Entertainment]] (tiles with MCD[59] set to 07).
+
|Mission descriptor. Possible values:
<b>12-13/0C-0D:</b> [[Alien Surgery]]      (tiles with MCD[59] set to 08).
+
<b>UFO</b>                             <b>TFTD</b>
<b>14-15/0E-0F:</b> [[Examination Room]]   (tiles with MCD[59] set to 09).
+
0: UFO Site                      0: Alien Sub Site
<b>16-17/10-11:</b> [[Alien Alloys]]       (tiles with MCD[59] set to 10).
+
1: Terror Site                  1: Port/Island Attack
              The total is divided by 2 for a UFO mission or 30 for an alien base.  
+
2: Base Defence (X-COM Base)    2: Base Defense (X-COM Base)
              The value stored here is further divided by 5 to get the result you
+
3: Base Offense (Alien Base)    3: Colony Stage 1
              see on the debriefing screen.
+
4: Mars Stage 1                  4: T'leth Stage 1
<b>18-19/12-13:</b> [[Alien Habitat]]       (tiles with MCD[59] set to 11).
+
5: Mars Stage 2                  5: T'leth Stage 2
              No known tiles have this set.
+
                                  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
 +
|-
 +
|colspan="3"|<span id="22-73"></span><span id="0x16-0x49"></span>Values <b>22-73</b> (Hex: <b>16-49</b>) 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]].
 +
|- valign="top"
 +
!<span id="22-23"></span>22-23
 +
!<span id="0x16-0x17"></span>0x16-0x17
 +
|Aliens killed.
 +
|- valign="top"
 +
!<span id="24-25"></span>24-25
 +
!<span id="0x18-0x19"></span>0x18-0x19
 +
|Aliens killed score.
 +
|- valign="top"
 +
!<span id="26-27"></span>26-27
 +
!<span id="0x1A-0x1B"></span>0x1A-0x1B
 +
|Alien corpses.
 +
|- valign="top"
 +
!<span id="28-29"></span>28-29
 +
!<span id="0x1C-0x1D"></span>0x1C-0x1D
 +
|Corpse score.
 +
|- valign="top"
 +
!<span id="30-31"></span>30-31
 +
!<span id="0x1E0x1F"></span>0x1E-0x1F
 +
|Live aliens captured.
 +
|- valign="top"
 +
!<span id="32-33"></span>32-33
 +
!<span id="0x20-0x21"></span>0x20-0x21
 +
|Live alien score.
 +
|- valign="top"
 +
!<span id="34-35"></span>34-35
 +
!<span id="0x22-0x23"></span>0x22-0x23
 +
|Artefacts (''unresearched'' alien items) recovered.
 +
|- valign="top"
 +
!<span id="36-37"></span>36-37
 +
!<span id="0x24-0x25"></span>0x24-0x25
 +
|Artefacts score.
 +
|- valign="top"
 +
!<span id="38-39"></span>38-39
 +
!<span id="0x26-0x27"></span>0x26-0x27
 +
|Alien base control destroyed. This flags if you win a [[Alien_Base_Assault|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.
 +
|- valign="top"
 +
!<span id="40-41"></span>40-41
 +
!<span id="0x28-0x29"></span>0x28-0x29
 +
|Base control score.
 +
|- valign="top"
 +
!<span id="42-43"></span>42-43
 +
!<span id="0x2A-0x2B"></span>0x2A-0x2B
 +
|Civilians killed by aliens.
 +
|- valign="top"
 +
!<span id="44-45"></span>44-45
 +
!<span id="0x2C-0x2D"></span>0x2C-0x2D
 +
|Civilians killed by aliens score (typically negative).
 +
|- valign="top"
 +
!<span id="46-47"></span>46-47
 +
!<span id="0x2E-0x2F"></span>0x2E-0x2F
 +
|Civilians killed by X-COM.
 +
|- valign="top"
 +
!<span id="48-49"></span>48-49
 +
!<span id="0x30-0x31"></span>0x30-0x31
 +
|Civilians killed by X-COM score (typically negative).
 +
|- valign="top"
 +
!<span id="50-51"></span>50-51
 +
!<span id="0x32-0x33"></span>0x32-0x33
 +
|Civilians saved.
 +
|- valign="top"
 +
!<span id="52-53"></span>52-53
 +
!<span id="0x34-0x35"></span>0x34-0x35
 +
|Civilians saved score.
 +
|- valign="top"
 +
!<span id="54-55"></span>54-55
 +
!<span id="0x36-0x37"></span>0x36-0x37
 +
|X-COM troopers killed.
 +
|- valign="top"
 +
!<span id="56-57"></span>56-57
 +
!<span id="0x38-0x39"></span>0x38-0x39
 +
|X-COM troopers killed score (typically negative).
 +
|- valign="top"
 +
!<span id="58-59"></span>58-59
 +
!<span id="0x3A-0x3B"></span>0x3A-0x3B
 +
|X-COM troopers "retired through injury" (never actually flags).
 +
|- valign="top"
 +
!<span id="60-61"></span>60-61
 +
!<span id="0x3C-0x3D"></span>0x3C-0x3D
 +
|X-COM troopers "retired through injury" score (never actually flags).
 +
|- valign="top"
 +
!<span id="62-63"></span>62-63
 +
!<span id="0x3E-0x3F"></span>0x3E-0x3F
 +
|X-COM troopers MIA.
 +
|- valign="top"
 +
!<span id="64-65"></span>64-65
 +
!<span id="0x40-0x41"></span>0x40-0x41
 +
|X-COM troopers MIA score (typically negative).
 +
|- valign="top"
 +
!<span id="66-67"></span>66-67
 +
!<span id="0x42-0x43"></span>0x42-0x43
 +
|Tanks lost.
 +
|- valign="top"
 +
!<span id="68-69"></span>68-69
 +
!<span id="0x44-0x45"></span>0x44-0x45
 +
|Tanks lost score (typically negative).
 +
|- valign="top"
 +
!<span id="70-71"></span>70-71
 +
!<span id="0x46-0x47"></span>0x46-0x47
 +
|X-COM craft lost (GeoScape ignores this if you actually lose a craft, Tactical sets it regardless).
 +
|- valign="top"
 +
!<span id="72-73"></span>72-73
 +
!<span id="0x48-0x49"></span>0x48-0x49
 +
|X-COM craft lost score (GeoScape ignores this if you actually lose a craft, Tactical doesn't set it regardless).
 +
|- valign="top"
 +
!<span id="74-75"></span>74-75
 +
!<span id="0x4A-0x4B"></span>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]].
 +
|- valign="top"
 +
!<span id="76"></span>76
 +
!<span id="0x4C"></span>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 [[Cydonia|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. - [[User:Bomb Bloke|Bomb Bloke]] 03:45, 23 June 2008 (PDT)''
 +
|- valign="top"
 +
!<span id="77"></span>77
 +
!<span id="0x4D"></span>0x4D
 +
|Index into [[CRAFT.DAT]] pointing to the craft sent on this mission. In the case of base defence (see offset [[#79|[79]]]), it indexes to the [[LOC.DAT]] record for the base in concern.
 +
|- valign="top"
 +
!<span id="78"></span>78
 +
!<span id="0x4E"></span>0x4E
 +
|Victory status.
  
<b>20-21/14-15:</b> Mission descriptor. Possible values:
+
  0: Mission aborted with some units in exit areas.
<b>UFO</b>                                      <b>TFTD</b>
 
  0: UFO Site                              0: USO Site
 
1: Terror Site                            1: Port/Island Attack
 
2: Base Defense (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 <b>22-73</b> (Hex: <b>16-49</b>) 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]].
 
 
 
<b>22-23/16-17:</b> Aliens killed.
 
 
 
<b>24-25/18-19:</b> Aliens killed score.
 
 
 
<b>26-27/1A-1B:</b> Alien corpses.
 
 
 
<b>28-29/1C-1D:</b> Corpse score.
 
 
 
<b>30-31/1E-1F:</b> Live aliens captured.
 
 
 
<b>32-33/20-21:</b> Live alien score.
 
 
 
<b>34-35/22-23:</b> Artefacts (unresearched alien items) recovered.
 
 
 
<b>36-37/24-25:</b> Artifacts score.
 
 
 
<b>38-39/26-27:</b> Alien base control destroyed. This flags if you win a [[Alien_Base_Assault|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.
 
 
 
<b>40-41/28-29:</b> Base control score.
 
 
 
<b>42-43/2A-2B:</b> Civilians killed by aliens.
 
 
 
<b>44-45/2C-2D:</b> Civilians killed by aliens score (typically negative).
 
 
 
<b>46-47/2E-2F:</b> Civilians killed by X-Com.
 
 
 
<b>48-49/30-31:</b> Civilians killed by X-Com score (typically negative).
 
 
 
<b>50-51/32-33:</b> Civilians saved.
 
 
 
<b>52-53/34-35:</b> Civilians saved score.
 
 
 
<b>54-55/36-37:</b> X-Com troopers killed.
 
 
 
<b>56-57/38-39:</b> X-Com troopers killed score (typically negative).
 
 
 
<b>58-59/3A-3B:</b> X-Com troopers "retired through injury" (never actually flags).
 
 
 
<b>60-61/3C-3D:</b> X-Com troopers "retired through injury" score (never actually flags).
 
 
 
<b>62-63/3E-3F:</b> X-Com troopers MIA.
 
 
 
<b>64-65/40-41:</b> X-Com troopers MIA score (typically negative).
 
 
 
<b>66-67/42-43:</b> Tanks lost.
 
 
 
<b>68-69/44-45:</b> Tanks lost score (typically negative).
 
 
 
<b>70-71/46-47:</b> X-Com craft lost (GeoScape ignores this if you actually lose a craft, Tactical sets it regardless).
 
 
 
<b>72-73/48-49:</b> X-Com craft lost score (GeoScape ignores this if you actually lose a craft, Tactical doesn't set it regardless).
 
 
 
<b>74-75/4A-4B:</b> 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]].
 
 
 
<b>76/4C:</b> 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 [[Cydonia|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. - [[User:Bomb Bloke|Bomb Bloke]] 03:45, 23 June 2008 (PDT)''
 
 
 
<b>77/4D:</b> Index into [[CRAFT.DAT]] pointing to the craft sent on this mission. In the case of base defense (see offset [79]), it indexes into [[BASE.DAT]].
 
 
 
<b>78/4E:</b> Victory status.
 
 
 
0: Mission aborted.
 
 
  1: Mission won.
 
  1: Mission won.
 
  2: Mission lost.
 
  2: Mission lost.
  3: Mission completely lost through abortion (no units in exit areas).
+
  3: Mission aborted with no units in exit areas.
 +
|- valign="top"
 +
!<span id="79"></span>79
 +
!<span id="0x4F"></span>0x4F
 +
|0 unless the mission is a UFO site, in which case it is 1. Determines use of [[#77|[77]]] but doesn't seem to affect [[#16-17|[16-17]]].
 +
|- valign="top"
 +
!<span id="80-151"></span>80-151
 +
!<span id="0x50-0x97"></span>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.
  
<b>79/4F:</b> 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].
+
At the end of battle, the tactical game engine tallies up the amount of [[Base_Defence#Destruction_Of_Base_Facilities|"target" objects]] existing within each module, and stores the results in "MISSION2.DAT". If that figure is 0 for any given destructible [[Base_Facilities_(EU)|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]]).
  
<b>80-151/50-97:</b> These 72 values are unknown (<i>I've never seen them flag. - [[User:Bomb Bloke|Bomb Bloke]] 20:32, 21 January 2008 (PST)</i>).
+
"Target objects" are tiles that have offset 60 set to 1 within their [[MCD]] record.
 
+
|-
The following bytes allow you to use the following equipment only if they are set to 1:
+
|colspan="3"|<span id="152-167"></span><span id="0x98-0xA7"></span>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 <i>that</i> requires research). The last three entries in the list are item slots that were never used in the game.
 
+
|'''TFTD'''
<b>152/98:</b> [[Heavy Plasma]]       (ObData[34])
+
|- valign="top"
<b>153/99:</b> [[Heavy Plasma Clip]] (ObData[35])
+
!<span id="152"></span>152
<b>154/9A:</b> [[Plasma Rifle]]       (ObData[36])
+
!<span id="0x98"></span>0x98
<b>155/9B:</b> [[Plasma Rifle Clip]] (ObData[37])
+
|Enables [[Heavy Plasma]] ([[OBDATA.DAT|ObData]][34])  
<b>156/9C:</b> [[Plasma Pistol]]     (ObData[38])
+
|[[Vibro_Blade|Vibroblade]]
<b>157/9D:</b> [[Plasma Pistol Clip]] (ObData[39])
+
|- valign="top"
<b>158/9E:</b> [[Blaster Launcher]]   (ObData[40])
+
!<span id="153"></span>153
<b>159/9F:</b> [[Blaster Bomb]]       (ObData[41])
+
!<span id="0x99"></span>0x99
<b>160/A0:</b> [[Small Launcher]]     (ObData[42])
+
|Enables [[Heavy Plasma Clip]] ([[OBDATA.DAT|ObData]][35])  
<b>161/A1:</b> [[Stun Bomb]]         (ObData[43])
+
|[[Thermic_Lance|Thermic Lance]]
<b>162/A2:</b> [[Alien Grenade]]     (ObData[44])
+
|- valign="top"
<b>163/A3:</b> [[Elerium-115]]       (ObData[45])
+
!<span id="154"></span>154
<b>164/A4:</b> [[Mind Probe]]         (ObData[46])
+
!<span id="0x9A"></span>0x9A
<b>165/A5:</b> null>>UNDEFINED << (ObData[47])
+
|Enables [[Plasma Rifle]] ([[OBDATA.DAT|ObData]][36])  
<b>166/A6:</b> null>> empty <<   (ObData[48])
+
|[[Heavy_Thermic_Lance|Heavy Thermic Lance]]
<b>167/A7:</b> null>> empty <<   (ObData[49])
+
|- valign="top"
 
+
!<span id="155"></span>155
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 <i>that</i> requires research). The last three entries in the list are item slots that were never used in the game.
+
!<span id="0x9B"></span>0x9B
 
+
|Enables [[Plasma Rifle Clip]] ([[OBDATA.DAT|ObData]][37])  
<b>168/A8:</b> 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.
+
|[[Sonic_Cannon|Sonic Cannon]]
 +
|- valign="top"
 +
!<span id="156"></span>156
 +
!<span id="0x9C"></span>0x9C
 +
|Enables [[Plasma Pistol]] ([[OBDATA.DAT|ObData]][38])  
 +
|Sonic Cannon Clip
 +
|- valign="top"
 +
!<span id="157"></span>157
 +
!<span id="0x9D"></span>0x9D
 +
|Enables [[Plasma Pistol Clip]] ([[OBDATA.DAT|ObData]][39])  
 +
|[[Sonic-Blasta_Rifle|Sonic-Blasta Rifle]]
 +
|- valign="top"
 +
!<span id="158"></span>158
 +
!<span id="0x9E"></span>0x9E
 +
|Enables [[Blaster Launcher]] ([[OBDATA.DAT|ObData]][40])  
 +
|Blasta Clip
 +
|- valign="top"
 +
!<span id="159"></span>159
 +
!<span id="0x9F"></span>0x9F
 +
|Enables [[Blaster Bomb]] ([[OBDATA.DAT|ObData]][41])  
 +
|[[Sonic_Pistol|Sonic Pistol]]
 +
|- valign="top"
 +
!<span id="160"></span>160
 +
!<span id="0xA0"></span>0xA0
 +
|Enables [[Small Launcher]] ([[OBDATA.DAT|ObData]][42])  
 +
|Sonic Pistol Clip
 +
|- valign="top"
 +
!<span id="161"></span>161
 +
!<span id="0xA1"></span>0xA1
 +
|Enables [[Stun Bomb]] ([[OBDATA.DAT|ObData]][43])  
 +
|[[Disruptor_Pulse_Launcher|Disruptor Pulse Launcher]]
 +
|- valign="top"
 +
!<span id="162"></span>162
 +
!<span id="0xA2"></span>0xA2
 +
|Enables [[Alien Grenade]] ([[OBDATA.DAT|ObData]][44])  
 +
|Disruptor Ammo
 +
|- valign="top"
 +
!<span id="163"></span>163
 +
!<span id="0xA3"></span>0xA3
 +
|Enables [[Elerium-115]] ([[OBDATA.DAT|ObData]][45])  
 +
|[[Thermal_Shok_Launcher|Thermal Shok Launcher]]
 +
|- valign="top"
 +
!<span id="164"></span>164
 +
!<span id="0xA4"></span>0xA4
 +
|Enables [[Mind Probe]] ([[OBDATA.DAT|ObData]][46])  
 +
|Thermal Shok Bomb
 +
|- valign="top"
 +
!<span id="165"></span>165
 +
!<span id="0xA5"></span>0xA5
 +
|Enables "null>>UNDEFINED <<" ([[OBDATA.DAT|ObData]][47])  
 +
|[[Sonic_Pulser|Sonic Pulsar]]
 +
|- valign="top"
 +
!<span id="166"></span>166
 +
!<span id="0xA6"></span>0xA6
 +
|Enables "null>> empty <<" ([[OBDATA.DAT|ObData]][48])
 +
|null
 +
|- valign="top"
 +
!<span id="167"></span>167
 +
!<span id="0xA7"></span>0xA7
 +
|Enables "null>> empty <<" ([[OBDATA.DAT|ObData]][49])  
 +
|[[M.C._Reader|M.C. Reader]]
 +
|- valign="top"
 +
!<span id="168-169"></span>168-169
 +
!<span id="0xA8-0xA9"></span>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
 
  0 - English
 
  1 - German
 
  1 - German
 
  2 - French
 
  2 - French
 
+
|- valign="top"
<b>169/A9:</b> Unknown, never seen it flag. Could be part of the above value.
+
!<span id="170-171"></span>170-171
 
+
!<span id="0xAA-0xAB"></span>0xAA-0xAB
<b>170/AA:</b> Only present for TFTD. Determines the depth level (that is, which [[PALETTES.DAT#TFTD Tactical Palettes|battlescape palette]] to use, whether to render air bubbles around units, and which background noise to play):
+
|Only present for TFTD. Determines the depth level (that is, which [[PALETTES.DAT#TFTD Tactical Palettes|battlescape palette]] to use, whether to render air bubbles around units, and which background noise to play):
  
 
  0 - Surface
 
  0 - Surface
Line 158: Line 322:
 
  3 - Deep Sea
 
  3 - Deep Sea
  
<b>171/AB:</b> Only present for TFTD. Unknown, never seen it flag. Could be part of the above value.
+
Values above 3 use the surface palette, but otherwise act as though the mission were underwater.
 +
|}
  
 
==See Also==
 
==See Also==
Line 164: Line 329:
 
* [[Saved Game Files]]
 
* [[Saved Game Files]]
 
* [[OBDATA.DAT]]
 
* [[OBDATA.DAT]]
* [[TERRAIN|MCD files]]
+
* [[MCD|MCD files]]
 
* [[WGLOB.DAT]]
 
* [[WGLOB.DAT]]
 
* [[CRAFT.DAT]]
 
* [[CRAFT.DAT]]
 
* [[BASE.DAT]]
 
* [[BASE.DAT]]
 
[[Category:Game Files]]
 
[[Category:Game Files]]
 +
[[Category:Enemy Unknown/UFO Defense]]

Latest revision as of 08:40, 23 March 2016

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:

  • MISSION.DAT

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

  • MISDATA.DAT

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

  • MISSION2.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!!

Structure

Offset
(Decimal)
Offset
(Hex)
Usage
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