Difference between revisions of "Thing"

From DoomWiki.org

[unchecked revision][checked revision]
(transwikied from zdoom wiki, sorry about doing plurals by mistake)
 
m (Doom 64 flags: fix bit number)
(39 intermediate revisions by 17 users not shown)
Line 1: Line 1:
In Doom, '''thing'''s are used to represent players, monsters, pick-ups, and projectiles. Inside the game, these are known as actors. There are three ways to get an actor into your map.
+
'''Things''' represent [[player]]s, [[monster]]s, [[pick-up]]s, and [[projectile]]s. Inside the game, these are known as actors, or [[mobj]]s. They also represent obstacles, certain decorations, player start positions and [[teleporter|teleport]] landing sites.  
  
[[DoomEd numbers]] are the numbers used in the editor to represent an actor. When the map is loaded, an actor that corresponds to that number will be spawned at the location of that map thing. Although many actors have DoomEd numbers, not all of them do. For instance, a blue key card has a DoomEd number, but a rocket flying through the air does not.
+
While some mobjs, such as projectiles and special effects, can only be created during play, most things can be placed in a map from a map editor through an associated editor number. When the map is loaded, an actor that corresponds to that number will be spawned at the location of that map thing. See [[thing types]] for a listing of all things that have an associated editor number.
  
[[Spawn numbers]] are the numbers used by specials such as [[Thing_Spawn]] to spawn actors in the game once the user has started playing the map. Although DoomEd numbers and spawn numbers both describe actors, they are not interchangeable—you must not use a spawn number on a map thing, and you must not use a DoomEd number for instance as a Thing_Spawn parameter.
+
==THINGS lump==
 +
{{Doom level format}}
 +
Level thing data is stored in the {{c|THINGS}} [[lump]]. Each entry is 10 bytes long. This format is used by both [[Doom]] and [[Heretic]].
 +
{| {{prettytable|style=text-align: center;}}
 +
! Offset
 +
! Size (bytes)
 +
! C99 type
 +
! Description
 +
|-
 +
| 0 || 2 || int16_t
 +
| style="text-align: left;" | ''x'' position
 +
|-
 +
| 2 || 2 || int16_t
 +
| style="text-align: left;" | ''y'' position
 +
|-
 +
| 4 || 2 || int16_t
 +
| style="text-align: left;" | [[Angle]] facing
 +
|-
 +
| 6 || 2 || int16_t
 +
| style="text-align: left;" | DoomEd [[thing type]]
 +
|-
 +
| 8 || 2 || int16_t
 +
| style="text-align: left;" | Flags
 +
|}
  
