Difference between revisions of "Doom source code"

From DoomWiki.org

[unchecked revision][unchecked revision]
m (Reverted edit of, changed back to last version by Jdowland)
(the anonymous contributor was right, but i prefer "system specific")
Line 14: Line 14:
; G_*:  Main game loop/control
; G_*:  Main game loop/control
; HU_*:  [[Heads-up display]]
; HU_*:  [[Heads-up display]]
; I_*:  System-independent code
; I_*:  System-specific code
; M_*:  Miscellaneous (includes the menu)
; M_*:  Miscellaneous (includes the menu)
; P_*:  Game logic/behaviour
; P_*:  Game logic/behaviour

Revision as of 07:01, 19 December 2005

The Doom source code was released December 23, 1997, initially under a not-for-profit license. Later, permission was granted to re-release the source code under the GNU GPL in 1999.

Before release, the source code was apparently tidied up by Bernd Kreimeier; the source release includes a changelog of his contributions. Several documentation files are also included. The original plan for the source code release involved a book Kreimeier was to write on the Doom engine; however, due to Doom's decreasing relevance in the gaming community, it was eventually judged not to be a marketable idea, and the project was abandoned. The source code was then released to the public.

Because of legal issues regarding the sound library used for Doom, the release was of the source code to the Linux port of Doom. Despite this, within several months, several ports had been made back to DOS. As a result, many source ports exist.

Source code structure

The source code can be divided into sections. Files and functions within the source code have one- or two-letter prefixes to denote their subsystem.

Automap code
Initialisation/general code
"Finale" (end of game) and "screen melt" code.
Main game loop/control
Heads-up display
System-specific code
Miscellaneous (includes the menu)
Game logic/behaviour
Rendering engine
Sound code
Status bar
General graphic rendering
End-of level "intermission" screen
WAD file loading
Zone memory allocation system

The following are common prefixes for functions, although they do not denote a particular subsystem, and there are no files with these prefixes:

Action functions invoked in sprite movement frames (these are the functions used in Dehacked "code pointers")
Callback functions passed to P_BlockThingsIterator (see p_maputl.c)
"Thinker" functions set to be called each clock tic for some purpose (eg, moving platforms or flickering lights)

A detailed list of files and their purposes can be found in Doom source code: files.

External links