Feature: John Carmack

by Lars A. Bratteberg in Issue 2: Ch-ch-changes (12 March 2009)

This feature will examine how the work of John Carmack has contributed to the design of contemporary 3D computer games.

,

John Carmack is an American programmer who develops computer games’ graphics engines. An engine is the core software of a game; the part that determines how a monitor will handle and display the game’s graphics. The field of graphics engines in which Carmack’s work holds most importance, is that of first-person shooter (FPS) games. An FPS engine draws a graphic simulation of a three dimensional milieu surrounding the game’s protagonist. An engine both offers opportunities and sets limitations to the graphics; Carmack helped define the engine’s use with his first two FPS titles in the early 1990’s.

In 1992, computer game developer id software published the game Wolfenstein 3D, which was built upon a graphics engine made by John Carmack, lead programmer for the company. Wolfenstein 3D, a world war two-themed game, was among the first games in 3D and established FPS games as a genre, popularizing it to main-stream audiences.
When developing the graphics engine for Wolfenstein 3D, Carmack had to deal with the very limited power of the PC at the time. He saw that if the computer had to draw too much of the game at once, the game’s performance would suffer; he therefore made the computer draw only a few surfaces at any given time. “Rather than draw, in this case, arbitrary polygons, he designed a program that would draw only sideways trapezoids – in other words, walls but no ceilings or floors” (Kushner, 2003). The ceilings and floors are simply one-coloured, horizon covering planes.

Carmack also pioneered a 3D rendering method called raycasting, “[which] transform [sic] a limited form of data (a very simplified map or floor plan) into a 3D projection” (LaMothe, 1995, p. 942). “[It] determines the visibility of surfaces by tracing imaginary rays of light from viewer’s eye to the object in the scene;” (Foley, 1995, p. 701) “a vertical slice of wall texture is selected and scaled according to where in the world the ray hits a wall and how far it travels before doing so” (Hees, 2006). The walls must be parallel or perpendicular with the ground in using this technique - a geometric constraint needed to make the rendering process efficient.

Raycasting: This figure shows a room in 2D, and how rays from the viewer’s eyes transform it into a 3D projection. The rays travel different lengths, which determine the angle of the solid wall model (Stephens, 1995).

In making the computer use minimal of its processes in rendering solid models, Carmack made the foundation of a fast-action game with more power freed for design input. In practical terms this enabled the game to employ texture mapping, a systematic use of a pattern onto tiles of graphic. Solid models were coated in textures - for Wolfenstein 3D, in repeating blocks of 64×64 pixel patterns. The textured walls gained a further sense of realism with the graphics engine supporting 256 colours, an adaptation of Video Graphics Array (VGA), an analogue standard for defining colour display screens. The new palette was a giant leap from the faltering 16-colour standard in preceding computer games. Upon its release, Wolfenstein became a major commercial success. The technology for games in first-person view was not completely new, but the aesthetical realism Carmack’s graphics engine brought to it made for an in depth experience never seen before.

With Carmack’s next work, the graphics engine for id software’s 1993 release, Doom, progress in computer development made way for several innovations. He expanded the implementation of texture mapping he used in Wolfenstein to include floors and ceilings in addition to walls. In a time-consuming process he discovered how to get the textured floor in perfect perspective, and also to make an impression of a sloped ground so as to make the player feel like running up or downhill (Kushner, 2003).
Another new feature of the engine was its support of diminished lighting. While all of Wolfenstein’s rooms were equally brightly lit, no matter the distance it stretched, the environment in Doom could recede into variable shadow. VGA programming was still the standard, however, and forced Carmack to attain this fading effect with a limitation of 256 colours. As Kushner explains in the book Masters of Doom, Carmack resorted to choosing the palette’s colours so there, for instance, might be “sixteen shades of red, ranging from very bright to black. Carmack then programmed the computer to apply a different shade based on where a player was within a room. If the player walked into a big, open space, the computer would make a quick calculation and then apply the darkest shades to the farthest section. As the player moved forward, the computer would brighten the colours; the colours nearer would always be brighter than the ones farther away” (Kushner, 2003, p. 129).

