Quake engine

Last updated

Quake engine
Developer(s) id Software, (John Carmack, Michael Abrash, John Cash)
Final release
1.09 / December 21, 1999;24 years ago (1999-12-21)
Repository github.com/id-Software/Quake
Written in C, Assembly (for software rendering & optimization)
Platform DOS, AmigaOS, Microsoft Windows, macOS, Linux, Nintendo 64, Zeebo, Xbox One, Xbox Series X/S, PlayStation 4, PlayStation 5
Predecessor Doom engine
Successor Quake II engine, GoldSrc
License GNU GPL-2.0-or-later
Website www.idsoftware.com   OOjs UI icon edit-ltr-progressive.svg
Ingame screenshot of the first-person shooter Nexuiz, running on a modified Quake engine Nexuiz (screenshot 04).jpg
Ingame screenshot of the first-person shooter Nexuiz , running on a modified Quake engine

The Quake engine (Also known as id Tech 2) is the game engine developed by id Software to power their 1996 video game Quake . It featured true 3D real-time rendering. Since 2012, it has been licensed under the terms of GNU General Public License v2.0 or later.

Contents

After release, the Quake engine immediately forked. Much of the engine remained in Quake II and Quake III Arena . The Quake engine, like the Doom engine, used binary space partitioning (BSP) to optimise the world rendering. The Quake engine also used Gouraud shading for moving objects, and a static lightmap for non-moving objects.

Historically, the Quake engine has been treated as a separate engine from its successor, the Quake II engine. Although the codebases for Quake and Quake II were separate GPL releases. [1] [2] , both engines are now considered variants of id Tech 2.[ citation needed ]

History

The Quake engine was developed from 1995 for the video game Quake, released on June 22, 1996. John Carmack did most of the programming of the engine, with help from Michael Abrash in algorithms and assembly optimization. The Quake II engine (id Tech 2.5) was based on it.

John Romero initially conceived of Quake as an action game taking place in a fully 3D polygon world, inspired by Sega AM2's 3D fighting game Virtua Fighter . Quake was also intended to feature Virtua Fighter-influenced third-person melee combat. However, id Software considered it to be risky, and it would've taken longer to develop the engine. Because the project was taking too long, the third-person melee was eventually dropped. [3] [4]

Engine design and milestones

Reducing 3D complexity to increase speed

Simplified process of reducing map complexity in Quake QuakeMapTrim.PNG
Simplified process of reducing map complexity in Quake

Quake was the first true-3D game to use a special map design system that preprocessed and pre-rendered some elements of the 3D environment, so as to reduce the processing required when playing the game on the 50–75 MHz CPUs of the time. The 3D environment in which the game takes place is referred to as a map, even though it is three-dimensional in nature rather than a flat 2D space. The map editor program uses a number of simple convex 3D geometric objects known as brushes that are sized and rotated to build the environment. The brushes are placed and oriented to create an enclosed, empty, volumetric space, and when the design is complete, the map is run through the rendering preprocessor. The preprocessor is used to locate two types of empty space in the map: the empty space enclosed by brushes where the game will be played and the other empty space outside the brushes that the player will never see. The preprocessor then strips away the back faces of the individual brushes, which are outside the game space, leaving only a few polygons that define the outer perimeter of the enclosed game space.

Generally, once a map has been preprocessed, it cannot be re-edited in a normal fashion because the original brushes have been cut into small pieces. Instead, the original map editor data with the brushes is retained and used to create new versions of the map. But it is possible to edit a processed map by opening it in a special vertex editor and editing the raw vertex data, or to add or remove individual triangle faces. Though difficult, this technique was occasionally used by cheaters to create windows in walls, to see normally hidden enemies approaching from behind doors and walls, and resulted in an anti-cheat mechanism used in recent 3D games that calculates a checksum for each file used in the game, to detect players using potentially hacked map files.

A processed map file can have a much lower polygon count than the original unprocessed map, often by 50–80%. On the 50–75 MHz PCs of the time, it was common for this pruning step to take many hours to complete on a map, often running overnight if the map design was extremely complex.