[[classes|Actor Names]] are the actual names each actor has internally (to test these you may want to try out the [[summon]] console command).  These are used with the functions [[SpawnSpot]] and [[Spawn]] which allow you to spawn any actor available with [[Thing_Spawn]] and also all other actors (though some actors aren't meant to be spawned) such as cameras, scenery or whatever you might require.
+
===Flags===
  
If you create a new actor with the [[DECORATE]] lump, you can specify both the spawn number (SpawnNum), and the DoomEd number (DoomEdNum).  The name you give the new [[DECORATE]] item is also its actor name, so you can also spawn it using that.
+
{| {{prettytable}}
 +
!bit||hex||description
 +
|-
 +
|0||0x0001||Thing is on [[Skill level#Doom and Doom II skill levels|skill levels]] 1 & 2
 +
|-
 +
|1||0x0002||Thing is on skill level 3
 +
|-
 +
|2||0x0004||Thing is on skill levels 4 & 5
 +
|-
 +
|3||0x0008||Thing is waiting in ambush. Commonly known as "deaf" flag.<br>In fact, it [[Monster_behavior#Initial_state_and_alertness|does not render monsters deaf]] per se. 
 +
|-
 +
|4||0x0010||Thing is not in single player
 +
|}
  
There is also a third set of numbers used to represent actors that is only important for [[DeHacked]]. These numbers correspond to the order the actors were defined in doom2.exe. They have no meaning outside of ZDoom's dehacked loader.
+
===Boom flags===
  
=== Thing Structure ===
+
[[Boom]] adds the flags:
  
For the more technical you may wish to know the actual structure that all things have should you decide to make some sort of WAD utility.
+
{| {{prettytable}}
 +
!bit||hex||description
 +
|-
 +
|5||0x0020||Thing is not in deathmatch
 +
|-
 +
|6||0x0040||Thing is not in coop
 +
|}
  
<tt>
+
===MBF flag===
<table border cellpadding=2>
 
<tr align=center>
 
  <td>Doom Offset</td>
 
  <td>Hexen Offset</td>
 
  <td>Size (bytes)</td>
 
  <td>Description</td>
 
</tr>
 
<tr align=center>
 
  <td>--</td> <td>0</td> <td>2</td> <td>Thing id (tid)</td>
 
</tr>
 
<tr align=center>
 
  <td>0</td> <td>2</td> <td>2</td> <td>X position</td>
 
</tr>
 
<tr align=center>
 
  <td>2</td> <td>4</td> <td>2</td> <td>Y position</td>
 
</tr>
 
<tr align=center>
 
  <td>--</td> <td>6</td> <td>2</td> <td>Starting height</td>
 
</tr>
 
<tr align=center>
 
  <td>4</td> <td>8</td> <td>2</td> <td>Angle facing</td>
 
</tr>
 
<tr align=center>
 
  <td>6</td> <td>10</td> <td>2</td> <td>DoomEd Thing type</td>
 
</tr>
 
<tr align=center>
 
  <td>8</td> <td>12</td> <td>2</td> <td>Thing's Flags (see Below)</td>
 
</tr>
 
<tr align=center>
 
  <td>--</td> <td>14</td> <td>1</td> <td>Hexen/ZDoom Special type</td>
 
</tr>
 
<tr align=center>
 
  <td>--</td> <td>15</td> <td>1</td> <td>Argument 1</td>
 
</tr>
 
<tr align=center>
 
  <td>--</td> <td>16</td> <td>1</td> <td>Argument 2</td>
 
</tr>
 
<tr align=center>
 
  <td>--</td> <td>17</td> <td>1</td> <td>Argument 3</td>
 
</tr>
 
<tr align=center>
 
  <td>--</td> <td>18</td> <td>1</td> <td>Argument 4</td>
 
</tr>
 
<tr align=center>
 
  <td>--</td> <td>19</td> <td>1</td> <td>Argument 5</td>
 
</tr>
 
</table>
 
</tt>
 
Doom Format things are 10 bytes in size, while Hexen/ZDoom format things are 20 bytes in size.
 
  
===Thing Flags===
+
[[MBF]] adds the flag:
<table cellpadding=10>
+
 
<tr>
+
{| {{prettytable}}
<td>Thing Flags are in this format for Hexen/ZDoom:</td>
+
!bit||hex||description
<td>Thing Flags are in this format for Doom:</td>
+
|-
<td>Thing Flags are in this format for Strife:</td>
+
|7||0x0080||Friendly monster
</tr>
+
|}
<tr align=center valign=top>
+
 
<td><table border cellpadding=2>
+
==Hexen Format==
<tr align=center>
+
[[Hexen]] extended upon the things lump.  Hexen things may contain an action special which is executed upon death or pickup of the thing (for monsters and items, respectively).  Hexen format also introduced true [[z-clipping]], allowing placement of monsters on the z-axis.  Finally, Hexen monsters are also able to have a tag similar to sectors.  This is called the thing ID or TID.
<td>bit</td> <td>hex</td> <td>description</td>
+
 
</tr>
+
{| {{prettytable|style=text-align: center;}}
<tr align=left>
+
! Offset
<td>0</td><td>0x0001</td><td>Thing is on Skill levels 1 &amp; 2</td>
+
! Size (bytes)
</tr>
+
! C99 type
<tr align=left>
+
! Description
<td>1</td><td>0x0002</td><td>Thing is on Skill level 3</td>
+
|-
</tr>
+
| 0 || 2 || int16_t
<tr align=left>
+
| style="text-align: left;" | Thing id (tid)
<td>2</td><td>0x0004</td><td>Thing is on Skill levels 4 &amp; 5</td>
+
|-
</tr>
+
| 2 || 2 || int16_t
<tr align=left>
+
| style="text-align: left;" | X position
<td>3</td><td>0x0008</td><td>Thing is Deaf</td>
+
|-
</tr>
+
| 4 || 2 || int16_t
<tr align=left>
+
| style="text-align: left;" | Y position
<td>4</td><td>0x0010</td><td>Thing is dormant until activated</td>
+
|-
</tr>
+
| 6 || 2 || int16_t
<tr align=left>
+
| style="text-align: left;" | Starting height
<td>8</td><td>0x0100</td><td>Thing is in Single Player</td>
+
|-
</tr>
+
| 8 || 2 || int16_t
<tr align=left>
+
| style="text-align: left;" | Angle facing
<td>9</td><td>0x0200</td><td>Thing is in Co-Op</td>
+
|-
</tr>
+
| 10 || 2 || int16_t
<tr align=left>
+
| style="text-align: left;" | DoomEd thing type
<td>10</td><td>0x0400</td><td>Thing is in Deathmatch</td>
+
|-
</tr>
+
| 12 || 2 || int16_t
<tr align=left>
+
| style="text-align: left;" | Flags
<td>11</td><td>0x0800</td><td>Thing is 25% translucent</td>
+
|-
</tr>
+
| 14 || 1 || uint8_t
<tr align=left>
+
| style="text-align: left;" | [[Hexen action special]]
<td>12</td><td>0x1000</td><td>Makes the thing invisible</td>
+
|-
</tr>
+
| 15 || 1 || uint8_t
<tr align=left>
+
| style="text-align: left;" | Argument 1
<td>13</td><td>0x2000</td><td>Friendly monster</td>
+
|-
</tr>
+
| 16 || 1 || uint8_t
<tr align=left>
+
| style="text-align: left;" | Argument 2
<td>14</td><td>0x4000</td><td>Thing stands still (only useful for specific Strife monsters or friendlies)</td>
+
|-
</tr>
+
| 17 || 1 || uint8_t
</table>
+
| style="text-align: left;" | Argument 3
</td>
+
|-
<td><table border cellpadding=2>
+
| 18 || 1 || uint8_t
<tr align=center>
+
| style="text-align: left;" | Argument 4
<td>bit</td> <td>hex</td> <td>description</td>
+
|-
</tr>
+
| 19 || 1 || uint8_t
<tr align=left>
+
| style="text-align: left;" | Argument 5
<td>0</td><td>0x0001</td><td>Thing is on Skill levels 1 &amp; 2</td>
+
|}
</tr>
+
 
<tr align=left>
+
Note that Hexen things are 20 bytes in size; 10 bytes larger than things in Doom.
<td>1</td><td>0x0002</td><td>Thing is on Skill level 3</td>
+
 
</tr>
+
===Hexen flags===
<tr align=left>
+
 
<td>2</td><td>0x0004</td><td>Thing is on Skill levels 4 &amp; 5</td>
+
{| {{prettytable}}
</tr>
+
!bit||hex||description
<tr align=left>
+
|-
<td>3</td><td>0x0008</td><td>Thing is Deaf</td>
+
|0||0x0001||Thing is on [[Skill level#Hexen skill levels|skill levels]] 1 &amp; 2
</tr>
+
|-
<tr align=left>
+
|1||0x0002||Thing is on skill level 3
<td>4</td><td>0x0010</td><td>Thing is not in Single player</td>
+
|-
</tr>
+
|2||0x0004||Thing is on skill levels 4 &amp; 5
<tr align=left>
+
|-
<td>5</td><td>0x0020</td><td>Thing is not in Deathmatch</td>
+
|3||0x0008||Thing is waiting in ambush
</tr>
+
|-
<tr align=left>
+
|4||0x0010||Thing is dormant - it will not wake up until it is activated using Thing_Activate
<td>6</td><td>0x0040</td><td>Thing is not in Coop</td>
+
|-
</tr>
+
|5||0x0020||Thing appears to the [[Fighter]] class
<tr align=left>
+
|-
<td>7</td><td>0x0080</td><td>Friendly monster</td>
+
|6||0x0040||Thing appears to the [[Cleric]] class
</tr>
+
|-
</table></td>
+
|7||0x0080||Thing appears to the [[Mage]] class
<td><table border cellpadding=2>
+
|-
<tr align=center>
+
|8||0x0100||Thing appears in single-player games
<td>bit</td> <td>hex</td> <td>description</td>
+
|-
</tr>
+
|9||0x0200||Thing appears in cooperative games
<tr align=left>
+
|-
<td>0</td><td>0x0001</td><td>Thing is on Skill levels 1 &amp; 2</td>
+
|10||0x0400||Thing appears in deathmatch games
</tr>
+
|}
<tr align=left>
+
 
<td>1</td><td>0x0002</td><td>Thing is on Skill level 3</td>
+
==Strife Format==
</tr>
+
[[Strife]] did not alter the thing structure like Hexen did, however it did make use of the unused flag bits.
<tr align=left>
+
 
<td>2</td><td>0x0004</td><td>Thing is on Skill levels 4 &amp; 5</td>
+
===Strife flags===
</tr>
+
{| {{prettytable}}
<tr align=left>
+
!bit||hex||description
<td>3</td><td>0x0008</td><td>Thing stands still (only useful for specific Strife monsters)</td>
+
|-
</tr>
+
|0||0x0001||Thing is on [[Skill level#Strife skill levels|skill levels]] 1 &amp; 2
<tr align=left>
+
|-
<td>4</td><td>0x0010</td><td>Thing is not in Single player</td>
+
|1||0x0002||Thing is on skill level 3
</tr>
+
|-
<tr align=left>
+
|2||0x0004||Thing is on skill levels 4 &amp; 5
<td>5</td><td>0x0020</td><td>Thing is Deaf</td>
+
|-
</tr>
+
|3||0x0008||Thing stands still (only useful for specific enemies)
<tr align=left>
+
|-
<td>6</td><td>0x0040</td><td>Friendly monster</td>
+
|4||0x0010||Thing will not appear in single player
</tr>
+
|-
<tr align=left>
+
|5||0x0020||Thing is waiting in ambush
<td>8</td><td>0x0100</td><td>Thing is 25% translucent</td>
+
|-
</tr>
+
|6||0x0040||Thing is a friendly monster
<tr align=left>
+
|-
<td>9</td><td>0x0200</td><td>Makes the thing invisible</td>
+
|7||0x0080||Unused
</tr>
+
|-
</table></td>
+
|8||0x0100||Thing is 25% translucent
 +
|-
 +
|9||0x0200||Thing is either invisible, or 75% translucent if combined with bit 8.
 +
|}
 +
 
 +
==Doom 64 format==
 +
The [[Doom 64]] THING format is similar to the Doom format except for the inclusion of a ''z'' position and an ID. Each entry is 14 bytes long.
 +
{| {{prettytable|style=text-align: center;}}
 +
! Offset
 +
! Size (bytes)
 +
! C99 type
 +
! Description
 +
|-
 +
| 0 || 2 || int16_t
 +
| style="text-align: left;" | ''x'' position
 +
|-
 +
| 2 || 2 || int16_t
 +
| style="text-align: left;" | ''y'' position
 +
|-
 +
| 4 || 2 || int16_t
 +
| style="text-align: left;" | ''z'' position
 +
|-
 +
| 6 || 2 || int16_t
 +
| style="text-align: left;" | [[Angle]] facing
 +
|-
 +
| 8 || 2 || int16_t
 +
| style="text-align: left;" | DoomEd [[thing type]]
 +
|-
 +
| 10 || 2 || int16_t
 +
| style="text-align: left;" | Flags
 +
|-
 +
| 12 || 2 || int16_t
 +
| style="text-align: left;" | ID
 +
|}
 +
 
 +
===Doom 64 flags===
 +
Additional flags are defined in comparison to the Doom format, however flags 10 through 12 are not used in any Doom 64 maps.
 +
 
 +
{| {{prettytable}}
 +
!bit||hex||description
 +
|-
 +
|0||0x0001||Thing is on [[Skill level#Doom 64 skill levels|skill levels]] 1 &amp; 2
 +
|-
 +
|1||0x0002||Thing is on skill level 3
 +
|-
 +
|2||0x0004||Thing is on skill level 4
 +
|-
 +
|3||0x0008||Thing is waiting in ambush
 +
|-
 +
|4||0x0010||Thing is not in single player
 +
|-
 +
|5||0x0020||Thing doesn't spawn until triggered in level
 +
|-
 +
|6||0x0040||Thing triggers something when picked up
 +
|-
 +
|7||0x0080||Thing triggers something when killed
 +
|-
 +
|8||0x0100||Thing counts as secret in [[intermission]] screen
 +
|-
 +
|9||0x0200||Thing ignores other attackers (no [[infighting]])
 +
|-
 +
|10||0x0400||Thing doesn't spawn in deathmatch games
 +
|-
 +
|11||0x0800||Thing doesn't in standard netgame mode
 +
|-
 +
|12||0x1000||Thing appears in nightmare mode ([[KEX Engine]])
 +
|}
 +
 
 +
==Sources==
 +
* [[Unofficial Doom Specs]]
 +
* [[Boom]] source code: <tt>boomref.txt</tt>
 +
* {{idgames|file=docs/editing/d64techbible|title=Doom 64 Tech Bible}}
 +
 
 +
[[Category:Doom engine]]
 +
[[Category:WAD lumps]]
 +
[[Category:Lists]]

Revision as of 08:46, 25 July 2020

Things represent players, monsters, pick-ups, and projectiles. Inside the game, these are known as actors, or mobjs. They also represent obstacles, certain decorations, player start positions and teleport landing sites.

While some mobjs, such as projectiles and special effects, can only be created during play, most things can be placed in a map from a map editor through an associated editor number. When the map is loaded, an actor that corresponds to that number will be spawned at the location of that map thing. See thing types for a listing of all things that have an associated editor number.

THINGS lump

Doom level format

Level thing data is stored in the THINGS lump. Each entry is 10 bytes long. This format is used by both Doom and Heretic.

Offset Size (bytes) C99 type Description
0 2 int16_t x position
2 2 int16_t y position
4 2 int16_t Angle facing
6 2 int16_t DoomEd thing type
8 2 int16_t Flags

Flags

bit hex description
0 0x0001 Thing is on skill levels 1 & 2
1 0x0002 Thing is on skill level 3
2 0x0004 Thing is on skill levels 4 & 5
3 0x0008 Thing is waiting in ambush. Commonly known as "deaf" flag.
In fact, it does not render monsters deaf per se.
4 0x0010 Thing is not in single player

Boom flags

Boom adds the flags:

bit hex description
5 0x0020 Thing is not in deathmatch
6 0x0040 Thing is not in coop

MBF flag

MBF adds the flag:

bit hex description
7 0x0080 Friendly monster

Hexen Format

Hexen extended upon the things lump. Hexen things may contain an action special which is executed upon death or pickup of the thing (for monsters and items, respectively). Hexen format also introduced true z-clipping, allowing placement of monsters on the z-axis. Finally, Hexen monsters are also able to have a tag similar to sectors. This is called the thing ID or TID.

Offset Size (bytes) C99 type Description
0 2 int16_t Thing id (tid)
2 2 int16_t X position
4 2 int16_t Y position
6 2 int16_t Starting height
8 2 int16_t Angle facing
10 2 int16_t DoomEd thing type
12 2 int16_t Flags
14 1 uint8_t Hexen action special
15 1 uint8_t Argument 1
16 1 uint8_t Argument 2
17 1 uint8_t Argument 3
18 1 uint8_t Argument 4
19 1 uint8_t Argument 5

Note that Hexen things are 20 bytes in size; 10 bytes larger than things in Doom.

Hexen flags

bit hex description
0 0x0001 Thing is on skill levels 1 & 2
1 0x0002 Thing is on skill level 3
2 0x0004 Thing is on skill levels 4 & 5
3 0x0008 Thing is waiting in ambush
4 0x0010 Thing is dormant - it will not wake up until it is activated using Thing_Activate
5 0x0020 Thing appears to the Fighter class
6 0x0040 Thing appears to the Cleric class
7 0x0080 Thing appears to the Mage class
8 0x0100 Thing appears in single-player games
9 0x0200 Thing appears in cooperative games
10 0x0400 Thing appears in deathmatch games

Strife Format

Strife did not alter the thing structure like Hexen did, however it did make use of the unused flag bits.

Strife flags

bit hex description
0 0x0001 Thing is on skill levels 1 & 2
1 0x0002 Thing is on skill level 3
2 0x0004 Thing is on skill levels 4 & 5
3 0x0008 Thing stands still (only useful for specific enemies)
4 0x0010 Thing will not appear in single player
5 0x0020 Thing is waiting in ambush
6 0x0040 Thing is a friendly monster
7 0x0080 Unused
8 0x0100 Thing is 25% translucent
9 0x0200 Thing is either invisible, or 75% translucent if combined with bit 8.

Doom 64 format

The Doom 64 THING format is similar to the Doom format except for the inclusion of a z position and an ID. Each entry is 14 bytes long.

Offset Size (bytes) C99 type Description
0 2 int16_t x position
2 2 int16_t y position
4 2 int16_t z position
6 2 int16_t Angle facing
8 2 int16_t DoomEd thing type
10 2 int16_t Flags
12 2 int16_t ID

Doom 64 flags

Additional flags are defined in comparison to the Doom format, however flags 10 through 12 are not used in any Doom 64 maps.

bit hex description
0 0x0001 Thing is on skill levels 1 & 2
1 0x0002 Thing is on skill level 3
2 0x0004 Thing is on skill level 4
3 0x0008 Thing is waiting in ambush
4 0x0010 Thing is not in single player
5 0x0020 Thing doesn't spawn until triggered in level
6 0x0040 Thing triggers something when picked up
7 0x0080 Thing triggers something when killed
8 0x0100 Thing counts as secret in intermission screen
9 0x0200 Thing ignores other attackers (no infighting)
10 0x0400 Thing doesn't spawn in deathmatch games
11 0x0800 Thing doesn't in standard netgame mode
12 0x1000 Thing appears in nightmare mode (KEX Engine)

Sources