Difference between revisions of "OBPOS.DAT"
(More data for unconscious corpses) |
m (→Structure) |
||
(13 intermediate revisions by 5 users not shown) | |||
Line 1: | Line 1: | ||
− | This file is used by the tactical game engine to record the location of items. Each record is made up of 16 single byte values. UFO has 170 records (for a total 2,720 bytes), and TFTD has 200 (for a total of 3,200 bytes). It comes in three flavours:<br><br> |
+ | This file is used by the tactical game engine to record the location of items. Each record is made up of 16 single byte values. UFO has 170 records (for a total 2,720 bytes), and TFTD has 200 (210) (for a total of 3,200 [3360] bytes). It comes in three flavours:<br><br> |
*<b>OBPOSREF.DAT</b><br> |
*<b>OBPOSREF.DAT</b><br> |
||
Line 14: | Line 14: | ||
== Structure == |
== Structure == |
||
+ | {| class="wikitable" |
||
− | <b>0/00</b>: Object type (Object is the item ID# in geodata\obdata.dat). Value of 255/-1 = item in this slot is meant to be unused or destroyed. See [[OBDATA.DAT]] for a list of possibilities. |
||
+ | |- |
||
− | |||
+ | !Offset<br>(Decimal) |
||
− | <b>1/01</b>: Y coordinate when on the ground. |
||
+ | !Offset<br>(Hex) |
||
− | |||
+ | !Usage |
||
− | <b>2/02</b>: X coordinate when on the ground. |
||
+ | |- valign="top" |
||
− | |||
+ | !<span id="0"></span>0 |
||
− | <b>3/03</b>: Z coordinate when on the ground. |
||
+ | !<span id="0x00"></span>0x00 |
||
− | |||
+ | |Object type (Object is the item ID# in geodata\obdata.dat). Value of 255/-1 = item in this slot is meant to be unused or destroyed. See [[OBDATA.DAT]] for a list of possibilities. |
||
− | The three above values are meant to tell the game where the items physically are. They determine where an unconcious unit will wake up. They tell the game where to centre an explosion for area effect items. |
||
+ | |- valign="top" |
||
+ | !<span id="1"></span>1 |
||
+ | !<span id="0x01"></span>0x01 |
||
+ | |Y coordinate when on the ground. |
||
+ | |- valign="top" |
||
+ | !<span id="2"></span>2 |
||
+ | !<span id="0x02"></span>0x02 |
||
+ | |X coordinate when on the ground. |
||
+ | |- valign="top" |
||
+ | !<span id="3"></span>3 |
||
+ | !<span id="0x03"></span>0x03 |
||
+ | |Z coordinate when on the ground. |
||
+ | |- |
||
+ | |colspan="3"|The three above values are meant to tell the game where the items physically are. They determine where an unconcious unit will wake up. They tell the game where to centre an explosion for area effect items. |
||
Oddly enough, these values ARE NOT UPDATED when in inventory. All items that start in your inventory default to the equipment pile. All items that start in the alien inventories are at location (0,0,0). |
Oddly enough, these values ARE NOT UPDATED when in inventory. All items that start in your inventory default to the equipment pile. All items that start in the alien inventories are at location (0,0,0). |
||
+ | |- valign="top" |
||
+ | !<span id="4"></span>4 |
||
+ | !<span id="0x04"></span>0x04 |
||
+ | |Owner of item. References the units in [[UNITPOS.DAT]]. First unit unit index is 0, naturally. Just tells the game who's holding the current item. If 255 = object will be on the ground. |
||
+ | |- valign="top" |
||
+ | !<span id="5"></span>5 |
||
+ | !<span id="0x05"></span>0x05 |
||
+ | |[[Image:Slots.png|right|400px]]Inventory slot (from left to right): |
||
+ | <table {{StdCenterTable}} width="30%"> |
||
− | <b>4/04</b>: Owner of item. References the units in unitpos. First unit unit index is 0, naturally. Just tells the game who's holding the current item. If 255 = object will be on the ground. |
||
− | [[Image:Slots.png|right|400px]] |
||
− | <b>5/05</b>: Inventory slot (from left to right): |
||
− | |||
− | <table {{StdCenterTable}} width="50%"> |
||
<tr {{StdDescTable_Heading}}><th>Slot(s)</th><th>Area</th></tr> |
<tr {{StdDescTable_Heading}}><th>Slot(s)</th><th>Area</th></tr> |
||
<tr><td>0</td><td>Right Hand</td></tr> |
<tr><td>0</td><td>Right Hand</td></tr> |
||
Line 39: | Line 57: | ||
<tr><td>8-9</td><td>Left Shoulder</td></tr> |
<tr><td>8-9</td><td>Left Shoulder</td></tr> |
||
<tr><td>10-18</td><td>Back Pack</td></tr> |
<tr><td>10-18</td><td>Back Pack</td></tr> |
||
− | <tr><td>19-24</td><td>Belt</td></tr><table><br> |
+ | <tr><td>19-24</td><td>Belt</td></tr></table><br> |
− | WARNING: If adding an item to the hand slots, remember to update the hand slot images in UNITREF for the soldier involved. |
+ | WARNING: If adding an item to the hand slots, remember to update the hand slot images in [[UNITREF.DAT] for the soldier involved] (offsets [[UNITREF.DAT#53|53]] and [[UNITREF.DAT#54|54]]). See also [[Inventory_TU_Table]]. |
− | Note that if an alien doesn't need an object in the hand(s), it'll move it to slot 2 |
+ | Note that if an alien doesn't need an object in the hand(s), it'll move it to slot 2. See the discussion section on Alien's Storage Zone. |
+ | |- valign="top" |
||
− | |||
+ | !<span id="6-7"></span>6-7 |
||
− | <b>6/06</b>: Object the current item is loaded into. -1/255 by default for no item. (Uses obpos item index - first object in obpos is 0). |
||
+ | !<span id="0x06-0x07"></span>0x06-0x07 |
||
− | |||
+ | |Object the current item is loaded into. -1/65535 (0xFFFF) by default for no item. (Uses obpos item index - first object in obpos is 0). |
||
− | <b>7/07</b>: -1/255 by default, otherwise 0 if the item is loaded into something. |
||
+ | |- valign="top" |
||
− | |||
+ | !<span id="8"></span>8 |
||
− | <b>8/08</b>: Item Quantity 1: |
||
+ | !<span id="0x08"></span>0x08 |
||
+ | |Item Quantity 1: |
||
For Ammo: Ammo quantity. |
For Ammo: Ammo quantity. |
||
− | For Medikits: Painkillers remaining. |
+ | For [[Medi-Kit (EU)|Medikits]]: Painkillers remaining. |
For Unconscious 'corpses': Index to [[UNITPOS.DAT]], Also see offset 12 |
For Unconscious 'corpses': Index to [[UNITPOS.DAT]], Also see offset 12 |
||
− | For Proximity |
+ | For [[Proximity Grenade]]s: Grenade status (1 = proximity grenade is armed). |
− | For |
+ | For others grenades: 'Turn to detonate on' trigger (0 = grenade object has not been primed). |
Non zero positive value = What turn to explode on. Grenade will explode if current 'turn' is equal or greater than this number. See [[WGLOB.DAT]] for No. of turns. |
Non zero positive value = What turn to explode on. Grenade will explode if current 'turn' is equal or greater than this number. See [[WGLOB.DAT]] for No. of turns. |
||
− | When priming grenades this is set to the current turn number +1 for every additional turn added onto the timer. Refer to |
+ | When priming grenades this is set to the current turn number +1 for every additional turn added onto the timer. Refer to [[WGLOB.DAT]] for current number of turns. (Uses actual turns, not turns/2). |
+ | |- valign="top" |
||
− | |||
+ | !<span id="9"></span>9 |
||
− | <b>9/09</b>: Item Quantity 2: |
||
+ | !<span id="0x09"></span>0x09 |
||
− | |||
+ | |Item Quantity 2: |
||
− | For Medikits: Stimulants remaining. |
||
− | |||
− | For Grenades: Ownership flag (unitpos reference). For remembering who last threw the live grenade. For morale loss calculations and for determining the soldier's combat experience. Refers to unit 0 by default. Refers to unit in unitpos. |
||
− | |||
− | For Unconscious 'corpses': Type of unit. See offset 0 in [[UNITREF.DAT]]. |
||
+ | For [[Medi-Kit (EU)|Medikits]]: Stimulants remaining. |
||
− | <b>10/0A</b>: Item Quantity 3: |
||
+ | For Grenades: Ownership flag (unitpos reference). For remembering who last threw the live grenade. For morale loss calculations and for determining the soldier's combat experience. Refers to unit 0 by default. Refers to unit in [[UNITPOS.DAT]]. |
||
− | Medikit's Heal uses remaining. |
||
− | For |
+ | For unconscious 'corpses': Type of unit. See [[UNITREF.DAT#0|UNITREF[0]]]. |
+ | |- valign="top" |
||
+ | !<span id="10"></span>10 |
||
+ | !<span id="0x0A"></span>0x0A |
||
+ | |Item Quantity 3: |
||
+ | For [[Medi-Kit (EU)|Medikits]]: Heal uses remaining. |
||
− | <b>11/0B</b>: This is a direct copy of offset[48] from the MCD record (see [[TERRAIN]]) of the tile the unit is standing on. A signed byte. |
||
+ | For unconscious 'corpses': Rank of unit. See [[UNITREF.DAT#42|UNITREF[42]]]. |
||
− | <b>12/0C</b>: Some kind of bitfield, seems to change with the inventory view ''--[[User:Pi Masta|Pi Masta]] 15:48, 14 February 2007 (PST)'' |
||
+ | |- valign="top" |
||
+ | !<span id="11"></span>11 |
||
+ | !<span id="0x0B"></span>0x0B |
||
+ | |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="12"></span>12 |
||
+ | !<span id="0x0C"></span>0x0C |
||
+ | |Some kind of bitfield, seems to change with the inventory view ''--[[User:Pi Masta|Pi Masta]] 15:48, 14 February 2007 (PST)'' |
||
− | Bit 0 On - object has been on the ground this turn, |
+ | Bit 0 On - object has been on the ground this turn, |
+ | Off - object has not touched the ground this turn |
||
− | Bit 1 On - seems to only flag with bit 0 and after you have selected another soldier or have thrown it |
||
− | Bit |
+ | Bit 1 On - seems to only flag with bit 0 and after you have |
+ | selected another soldier or have thrown it |
||
− | Bit 3 Flags on for unconscious units (corpse), offset 8 will point to [[UNITPOS.DAT]] index of unit |
||
+ | Bit 2 On - was seen in last inventory view , {show object in inventory} |
||
+ | Off - wasn't seen in last inventory view {don't show object in inventory} |
||
+ | Bit 3 Flags on for unconscious units (corpse), offset 8 |
||
+ | will point to [[UNITPOS.DAT]] index of unit |
||
Bit 4 ?? ''--[[User:Pi Masta|Pi Masta]]'' |
Bit 4 ?? ''--[[User:Pi Masta|Pi Masta]]'' |
||
Bit 5 ?? |
Bit 5 ?? |
||
Line 98: | Line 130: | ||
11100011 - 227 |
11100011 - 227 |
||
+ | <i> |
||
− | <b>13/0D</b>: Presumed unused. |
||
+ | bit 0 - object appeared on the ground by player's action |
||
+ | bit 1 - object appeared on the ground by AI's action |
||
+ | bit 2 - mark of obseved items in inventory |
||
+ | bit 3 - unit's body object |
||
+ | others - unused (garbage). |
||
+ | Bits 0-1 used for unused AI function of picking up of objects. |
||
− | <b>14/0E</b>: Presumed unused. |
||
+ | Fields 13-15 are high bits of flag field (field 0x0C is 32bit value). |
||
+ | --[[User:Volutar|Volutar]] 03:40, 8 April 2011 (EDT) |
||
+ | </i> |
||
+ | |- valign="top" |
||
− | <b>15/0F</b>: Presumed unused. |
||
+ | !<span id="13"></span>13~15 |
||
+ | !<span id="0x0D"></span>0x0D~0x0F |
||
+ | |High bits for byte 12 - Presumed unused. |
||
+ | |} |
||
==See Also== |
==See Also== |
||
Line 108: | Line 152: | ||
* [[Battlescape Map Generation]] |
* [[Battlescape Map Generation]] |
||
[[Category:Game Files]] |
[[Category:Game Files]] |
||
+ | [[Category:Enemy Unknown/UFO Defense]] |
Latest revision as of 07:07, 31 December 2014
This file is used by the tactical game engine to record the location of items. Each record is made up of 16 single byte values. UFO has 170 records (for a total 2,720 bytes), and TFTD has 200 (210) (for a total of 3,200 [3360] bytes). It comes in three flavours:
- OBPOSREF.DAT
Initially created by the GeoScape engine and stored in the MISSDAT folder. Contains info required for Battlescape Map Generation. Unlike the other two versions, this only contains the bare minimum number of records required to store the items it details.
- OBPOS.DAT
Created along with a battlescape save, contains the mid-mission state of the object table.
- OBPOS2.DAT
Appears in the MISSDAT folder at the end of combat. Used to determine what equipment is to be returned back to the base stores (though base/UFO components are listed in MISSION2.DAT. See Equipment Recovery for more info).
Values are presented according to the byte offset within each record (0 to 15) followed by the equivalent hex offset (00 to 0F) in bold. Let us know what else you can find!!
Structure
Offset (Decimal) |
Offset (Hex) |
Usage | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0 | 0x00 | Object type (Object is the item ID# in geodata\obdata.dat). Value of 255/-1 = item in this slot is meant to be unused or destroyed. See OBDATA.DAT for a list of possibilities. | ||||||||||||||||||
1 | 0x01 | Y coordinate when on the ground. | ||||||||||||||||||
2 | 0x02 | X coordinate when on the ground. | ||||||||||||||||||
3 | 0x03 | Z coordinate when on the ground. | ||||||||||||||||||
The three above values are meant to tell the game where the items physically are. They determine where an unconcious unit will wake up. They tell the game where to centre an explosion for area effect items.
Oddly enough, these values ARE NOT UPDATED when in inventory. All items that start in your inventory default to the equipment pile. All items that start in the alien inventories are at location (0,0,0). | ||||||||||||||||||||
4 | 0x04 | Owner of item. References the units in UNITPOS.DAT. First unit unit index is 0, naturally. Just tells the game who's holding the current item. If 255 = object will be on the ground. | ||||||||||||||||||
5 | 0x05 | Inventory slot (from left to right):
WARNING: If adding an item to the hand slots, remember to update the hand slot images in [[UNITREF.DAT] for the soldier involved] (offsets 53 and 54). See also Inventory_TU_Table. Note that if an alien doesn't need an object in the hand(s), it'll move it to slot 2. See the discussion section on Alien's Storage Zone. | ||||||||||||||||||
6-7 | 0x06-0x07 | Object the current item is loaded into. -1/65535 (0xFFFF) by default for no item. (Uses obpos item index - first object in obpos is 0). | ||||||||||||||||||
8 | 0x08 | Item Quantity 1:
For Ammo: Ammo quantity. For Medikits: Painkillers remaining. For Unconscious 'corpses': Index to UNITPOS.DAT, Also see offset 12 For Proximity Grenades: Grenade status (1 = proximity grenade is armed). For others grenades: 'Turn to detonate on' trigger (0 = grenade object has not been primed). Non zero positive value = What turn to explode on. Grenade will explode if current 'turn' is equal or greater than this number. See WGLOB.DAT for No. of turns. When priming grenades this is set to the current turn number +1 for every additional turn added onto the timer. Refer to WGLOB.DAT for current number of turns. (Uses actual turns, not turns/2). | ||||||||||||||||||
9 | 0x09 | Item Quantity 2:
For Medikits: Stimulants remaining. For Grenades: Ownership flag (unitpos reference). For remembering who last threw the live grenade. For morale loss calculations and for determining the soldier's combat experience. Refers to unit 0 by default. Refers to unit in UNITPOS.DAT. For unconscious 'corpses': Type of unit. See UNITREF[0]. | ||||||||||||||||||
10 | 0x0A | Item Quantity 3:
For Medikits: Heal uses remaining. For unconscious 'corpses': Rank of unit. See UNITREF[42]. | ||||||||||||||||||
11 | 0x0B | This is a direct copy of offset[48] from the MCD record of the tile the unit is standing on. A signed byte. | ||||||||||||||||||
12 | 0x0C | Some kind of bitfield, seems to change with the inventory view --Pi Masta 15:48, 14 February 2007 (PST)
Bit 0 On - object has been on the ground this turn, Off - object has not touched the ground this turn Bit 1 On - seems to only flag with bit 0 and after you have selected another soldier or have thrown it Bit 2 On - was seen in last inventory view , {show object in inventory} Off - wasn't seen in last inventory view {don't show object in inventory} Bit 3 Flags on for unconscious units (corpse), offset 8 will point to UNITPOS.DAT index of unit Bit 4 ?? --Pi Masta Bit 5 ?? Bit 6 ?? Bit 7 ?? Usually 224 (-32?) or 227 (-35?), though other values have been observed. Some of these may have something to do with whether an item should appear on the ground view of the inventory display. If you hit the arrow thingy to display extra items on the ground, those which have already been displayed aren't rendered again until the full set has been shown, or until you re-enter the inventory display, check another soldier, etc... - Bomb Bloke 23:32, 9 June 2007 (PDT) 11100000 - 224
bit 0 - object appeared on the ground by player's action bit 1 - object appeared on the ground by AI's action bit 2 - mark of obseved items in inventory bit 3 - unit's body object others - unused (garbage). Bits 0-1 used for unused AI function of picking up of objects. Fields 13-15 are high bits of flag field (field 0x0C is 32bit value). --Volutar 03:40, 8 April 2011 (EDT) | ||||||||||||||||||
13~15 | 0x0D~0x0F | High bits for byte 12 - Presumed unused. |