This preprocessing step cannot work if there are any small holes or "leaks" that interconnect the interior game space with the exterior empty space, and it was common for complex map-building projects to be abandoned because the map designer could not locate the leaks in their map. To prevent leaks, the brushes should overlap and slightly interpenetrate each other; attempting to perfectly align along the edges of unusually shaped brushes on a grid can result in very small gaps that are difficult to locate. Modern level editors feature leak detection, alleviating this issue.

The open sky in Quake maps is in fact not open, but is covered over and enclosed with large brushes, and textured with a special skybox texture, which is programmed to use sphere mapping, and thus always looks the same from any viewing position, giving the illusion of a distant sky.

Precalculating lighting and shadows

Quake also incorporated the use of lightmaps and 3D light sources, as opposed to the sector-based static lighting used in games of the past. id Software's innovation has been used for many 3D games released since, particularly first-person shooters, though id Software switched to a Unified lighting and shadowing model for Doom 3 (however, they switched back to a lightmapped or semi-lightmapped method starting with RAGE ). After a map had been pruned of excess polygons, a second preprocessing system was used to precalculate and bake the lightmaps into the game map to further reduce load on the CPU when playing the game. However, full light processing could take an extremely long time, so for the initial map design process, lesser-quality light processing could be done, but at the cost of creating a jagged stair-step lightcast around lights.

Sectioning the map to increase speed

To further decrease the workload of 3D rendering, a mechanism was developed to section off large regions of the map not currently visible to the player, so the engine would not need to render those unseen spaces. A 3D rendering engine without any such optimizations must draw every part of the world and then attempt to determine which polygons are the closest, then hide all polygons located behind these closest polygons (a technique known as Z-buffering). Just because a polygon is not visible does not mean it is excluded from the scene calculations.

The Quake engine was optimized specifically to obviate this problem. The engine could be told ahead of time to not calculate rendering for all objects in any space out of the player's view, greatly reducing the rendering load on the CPU. This effect is noticeable in the game as small tunnels with sharp 90-degree bends leading from one large space into another. This small tunnel serves to block view into the adjoining unrendered space, and a special type of transparent brush (called a visportal) is placed within it to define the edge of where the engine should stop rendering the adjoining space. It is uncommon in the original Quake to be able to see across the entire length of a map, and outdoor spaces are often very tall and narrow, primarily utilizing distance above into open sky or below into lava to create a low-polygonal illusion of expanse.

How sectioning is performed

A binary space partitioning (BSP) tree is built from the map, simplifying complexity of searching for a given polygon to O(number of polygons). Each leaf creates some area of 3D space (imagine cutting a pie into arbitrary pieces). The leaves of this binary tree have polygons of the original map associated with them, which are then used for computing each area's visibility. For each area, the VSD algorithm finds the parts of the map for which a line of sight exists. This is called the potentially visible set (PVS). [5]

This process uses large amounts of memory, since it should take (where is the number of polygons) bits (only visible/hidden information is needed). John Carmack realized that one area sees just a small fraction of the other areas, so he compressed this information by using run-length encoding (RLE). This is what allowed Quake's complex geometry to be rendered so quickly on the hardware of the time.

Speeding up the rendering, and rendering order

To reduce overdraw (rendering a new pixel that hides a previously rendered point, meaning the previous work was useless and wasted), the environment was displayed first, from front to back. To hide parts of walls hidden by other walls, a Global Edge List was sorting edges of already rendered polygons; new polygons were first clipped against previous edges so that only visible parts would get to the frame buffer.

Also while rendering the environment, a z-buffer was filled but never read while rendering the environment, as the BSP tree and Global Edge List ensured that each pixel was rendered only once. The ZBuffer was later used to render correctly characters and other moving objects that were partially hidden by the environment.

The pixel rendering loop was implemented in assembly. The texture coordinates perspective correction and interpolation was done using the floating-point unit, due to the limited number of integer registers; it also allows to compute expensive division operation (part of perspective correction) on the floating-point unit in parallel with integer interpolation (in other words, at no cost).

The base texture and the lightmap of a wall were rendered at the same time: a "surface cache" was creating new surfaces, which are new pre-lighted textures which combines the base and light map textures baked together. Surfaces not used since a few frames were released, while new required Surfaces were dynamically created. Generating the surfaces was consuming less time than a secondary lighting pass would have. To save memory, smaller surfaces using mipmaps of the original texture were generated first for further walls.