These improvements were possible due to Carmack’s use of a programming process by the name of Binary Space Partitioning (BSP). “[BSP] broke [the surroundings] into larger sections or leaves of data, as opposed to sluggishly drawing out many little polygons at a time. (…) With BSP, the image of a room in Doom would be essentially split up into a giant tree of leaves. Rather than trying to draw the whole tree every time the player moved, the computer would draw only the leaves he was facing” (Kushner, 2003, p. 142). The premise of BSP is to compute the order of polygons to be drawn, based on the viewer’s position in the universe (LaMothe, 1995).
Until Doom, BSP had only been used to render single 3D models, but Carmack decided to experiment its capacity in creating a virtual world. Carmack’s vision was groundbreaking, and following successful tests the process was implemented in the game. BSP replaced the greater portion of what raycasting’s algorithmic drawing purpose had been in Wolfenstein. Raycasting was used in Doom only to texture walls, not to render the underlaying solid model. And with raycasting made redundant, gone were also its constraints.

The new engine technologies added not only to the Doom’s graphics, speed and enhanced realistic surroundings, but most of all to the sum of these parts; its atmosphere. It was like no other computer game ever seen; its story revolved around a space marine deployed on Mars who opens a gateway to Hell, and must fight the creatures emerging from it. Doom’s designers wanted to make the game fast-action with “the sci-fi suspense of Aliens combined with the demonic B-movie horror of Evil Dead II,” and Carmack’s engine enabled such a mood to be created (Kushner, 2003, p. 128).

In using raycasting, walls had to be at an identical distance from the viewer in each vertical slice of the view - for the rays to render them, walls would travel in the same path from top to low point. Putting BSP into practice meant opening possibilities to an all new geometrical world. The restriction of square pieces of tiled graphics as a basis for the architecture was no longer actual. The world in Doom presented a more free form of design, as the walls were not only in 90 degree, perpendicular angles. In addition walls did not need to be at a predetermined height; an innovation making way for grandeur design and huge areas. There were staircases and lifts, permitting the player to travel between different floors within the game environment, though not enabling rooms to be placed directly upon each other. Still, the technology of Doom’s graphics engine provided movement for the player on all three axes. This heightened the complexity of the level design and allowed for a much more realistic appearance of the game’s environment. Doom’s designers used the freedom of more arbitrary polygons to advance the game’s tone; the rooms felt abnormal, twisted, distorted (Kushner, 2003).

The possibility of sloped surfaces, however, applied to no other than vertical planes. All floors and ceilings were entirely flat as a consequence of the graphics engine not supporting inclination of horizontal surfaces. - A problem solved by Carmack’s technique for giving the false impression of a sloped ground by altering the perspective of its texture; naturally only achievable due to his expanded use of texture mapping. Texturing the ceilings and floors, made for a more continuous, seamless experience. Instead of gaping holes, the player walked on blood-stained floor tiles and looked up on stretches of fully decorated ceiling.

The textures in both horizontal and vertical polygons were also used in Doom’s outer environment; when moving outside, the player would see the sky above and mountains off in the distance. Doom was among the first 3D games to recognize the existence of an outside world, greatly adding to the game’s overall rationality. The design of all surroundings further improved the game’s appearance and immersion, especially considering these surroundings’ varying light levels. Highlight and shadow gave the game an authentic look, bringing a - though textured - rather flat surface to life. Aesthetic progress the light brought, however, was overshadowed by the impact the lighting had on the game’s atmosphere and gameplay. Carmack programmed the diminished lighting to have a dynamic option, enabling it to not only be precomputed (Kushner, 2003). A room’s light value could be changed while the game was playing; “In many cases, the ability to alter the lighting level was used to plunge the player into darkness at highly inopportune moments, leading to players panicking as they were attacked by nearly unseen opponents, desperately searching for a switch or trigger that would reactivate the lights” (Shahrani, 2006). Effects of strobes and darkness were used to promote the horror of the game; frightening the player with nightmarish milieus was an all new element Doom brought to gaming.

“If you look at our 3D games, they were basically like 2D overhead games, but with a fresh perspective. We took the same game design concepts, but it became much more exciting when, instead of a 16-pixel blob on the screen, we put you in it. We created a brand-new generation of games - the first-person shooter - but it’s really an overhead action shooter game with a new perspective,” (Demaria, Wilson, 2002, p. 275) John Carmack concludes on id software’s titles.

(Excerpts from case study written in 2007)

    Sources:

Do you have an opinion on this?

You must be logged in to post a comment.

Looking for something?

Use the form below to search the site: