Doom engine

The source code to the Linux version of Doom was released to the public under a license that granted rights to non-commercial use on December 23, 1997, followed by the Linux version of Doom II about a week later on December 29, 1997.

[4][5] The source code was later re-released under the GNU General Public License v2.0 or later on October 3, 1999.

This limitation, however, has a silver lining: a "map mode" can be easily displayed, which represents the walls and the player's position, much like the first image to the right.

Vertices (or "vertexes" as they are referred to internally) are then joined to form lines, known as "linedefs".

The algorithm is fairly simple: The process is complete when the whole column of pixels is filled (i.e., there are no more gaps left).

This ordering ensures that no time is used drawing objects that are not visible and as a result maps can become very large without any speed penalty.

It is possible to perform a form of look up/down via "y-shearing", and many modern Doom source ports do this, as well as later games that use the engine, such as Heretic.

Essentially this works by moving the horizon line up and down within the screen, in effect providing a "window" on a taller viewable area.

The Doom engine renders the walls as it traverses the BSP tree, drawing subsectors by order of distance from the camera so that the closest segs are drawn first.

Once the engine reaches a solid (1-sided) wall at a particular x coordinate, no more lines need to be drawn at that area.

For clipping the engine stores a "map" of areas of the screen where solid walls have been reached.

Because of this, if a bad BSP builder is used, it is sometimes possible to get "holes" where the floor or ceiling bleeds down to the edges of the screen, a visual error commonly referred to as a "slime trail".

In that horizontal range where the inner square is drawn, two visplanes are needed for the surrounding floor.

Because of the way this works, the system is dependent on the fact that segs are rendered in order by the overall engine; it is necessary to draw nearer visplanes first, so that they can "cut off" by others further away.

Eventually, the visplanes form a "map" of particular areas of the screen in which to draw particular textures.

While visplanes are constructed essentially from vertical "strips", the actual low level rendering is performed in the form of horizontal "spans" of texture.

The edges of sprites are clipped by checking the list of segs previously drawn.

Sprites in Doom are stored in the same column based format as the walls are, which again is useful for the renderer.

In the 1990s a handful of developers acquired licenses to distribute total conversions of Doom, and following the 1997 source code release a number of standalone titles have been produced in the engine, including freeware, fangames and commercial titles.

Map view in editor