Quake Engine
   HOME

TheInfoList



OR:

The ''Quake'' engine is the
game engine A game engine is a software framework primarily designed for the development of video games and generally includes relevant libraries and support programs. The "engine" terminology is similar to the term "software engine" used in the software i ...
developed by
id Software id Software LLC () is an American video game developer based in Richardson, Texas. It was founded on February 1, 1991, by four members of the computer company Softdisk: programmers John Carmack and John Romero, game designer Tom Hall, and ar ...
to power their 1996 video game '' Quake''. It featured
true 3D 3D computer graphics, or “3D graphics,” sometimes called CGI, 3D-CGI or three-dimensional computer graphics are graphics that use a three-dimensional representation of geometric data (often Cartesian) that is stored in the computer for the ...
real-time rendering Real-time computer graphics or real-time rendering is the sub-field of computer graphics focused on producing and analyzing images in real time. The term can refer to anything from rendering an application's graphical user interface ( GUI) to ...
and is now licensed under the terms of GNU General Public License v2.0 or later. After release, it immediately
fork In cutlery or kitchenware, a fork (from la, furca 'pitchfork') is a utensil, now usually made of metal, whose long handle terminates in a head that branches into several narrow and often slightly curved tines with which one can spear foods ei ...
ed, as did the level design. Much of the engine remained in ''
Quake II ''Quake II'' is a 1997 first-person shooter video game developed by id Software and published by Activision. It is the second installment of the Quake (series), ''Quake'' series, but not a direct sequel to ''Quake (video game), Quake''. The game ...
'' and ''
Quake III Arena ''Quake III Arena'' is a 1999 multiplayer-focused first-person shooter developed by id Software. The third installment of the ''Quake'' series, ''Arena'' differs from previous games by excluding a story-based single-player mode and focusing prima ...
''. The ''Quake'' engine, like the ''Doom'' engine, used
binary space partitioning 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 represent ...
(BSP) to optimise the world rendering. The ''Quake'' engine also used
Gouraud shading Gouraud shading, named after Henri Gouraud, is an interpolation method used in computer graphics to produce continuous shading of surfaces represented by polygon meshes. In practice, Gouraud shading is most often used to achieve continuous l ...
for moving objects, and a static
lightmap 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 o ...
for nonmoving objects. Historically, the ''Quake'' engine has been treated as a separate engine from its successor, the ''Quake II'' engine. However, both engines are now considered variants of
id Tech 2 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 sev ...
. Although, the codebases for ''Quake'' and ''Quake II'' were separate GPL releases.


History

The ''Quake'' engine was developed from 1995 for the video game ''Quake'', released on June 22, 1996.
John Carmack John D. Carmack II (born August 20, 1970) 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'', ''Doo ...
did most of the programming of the engine, with help from
Michael Abrash Michael Abrash is a programmer and technical writer specializing in code optimization and 80x86 assembly language. He wrote the 1990 book ''Zen of Assembly Language Volume 1: Knowledge'' and a monthly column in '' Dr. Dobb's Journal'' in the earl ...
in
algorithm In mathematics and computer science, an algorithm () is a finite sequence of rigorous instructions, typically used to solve a class of specific Computational problem, problems or to perform a computation. Algorithms are used as specificat ...
s and
assembly Assembly may refer to: Organisations and meetings * Deliberative assembly, a gathering of members who use parliamentary procedure for making decisions * General assembly, an official meeting of the members of an organization or of their representa ...
optimization Mathematical optimization (alternatively spelled ''optimisation'') or mathematical programming is the selection of a best element, with regard to some criterion, from some set of available alternatives. It is generally divided into two subfi ...
. The
Quake II 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 sev ...
(id Tech 2) was based on it.
John Romero John is a common English name and surname: * John (given name) * John (surname) John may also refer to: New Testament Works * Gospel of John, a title often shortened to John * First Epistle of John, often shortened to 1 John * Second ...
initially conceived of ''Quake'' as an
action game An action game is a video game genre that emphasizes physical challenges, including hand–eye coordination and reaction-time. The genre includes a large variety of sub-genres, such as fighting games, beat 'em ups, shooter games, and platform gam ...
taking place in a fully 3D polygon world, inspired by
Sega AM2 previously known as is a video game development team within the Japanese multinational video game developer Sega. Yu Suzuki, who had previously developed arcade games for Sega including ''Hang-On'' and ''Out Run'', was the first manager of th ...
's 3D
fighting game A fighting game, also known as a versus fighting game, is a video game genre, genre of video game that involves combat between two or more players. Fighting game combat often features mechanics such as Blocking (martial arts), blocking, grappli ...
''
Virtua Fighter is a series of fighting games created by Sega-AM2 and designer Yu Suzuki. The original ''Virtua Fighter'' was released in October 1993 and has received four main sequels and several spin-offs. The highly influential first ''Virtua Fighter'' game ...
''. ''Quake'' was also intended to feature ''Virtua Fighter''-influenced third-person
melee combat A melee ( or , French: mêlée ) or pell-mell is disorganized hand-to-hand combat in battles fought at abnormally close range with little central control once it starts. In military aviation, a melee has been defined as " air battle in whic ...
. 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.


