Doom source code
From DoomWiki.org
The Doom source code was released December 23, 1997, initially under a not-for-profit license. Later, permission was granted by John Carmack to re-release the source code under the GNU General Public License on October 3, 1999, albeit only via an email conversation.
Before release, the source code was 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 DMX sound library developed by Paul Radek which was used for Doom, the official release was of the source code to the Linux port of Doom. The original source code for the DOS version remained unavailable until the 2023 Doom source code leak, when a copy of the DOS source code, as well as the source code for the Doom Macintosh version, surfaced online. The source code for Doom95 remains unavailable.
Many source ports were created in the wake of the source code release, starting with DOSDoom, released on the same day as the official source code release, which aimed to port the game back to DOS. Thus, the release of the source code allowed for the establishment of popular source ports such as Boom, ZDoom, Doom Legacy, Doomsday, EDGE and Vavoom, which greatly increased capabilities for modding the game.
The GNU General Public License v2.0 was officially applied to the public id Software Doom repository on January 16, 2024, for the sake of preventing any future ambiguity. Older revisions can still be utilized under the older Doom Source License.[1]
The source code for the DOS and Macintosh versions of Doom were never publicly released, but were uploaded to the internet as part of the 2023 Doom source code leak. The source code for Doom95, on the other hand, remains unreleased and unavailable as of this writing.
Source code structure[edit]
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.
- AM_*
- Automap code
- D_*
- Initialisation/general code
- F_*
- "Finale" (end of game) and "screen melt" code.
- G_*
- Main game loop/control
- HU_*
- Heads-up display
- I_*
- System-specific code
- M_*
- Miscellaneous (includes the menu)
- P_*
- Game logic/behaviour
- R_*
- Rendering engine
- S_*
- Sound code
- ST_*
- Status bar
- V_*
- General graphic rendering
- WI_*
- End-of level "intermission" screen
- W_*
- WAD file loading
- Z_*
- 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:
- A_*
- Action functions invoked in sprite movement frames (these are the functions used in DeHackEd "code pointers")
- PIT_*
- Callback functions passed to iterator functions such as P_BlockThingsIterator (see p_maputl.c)
- T_*
- "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.
Doom Classic[edit]
Doom 3: BFG Edition incorporates the "Doom Classic" port allowing to play The Ultimate Doom and Doom II on 32- and 64-bit Windows, on the Xbox 360 and on the PlayStation 3. There are a few changes done to the source code and packaging here. Notably:
- Bugs introduced in the LinuxDoom code by Bernd Kreimeier's cleanup and changes are absent
- MUS2MIDI and TiMidity are incorporated for MIDI playback, instead of using DMX
- A few static limits have been raised, notably visplanes and drawsegs to accommodate for No Rest for the Living's levels
- Several #defines have been moved out of their original files and into either Precompiled.h or defs.h (both new files)
- The Master Levels and No Rest for the Living are handled as mission packs like TNT: Evilution and Plutonia
- The French language file is still present but emptied, French is removed from the language_t enum
- The code is available under the GPLv3 or later
Note: this should not be confused with the iOS port also named Doom Classic.
See also[edit]
- Doom source code functions
- Doom Source License
- Heretic source code
- Hexen source code
- Strife source code
- Doom 3 source code
- Game Engine Black Book: Doom - a book by Fabien Sanglard that embodies Bernd Kreimeier's original idea
External links[edit]
- Doomworld - 10 years of Doom - some history of the Doom source release.
- Doom source code at Doomworld/idgames (Original DOOM Source Licensed version)
- Doom source code at Doomworld/idgames (Revised GPL version)
- GitHub repository for Doom
- GitHub repository for Doom Classic
References[edit]
- ↑ Rubits, Mike (16 January 2024). "Add GPL information." GitHub. Retrieved 16 January 2024.