World Physics and Thinkers

World Physics and Thinkers

Doom’s runtime world is advanced through thinkers, a common update mechanism declared in d_think.h and managed in p_tick.c. Movers, monsters, projectiles, doors, platforms, and related dynamic entities register behavior that is executed during the play tick, rather than being driven by one enormous switch over every possible object kind.

Mobjs and special movers advanced through the thinker list

p_mobj.c handles mobile objects, or mobjs, including spawning, movement, and state progression. Collision and line interactions are distributed across files such as p_map.c, p_maputl.c, p_inter.c, and p_sight.c; special map behavior, including floors, ceilings, doors, plats, and lights, is represented in the corresponding p_*.c systems.

A bounded world model

The map representation provides sectors, linedefs, sidedefs, vertices, and things, while the play code interprets them as a changing simulation. An attempted movement is therefore not merely a coordinate addition: it queries blocking lines, other mobjs, floor and ceiling constraints, special-line crossings, and possibly damage or pickup interactions. The apparent simplicity of a Doom monster walking down a corridor is the result of several local systems agreeing on the result of that movement.

Following a feature from P_Ticker into its thinker and then into collision or special-line code is generally more reliable than searching for a monster or door by name. The engine is organized around update responsibilities, not around a single object-oriented class hierarchy.