Characters were lit by an ambient light and fixed distant light both dependent on the light level of the spot on the floor where the character was standing. Close-by characters were Gouraud shaded and affinely textured, whereas faraway characters were rendered using triangle subdivision. [6]

Hardware 3D acceleration

Quake was one of the first games to support 3D hardware acceleration. [ citation needed ] While initially released with only software rendering, John Carmack created a version of the Quake executable that took advantage of Rendition's Vérité 1000 graphics chip (VQuake). OpenGL support was added in the form of the GLQuake executable for Windows 95 and higher. Other cards capable of rendering GLQuake were a professional (and very expensive) Intergraph 3D OpenGL card and later, the PowerVR cards.

To optimize the software rendering engine, lightmaps were shared by polygons that were close in space, and in the same leaf of the BSP tree. This means that quite often polygons using the same main texture could not be rendered at the same time with the 3D acceleration, due to the multi-texturing second unit having to be reconfigured with another lightmap. This architecture decision reduced hardware-accelerated rendering performance.[ clarification needed ]

Network play

Quake includes cooperative and deathmatch multiplayer modes over LAN or the Internet. Additional multiplayer modes were later added using mods.

Quake uses the client–server model, where a server has control of all game events. All players connect to this server in order to participate, with the server telling the clients what is happening in the game. The server may either be a dedicated server or a Listen Server. Even in the latter situation, Quake still uses the client-server model, as opposed to the peer-to-peer networking used by some other games. Quake thus cannot suffer from de-synchronized network games that could occur from different clients disagreeing with each other, since the server is always the final authority.

Derivative engines

Family tree illustrating derivations of Quake engines Quake - family tree.svg
Family tree illustrating derivations of Quake engines

On December 21, 1999, John Carmack of id Software released the Quake engine source code on the Internet under the terms of GPL-2.0-or-later, allowing programmers to edit the engine and add new features. Programmers were soon releasing new versions of the engine on the net. Some of the most known engines are:

Games using the Quake engine

YearTitleDeveloper(s)Publisher(s)
1996 Quake id Software GT Interactive
1997 Quake Mission Pack No. 1: Scourge of Armagon Hipnotic Interactive 3D Realms
Quake Mission Pack No. 2: Dissolution of Eternity Rogue Entertainment 3D Realms
Hexen II Raven Software id Software, Activision
Malice Ratloop Quantum Axcess
ShrakQuantum AxcessQuantum Axcess
X-Men: The Ravages of Apocalypse Zero Gravity Entertainment WizardWorks
1998 Hexen II Mission Pack: Portal of Praevus Raven Software id Software
Activision
2000 Laser Arena Trainwreck Studios ValuSoft
2001CIA Operative: Solo Missions Trainwreck Studios ValuSoft
Urban MercenaryMoshpit EntertainmentMoshpit Entertainment
2002Eternal War: Shadows of LightTwo Guys SoftwareTwo Guys Software
2005 Nexuiz Alientrap Alientrap
2011 Xonotic Team XonoticTeam Xonotic
2021 (Early access)Doombringer [14] Anomic GamesAnomic Games
2023 Wrath: Aeon of Ruin Killpixel 3D Realms
1C Entertainment
Blood WestHyperstrangeHyperstrange

Quake engine tools

See also

Related Research Articles

<i>Quake</i> (video game) 1996 video game

Quake is a first-person shooter game developed by id Software and published by GT Interactive. The first game in the Quake series, it was originally released for MS-DOS, Microsoft Windows and Linux in 1996, followed by Mac OS and Sega Saturn in 1997 and Nintendo 64 in 1998. In the game, players must find their way through various maze-like, medieval environments while battling monsters using an array of weaponry. Quake takes inspiration from gothic fiction and the works of H. P. Lovecraft.

<span class="mw-page-title-main">John Carmack</span> American computer programmer and video game developer

John D. Carmack II is an American computer programmer and video game developer. He co-founded the video game company id Software and was the lead programmer of its 1990s games Commander Keen, Wolfenstein 3D, Doom, Quake, and their sequels. Carmack made innovations in 3D computer graphics, such as his Carmack's Reverse algorithm for shadow volumes.

