Difference between revisions of "UNITREF.DAT"
Bomb Bloke (talk | contribs) m (Of course) |
Bomb Bloke (talk | contribs) (Let's merge UNIREF/UNIREF2) |
||
Line 1: | Line 1: | ||
− | + | A [[Saved Game Files|save game file]] that has a record size of 124 bytes for UFO, or 132 for TFTD. Values are unsigned unless otherwise stated. Some bytes represent bitfields. There are 80 records (not all of them necessarily used) for a fixed file size of 9,920 bytes (or 10,560 for TFTD). It goes hand in hand with [[UNITPOS.DAT]]. |
|
+ | |||
+ | Comes in three flavours:<br><br> |
||
+ | |||
+ | *<b>UNIREF.DAT</b><br> |
||
+ | Initially created by the GeoScape engine before tactical battles. Stored in the [[Saved_Game_Files#Missdat_Files|MISSDAT]] folder and contains info on all units that will be present in the coming mission (in an alive state - the deaths of aliens killed by exploding UFO power units isn't determined until [[Battlescape_Map_Generation#KABOOM.21.21|later]]). Unlike the other two versions, this only contains the bare minimum number of records required to store the units it details.<br><br> |
||
+ | |||
+ | *<b>UNITREF.DAT</b><br> |
||
+ | Created along with a [[Saved_Game_Files#Battlescape_Files|battlescape save]], contains the mid-mission state of the unit table.<br><br> |
||
+ | |||
+ | *<b>UNIREF2.DAT</b><br> |
||
+ | Appears in the [[Saved_Game_Files#Missdat_Files|MISSDAT]] folder at the end of combat. Used to determine which troopers/tanks survived, statistic gains via [[experience]], and which aliens need to be hauled off to the [[Alien Containment]] unit.<br><br> |
||
+ | |||
+ | Values are presented according to byte offset ([[#0|0]] to [[#123|123]] (or [[#131|131]] for TFTD)) followed by the equivalent hex offset ([[#0x00|0x00]] to [[#0x7B|0x7B]] (or [[#0x83|0x83]] for TFTD)). Notes apply to both UFO and TFTD unless otherwise stated. Let us know what else you can find - refer to the [[#Notes|bottom of the page]] for those values that're unknown, or to the [[Talk:UNITREF.DAT|talk page]] for further ideas as to what they could be. |
||
− | Values are presented according to byte offset ([[#0|0]] to [[#123|123]]) followed by the equivalent hex offset ([[#0x00|0x00]] to [[#0x7B|0x7B]]) in <b>bold</b>. Notes to both UFO and TFTD unless otherwise stated. Let us know what else you can find!! |
||
== Structure == |
== Structure == |
||
{| class="wikitable" |
{| class="wikitable" |
||
+ | |- |
||
− | |- align="center" |
||
!Offset<br>(Decimal) |
!Offset<br>(Decimal) |
||
!Offset<br>(Hex) |
!Offset<br>(Hex) |
||
!Usage |
!Usage |
||
+ | |- valign="top" |
||
− | |- |
||
!<span id="0"></span>0 |
!<span id="0"></span>0 |
||
!<span id="0x00"></span>0x00 |
!<span id="0x00"></span>0x00 |
||
Line 36: | Line 48: | ||
<blockquote>If the corresponding [[UNITPOS.DAT]] record is unused, then the record is unused.</blockquote> |
<blockquote>If the corresponding [[UNITPOS.DAT]] record is unused, then the record is unused.</blockquote> |
||
+ | |- valign="top" |
||
− | |- |
||
!<span id="1"></span>1 |
!<span id="1"></span>1 |
||
!<span id="0x01"></span>0x01 |
!<span id="0x01"></span>0x01 |
||
Line 44: | Line 56: | ||
2: Power suit. |
2: Power suit. |
||
3: Flying suit. |
3: Flying suit. |
||
+ | |- valign="top" |
||
− | |- |
||
!<span id="2-5"></span>2-5 |
!<span id="2-5"></span>2-5 |
||
!<span id="0x02-0x05"></span>0x02-0x05 |
!<span id="0x02-0x05"></span>0x02-0x05 |
||
|Four byte value pointing to RAM location of the [[Image_Formats#PCK|PCK set]] used by the unit. Re-determined when the save game is loaded. |
|Four byte value pointing to RAM location of the [[Image_Formats#PCK|PCK set]] used by the unit. Re-determined when the save game is loaded. |
||
+ | |- valign="top" |
||
− | |- |
||
!<span id="6-9"></span>6-9 |
!<span id="6-9"></span>6-9 |
||
!<span id="0x06-0x09"></span>0x06-0x09 |
!<span id="0x06-0x09"></span>0x06-0x09 |
||
|Four byte value pointing to RAM location of the [[Image_Formats#PCK|TAB index for the PCK data]] used by the unit. Re-determined when the save game is loaded. |
|Four byte value pointing to RAM location of the [[Image_Formats#PCK|TAB index for the PCK data]] used by the unit. Re-determined when the save game is loaded. |
||
+ | |- valign="top" |
||
− | |- |
||
!<span id="10"></span>10 |
!<span id="10"></span>10 |
||
!<span id="0x0A"></span>0x0A |
!<span id="0x0A"></span>0x0A |
||
− | |Unit facing. Does NOT control HWP turret direction; see [[#24|[ |
+ | |Unit facing. Does NOT control HWP turret direction; see [[#24|[24]]]. |
0: North (up right) |
0: North (up right) |
||
1: Northeast (right) |
1: Northeast (right) |
||
Line 64: | Line 76: | ||
6: West (up left) |
6: West (up left) |
||
7: Northwest (up) |
7: Northwest (up) |
||
+ | |- valign="top" |
||
− | |- |
||
!<span id="11"></span>11 |
!<span id="11"></span>11 |
||
!<span id="0x0B"></span>0x0B |
!<span id="0x0B"></span>0x0B |
||
Line 71: | Line 83: | ||
1: Sliding |
1: Sliding |
||
2: Flying |
2: Flying |
||
+ | |- valign="top" |
||
− | |- |
||
!<span id="12"></span>12 |
!<span id="12"></span>12 |
||
!<span id="0x0C"></span>0x0C |
!<span id="0x0C"></span>0x0C |
||
|Current TUs. |
|Current TUs. |
||
+ | |- valign="top" |
||
− | |- |
||
!<span id="13"></span>13 |
!<span id="13"></span>13 |
||
!<span id="0x0D"></span>0x0D |
!<span id="0x0D"></span>0x0D |
||
Line 85: | Line 97: | ||
: ''While the game kills characters when Health<=Fatal Wounds (__ dies message), XComUtil will recover them based if their health is greater than 0. Haven't tested an unmodified game. --[[User:Zaimoni|Zaimoni]] 11:52, 14 April 2007 (CDT)'' |
: ''While the game kills characters when Health<=Fatal Wounds (__ dies message), XComUtil will recover them based if their health is greater than 0. Haven't tested an unmodified game. --[[User:Zaimoni|Zaimoni]] 11:52, 14 April 2007 (CDT)'' |
||
+ | |- valign="top" |
||
− | |- |
||
!<span id="14"></span>14 |
!<span id="14"></span>14 |
||
!<span id="0x0E"></span>0x0E |
!<span id="0x0E"></span>0x0E |
||
|Current Stun level ''how much falloff of paralysis every turn? What determines it?'' |
|Current Stun level ''how much falloff of paralysis every turn? What determines it?'' |
||
+ | |- valign="top" |
||
− | |- |
||
!<span id="15"></span>15 |
!<span id="15"></span>15 |
||
!<span id="0x0F"></span>0x0F |
!<span id="0x0F"></span>0x0F |
||
|Current Energy |
|Current Energy |
||
+ | |- valign="top" |
||
− | |- |
||
!<span id="16"></span>16 |
!<span id="16"></span>16 |
||
!<span id="0x10"></span>0x10 |
!<span id="0x10"></span>0x10 |
||
|Current Reactions ''NKF: affected by health percentage'' |
|Current Reactions ''NKF: affected by health percentage'' |
||
+ | |- valign="top" |
||
− | |- |
||
!<span id="17"></span>17 |
!<span id="17"></span>17 |
||
!<span id="0x11"></span>0x11 |
!<span id="0x11"></span>0x11 |
||
|Strength |
|Strength |
||
+ | |- valign="top" |
||
− | |- |
||
!<span id="18"></span>18 |
!<span id="18"></span>18 |
||
!<span id="0x12"></span>0x12 |
!<span id="0x12"></span>0x12 |
||
|Current Front Armour |
|Current Front Armour |
||
+ | |- valign="top" |
||
− | |- |
||
!<span id="19"></span>19 |
!<span id="19"></span>19 |
||
!<span id="0x13"></span>0x13 |
!<span id="0x13"></span>0x13 |
||
|Current Left Armour |
|Current Left Armour |
||
+ | |- valign="top" |
||
− | |- |
||
!<span id="20"></span>20 |
!<span id="20"></span>20 |
||
!<span id="0x14"></span>0x14 |
!<span id="0x14"></span>0x14 |
||
|Current Right Armour |
|Current Right Armour |
||
+ | |- valign="top" |
||
− | |- |
||
!<span id="21"></span>21 |
!<span id="21"></span>21 |
||
!<span id="0x15"></span>0x15 |
!<span id="0x15"></span>0x15 |
||
|Current Rear Armour |
|Current Rear Armour |
||
+ | |- valign="top" |
||
− | |- |
||
!<span id="22"></span>22 |
!<span id="22"></span>22 |
||
!<span id="0x16"></span>0x16 |
!<span id="0x16"></span>0x16 |
||
|Current Under Armour |
|Current Under Armour |
||
+ | |- valign="top" |
||
− | |- |
||
|colspan="3"|<b><i>"Base" means the original (total) value (as carried forward from geoscape) - Also see Note 1 re: Base soldier stat values.</i></b> |
|colspan="3"|<b><i>"Base" means the original (total) value (as carried forward from geoscape) - Also see Note 1 re: Base soldier stat values.</i></b> |
||
+ | |- valign="top" |
||
− | |- |
||
!<span id="23"></span>23 |
!<span id="23"></span>23 |
||
!<span id="0x17"></span>0x17 |
!<span id="0x17"></span>0x17 |
||
|Base Firing accuracy. Current value = this * [[#13|[13]]]/[[#26|[26]]] (percent health) |
|Base Firing accuracy. Current value = this * [[#13|[13]]]/[[#26|[26]]] (percent health) |
||
+ | |- valign="top" |
||
− | |- |
||
!<span id="24"></span>24 |
!<span id="24"></span>24 |
||
!<span id="0x18"></span>0x18 |
!<span id="0x18"></span>0x18 |
||
Line 133: | Line 145: | ||
<b>Note:</b> Tanks (turreted units?) always have 0 throwing accuracy. They use this for turret facing, relative to unit facing. 0 means it's facing forwards. Additional values are clockwise increments; see [[#10|[10]]]. |
<b>Note:</b> Tanks (turreted units?) always have 0 throwing accuracy. They use this for turret facing, relative to unit facing. 0 means it's facing forwards. Additional values are clockwise increments; see [[#10|[10]]]. |
||
+ | |- valign="top" |
||
− | |- |
||
!<span id="25"></span>25 |
!<span id="25"></span>25 |
||
!<span id="0x19"></span>0x19 |
!<span id="0x19"></span>0x19 |
||
|Base TUs |
|Base TUs |
||
+ | |- valign="top" |
||
− | |- |
||
!<span id="26"></span>26 |
!<span id="26"></span>26 |
||
!<span id="0x1A"></span>0x1A |
!<span id="0x1A"></span>0x1A |
||
|Base Health |
|Base Health |
||
+ | |- valign="top" |
||
− | |- |
||
!<span id="27"></span>27 |
!<span id="27"></span>27 |
||
!<span id="0x1B"></span>0x1B |
!<span id="0x1B"></span>0x1B |
||
|Base Energy |
|Base Energy |
||
+ | |- valign="top" |
||
− | |- |
||
!<span id="28"></span>28 |
!<span id="28"></span>28 |
||
!<span id="0x1C"></span>0x1C |
!<span id="0x1C"></span>0x1C |
||
|Base Reactions |
|Base Reactions |
||
+ | |- valign="top" |
||
− | |- |
||
|colspan="3"|''These Base Armour values are used to show the starting armor value in the Attributes screen (so you can readily see if it's been damaged'' |
|colspan="3"|''These Base Armour values are used to show the starting armor value in the Attributes screen (so you can readily see if it's been damaged'' |
||
+ | |- valign="top" |
||
− | |- |
||
!<span id="29"></span>29 |
!<span id="29"></span>29 |
||
!<span id="0x1D"></span>0x1D |
!<span id="0x1D"></span>0x1D |
||
|Base Front Armour |
|Base Front Armour |
||
+ | |- valign="top" |
||
− | |- |
||
!<span id="30"></span>30 |
!<span id="30"></span>30 |
||
!<span id="0x1E"></span>0x1E |
!<span id="0x1E"></span>0x1E |
||
|Base Left Armour |
|Base Left Armour |
||
+ | |- valign="top" |
||
− | |- |
||
!<span id="31"></span>31 |
!<span id="31"></span>31 |
||
!<span id="0x1F"></span>0x1F |
!<span id="0x1F"></span>0x1F |
||
|Base Right Armour |
|Base Right Armour |
||
+ | |- valign="top" |
||
− | |- |
||
!<span id="32"></span>32 |
!<span id="32"></span>32 |
||
!<span id="0x20"></span>0x20 |
!<span id="0x20"></span>0x20 |
||
|Base Rear Armour |
|Base Rear Armour |
||
+ | |- valign="top" |
||
− | |- |
||
!<span id="33"></span>33 |
!<span id="33"></span>33 |
||
!<span id="0x21"></span>0x21 |
!<span id="0x21"></span>0x21 |
||
|Base Under Armour |
|Base Under Armour |
||
+ | |- valign="top" |
||
− | |- |
||
!<span id="34"></span>34 |
!<span id="34"></span>34 |
||
!<span id="0x22"></span>0x22 |
!<span id="0x22"></span>0x22 |
||
|Always 0? |
|Always 0? |
||
+ | |- valign="top" |
||
− | |- |
||
!<span id="35"></span>35 |
!<span id="35"></span>35 |
||
!<span id="0x23"></span>0x23 |
!<span id="0x23"></span>0x23 |
||
|Energy to recharge each turn. Equals '''recruit initial''' TUs/3 ([[SOLDIER.DAT]][43], '''not''' total base TUs). This is a signed byte. See [[Time Units]] and [[Energy#Usage|Energy Usage]]; also see [[#45|[45]]] (energy usage when walking/turning). ''BombBloke: Is this affected by damage?'' |
|Energy to recharge each turn. Equals '''recruit initial''' TUs/3 ([[SOLDIER.DAT]][43], '''not''' total base TUs). This is a signed byte. See [[Time Units]] and [[Energy#Usage|Energy Usage]]; also see [[#45|[45]]] (energy usage when walking/turning). ''BombBloke: Is this affected by damage?'' |
||
+ | |- valign="top" |
||
− | |- |
||
!<span id="36"></span>36 |
!<span id="36"></span>36 |
||
!<span id="0x24"></span>0x24 |
!<span id="0x24"></span>0x24 |
||
|Always 0? |
|Always 0? |
||
+ | |- valign="top" |
||
− | |- |
||
!<span id="37"></span>37 |
!<span id="37"></span>37 |
||
!<span id="0x25"></span>0x25 |
!<span id="0x25"></span>0x25 |
||
|Psi skill. Psi stats not displayed/usable until this is greater then 0. |
|Psi skill. Psi stats not displayed/usable until this is greater then 0. |
||
+ | |- valign="top" |
||
− | |- |
||
!<span id="38"></span>38 |
!<span id="38"></span>38 |
||
!<span id="0x26"></span>0x26 |
!<span id="0x26"></span>0x26 |
||
Line 197: | Line 209: | ||
Actually, I do not even want to think about what would happen if you 'prime' a grenade/stunned body. |
Actually, I do not even want to think about what would happen if you 'prime' a grenade/stunned body. |
||
+ | |- valign="top" |
||
− | |- |
||
!<span id="39"></span>39 |
!<span id="39"></span>39 |
||
!<span id="0x27"></span>0x27 |
!<span id="0x27"></span>0x27 |
||
Line 208: | Line 220: | ||
with [[Rank]] Bonus as follows: SGT +1, CPT +3, COL +6, CDR +10 |
with [[Rank]] Bonus as follows: SGT +1, CPT +3, COL +6, CDR +10 |
||
Note that although this equation holds true, the value is not actually computed per se. Instead, 1 is added directly to it each mission, as is a rank-bonus delta if you advance (e.g. COL to CDR, delta +4). In other words, hacking the Missions or Rank fields does not affect this value. |
Note that although this equation holds true, the value is not actually computed per se. Instead, 1 is added directly to it each mission, as is a rank-bonus delta if you advance (e.g. COL to CDR, delta +4). In other words, hacking the Missions or Rank fields does not affect this value. |
||
+ | |- valign="top" |
||
− | |- |
||
!<span id="40"></span>40 |
!<span id="40"></span>40 |
||
!<span id="0x28"></span>0x28 |
!<span id="0x28"></span>0x28 |
||
|Index into [[SOLDIER.DAT]], so game knows what to update. 255 = does not belong to anyone (i.e., it's not a soldier). ''NKF: This byte is critical for player controlled units. If this doesn't refer to anything, the unit ceases to exist at the end of the game. If it points to a valid soldier entry in soldier.dat, the soldier.dat entry will be updated.'' |
|Index into [[SOLDIER.DAT]], so game knows what to update. 255 = does not belong to anyone (i.e., it's not a soldier). ''NKF: This byte is critical for player controlled units. If this doesn't refer to anything, the unit ceases to exist at the end of the game. If it points to a valid soldier entry in soldier.dat, the soldier.dat entry will be updated.'' |
||
+ | |- valign="top" |
||
− | |- |
||
!<span id="41"></span>41 |
!<span id="41"></span>41 |
||
!<span id="0x29"></span>0x29 |
!<span id="0x29"></span>0x29 |
||
|Animation frame counter for the unit. Used by eg [[Celatid]]s and [[Silacoid]]s. |
|Animation frame counter for the unit. Used by eg [[Celatid]]s and [[Silacoid]]s. |
||
+ | |- valign="top" |
||
− | |- |
||
!<span id="42"></span>42 |
!<span id="42"></span>42 |
||
!<span id="0x2A"></span>0x2A |
!<span id="0x2A"></span>0x2A |
||
Line 243: | Line 255: | ||
1: Hover |
1: Hover |
||
''I don't see 255 set for three dead mutons in a current game... [[#13|[13]]] (Health=0) seems to be the only reliable death indicator for them. Compare [[#120|[120]]]. -[[User:MikeTheRed|MikeTheRed]]'' |
''I don't see 255 set for three dead mutons in a current game... [[#13|[13]]] (Health=0) seems to be the only reliable death indicator for them. Compare [[#120|[120]]]. -[[User:MikeTheRed|MikeTheRed]]'' |
||
+ | |- valign="top" |
||
− | |- |
||
!<span id="43"></span>43 |
!<span id="43"></span>43 |
||
!<span id="0x2B"></span>0x2B |
!<span id="0x2B"></span>0x2B |
||
Line 249: | Line 261: | ||
''MTR: If the next byte is "aggression", and civvies and sectoids have a 1 here, could this be "cowardliness"? Likelihood to panic; to do something dumb/random? We've all seen civvies running around in a mad / random panic.'' |
''MTR: If the next byte is "aggression", and civvies and sectoids have a 1 here, could this be "cowardliness"? Likelihood to panic; to do something dumb/random? We've all seen civvies running around in a mad / random panic.'' |
||
+ | |- valign="top" |
||
− | |- |
||
!<span id="44"></span>44 |
!<span id="44"></span>44 |
||
!<span id="0x2C"></span>0x2C |
!<span id="0x2C"></span>0x2C |
||
|Alien aggression. The higher it is, the less likely an alien will take cover. Maximum of 2. ''MTR: This is true for aliens in Hobbes game, but soldiers have values from 4 to 254. Garbage? Delete this comment if so.'' |
|Alien aggression. The higher it is, the less likely an alien will take cover. Maximum of 2. ''MTR: This is true for aliens in Hobbes game, but soldiers have values from 4 to 254. Garbage? Delete this comment if so.'' |
||
+ | |- valign="top" |
||
− | |- |
||
!<span id="45"></span>45 |
!<span id="45"></span>45 |
||
!<span id="0x2D"></span>0x2D |
!<span id="0x2D"></span>0x2D |
||
|Used to calculate energy loss when walking or turning as: INT( TUs / 2<sup>[45]</sup> ). See [[Energy#Usage]]; compare [[#35|[35]]] (energy recharge per turn). Set this byte to 4 to ensure no energy use whatsoever (maximum map [[Time Units#Time_Unit_Walking_Usage_Tables|tile TU cost]] is 12). ''In Hobbes game, many aliens are 0 and all soldiers are 1, but a dozen aliens have higher values ranging all the way up to 112! Garbage and/or the game doesn't care if they are garbage?'' |
|Used to calculate energy loss when walking or turning as: INT( TUs / 2<sup>[45]</sup> ). See [[Energy#Usage]]; compare [[#35|[35]]] (energy recharge per turn). Set this byte to 4 to ensure no energy use whatsoever (maximum map [[Time Units#Time_Unit_Walking_Usage_Tables|tile TU cost]] is 12). ''In Hobbes game, many aliens are 0 and all soldiers are 1, but a dozen aliens have higher values ranging all the way up to 112! Garbage and/or the game doesn't care if they are garbage?'' |
||
+ | |- valign="top" |
||
− | |- |
||
!<span id="46"></span>46 |
!<span id="46"></span>46 |
||
!<span id="0x2E"></span>0x2E |
!<span id="0x2E"></span>0x2E |
||
− | |HWP turret image. Only used (and only appears) if unit type [[#0|[ |
+ | |HWP turret image. Only used (and only appears) if unit type [[#0|[0]]]=3 (X-COM tanks): |
0: Cannon |
0: Cannon |
||
1: Rocket |
1: Rocket |
||
Line 268: | Line 280: | ||
5,6: ? Blanks |
5,6: ? Blanks |
||
'''Note:''' For non-tanks, this controls the inventory layout. ''Only'' 0 and 1 are valid. 0 is the standard layout seen on all soldiers. 1 is an alternate layout that may have been intended for custom tank equipment. Larger values only crash the game due to missing files. Also see [[#113|[113]]] and [[#117|[117]]]. |
'''Note:''' For non-tanks, this controls the inventory layout. ''Only'' 0 and 1 are valid. 0 is the standard layout seen on all soldiers. 1 is an alternate layout that may have been intended for custom tank equipment. Larger values only crash the game due to missing files. Also see [[#113|[113]]] and [[#117|[117]]]. |
||
+ | |- valign="top" |
||
− | |- |
||
!<span id="47"></span>47 |
!<span id="47"></span>47 |
||
!<span id="0x2F"></span>0x2F |
!<span id="0x2F"></span>0x2F |
||
|This is a direct copy of offset[48] from the [[MCD]] record of the tile the unit is standing on. A signed byte. |
|This is a direct copy of offset[48] from the [[MCD]] record of the tile the unit is standing on. A signed byte. |
||
+ | |- valign="top" |
||
− | |- |
||
!<span id="48"></span>48 |
!<span id="48"></span>48 |
||
!<span id="0x30"></span>0x30 |
!<span id="0x30"></span>0x30 |
||
Line 312: | Line 324: | ||
Note that causing an X-Com soldier to kneel causes their cross section to fall by 36.36~% of that of when they are standing. |
Note that causing an X-Com soldier to kneel causes their cross section to fall by 36.36~% of that of when they are standing. |
||
+ | |- valign="top" |
||
− | |- |
||
!<span id="49"></span>49 |
!<span id="49"></span>49 |
||
!<span id="0x31"></span>0x31 |
!<span id="0x31"></span>0x31 |
||
|[[height|Standing height]]. |
|[[height|Standing height]]. |
||
+ | |- valign="top" |
||
− | |- |
||
!<span id="50"></span>50 |
!<span id="50"></span>50 |
||
!<span id="0x32"></span>0x32 |
!<span id="0x32"></span>0x32 |
||
|[[height|Kneeling height]]. |
|[[height|Kneeling height]]. |
||
+ | |- valign="top" |
||
− | |- |
||
!<span id="51"></span>51 |
!<span id="51"></span>51 |
||
!<span id="0x33"></span>0x33 |
!<span id="0x33"></span>0x33 |
||
|Floating [[height]]. A unit 'floats' this high above the ground, thus allowing shots to fly underneath. The heighest point of a unit can be found by adding this to the units height stat. <i>Does this have an effect on explosive damage?</i> |
|Floating [[height]]. A unit 'floats' this high above the ground, thus allowing shots to fly underneath. The heighest point of a unit can be found by adding this to the units height stat. <i>Does this have an effect on explosive damage?</i> |
||
+ | |- valign="top" |
||
− | |- |
||
!<span id="52"></span>52 |
!<span id="52"></span>52 |
||
!<span id="0x34"></span>0x34 |
!<span id="0x34"></span>0x34 |
||
|Always the same as [[#48|[48]]] in all known saved games. XCOMmies are trying to test its significance, as seen at [[Talk:UNITREF.DAT#Offsets_0x30_.26_0x34|Talk:UNITREF.DAT#Offsets_0x30_&_0x34]] ([48] and [52]). |
|Always the same as [[#48|[48]]] in all known saved games. XCOMmies are trying to test its significance, as seen at [[Talk:UNITREF.DAT#Offsets_0x30_.26_0x34|Talk:UNITREF.DAT#Offsets_0x30_&_0x34]] ([48] and [52]). |
||
+ | |- valign="top" |
||
− | |- |
||
!<span id="53"></span>53 |
!<span id="53"></span>53 |
||
!<span id="0x35"></span>0x35 |
!<span id="0x35"></span>0x35 |
||
|Image index for item in left hand. 255 for none. Indexes into [[OBDATA.DAT]], not [[OBPOS.DAT]]. |
|Image index for item in left hand. 255 for none. Indexes into [[OBDATA.DAT]], not [[OBPOS.DAT]]. |
||
+ | |- valign="top" |
||
− | |- |
||
!<span id="54"></span>54 |
!<span id="54"></span>54 |
||
!<span id="0x36"></span>0x36 |
!<span id="0x36"></span>0x36 |
||
|Image index for item in right hand. 255 for none. Indexes into [[OBDATA.DAT]], not [[OBPOS.DAT]]. |
|Image index for item in right hand. 255 for none. Indexes into [[OBDATA.DAT]], not [[OBPOS.DAT]]. |
||
+ | |- valign="top" |
||
− | |- |
||
|colspan="3"|''NKF:'' If there is no item in the unit's hands, but one of the above two bytes are set, the 'image' that represents the item will still be displayed in the battlescape. If these phantom items are clicked on, the game crashes. If the image is not the right type for the real item in hand, the ammo count doesn't get displayed. Otherwise, it'll work as normal. |
|colspan="3"|''NKF:'' If there is no item in the unit's hands, but one of the above two bytes are set, the 'image' that represents the item will still be displayed in the battlescape. If these phantom items are clicked on, the game crashes. If the image is not the right type for the real item in hand, the ammo count doesn't get displayed. Otherwise, it'll work as normal. |
||
+ | |- valign="top" |
||
− | |- |
||
!<span id="55"></span>55 |
!<span id="55"></span>55 |
||
!<span id="0x37"></span>0x37 |
!<span id="0x37"></span>0x37 |
||
Line 360: | Line 372: | ||
'''12''' Cyberdisc |
'''12''' Cyberdisc |
||
'''13''' Zombie |
'''13''' Zombie |
||
+ | |- valign="top" |
||
− | |- |
||
!<span id="56"></span>56 |
!<span id="56"></span>56 |
||
!<span id="0x38"></span>0x38 |
!<span id="0x38"></span>0x38 |
||
|[[Melee Accuracy]] ([[SOLDIER.DAT]] bytes 50 (initial) & 60 (increase) added together) |
|[[Melee Accuracy]] ([[SOLDIER.DAT]] bytes 50 (initial) & 60 (increase) added together) |
||
+ | |- valign="top" |
||
− | |- |
||
!<span id="57"></span>57 |
!<span id="57"></span>57 |
||
!<span id="0x39"></span>0x39 |
!<span id="0x39"></span>0x39 |
||
|[[Psionic Strength]] |
|[[Psionic Strength]] |
||
+ | |- valign="top" |
||
− | |- |
||
!<span id="58"></span>58 |
!<span id="58"></span>58 |
||
!<span id="0x3A"></span>0x3A |
!<span id="0x3A"></span>0x3A |
||
|Current [[Morale]]. Base morale is hardcoded to 100. |
|Current [[Morale]]. Base morale is hardcoded to 100. |
||
+ | |- valign="top" |
||
− | |- |
||
!<span id="59"></span>59 |
!<span id="59"></span>59 |
||
!<span id="0x3B"></span>0x3B |
!<span id="0x3B"></span>0x3B |
||
|[[Bravery]] = 110 - (10 * ''this value'') |
|[[Bravery]] = 110 - (10 * ''this value'') |
||
+ | |- valign="top" |
||
− | |- |
||
!<span id="60"></span>60 |
!<span id="60"></span>60 |
||
!<span id="0x3C"></span>0x3C |
!<span id="0x3C"></span>0x3C |
||
Line 384: | Line 396: | ||
2: Running |
2: Running |
||
3: Berserk |
3: Berserk |
||
+ | |- valign="top" |
||
− | |- |
||
!<span id="61"></span>61 |
!<span id="61"></span>61 |
||
!<span id="0x3D"></span>0x3D |
!<span id="0x3D"></span>0x3D |
||
Line 391: | Line 403: | ||
4: Soldiers, civs, and all other aliens (but Hobbes had no Large aliens) |
4: Soldiers, civs, and all other aliens (but Hobbes had no Large aliens) |
||
30: Tank/Laser |
30: Tank/Laser |
||
+ | |- valign="top" |
||
− | |- |
||
!<span id="62"></span>62 |
!<span id="62"></span>62 |
||
!<span id="0x3E"></span>0x3E |
!<span id="0x3E"></span>0x3E |
||
|Visibility via motion scanner. The bigger it is, the bigger the blip. Test this one out for values. |
|Visibility via motion scanner. The bigger it is, the bigger the blip. Test this one out for values. |
||
+ | |- valign="top" |
||
− | |- |
||
!<span id="63"></span>63 |
!<span id="63"></span>63 |
||
!<span id="0x3F"></span>0x3F |
!<span id="0x3F"></span>0x3F |
||
|Number of [[Fatal Wounds]] to head. |
|Number of [[Fatal Wounds]] to head. |
||
+ | |- valign="top" |
||
− | |- |
||
!<span id="64"></span>64 |
!<span id="64"></span>64 |
||
!<span id="0x40"></span>0x40 |
!<span id="0x40"></span>0x40 |
||
|Number of fatal wounds to torso. |
|Number of fatal wounds to torso. |
||
+ | |- valign="top" |
||
− | |- |
||
!<span id="65"></span>65 |
!<span id="65"></span>65 |
||
!<span id="0x41"></span>0x41 |
!<span id="0x41"></span>0x41 |
||
|Number of fatal wounds to right arm. |
|Number of fatal wounds to right arm. |
||
+ | |- valign="top" |
||
− | |- |
||
!<span id="66"></span>66 |
!<span id="66"></span>66 |
||
!<span id="0x42"></span>0x42 |
!<span id="0x42"></span>0x42 |
||
|Number of fatal wounds to left arm. |
|Number of fatal wounds to left arm. |
||
+ | |- valign="top" |
||
− | |- |
||
!<span id="67"></span>67 |
!<span id="67"></span>67 |
||
!<span id="0x43"></span>0x43 |
!<span id="0x43"></span>0x43 |
||
|Number of fatal wounds to right leg. |
|Number of fatal wounds to right leg. |
||
+ | |- valign="top" |
||
− | |- |
||
!<span id="68"></span>68 |
!<span id="68"></span>68 |
||
!<span id="0x44"></span>0x44 |
!<span id="0x44"></span>0x44 |
||
|Number of fatal wounds to left leg. |
|Number of fatal wounds to left leg. |
||
+ | |- valign="top" |
||
− | |- |
||
!<span id="69-70"></span>69-70 |
!<span id="69-70"></span>69-70 |
||
!<span id="0x45-0x46"></span>0x45-0x46 |
!<span id="0x45-0x46"></span>0x45-0x46 |
||
Line 427: | Line 439: | ||
::Byte 70 is the index of the node of the end of the planned move. |
::Byte 70 is the index of the node of the end of the planned move. |
||
:Note that the move may be multi-turn, and byte 69 is not guaranteed to update during a multi-turn move. I think it will if the alien ends its move on a node, however. -- Zaimoni |
:Note that the move may be multi-turn, and byte 69 is not guaranteed to update during a multi-turn move. I think it will if the alien ends its move on a node, however. -- Zaimoni |
||
+ | |- valign="top" |
||
− | |- |
||
!<span id="71"></span>71 |
!<span id="71"></span>71 |
||
!<span id="0x47"></span>0x47 |
!<span id="0x47"></span>0x47 |
||
|''NKF:'' Always 16 for XCom units, 1 for cyberdisc, 0 for others? Perhaps involves mobile lighting - see the [[Talk:UNITREF.DAT#Offset_0x47|Talk]] page. |
|''NKF:'' Always 16 for XCom units, 1 for cyberdisc, 0 for others? Perhaps involves mobile lighting - see the [[Talk:UNITREF.DAT#Offset_0x47|Talk]] page. |
||
+ | |- valign="top" |
||
− | |- |
||
!<span id="72"></span>72 |
!<span id="72"></span>72 |
||
!<span id="0x48"></span>0x48 |
!<span id="0x48"></span>0x48 |
||
|The amount of [[Morale]] that has been restored using the [[Medi-Kit (EU)|Medkit's]] painkillers. The amount that ''can'' be restored is equal to the maximum health of the unit (index 26) minus their current health (index 13) further minus this. |
|The amount of [[Morale]] that has been restored using the [[Medi-Kit (EU)|Medkit's]] painkillers. The amount that ''can'' be restored is equal to the maximum health of the unit (index 26) minus their current health (index 13) further minus this. |
||
+ | |- valign="top" |
||
− | |- |
||
!<span id="73"></span>73 |
!<span id="73"></span>73 |
||
!<span id="0x49"></span>0x49 |
!<span id="0x49"></span>0x49 |
||
|Intelligence. Rated from 2 - 8. Indicates for how many turns the alien will know the location of spotted soldiers. ''Hey - why do humans have zero intelligence? :('' |
|Intelligence. Rated from 2 - 8. Indicates for how many turns the alien will know the location of spotted soldiers. ''Hey - why do humans have zero intelligence? :('' |
||
+ | |- valign="top" |
||
− | |- |
||
!<span id="74"></span>74 |
!<span id="74"></span>74 |
||
!<span id="0x4A"></span>0x4A |
!<span id="0x4A"></span>0x4A |
||
Line 445: | Line 457: | ||
''MikeTheRed:'' XCOMs always have 0, but Mutons have values of 0-3 (usually 0 or 2, and often fluctuating) in a firing squad situation. |
''MikeTheRed:'' XCOMs always have 0, but Mutons have values of 0-3 (usually 0 or 2, and often fluctuating) in a firing squad situation. |
||
+ | |- valign="top" |
||
− | |- |
||
!<span id="75"></span>75 |
!<span id="75"></span>75 |
||
!<span id="0x4B"></span>0x4B |
!<span id="0x4B"></span>0x4B |
||
|Always 0? |
|Always 0? |
||
+ | |- valign="top" |
||
− | |- |
||
!<span id="76-77"></span>76-77 |
!<span id="76-77"></span>76-77 |
||
!<span id="0x4C-0x4D"></span>0x4C-0x4D |
!<span id="0x4C-0x4D"></span>0x4C-0x4D |
||
|Mission count. Signed integer (low byte, high byte) also found in [[SOLDIER.DAT]] ''MTR: Wonder why they bothered to put this in Unitref since this will never change '''during''' a mission; compare how soldier stats are actually read from SOLDIER (not UNITREF) on return to geoscape. Is Missions shown anywhere on the combatscape? |
|Mission count. Signed integer (low byte, high byte) also found in [[SOLDIER.DAT]] ''MTR: Wonder why they bothered to put this in Unitref since this will never change '''during''' a mission; compare how soldier stats are actually read from SOLDIER (not UNITREF) on return to geoscape. Is Missions shown anywhere on the combatscape? |
||
+ | |- valign="top" |
||
− | |- |
||
!<span id="78-79"></span>78-79 |
!<span id="78-79"></span>78-79 |
||
!<span id="0x4E-0x4F"></span>0x4E-0x4F |
!<span id="0x4E-0x4F"></span>0x4E-0x4F |
||
|Kill count. Signed integer (low byte, high byte) also found in [[SOLDIER.DAT]]. Number of kills this unit has made for ALL missions, not just this one. This one '''can''' vary "unpredictably" and thus is the only byte known to directly carry forward into the geoscape / Soldier.Dat! |
|Kill count. Signed integer (low byte, high byte) also found in [[SOLDIER.DAT]]. Number of kills this unit has made for ALL missions, not just this one. This one '''can''' vary "unpredictably" and thus is the only byte known to directly carry forward into the geoscape / Soldier.Dat! |
||
+ | |- valign="top" |
||
− | |- |
||
!<span id="80"></span>80 |
!<span id="80"></span>80 |
||
!<span id="0x50"></span>0x50 |
!<span id="0x50"></span>0x50 |
||
Line 463: | Line 475: | ||
''NKF:'' Where does death by fire (overexposure rather than incendiary shell impact) fit into the experience counters? It becomes a non-assigned kill, I guess, like death by wounds, or death by a grenade that hasn't got an owner? |
''NKF:'' Where does death by fire (overexposure rather than incendiary shell impact) fit into the experience counters? It becomes a non-assigned kill, I guess, like death by wounds, or death by a grenade that hasn't got an owner? |
||
+ | |- valign="top" |
||
− | |- |
||
!<span id="81"></span>81 |
!<span id="81"></span>81 |
||
!<span id="0x51"></span>0x51 |
!<span id="0x51"></span>0x51 |
||
|[[Firing Accuracy]] experience counter, for number of hits on an enemy (lethal or not, grenades or bullets). Each Autoshot hit counts as 1, so you can get 3 hits from one Autoshot burst. Likewise, grenades and blaster bombs can hit multiple targets with one explosion. Also, if you miss the intended target but hit a different alien, it still counts. Finally, if your shot actually has zero [[Damage]], it does still count as a hit. (Not due to armor blockage; a pure roll of 0 coming out of the gun.) |
|[[Firing Accuracy]] experience counter, for number of hits on an enemy (lethal or not, grenades or bullets). Each Autoshot hit counts as 1, so you can get 3 hits from one Autoshot burst. Likewise, grenades and blaster bombs can hit multiple targets with one explosion. Also, if you miss the intended target but hit a different alien, it still counts. Finally, if your shot actually has zero [[Damage]], it does still count as a hit. (Not due to armor blockage; a pure roll of 0 coming out of the gun.) |
||
+ | |- valign="top" |
||
− | |- |
||
!<span id="82"></span>82 |
!<span id="82"></span>82 |
||
!<span id="0x52"></span>0x52 |
!<span id="0x52"></span>0x52 |
||
|[[Melee Accuracy]] experience counter, for number of times stun rod has been used (not stun bombs). |
|[[Melee Accuracy]] experience counter, for number of times stun rod has been used (not stun bombs). |
||
+ | |- valign="top" |
||
− | |- |
||
!<span id="83"></span>83 |
!<span id="83"></span>83 |
||
!<span id="0x53"></span>0x53 |
!<span id="0x53"></span>0x53 |
||
|[[Throwing Accuracy]] experience counter, for number of times unit has thrown any object. |
|[[Throwing Accuracy]] experience counter, for number of times unit has thrown any object. |
||
+ | |- valign="top" |
||
− | |- |
||
!<span id="84"></span>84 |
!<span id="84"></span>84 |
||
!<span id="0x54"></span>0x54 |
!<span id="0x54"></span>0x54 |
||
|<div id="Psi_Skill_Experience_Counter"></div>[[Psionic Skill]] experience counter, for number of psi attacks performed. 1 is added if attempt was unsuccessful, 3 if it was successful. Note: if this value goes over 255, all psi experience is lost. That's 85 successful psis (255/3). So be careful of marathon psi'ing (a minimum of 43 turns at 2 psis/turn, 29 turns at 3/turn). |
|<div id="Psi_Skill_Experience_Counter"></div>[[Psionic Skill]] experience counter, for number of psi attacks performed. 1 is added if attempt was unsuccessful, 3 if it was successful. Note: if this value goes over 255, all psi experience is lost. That's 85 successful psis (255/3). So be careful of marathon psi'ing (a minimum of 43 turns at 2 psis/turn, 29 turns at 3/turn). |
||
+ | |- valign="top" |
||
− | |- |
||
!<span id="85"></span>85 |
!<span id="85"></span>85 |
||
!<span id="0x55"></span>0x55 |
!<span id="0x55"></span>0x55 |
||
|[[Bravery]] experience counter, for number of times unit has ''resisted'' panicking, despite Morale < 50. Being mind-controlled, panicking, or going berserk does ''not'' increase this stat -- although Panic Unit attacks will reduce Morale to the point where panic checks will be performed by the game. |
|[[Bravery]] experience counter, for number of times unit has ''resisted'' panicking, despite Morale < 50. Being mind-controlled, panicking, or going berserk does ''not'' increase this stat -- although Panic Unit attacks will reduce Morale to the point where panic checks will be performed by the game. |
||
+ | |- valign="top" |
||
− | |- |
||
!<span id="86-111"></span>86-111 |
!<span id="86-111"></span>86-111 |
||
!<span id="0x56-0x6F"></span>0x56-0x6F |
!<span id="0x56-0x6F"></span>0x56-0x6F |
||
|Unit's <b>Name</b>. Standard string ended by null byte. The rest can hold garbage. |
|Unit's <b>Name</b>. Standard string ended by null byte. The rest can hold garbage. |
||
+ | |- valign="top" |
||
− | |- |
||
!<span id="112"></span>112 |
!<span id="112"></span>112 |
||
!<span id="0x70"></span>0x70 |
!<span id="0x70"></span>0x70 |
||
|0; sometimes 1 for aliens. |
|0; sometimes 1 for aliens. |
||
+ | |- valign="top" |
||
− | |- |
||
!<span id="113"></span>113 |
!<span id="113"></span>113 |
||
!<span id="0x71"></span>0x71 |
!<span id="0x71"></span>0x71 |
||
Line 504: | Line 516: | ||
[[#1|[1]]] actually determines the inventory screen used, might be worth playing with that. [[#46|[46]]] determines the layout. |
[[#1|[1]]] actually determines the inventory screen used, might be worth playing with that. [[#46|[46]]] determines the layout. |
||
+ | |- valign="top" |
||
− | |- |
||
!<span id="114"></span>114 |
!<span id="114"></span>114 |
||
!<span id="0x72"></span>0x72 |
!<span id="0x72"></span>0x72 |
||
|If not 0, then unit is on fire, and will burn for this amount of turns. |
|If not 0, then unit is on fire, and will burn for this amount of turns. |
||
+ | |- valign="top" |
||
− | |- |
||
!<span id="115"></span>115 |
!<span id="115"></span>115 |
||
!<span id="0x73"></span>0x73 |
!<span id="0x73"></span>0x73 |
||
|Gender: 0 = male, 1 = female. |
|Gender: 0 = male, 1 = female. |
||
+ | |- valign="top" |
||
− | |- |
||
!<span id="116"></span>116 |
!<span id="116"></span>116 |
||
!<span id="0x74"></span>0x74 |
!<span id="0x74"></span>0x74 |
||
Line 520: | Line 532: | ||
2: Asian |
2: Asian |
||
3: Black |
3: Black |
||
+ | |- valign="top" |
||
− | |- |
||
!<span id="117"></span>117 |
!<span id="117"></span>117 |
||
!<span id="0x75"></span>0x75 |
!<span id="0x75"></span>0x75 |
||
Line 540: | Line 552: | ||
Also see [[#46|[46]]], [[#113|[113]]], and [[#118|[118]]]. |
Also see [[#46|[46]]], [[#113|[113]]], and [[#118|[118]]]. |
||
+ | |- valign="top" |
||
− | |- |
||
!<span id="118"></span>118 |
!<span id="118"></span>118 |
||
!<span id="0x76"></span>0x76 |
!<span id="0x76"></span>0x76 |
||
|Ammo for [[#117|[117]]] turret weapon |
|Ammo for [[#117|[117]]] turret weapon |
||
+ | |- valign="top" |
||
− | |- |
||
!<span id="119"></span>119 |
!<span id="119"></span>119 |
||
!<span id="0x77"></span>0x77 |
!<span id="0x77"></span>0x77 |
||
Line 568: | Line 580: | ||
11000000 192 Celatid |
11000000 192 Celatid |
||
11111110 254 Muton |
11111110 254 Muton |
||
+ | |- valign="top" |
||
− | |- |
||
!<span id="120"></span>120 |
!<span id="120"></span>120 |
||
!<span id="0x78"></span>0x78 |
!<span id="0x78"></span>0x78 |
||
Line 588: | Line 600: | ||
What if a hovertank is half on the ground, half in the air? What about a treaded tank, or large alien unit? What about units in lifts? |
What if a hovertank is half on the ground, half in the air? What about a treaded tank, or large alien unit? What about units in lifts? |
||
+ | |- valign="top" |
||
− | |- |
||
!<span id="121"></span>121 |
!<span id="121"></span>121 |
||
!<span id="0x79"></span>0x79 |
!<span id="0x79"></span>0x79 |
||
|Possible Values: 0 or 16. All units in unitref.dat get a value of 0 except for the second unit in the list which gets 16. Doesn't matter if the second unit is a soldier, a tank, or an alien. It's always 16. Editing it to 0 doesn't crash the game or have any dire consequences. |
|Possible Values: 0 or 16. All units in unitref.dat get a value of 0 except for the second unit in the list which gets 16. Doesn't matter if the second unit is a soldier, a tank, or an alien. It's always 16. Editing it to 0 doesn't crash the game or have any dire consequences. |
||
+ | |- valign="top" |
||
− | |- |
||
!<span id="122"></span>122 |
!<span id="122"></span>122 |
||
!<span id="0x7A"></span>0x7A |
!<span id="0x7A"></span>0x7A |
||
|Always 0? |
|Always 0? |
||
+ | |- valign="top" |
||
− | |- |
||
!<span id="123"></span>123 |
!<span id="123"></span>123 |
||
!<span id="0x7B"></span>0x7B |
!<span id="0x7B"></span>0x7B |
||
|Always 0? |
|Always 0? |
||
+ | |- valign="top" |
||
− | |- |
||
!<span id="124"></span>124 |
!<span id="124"></span>124 |
||
!<span id="0x7C"></span>0x7C |
!<span id="0x7C"></span>0x7C |
||
|TFTD ONLY - Appears to be a count as to which frame of bubbles the soldier is on. Can be 0 to 16 (0x0F), most likely 125/7D is included with this. |
|TFTD ONLY - Appears to be a count as to which frame of bubbles the soldier is on. Can be 0 to 16 (0x0F), most likely 125/7D is included with this. |
||
+ | |- valign="top" |
||
− | |- |
||
!<span id="125"></span>125 |
!<span id="125"></span>125 |
||
!<span id="0x7D"></span>0x7D |
!<span id="0x7D"></span>0x7D |
||
|TFTD ONLY, unknown. |
|TFTD ONLY, unknown. |
||
+ | |- valign="top" |
||
− | |- |
||
!<span id="126"></span>126 |
!<span id="126"></span>126 |
||
!<span id="0x7E"></span>0x7E |
!<span id="0x7E"></span>0x7E |
||
|TFTD ONLY, unknown. |
|TFTD ONLY, unknown. |
||
+ | |- valign="top" |
||
− | |- |
||
!<span id="127"></span>127 |
!<span id="127"></span>127 |
||
!<span id="0x7F"></span>0x7F |
!<span id="0x7F"></span>0x7F |
||
|TFTD ONLY, unknown. |
|TFTD ONLY, unknown. |
||
+ | |- valign="top" |
||
− | |- |
||
!<span id="128"></span>128 |
!<span id="128"></span>128 |
||
!<span id="0x80"></span>0x80 |
!<span id="0x80"></span>0x80 |
||
|TFTD ONLY, unknown. |
|TFTD ONLY, unknown. |
||
+ | |- valign="top" |
||
− | |- |
||
!<span id="129"></span>129 |
!<span id="129"></span>129 |
||
!<span id="0x81"></span>0x81 |
!<span id="0x81"></span>0x81 |
||
|TFTD ONLY, unknown. |
|TFTD ONLY, unknown. |
||
+ | |- valign="top" |
||
− | |- |
||
!<span id="130"></span>130 |
!<span id="130"></span>130 |
||
!<span id="0x82"></span>0x82 |
!<span id="0x82"></span>0x82 |
||
|TFTD ONLY, unknown. |
|TFTD ONLY, unknown. |
||
+ | |- valign="top" |
||
− | |- |
||
!<span id="131"></span>131 |
!<span id="131"></span>131 |
||
!<span id="0x83"></span>0x83 |
!<span id="0x83"></span>0x83 |
Revision as of 14:11, 24 February 2011
A save game file that has a record size of 124 bytes for UFO, or 132 for TFTD. Values are unsigned unless otherwise stated. Some bytes represent bitfields. There are 80 records (not all of them necessarily used) for a fixed file size of 9,920 bytes (or 10,560 for TFTD). It goes hand in hand with UNITPOS.DAT.
Comes in three flavours:
- UNIREF.DAT
Initially created by the GeoScape engine before tactical battles. Stored in the MISSDAT folder and contains info on all units that will be present in the coming mission (in an alive state - the deaths of aliens killed by exploding UFO power units isn't determined until later). Unlike the other two versions, this only contains the bare minimum number of records required to store the units it details.
- UNITREF.DAT
Created along with a battlescape save, contains the mid-mission state of the unit table.
- UNIREF2.DAT
Appears in the MISSDAT folder at the end of combat. Used to determine which troopers/tanks survived, statistic gains via experience, and which aliens need to be hauled off to the Alien Containment unit.
Values are presented according to byte offset (0 to 123 (or 131 for TFTD)) followed by the equivalent hex offset (0x00 to 0x7B (or 0x83 for TFTD)). Notes apply to both UFO and TFTD unless otherwise stated. Let us know what else you can find - refer to the bottom of the page for those values that're unknown, or to the talk page for further ideas as to what they could be.
Structure
Offset (Decimal) |
Offset (Hex) |
Usage |
---|---|---|
0 | 0x00 | Type of unit. Unit scream and movement sound effects are based on this and gender. Gender and flying abilities affect the sprites as well. Not turrets. Specifically: [53] & [54] (weapons in hands), [115] (gender) and [120] (other flags) affect the final screen image. If the unit is a large unit, this will also determine the appearance of the last three quarters of the unit. This does NOT affect: the flying ability of the unit, the soldier image in the inventory screen, or the special abilities for certain aliens.
UFO TFTD 0: Male/female unarmored X-COM soldier 0: Male/female unarmored X-COM diver 1: Male/female personal armor soldier 1: Male/female plastic armor diver 2: Power/flying suit soldier 2: Power/flying suit diver 3: Tank 3: Tank 4: Sectoid 4: Aquatoid 5: Snakeman 5: Gillman 6: Ethereal 6: Lobster Man 7: Muton 7: Tasoth 8: Floater 8: Calcinite 9: Celatid 9: Deep One 10: Silacoid 10: BioDrone 11: Chryssalid 11: Tentaculat 12: Reaper 12: Triscene 13: Sectopod 13: Hallucinoid 14: Cyberdisc 14: Xarquid 15: Male civilian 15: Male civilians 16: Female civilian 16: Female civilians 17: Zombie 17: Zombie 18: Unused (but it made the sound of a tank?) 255: Unused
|
1 | 0x01 | Inventory paper doll image. File "UFOGRAPH\MAN_"+(char)(value + 48)+".SPK" will be used as the inventory sprite, unless the value is 0 or 1. In those cases, [115] and [116] are used to determine the picture.
0: No armor. 1: Personal armour. 2: Power suit. 3: Flying suit. |
2-5 | 0x02-0x05 | Four byte value pointing to RAM location of the PCK set used by the unit. Re-determined when the save game is loaded. |
6-9 | 0x06-0x09 | Four byte value pointing to RAM location of the TAB index for the PCK data used by the unit. Re-determined when the save game is loaded. |
10 | 0x0A | Unit facing. Does NOT control HWP turret direction; see [24].
0: North (up right) 1: Northeast (right) 2: East (down right) 3: Southeast (down) 4: South (down left) 5: Southwest (left) 6: West (up left) 7: Northwest (up) |
11 | 0x0B | Movement type. When entering a given map location, each tile is checked to see the TU requirements accordingly. MCD[39+UnitRef[11]] is the offset used. Note: By default, this is 0 for ALL unit types.
0: Walking 1: Sliding 2: Flying |
12 | 0x0C | Current TUs. |
13 | 0x0D | Current Health. Health of 0 = Dead. Compare [42], [120].
For my Bravery experience point testing, I killed 15 of 16 aliens by setting this to zero, and my soldiers to 0 Morale. When I loaded the savegame, the aliens were still "alive" (i.e., up), then all died when I ended this turn. So death is probably only checked when injury happens, and at end of turn... to truly kill them dead on the ground through savegame editing must take more. And arg - when they all died, my soldiers all went to 100 Morale! So I edited them back to 0 Morale. But guess what... then all the aliens died again at the end of next turn, even though they were all on the ground (I heard screams, and all soldiers' Morale went to 100 again). What the heck? The aliens stayed down after that, though. --MikeTheRed 16:01, 3 November 2006 (PST) Update: UNITPOS.DAT offset 10 bit 2 should be used to kill a unit entirely dead. Thanks, NKF & BB - MTR
|
14 | 0x0E | Current Stun level how much falloff of paralysis every turn? What determines it? |
15 | 0x0F | Current Energy |
16 | 0x10 | Current Reactions NKF: affected by health percentage |
17 | 0x11 | Strength |
18 | 0x12 | Current Front Armour |
19 | 0x13 | Current Left Armour |
20 | 0x14 | Current Right Armour |
21 | 0x15 | Current Rear Armour |
22 | 0x16 | Current Under Armour |
"Base" means the original (total) value (as carried forward from geoscape) - Also see Note 1 re: Base soldier stat values. | ||
23 | 0x17 | Base Firing accuracy. Current value = this * [13]/[26] (percent health) |
24 | 0x18 | Base Throwing accuracy. Current value = this * [13]/[26] (percent health)
Note: Tanks (turreted units?) always have 0 throwing accuracy. They use this for turret facing, relative to unit facing. 0 means it's facing forwards. Additional values are clockwise increments; see [10]. |
25 | 0x19 | Base TUs |
26 | 0x1A | Base Health |
27 | 0x1B | Base Energy |
28 | 0x1C | Base Reactions |
These Base Armour values are used to show the starting armor value in the Attributes screen (so you can readily see if it's been damaged | ||
29 | 0x1D | Base Front Armour |
30 | 0x1E | Base Left Armour |
31 | 0x1F | Base Right Armour |
32 | 0x20 | Base Rear Armour |
33 | 0x21 | Base Under Armour |
34 | 0x22 | Always 0? |
35 | 0x23 | Energy to recharge each turn. Equals recruit initial TUs/3 (SOLDIER.DAT[43], not total base TUs). This is a signed byte. See Time Units and Energy Usage; also see [45] (energy usage when walking/turning). BombBloke: Is this affected by damage? |
36 | 0x24 | Always 0? |
37 | 0x25 | Psi skill. Psi stats not displayed/usable until this is greater then 0. |
38 | 0x26 | Item to create when unit is unconscious/dead (index into obdata.dat).
NKF: If you set this value to that of a usable item, the item that is created in place of the unconscious or dead soldier can be used like the ordinary item. Elerium pods, for example, can be recovered for 50 elerium each after the battle. Weapons can be used as you normally use them, etc. For unconscious 'units', the item will be treated as the unconscious body - it will retain the name of the unconscious unit when looked at via the inventory screen. Picking up and using the 'item' will work, but when the unit wakes up, the 'item' image in the soldier's hands is not cleared, even though the item no longer 'exists' in the soldier's hands. Using this 'item' will just crash the battlescape. Actually, I do not even want to think about what would happen if you 'prime' a grenade/stunned body. |
39 | 0x27 | "Soldier value" a.k.a. victory points. You gain (or lose, as the case may be) score at the end of combat according to this value when the unit dies.
20 + Missions + Rank Bonus with Rank Bonus as follows: SGT +1, CPT +3, COL +6, CDR +10 Note that although this equation holds true, the value is not actually computed per se. Instead, 1 is added directly to it each mission, as is a rank-bonus delta if you advance (e.g. COL to CDR, delta +4). In other words, hacking the Missions or Rank fields does not affect this value. |
40 | 0x28 | Index into SOLDIER.DAT, so game knows what to update. 255 = does not belong to anyone (i.e., it's not a soldier). NKF: This byte is critical for player controlled units. If this doesn't refer to anything, the unit ceases to exist at the end of the game. If it points to a valid soldier entry in soldier.dat, the soldier.dat entry will be updated. |
41 | 0x29 | Animation frame counter for the unit. Used by eg Celatids and Silacoids. |
42 | 0x2A | Rank. Affects morale loss and interface icon (hull for tanks). Only X-COM troopers display rank icons.
X-COM 0: Rookie Civvies are 0 too 1: Squaddie 2: Sergeant 3: Captain 4: Colonel 5: Commander 255: Dead/unused Aliens 1: Commander 2: Leader 3: Engineer 4: Medic 5: Navigator 6: Soldier 7: Terrorist 255: Dead/unused Hull shape for X-COM tanks: 0: Treaded 1: Hover I don't see 255 set for three dead mutons in a current game... [13] (Health=0) seems to be the only reliable death indicator for them. Compare [120]. -MikeTheRed |
43 | 0x2B | 0 or 1? In Hobbes' savegame, civvies and sectoids are 1. All others are 0 (soldiers, aliens, terrorists, tank).
MTR: If the next byte is "aggression", and civvies and sectoids have a 1 here, could this be "cowardliness"? Likelihood to panic; to do something dumb/random? We've all seen civvies running around in a mad / random panic. |
44 | 0x2C | Alien aggression. The higher it is, the less likely an alien will take cover. Maximum of 2. MTR: This is true for aliens in Hobbes game, but soldiers have values from 4 to 254. Garbage? Delete this comment if so. |
45 | 0x2D | Used to calculate energy loss when walking or turning as: INT( TUs / 2[45] ). See Energy#Usage; compare [35] (energy recharge per turn). Set this byte to 4 to ensure no energy use whatsoever (maximum map tile TU cost is 12). In Hobbes game, many aliens are 0 and all soldiers are 1, but a dozen aliens have higher values ranging all the way up to 112! Garbage and/or the game doesn't care if they are garbage? |
46 | 0x2E | HWP turret image. Only used (and only appears) if unit type [0]=3 (X-COM tanks):
0: Cannon 1: Rocket 2: Laser 3: Plasma 4: Blaster 5,6: ? Blanks Note: For non-tanks, this controls the inventory layout. Only 0 and 1 are valid. 0 is the standard layout seen on all soldiers. 1 is an alternate layout that may have been intended for custom tank equipment. Larger values only crash the game due to missing files. Also see [113] and [117]. |
47 | 0x2F | This is a direct copy of offset[48] from the MCD record of the tile the unit is standing on. A signed byte. |
48 | 0x30 | Values for this byte always equal [52] and are:
2 (3x3 square; legacy 5 pixels): Sectoid 3 (5x5 square, corners removed; legacy 7 pixels): Celatid, Chryssalid, Civvie, Ethereal, Floater, Muton, Snake, Soldier 4 (7x7 octagon; legacy 9 pixels): Cyberdisc, Hovertank, Reaper, Sectopod, Tank 5 (9x9 square, Ls with 3-pixel legs removed; legacy 11 pixels): Silacoid Based on copious research by Bomb_Bloke, Seb76, Zombie, and others, this has been found to be a LOF Template look-up for the shape of targets; Loftemps 2 to 5 define the "3D" shape of units relative to Line Of Fire as a cylinder, where 2 (Sectoid) is a thin cylinder and 5 (Silacoid) is very wide. The pixel width of each "silhoutte" that LOFTEMPS.DAT corresponds to has been added to the list above (see LOFTemps images 2-5). Tiles are 16 pixels wide in the X or Y direction (that's what this byte is about), and 24 pixels high (compare [49]). This cylindrical shape is used in conjunction with height [49] to define the silhouette that targets present to a shooter. Combine the pixel-width cross-section from Loftemps with height to find the cross-sectional area presented to shooters (sorted on increasing cross-section): LOF LOF Cross Percent Lookup Width Height Section of 384 Float 4x? Type UR[48] Pixels UR[49] Pxls X Ht (16x24) UR[51] ---- ------ ------ ------ --------- ------- ------ --- Sectoid 2 5 16 80 20.8% - - Celatid 3 7 12 84 21.9% 6 - Soldier (Kneeling) 3 7 14 98 25.5% - - Hovertank 4 9 12 108 28.1% 6 Yes Silacoid 5 11 10 110 28.6% - - Snakeman 3 7 18 126 32.8% - - Zombie 3 7 18 126 32.8% - - Ethereal 3 7 20 140 36.5% - - Cyberdisc 4 9 15 135 35.2% 2 Yes Chryssalid 3 7 21 147 38.3% - - Civilian 3 7 21 147 38.3% 2 - Floater 3 7 21 147 38.3% 2 - Muton 3 7 21 147 38.3% - - Tank 4 9 16 144 37.5% - Yes Soldier 3 7 22 154 40.1% - - Reaper 4 9 23 207 53.9% - Yes Sectopod 4 9 23 207 53.9% - Yes Units take up an amount of the whole tile (as seen in cross-section by a shooter) as shown in the "Percent of 384" column. In reality, though, the accuracy of shots makes this a more complex topic than the percents suggest. Also, dividing by 384 is an oversimplification, since it implies a directly rectangular shot (shooting right down the X or Y axis). While it's useful to see, keep in mind that this column only shows relative numbers.
The unit Float number ([51], below) is shown simply for convenience. It does not enter into the cross-sectional computations. "4x" units actually consist of four units grouped in tight 2x2 formation (making their cross section effectively much larger then the percentage stated). Note that causing an X-Com soldier to kneel causes their cross section to fall by 36.36~% of that of when they are standing. |
49 | 0x31 | Standing height. |
50 | 0x32 | Kneeling height. |
51 | 0x33 | Floating height. A unit 'floats' this high above the ground, thus allowing shots to fly underneath. The heighest point of a unit can be found by adding this to the units height stat. Does this have an effect on explosive damage? |
52 | 0x34 | Always the same as [48] in all known saved games. XCOMmies are trying to test its significance, as seen at Talk:UNITREF.DAT#Offsets_0x30_&_0x34 ([48] and [52]). |
53 | 0x35 | Image index for item in left hand. 255 for none. Indexes into OBDATA.DAT, not OBPOS.DAT. |
54 | 0x36 | Image index for item in right hand. 255 for none. Indexes into OBDATA.DAT, not OBPOS.DAT. |
NKF: If there is no item in the unit's hands, but one of the above two bytes are set, the 'image' that represents the item will still be displayed in the battlescape. If these phantom items are clicked on, the game crashes. If the image is not the right type for the real item in hand, the ammo count doesn't get displayed. Otherwise, it'll work as normal. | ||
55 | 0x37 | Damage Modifier Category
This field is simply a look-up table, or more directly, a way to categorize the units into similar groups. The actual modifiers are listed in the executable. A value of 1 indicates the first DM category, a value of 4 indicates the 4th, etc. The values of 2 and 3 are not seen in the alien stats as they refer to X-COM soldier armor info. I'm not sure about 13 as the Zombie's stats haven't been found yet, but I think there is a category in the DM's for it. Value Unit Type(s) 0 Terrain and Items 1 Civilian, Sectoid, Celatid, Floater 2 Personal Armor 3 Power Suit, Flying Suit 4 Tanks, Hovertanks 5 Snakemen 6 Ethereal 7 Muton 8 Silacoid 9 Chryssalid 10 Reaper 11 Sectopod 12 Cyberdisc 13 Zombie |
56 | 0x38 | Melee Accuracy (SOLDIER.DAT bytes 50 (initial) & 60 (increase) added together) |
57 | 0x39 | Psionic Strength |
58 | 0x3A | Current Morale. Base morale is hardcoded to 100. |
59 | 0x3B | Bravery = 110 - (10 * this value) |
60 | 0x3C | Panic mode. This takes effect at the start of the unit's next turn. Since it is cleared at that point, you'll never see it at anything other then 0 in the save files. You can manually change it to other values to force a specific panic attack on the next turn.
0: None 1: Freeze 2: Running 3: Berserk |
61 | 0x3D | [62] will increment by this amount whenever the unit moves.
3: Sectiod - Hobbes 4: Soldiers, civs, and all other aliens (but Hobbes had no Large aliens) 30: Tank/Laser |
62 | 0x3E | Visibility via motion scanner. The bigger it is, the bigger the blip. Test this one out for values. |
63 | 0x3F | Number of Fatal Wounds to head. |
64 | 0x40 | Number of fatal wounds to torso. |
65 | 0x41 | Number of fatal wounds to right arm. |
66 | 0x42 | Number of fatal wounds to left arm. |
67 | 0x43 | Number of fatal wounds to right leg. |
68 | 0x44 | Number of fatal wounds to left leg. |
69-70 | 0x45-0x46 | Indexes into ROUTES.DAT. To start with, aliens will be located at the same position as the node indicated by byte 69.
|
71 | 0x47 | NKF: Always 16 for XCom units, 1 for cyberdisc, 0 for others? Perhaps involves mobile lighting - see the Talk page. |
72 | 0x48 | The amount of Morale that has been restored using the Medkit's painkillers. The amount that can be restored is equal to the maximum health of the unit (index 26) minus their current health (index 13) further minus this. |
73 | 0x49 | Intelligence. Rated from 2 - 8. Indicates for how many turns the alien will know the location of spotted soldiers. Hey - why do humans have zero intelligence? :( |
74 | 0x4A | NKF: Could be the unit spotted icon identifier? Could point to visible enemy units?
MikeTheRed: XCOMs always have 0, but Mutons have values of 0-3 (usually 0 or 2, and often fluctuating) in a firing squad situation. |
75 | 0x4B | Always 0? |
76-77 | 0x4C-0x4D | Mission count. Signed integer (low byte, high byte) also found in SOLDIER.DAT MTR: Wonder why they bothered to put this in Unitref since this will never change during a mission; compare how soldier stats are actually read from SOLDIER (not UNITREF) on return to geoscape. Is Missions shown anywhere on the combatscape? |
78-79 | 0x4E-0x4F | Kill count. Signed integer (low byte, high byte) also found in SOLDIER.DAT. Number of kills this unit has made for ALL missions, not just this one. This one can vary "unpredictably" and thus is the only byte known to directly carry forward into the geoscape / Soldier.Dat! |
80 | 0x50 | Reactions experience counter, for number of reaction shots. It doesn't matter if they hit the target; reactions still count. See Note 2 re: Experience counters. (Also note: Aliens do not use experience counters.)
NKF: Where does death by fire (overexposure rather than incendiary shell impact) fit into the experience counters? It becomes a non-assigned kill, I guess, like death by wounds, or death by a grenade that hasn't got an owner? |
81 | 0x51 | Firing Accuracy experience counter, for number of hits on an enemy (lethal or not, grenades or bullets). Each Autoshot hit counts as 1, so you can get 3 hits from one Autoshot burst. Likewise, grenades and blaster bombs can hit multiple targets with one explosion. Also, if you miss the intended target but hit a different alien, it still counts. Finally, if your shot actually has zero Damage, it does still count as a hit. (Not due to armor blockage; a pure roll of 0 coming out of the gun.) |
82 | 0x52 | Melee Accuracy experience counter, for number of times stun rod has been used (not stun bombs). |
83 | 0x53 | Throwing Accuracy experience counter, for number of times unit has thrown any object. |
84 | 0x54 | Psionic Skill experience counter, for number of psi attacks performed. 1 is added if attempt was unsuccessful, 3 if it was successful. Note: if this value goes over 255, all psi experience is lost. That's 85 successful psis (255/3). So be careful of marathon psi'ing (a minimum of 43 turns at 2 psis/turn, 29 turns at 3/turn). |
85 | 0x55 | Bravery experience counter, for number of times unit has resisted panicking, despite Morale < 50. Being mind-controlled, panicking, or going berserk does not increase this stat -- although Panic Unit attacks will reduce Morale to the point where panic checks will be performed by the game. |
86-111 | 0x56-0x6F | Unit's Name. Standard string ended by null byte. The rest can hold garbage. |
112 | 0x70 | 0; sometimes 1 for aliens. |
113 | 0x71 | If 1, then you can't use the inventory button and the unit will be immune to stun. Used for tanks. Mind controlled units don't use this but their button disables anyway.
BombBloke: This is the only way to access tank inventories.
[1] actually determines the inventory screen used, might be worth playing with that. [46] determines the layout. |
114 | 0x72 | If not 0, then unit is on fire, and will burn for this amount of turns. |
115 | 0x73 | Gender: 0 = male, 1 = female. |
116 | 0x74 | Hair/skin colour (for inventory; all other units = 0):
0: Blond caucasian 1: Brunette caucasian 2: Asian 3: Black |
117 | 0x75 | Turret weapon. Over-rides hand held weapon. Turret images are not centered; that would be impossible because they aren't all 'objects' (e.g. Celatid). (Mix of notes by BB and NKF)
F.A. TUs F.A. TUs 0: HWP cannon (bigobs[40])....................Aimed 90% 80% Snap 60% 33% 1: HWP rocket (bigobs[42])....................Aimed 115% 75% Snap 55% 45% 2: HWP laser (bigobs[54]).....................Aimed 85% 75% Snap 50% 33% 3: HWP plasma cannon (bigobs[43]).............Aimed 100% 60% Snap 86% 30% 4: HWP blaster (bigobs[43]) (looks like ordinary cannon?)......Aimed 120% 80% 5: Celatid plasma cannon (bigobs[38]).........Aimed 110% 60% Snap 75% 30% 6: Cyberdisc plasma cannon (bigobs[34]).......Aimed 110% 60% Snap 75% 30% 7: Sectopod Laser* cannon (bigobs[34])as cyberdisk, above, plus Auto 50% 35% 22: Invalid - Incredibly powerful armour piercing shell. Overpowering. 255: Unused Note: This item will take precendence over any item carried in the hand slots. It can be installed on non-tanks, but then the unit won't be able to use any carried weapons or items. This weapon is NOT affected by the kneeling modifier, but it is affected by the current unit's accuracy stat. Also note, this byte does NOT determine the turret image for HWPs in the battlescape. [*]The damage type for the Sectopod is indeed set to (3)laser in the executable! Graphical/sound effects of a turret weapon is set there as well, via a reference to a weapon in OBDATA.DAT (HWP Cannon=4=Heavy Cannon, Sectopod=34=Heavy Plasma) When I changed HWP Cannon to 2, it looked/sounded like rifle fire - Crus8r |
118 | 0x76 | Ammo for [117] turret weapon |
119 | 0x77 | Movement related? Large unit related? Possible bitfield.
MTR: 00000000 0 Chryssalid(2), Civilian(9), Ethereal(2), Floater(2), Muton, 00000001 1 Muton, PA Soldier(2) Sectoid(2), Silacoid(2), 00000011 3 PA Soldier PA Soldier(2), Tank/Laser 00000101 5 Snakeman 00001010 10 Celatid - Hobbes game - could have some garbage 00001101 13 Muton, PA Soldier (parens) is count, if more than 1 unit 00010011 19 Snakeman 00100110 38 PA Soldier 00101010 42 Muton(3) 00110001 49 Muton 00110010 50 PA Soldier 00110101 53 Silacoid(2) 00111011 59 Celatid 00111111 63 Silacoid 01001110 78 PA Soldier 01100111 103 PA Soldier 01111111 127 Muton 10010000 144 Muton 11000000 192 Celatid 11111110 254 Muton |
120 | 0x78 | Unit bit flags, mainly re: mobility. They do NOT affect the soldier in inventory screen: (Mix of notes by BB and NKF)
( 1) 1: 1 = Dead. This was only set for 2 of 3 dead aliens in my current game. [13] (Health=0) is the most reliable indicator for me. -MikeTheRed ( 2) 2: 1 = Unit can fly. ( 4) 3: 1 = Unit is flying. (Toggles leg sprites for power armour.) ( 8) 4: ??? Seems to flag if the unit has been selected this turn. ( 16) 5: 1 = Unit has been disabled for selection. (Stops the unit tab button from selecting this soldier.) ( 32) 6: 0 = Unit has left hand object selected, 1 = right hand object selected. ( 64) 7: 1 = Unit is kneeling. (128) 8: 1 = Unit is wearing power/flying suit. (Can't be stunned by smoke flag? Seems to work for fire, too.) If a unit is carrying something in either hand, it is impossible to get him to appear as if he is carrying nothing - in the game, at least. If he is carrying nothing, bit 6 can flag (as though the unit was using it's right hand item). But maybe it's just the order of dropped items affecting this? Note: A unit is only considered as flying if it is not on the ground. For example, a hover tank is not always considered as flying. What if a hovertank is half on the ground, half in the air? What about a treaded tank, or large alien unit? What about units in lifts? |
121 | 0x79 | Possible Values: 0 or 16. All units in unitref.dat get a value of 0 except for the second unit in the list which gets 16. Doesn't matter if the second unit is a soldier, a tank, or an alien. It's always 16. Editing it to 0 doesn't crash the game or have any dire consequences. |
122 | 0x7A | Always 0? |
123 | 0x7B | Always 0? |
124 | 0x7C | TFTD ONLY - Appears to be a count as to which frame of bubbles the soldier is on. Can be 0 to 16 (0x0F), most likely 125/7D is included with this. |
125 | 0x7D | TFTD ONLY, unknown. |
126 | 0x7E | TFTD ONLY, unknown. |
127 | 0x7F | TFTD ONLY, unknown. |
128 | 0x80 | TFTD ONLY, unknown. |
129 | 0x81 | TFTD ONLY, unknown. |
130 | 0x82 | TFTD ONLY, unknown. |
131 | 0x83 | TFTD ONLY, unknown. |
Notes
1) The original/base values for soldier stats (offsets [23]-[28], etc.) correspond to the initial+increase bytes from Soldier.Dat (bytes 43-62). Changes to these Unitref bytes are lost when the mission ends; instead, XCOM re-reads them from Soldier at that time. This makes sense because base soldier stats don't change during a mission per se (although they might increase when the mission ends); in this way, the programmers didn't have to bother with separately storing and/or adding initial+increase during combat. (It's also why you don't see the initial+increase in the soldier stat display during combat, that you can see back at base.) On a practical note, if you are testing soldier stat increases versus experience counters, change the experience counters in Unitref, but change the soldier stats in Soldier. (IOW, it doesn't matter what the soldier stats are in the combat mission.)
The Kill count (offset [78-79]) is the only Unitref value I know of that is directly carried forward into the geoscape and Soldier.dat. However, some others do indirectly carry forward, for example: experience (offsets [80]-[85]) causes stat and rank increases, and decreased health (offset [26] - offset [13]) means hospital time. And, of course, death is permanent. Heh.
2) Experience counters (offsets [80]-[85]) determine the likelihood of soldier stat increases at the end of the combat mission, according to the formula for Primary Stats shown here. The Bravery counter (offset [85]) affects Bravery as shown here.
Also, if at least one of the experience counters (except Throws) has a count, your secondary stats will increase, as discussed here. All you need is at least a 1 in offsets [80]-[82] or [84]-[85]; more than 1 and/or multiple counters has no additional effect.
3) BombBloke's additional "To be Done" notes - can we cross some of these off yet?
Need to research: Stun recovery rate, does it exist? Hand to hand attacksOffset of weapon from unit image?Based on unit height and nothing else. There may be values to determine what arm sprites to use, but I doubt it. Firing sprite offset? Probably just based on unit height and some hardcoded values in the executable.Inventory lockout?All mind controlled units are locked out. Kneel lockout? Probably the same as above, I seem to remember that using XcomUtil to "swap sides" would make it possible to kneel small alien units.Aliens seen?Not used in unitref.dat, only in unitpos.dat. -Zombie 23:48, 29 September 2006 (PDT)Whether a unit slides/floats/hovers/rolls/walks (movement noise)?Set according to unit type. What else? The more to look for, the easier it is... Know 111 values. Unknown values (13 in total): [034 / 0x22] - Always 0? [036 / 0x24] - Always 0? [043 / 0x2B] - Set to 1 on occasion, usually 0. [052 / 0x34] - Seems to be a mirror of 48 / 0x30, the LOFTemp index for the unit. [071 / 0x47] - Appears to relate to lighting caused by the unit, discussion here. [074 / 0x4A] - Appears to relate to the AI-mode used by the unit, discussion here. [075 / 0x4B] - Always 0? [112 / 0x70] - Set to 1 for some aliens, 0 otherwise. [119 / 0x77] - No idea, possible bitfield, could be anything. [120 / 0x78] - Unit bit flags, mainly re: mobility. Only one bit not 100% identified. [121 / 0x79] - Second unit gets a value of 16. Everyone else gets 0. No obvious purpose. [122 / 0x7A] - Always 0? [123 / 0x7B] - Always 0? Know 1 TFTD value. Unknown TFTD values (7 in total): [125] [126] [127] [128] [129] [130] [131]
4) Hobbes posted a savegame with a TON of different aliens in it here (message 6). Interesting for testing. But note it was made with XCOMUTIL and there may(?) be concerns over vailidity of unit info - see Talk:UNITREF.DAT.
5) A Hex Workshop Structure Library for UNITREF.DAT created by Danial is here.
For More Information
Return to Saved Game Files