MISDATA.DAT

From UFOpaedia
Revision as of 19:29, 5 May 2010 by Seb76 (talk | contribs) (→‎Structure: Language is indeed accessed/saved as a word (16bit))
Jump to navigation Jump to search

This 170 byte file (172 for TFTD) is only used by tactical saves. 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 (00 to A9/AA) in bold. Let us know what else you can find!!

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.

See Equipment Recovery for more information.

  0-1/00-01: UFO Power Source    (tiles with MCD[59] set to 02).
  2-3/02-03: UFO Navigation      (tiles with MCD[59] set to 03).
             Not counted for alien bases.
  4-5/04-05: UFO Construction    (tiles with MCD[59] set to 04). 
             No known tiles have this set.
  6-7/06-07: Alien Food          (tiles with MCD[59] set to 05).
  8-9/08-09: Alien Reproduction  (tiles with MCD[59] set to 06).
             No known tiles have this set.
10-11/0A-0B: Alien Entertainment (tiles with MCD[59] set to 07).
12-13/0C-0D: Alien Surgery       (tiles with MCD[59] set to 08).
14-15/0E-0F: Examination Room    (tiles with MCD[59] set to 09).
16-17/10-11: Alien Alloys        (tiles with 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/12-13: Alien Habitat       (tiles with MCD[59] set to 11).
             No known tiles have this set.

20-21/14-15: Mission descriptor. Possible values:

UFO                                       TFTD
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 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/16-17: Aliens killed.

24-25/18-19: Aliens killed score.

26-27/1A-1B: Alien corpses.

28-29/1C-1D: Corpse score.

30-31/1E-1F: Live aliens captured.

32-33/20-21: Live alien score.

34-35/22-23: Artefacts (unresearched alien items) recovered.

36-37/24-25: Artifacts score.

38-39/26-27: 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/28-29: Base control score.

42-43/2A-2B: Civilians killed by aliens.

44-45/2C-2D: Civilians killed by aliens score (typically negative).

46-47/2E-2F: Civilians killed by X-Com.

48-49/30-31: Civilians killed by X-Com score (typically negative).

50-51/32-33: Civilians saved.

52-53/34-35: Civilians saved score.

54-55/36-37: X-Com troopers killed.

56-57/38-39: X-Com troopers killed score (typically negative).

58-59/3A-3B: X-Com troopers "retired through injury" (never actually flags).

60-61/3C-3D: X-Com troopers "retired through injury" score (never actually flags).

62-63/3E-3F: X-Com troopers MIA.

64-65/40-41: X-Com troopers MIA score (typically negative).

66-67/42-43: Tanks lost.

68-69/44-45: Tanks lost score (typically negative).

70-71/46-47: X-Com craft lost (GeoScape ignores this if you actually lose a craft, Tactical sets it regardless).

72-73/48-49: X-Com craft lost score (GeoScape ignores this if you actually lose a craft, Tactical doesn't set it regardless).

74-75/4A-4B: 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/4C: 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/4D: 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.

78/4E: Victory status.

0: Mission aborted.
1: Mission won.
2: Mission lost.
3: Mission completely lost through abortion (no units in exit areas).

79/4F: 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/50-97: A list of 36 two-byte integers, used during base defense 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).

152-167/98-A7: The following bytes allow you to use the following equipment only if they are set to 1:

152/98: Heavy Plasma       (ObData[34])
153/99: Heavy Plasma Clip  (ObData[35])
154/9A: Plasma Rifle       (ObData[36])
155/9B: Plasma Rifle Clip  (ObData[37])
156/9C: Plasma Pistol      (ObData[38])
157/9D: Plasma Pistol Clip (ObData[39])
158/9E: Blaster Launcher   (ObData[40])
159/9F: Blaster Bomb       (ObData[41])
160/A0: Small Launcher     (ObData[42])
161/A1: Stun Bomb          (ObData[43])
162/A2: Alien Grenade      (ObData[44])
163/A3: Elerium-115        (ObData[45])
164/A4: Mind Probe         (ObData[46])
165/A5: null>>UNDEFINED << (ObData[47])
166/A6: null>> empty <<    (ObData[48])
167/A7: null>> empty <<    (ObData[49])

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.

168-169/A8-A9: 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/AA: 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

171/AB: Only present for TFTD. Unknown, never seen it flag. Could be part of the above value.

See Also