Hurt Me Plenty - Remembering Doom
Thanks to TotalGames.net for reprinting a GamesTM article remembering the genius of id Software's seminal PC FPS, Doom. The article starts with the question: "How many of the lodestones of modern gaming do we owe to Doom?", and continues by arguing: "Without Doom conceiving the multiplayer deathmatch, it could be radically touted that the PC today would be an abandoned platform insofar as gaming is concerned." The piece finishes with comments on Doom 3: "While tradition alone will endear Doom 3 to many, the long-anticipated game may yet fail to make the evolving grade it was fundamental in establishing. Let it be said that the gaming world is nothing if not perverse."
Actually, IIRC, it was Star Wars: Dark Forces that first introduced the three dimensional aiming. I remember an ad that ran in some gaming magazines when it was released. It was a simple screenshot showing your crosshairs aiming at a stormtrooper's head. The tag line went something like: We've added a new dimension to gaming.
Xenon, where's my money? -Borno
Unless they're referring to Wolfenstein 3D, which uses raycasting, this is wrong. Doom doesn't use raycasting, it renders by recursively walking a precalculated binary space partition tree
Simplified (I won't provide a detailed explanation because I don't know it), the BSP tree is, as the name implies, a binary tree that partitions space. The level is partitioned recursively so that the root of the tree is the entire map, each node divides the parent node in two parts, and the leafs are convex subsectors which don't need to be divided further.
Determining what to render is then done by walking the tree recursively, starting from the root. The clever thing here is the occlusion: if the bounding box of a node is outside the field of view, it can be ditched, along with all of its children.
A node can also be ignored, along with its children, if its bounding box is fully occluded by nodes that have already been drawn. Since the child node closest to the camera is drawn first at each branch, close objects are generally drawn before far-away ones, efficiently allowing things out-of-sight to be occluded.
BSP rendering is not only fast but also elegant in its simple algorithmic setup. It has the disadvantage, however, that the tree has to be precalculated. This means walls can't move during the game, as the BSP tree would have to be recalculated continuously. Doom's BSP is two-dimensional, though, so it is still possible for floors and ceilings to move up and down.
Wolfenstein is able to do raycasting efficiently because all walls are aligned to a perpendicular grid; the same technique wouldn't work as well with the arbitrary geometry Doom allows, at least it wasn't possible with 1993's hardware.
And for the record, neither raycasting nor BSP were Carmack's revolutionary ideas, though he might have been the first to use BSP in a game - I'm not sure.