<span class="mw-page-title-main">Binary space partitioning</span> Method for recursively subdividing a space into two subsets using hyperplanes

In computer science, binary space partitioning (BSP) is a method for space partitioning which recursively subdivides a Euclidean space into two convex sets by using hyperplanes as partitions. This process of subdividing gives rise to a representation of objects within the space in the form of a tree data structure known as a BSP tree.

<span class="mw-page-title-main">Texture mapping</span> Method of defining surface detail on a computer-generated graphic or 3D model

Texture mapping is a method for mapping a texture on a computer-generated graphic. Texture here can be high frequency detail, surface texture, or color.

id Tech 1, also known as the Doom engine, is the game engine used in the id Software video games Doom and Doom II: Hell on Earth. It is also used in Heretic, Hexen: Beyond Heretic, Strife: Quest for the Sigil, Hacx: Twitch 'n Kill, Freedoom, and other games produced by licensees. It was created by John Carmack, with auxiliary functions written by Mike Abrash, John Romero, Dave Taylor, and Paul Radek. Originally developed on NeXT computers, it was ported to MS-DOS and compatible operating systems for Doom's initial release and was later ported to several game consoles and operating systems.

Irrlicht is an open-source game engine written in C++. It is cross-platform, officially running on Windows, macOS, Linux and Windows CE and due to its open nature ports to other systems are available, including FreeBSD, Xbox, PlayStation Portable, Symbian, iPhone, AmigaOS 4, Sailfish OS via a QT/Qml wrapper, and Google Native Client.

<span class="mw-page-title-main">Build (game engine)</span> First-person shooter engine

The Build Engine is a first-person shooter engine created by Ken Silverman, author of Ken's Labyrinth, for 3D Realms. Like the Doom engine, the Build Engine represents its world on a two-dimensional grid using closed 2D shapes called sectors, and uses simple flat objects called sprites to populate the world geometry with objects.

A first-person shooter engine is a video game engine specialized for simulating 3D environments for use in a first-person shooter video game. First-person refers to the view where the players see the world from the eyes of their characters. Shooter refers to games which revolve primarily around wielding firearms and killing other entities in the game world, either non-player characters or other players.

<span class="mw-page-title-main">Lightmap</span> Data structure used in lightmapping

A lightmap is a data structure used in lightmapping, a form of surface caching in which the brightness of surfaces in a virtual scene is pre-calculated and stored in texture maps for later use. Lightmaps are most commonly applied to static objects in applications that use real-time 3D computer graphics, such as video games, in order to provide lighting effects such as global illumination at a relatively low computational cost.

<span class="mw-page-title-main">Quake Army Knife</span> 3D asset developing program

Quake Army Knife, is a free and open-source program for developing 3D assets for a large variety of first-person shooters, such as video games using the Quake engine by id Software or the Torque engine.

<span class="mw-page-title-main">Software rendering</span> Generating images by computer software

Software rendering is the process of generating an image from a model by means of computer software. In the context of computer graphics rendering, software rendering refers to a rendering process that is not dependent upon graphics hardware ASICs, such as a graphics card. The rendering takes place entirely in the CPU. Rendering everything with the (general-purpose) CPU has the main advantage that it is not restricted to the (limited) capabilities of graphics hardware, but the disadvantage is that more transistors are needed to obtain the same speed.

id Tech 3 Video game engine

id Tech 3, popularly known as the Quake III Arena engine, is a game engine developed by id Software for their video game Quake III Arena. It has been adopted by numerous games. During its time, it competed with the Unreal Engine; both engines were widely licensed.

<i>Quake II</i> engine Game engine

The Quake II engine is a game engine developed by id Software for use in their 1997 first-person shooter Quake II. It is the successor to the Quake engine. Since its release, the Quake II engine has been licensed for use in several other games.

id Tech 4 Video game engine

id Tech 4, popularly known as the Doom 3 engine, is a game engine developed by id Software and first used in the video game Doom 3. The engine was designed by John Carmack, who also created previous game engines, such as those for Doom and Quake, which are widely recognized as significant advances in the field. This OpenGL-based game engine has also been used in Quake 4, Prey, Enemy Territory: Quake Wars, Wolfenstein, and Brink. id Tech 4 is licensed under the terms of the GNU General Public License v3.0 or later.


