Difference between revisions of "Thing"

From DoomWiki.org

[checked revision][checked revision]
m (Doom 64 format: grammar)
(add C99 columns as per other lump articles, improve table fmtg)
Line 6: Line 6:
 
{{Doom level format}}
 
{{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]].
 
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}}
+
{| {{prettytable|style=text-align: center;}}
!Offset
+
! Offset
!Size (bytes)
+
! Size (bytes)
!Description
+
! C99 type
|-
+
! Description
| align="center" | 0 || align="center" | 2 || ''x'' position
 
 
|-
 
|-
| align="center" | 2 || align="center" | 2 || ''y'' position
+
| 0 || 2 || int16_t
 +
| style="text-align: left;" | ''x'' position
 
|-
 
|-
| align="center" | 4 || align="center" | 2 || [[Angle]] facing
+
| 2 || 2 || int16_t
 +
| style="text-align: left;" | ''y'' position
 
|-
 
|-
| align="center" | 6 || align="center" | 2 || DoomEd [[thing type]]
+
| 4 || 2 || int16_t
 +
| style="text-align: left;" | [[Angle]] facing
 
|-
 
|-
| align="center" | 8 || align="center" | 2 || Flags
+
| 6 || 2 || int16_t
 +
| style="text-align: left;" | DoomEd [[thing type]]
 
|-
 
|-
 +
| 8 || 2 || int16_t
 +
| style="text-align: left;" | Flags
 
|}
 
|}
 +
 
===Flags===
 
===Flags===
  
Line 36: Line 42:
 
|-
 
|-
 
|4||0x0010||Thing is not in single player
 
|4||0x0010||Thing is not in single player
|-
 
 
|}
 
|}
  
Line 64: Line 69:
 
[[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.
 
[[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.
  
{| {{prettytable}}
+
{| {{prettytable|style=text-align: center;}}
!Offset
+
! Offset
!Size (bytes)
+
! Size (bytes)
!Description
+
! C99 type
 +
! Description
 
|-
 
|-
|0||2||Thing id (tid)
+
| 0 || 2 || int16_t
 +
| style="text-align: left;" | Thing id (tid)
 
|-
 
|-
|2||2||X position
+
| 2 || 2 || int16_t
 +
| style="text-align: left;" | X position
 
|-
 
|-
|4||2||Y position
+
| 4 || 2 || int16_t
 +
| style="text-align: left;" | Y position
 
|-
 
|-
|6||2||Starting height
+
| 6 || 2 || int16_t
 +
| style="text-align: left;" | Starting height
 
|-
 
|-
|8||2||Angle facing
+
| 8 || 2 || int16_t
 +
| style="text-align: left;" | Angle facing
 
|-
 
|-
|10||2||DoomEd thing type
+
| 10 || 2 || int16_t
 +
| style="text-align: left;" | DoomEd thing type
 
|-
 
|-
|12||2||Flags
+
| 12 || 2 || int16_t
 +
| style="text-align: left;" | Flags
 
|-
 
|-
|14||1||[[Hexen action special]]
+
| 14 || 1 || uint8_t
 +
| style="text-align: left;" | [[Hexen action special]]
 
|-
 
|-
|15||1||Argument 1
+
| 15 || 1 || uint8_t
 +
| style="text-align: left;" | Argument 1
 
|-
 
|-
|16||1||Argument 2
+
| 16 || 1 || uint8_t
 +
| style="text-align: left;" | Argument 2
 
|-
 
|-
|17||1||Argument 3
+
| 17 || 1 || uint8_t
 +
| style="text-align: left;" | Argument 3
 
|-
 
|-
|18||1||Argument 4
+
| 18 || 1 || uint8_t
 +
| style="text-align: left;" | Argument 4
 
|-
 
|-
|19||1||Argument 5
+
| 19 || 1 || uint8_t
 +
| style="text-align: left;" | Argument 5
 
|}
 
|}
  
Line 124: Line 143:
 
|-
 
|-
 
|10||0x0400||Thing appears in deathmatch games
 
|10||0x0400||Thing appears in deathmatch games
|-
 
 
|}
 
|}
  
Line 157: Line 175:
 
==Doom 64 format==
 
==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.
 
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}}
+
{| {{prettytable|style=text-align: center;}}
!Offset
+
! Offset
!Size (bytes)
+
! Size (bytes)
!Description
+
! C99 type
|-
+
! Description
|0||2||''x'' position
 
 
|-
 
|-
|2||2||''y'' position
+
| 0 || 2 || int16_t
 +
| style="text-align: left;" | ''x'' position
 
|-
 
|-
|4||2||''z'' position
+
| 2 || 2 || int16_t
 +
| style="text-align: left;" | ''y'' position
 
|-
 
|-
|6||2||[[Angle]] facing
+
| 4 || 2 || int16_t
 +
| style="text-align: left;" | ''z'' position
 
|-
 
|-
|8||2||DoomEd [[thing type]]
+
| 6 || 2 || int16_t
 +
| style="text-align: left;" | [[Angle]] facing
 
|-
 
|-
|10||2||Flags
+
| 8 || 2 || int16_t
 +
| style="text-align: left;" | DoomEd [[thing type]]
 
|-
 
|-
|12||2||ID
+
| 10 || 2 || int16_t
 +
| style="text-align: left;" | Flags
 
|-
 
|-
 +
| 12 || 2 || int16_t
 +
| style="text-align: left;" | ID
 
|}
 
|}
  

Revision as of 05:50, 27 June 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