Engine design and milestones


Reducing 3D complexity to increase speed

''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 A brush is a common tool with bristles, wire or other filaments. It generally consists of a handle or block to which filaments are affixed in either a parallel or perpendicular orientation, depending on the way the brush is to be gripped durin ...
'' 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 Vertex, vertices or vertexes may refer to: Science and technology Mathematics and computer science *Vertex (geometry), a point where two or more curves, lines, or edges meet *Vertex (computer graphics), a data structure that describes the position ...
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 A checksum is a small-sized block of data derived from another block of digital data for the purpose of detecting errors that may have been introduced during its transmission or storage. By themselves, checksums are often used to verify data ...
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. 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 In computer graphics, sphere mapping (or spherical environment mapping) is a type of reflection mapping that approximates reflective surfaces by considering the environment to be an infinitely far-away spherical wall. This environment is stored as ...
, 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 ''Doom 3'' is a 2004 survival horror first-person shooter video game developed by id Software and published by Activision. ''Doom 3'' was originally released for Microsoft Windows on August 3, 2004, adapted for Linux later that year, and ported ...
'' (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 A depth buffer, also known as a z-buffer, is a type of data buffer used in computer graphics to represent depth information of objects in 3D space from a particular perspective. Depth buffers are an aid to rendering a scene to ensure that the ...
). 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 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 represent ...
(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 In computer science, a binary tree is a k-ary k = 2 tree data structure in which each node has at most two children, which are referred to as the ' and the '. A recursive definition using just set theory notions is that a (non-empty) binary t ...
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 In 3D computer graphics, Potentially Visible Sets are used to accelerate the rendering of 3D environments. They are a form of occlusion culling, whereby a candidate set of ''potentially visible'' polygons are pre-computed, then indexed at run-t ...
(PVS). This process uses large amounts of memory, since it should take O(n^2) (where n is the number of polygons) bits (only visible/hidden information is needed).
John Carmack John D. Carmack II (born August 20, 1970) 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'', ''Doo ...
realized that one area sees just a small fraction of the other areas, so he compressed this information by using
run-length encoding Run-length encoding (RLE) is a form of lossless data compression in which ''runs'' of data (sequences in which the same data value occurs in many consecutive data elements) are stored as a single data value and count, rather than as the original ...
(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 A depth buffer, also known as a z-buffer, is a type of data buffer used in computer graphics to represent depth information of objects in 3D space from a particular perspective. Depth buffers are an aid to rendering a scene to ensure that the ...
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 In the mathematical field of numerical analysis, interpolation is a type of estimation, a method of constructing (finding) new data points based on the range of a discrete set of known data points. In engineering and science, one often has a n ...
was done using the
floating-point unit In computing, floating-point arithmetic (FP) is arithmetic that represents real numbers approximately, using an integer with a fixed precision, called the significand, scaled by an integer exponent of a fixed base. For example, 12.345 can b ...
, 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 Baking is a method of preparing food that uses dry heat, typically in an oven, but can also be done in hot ashes, or on hot stones. The most common baked item is bread but many other types of foods can be baked. Heat is gradually transferre ...
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
mipmap In computer graphics, mipmaps (also MIP maps) or pyramids are pre-calculated, optimized sequences of images, each of which is a progressively lower resolution representation of the previous. The height and width of each image, or level, in the m ...
s 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.


Hardware 3D acceleration

''Quake'' was one of the first games to support 3D
hardware acceleration Hardware acceleration is the use of computer hardware designed to perform specific functions more efficiently when compared to software running on a general-purpose central processing unit (CPU). Any transformation of data that can be calcula ...
. While initially released with only
software rendering 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 AS ...
, John Carmack created a version of the ''Quake'' executable that took advantage of Rendition's Vérité 1000 graphics chip (
VQuake ''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 ...
).
OpenGL OpenGL (Open Graphics Library) is a cross-language, cross-platform application programming interface (API) for rendering 2D and 3D vector graphics. The API is typically used to interact with a graphics processing unit (GPU), to achieve hardwa ...
support was added in the form of the ''
GLQuake ''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 ...
'' executable for Windows 95 and higher. Other cards capable of rendering ''GLQuake'' were a professional (and very expensive)
Intergraph Intergraph Corporation was an American software development and services company, which now forms part of Hexagon AB. It provides enterprise engineering and geospatially powered software to businesses, governments, and organizations around the w ...
3D OpenGL card and later, the
PowerVR PowerVR is a division of Imagination Technologies (formerly VideoLogic) that develops hardware and software for 2D and 3D rendering, and for video encoding, decoding, associated image processing and DirectX, OpenGL ES, OpenVG, and OpenCL accelera ...
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.


Network play

''Quake'' includes
cooperative A cooperative (also known as co-operative, co-op, or coop) is "an autonomous association of persons united voluntarily to meet their common economic, social and cultural needs and aspirations through a jointly owned and democratically-control ...
and
deathmatch Deathmatch, also known as free-for-all, is a gameplay mode integrated into many shooter games, including first-person shooter (FPS), and real-time strategy (RTS) video games, where the goal is to kill (or "frag") the other players' characters a ...
multiplayer modes over LAN or the
Internet The Internet (or internet) is the global system of interconnected computer networks that uses the Internet protocol suite (TCP/IP) to communicate between networks and devices. It is a '' network of networks'' that consists of private, pub ...
. Additional multiplayer modes were later added using mods. ''Quake'' uses the
client–server model The client–server model is a distributed application structure that partitions tasks or workloads between the providers of a resource or service, called servers, and service requesters, called clients. Often clients and servers communicate over ...
, where a
server Server may refer to: Computing *Server (computing), a computer program or a device that provides functionality for other programs or devices, called clients Role * Waiting staff, those who work at a restaurant or a bar attending customers and su ...
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 A dedicated hosting service, dedicated server, or managed hosting service is a type of Internet hosting in which the client leases an entire server not shared with anyone else. This is more flexible than shared hosting, as organizations have f ...
or a Listen Server. Even in the latter situation, ''Quake'' still uses the client-server model, as opposed to the
peer-to-peer Peer-to-peer (P2P) computing or networking is a distributed application architecture that partitions tasks or workloads between peers. Peers are equally privileged, equipotent participants in the network. They are said to form a peer-to-peer n ...
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

On December 21, 1999, John Carmack of id Software released the ''Quake'' engine
source code In computing, source code, or simply code, is any collection of code, with or without comments, written using a human-readable programming language, usually as plain text. The source code of a program is specially designed to facilitate the wo ...
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: * DarkPlaces Engine – A significantly modified engine used in several standalone games and ''Quake'' mods. Although the last stable release was on May 13, 2014, it has received numerous updates through its SVN repository since then. Its home page was hosted on
Icculus.org Ryan C. Gordon (also known as icculus) is a computer programmer and former Loki Software employee responsible for ''icculus.org'', which hosts many Loki Software projects as well as others. Gordon's site hosts projects with the code from such c ...
until 2021, when the engine switched to a
Git Git () is a distributed version control system: tracking changes in any set of files, usually used for coordinating work among programmers collaboratively developing source code during software development. Its goals include speed, data inte ...
repository hosted on
GitHub GitHub, Inc. () is an Internet hosting service for software development and version control using Git. It provides the distributed version control of Git plus access control, bug tracking, software feature requests, task management, continuous ...
. Team Xonotic provides mirrors of DarkPlaces source code on various social coding platforms since the game is built on and distributed with the development version of the engine. *
GoldSrc GoldSrc ( ) is a proprietary game engine developed by Valve. At its core, GoldSrc is a heavily modified version of id Software's ''Quake'' engine. It originally made its debut in 1998 with ''Half-Life'', and would power future games developed b ...
– The first engine to be created by
Valve A valve is a device or natural object that regulates, directs or controls the flow of a fluid (gases, liquids, fluidized solids, or slurries) by opening, closing, or partially obstructing various passageways. Valves are technically fittings ...
. It was used in the ''Half-Life'' series, gave rise to the
Source engine Source is a 3D game engine developed by Valve. It debuted as the successor to GoldSrc in 2004 with the release of '' Counter-Strike: Source'' and '' Half-Life 2''. Updates to Source were released in incremental versions, with the engine being su ...
. * vkQuake – (Derivative of Quakespasm) Uses
Vulkan Vulkan is a low- overhead, cross-platform API, open standard for 3D graphics and computing. Vulkan targets high-performance real-time 3D graphics applications, such as video games and interactive media. Vulkan is intended to offer higher perform ...
API for rendering programmed by id Software employee Axel Gneiting, released under the
GPLv2 The GNU General Public License (GNU GPL or simply GPL) is a series of widely used free software licenses that guarantee end users the four freedoms to run, study, share, and modify the software. The license was the first copyleft for general us ...
.


Games using the ''Quake'' engine


''Quake'' engine tools

*''
QuArK A quark () is a type of elementary particle and a fundamental constituent of matter. Quarks combine to form composite particles called hadrons, the most stable of which are protons and neutrons, the components of atomic nuclei. All commonly o ...
'' – A multipurpose tool for ''Quake'' engine-based games. *Trenchbroom 2.0 – A map editor for ''Quake'' engine-based games. *PakExpl – Used for opening the .pak files that carry ''Quake's'' model, sound, and level data, as well as the ''progs.dat'' file. *fteqccgui – Used to open the ''progs.dat'' file in order to edit the quakec files that control entity behavior. *qME 3.1 – The final version of the ''Quake'' model editing tool, can be used to convert traditional 3d model files into ''Quake's'' .mdl format. *qPAK – Another tool for opening ''Quake'' .pak archives. Comes bundled with qME.


See also

*
List of game engines Game engines are tools available for game designers to code and plan out a video game quickly and easily without building one from the ground up. Whether they are 2D or 3D based, they offer tools to aid in asset creation and placement. Engines ...
*
First person shooter engine A first-person shooter engine is a game engine, video game engine specialized for simulating 3D graphics, 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 o ...
*
id Tech 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 ''D ...
*
Quake II 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 sev ...


References


External links


Quake's Lighting Model
Surface caching by
Michael Abrash Michael Abrash is a programmer and technical writer specializing in code optimization and 80x86 assembly language. He wrote the 1990 book ''Zen of Assembly Language Volume 1: Knowledge'' and a monthly column in '' Dr. Dobb's Journal'' in the earl ...

Quake engine code analysis
by Fabien Sanglard
Source code for winquake, glquake, quakeworld, and glquakeworld
{{DEFAULTSORT:Quake Engine 1996 software Free game engines Game engines for Linux Id Tech Quake (series) Video game engines