Pre-rendering is the process in which video footage is not rendered in real-time by the hardware that is outputting or playing back the video. Instead, the video is a recording of footage that was previously rendered on different equipment. Pre-rendered assets may also be outsourced by the developer to an outside production company. Such assets usually have a level of complexity that is too great for the target platform to render in real-time.

id Tech 5 Video game engine

id Tech 5 is a proprietary game engine developed by id Software. It followed its predecessors, id Tech 1, 2, 3 and 4, all of which had subsequently been published under the GNU General Public License. It was seen as a major advancement over id Tech 4. The engine was first demonstrated at the WWDC 2007 by John D. Carmack on an eight-core computer; however, the demo used only a single core with single-threaded OpenGL implementation running on a 512 MB 7000 class Quadro video card. id Tech 5 was first used in the video game Rage, followed by Wolfenstein: The New Order, The Evil Within and Wolfenstein: The Old Blood. It was followed up by id Tech 6.

id Tech Series of video game engines

id Tech is a series of separate game engines designed and developed by id Software. Prior to the presentation of the id Tech 5-based game Rage in 2011, the engines lacked official designation and as such were simply referred to as the Doom and Quake engines, from the name of the main game series the engines had been developed for. "id Tech" has been released as free software under the GNU General Public License. id Tech versions 0 to 3 were released under GPL-2.0-or-later. id Tech versions 3.5 to 4.5 were released under GPL-3.0-or-later. id Tech 5 to 7 are proprietary, with id Tech 7 currently being the latest utilized engine.

id Tech 6 is a multiplatform game engine developed by id Software. It is the successor to id Tech 5 and was first used to create the 2016 video game Doom. Internally, the development team also used the codename id Tech 666 to refer to the engine. The PC version of the engine is based on Vulkan API and OpenGL API.

<i>Xonotic</i> 2011 video game

Xonotic is a free and open-source first-person shooter video game. It was developed as a fork of Nexuiz, following controversy surrounding the game's development. The game runs on a heavily modified version of the Quake engine known as the DarkPlaces engine. Its gameplay is inspired by Unreal Tournament and Quake, but with various unique elements.

References

  1. "Quake engine GPL release". GitHub . Retrieved May 24, 2020.
  2. "id Tech 2 GPL release". GitHub . Retrieved May 24, 2020.
  3. "Does John Romero Still Enjoy Shooting People?". Next Generation . No. 30. June 1997. pp. 9–12.
  4. Edge , May 1997, My original idea was to do something like Virtua Fighter in a 3D world, with full-contact fighting, but you'd also be able to run through a world, and do the same stuff you do in Quake, only when you got into these melees, the camera would pull out into a third-person perspective. It would've been great, but nobody else had faith in trying it. The project was taking too long, and everybody just wanted to fall back on the safe thing – the formula.
  5. Abrash, Michael. "Quake's 3-D Engine: The Big Picture" . Retrieved August 22, 2012.
  6. "Surface Caching Revisited, Quake's Triangle Models, and More".
  7. "DarkPlaces Homepage". icculus.org. Retrieved November 6, 2017.
  8. "Darkplaces subversion repository". svn.icculus.org. Retrieved August 9, 2019.
  9. darkplacesengine/darkplaces, DarkPlaces Engine, June 14, 2021, retrieved June 21, 2021
  10. "DarkPlaces Quake Engine on Xonotic GitLab" . Retrieved February 3, 2020.
  11. "DarkPlaces Quake Engine on Xonotic GitHub". GitHub . Retrieved November 6, 2017.
  12. Gneiting, Axel (July 20, 2016). "My Vulkan Quake 1 Port running "In the Shadows" mod. Some stuff still missing. Code is here https://github.com/Novum/vkQuake". Twitter . Retrieved August 6, 2016.
  13. "Vulkan Quake port based on QuakeSpasm". github.com/Novum/vkQuake. Retrieved August 6, 2016.
  14. Dawe, Liam (June 5, 2021). "DOOMBRINGER is a new first-person shooter from veterans of the Doom and Quake communities" . Retrieved December 26, 2023.
  15. Pearson, Craig (March 12, 2013). "Make Quake With TrenchBroom". Rock Paper Shotgun . Retrieved September 17, 2023.