Mobj

A mobj, short for map object, is a type of thinker that roughly corresponds to things: players, monsters, items, obstacles and decorations, map spots such as teleport destinations or boss shooter destinations, and so on, are all map objects. Mobjs are also frequently called actors. Code comments present them as such: // MapObj data. Map Objects or mobjs are actors, entities, // thinker, take-your-pick... anything that moves, acts, or // suffers state changes of more or less violent nature.

In the source code, mobjs are represented by the enum and the  and  structures. The order in which the mobj types are declared in the and  files corresponds to their DeHackEd number, and most DeHackEd changes consist in altering the values of the mobjinfos' properties. The mobjinfo corresponds to the "class" of a mobj (for example, imp) whereas the mobj corresponds to a particular "instance" of the class (for example, the imp that waits in the exit room of E1M1). The structure determines how many hit points a mobj starts with, which states it uses, what its flags are, what sounds it makes, what is its reaction time, its movement speed, and so on. The structure stores its current position and momentum, which sector it is in, what is its current state, its current target, where it should respawn in Nightmare! mode, and so on.