Adaptive tile refresh

Last updated

Adaptive tile refresh is a computer graphics technique for side-scrolling video games. It was most famously used by id Software's John Carmack in games such as Commander Keen to compensate for the poor graphics performance of PCs in the early 1990s. Its principal innovation is a novel use of several EGA hardware features to perform the scrolling in hardware. The technique is named for its other aspect, the tracking of moved graphical elements in order to minimize the amount of redrawing required in every frame. Together, the combination saves the processing time that would be otherwise required for redrawing the entire screen. [1] :50 Carmack designed the software engine based on a scrolling display for large images from the 1970s. [2]

Contents

The IBM PC graphics generation previous to EGA is CGA, which lacks features for scrolling in hardware. Therefore, CGA scrolling is done in software, by redrawing the entire screen for every frame, which such systems lack the performance to do for full-screen animation. Adaptive tile refresh minimizes the computing power required for sidescrolling games, to be within the reach of contemporary hardware. This works by flagging bitmap tiles and redrawing only the graphics on the screen that actually update. [3]

History

Adaptive tile refresh using hardware scrolling debuted in the unreleased prototype game Dangerous Dave in Copyright Infringement, implemented by Carmack. The title of "Dangerous Dave" had been previously used by John Romero while programming games for Softdisk. This was developed within one week as a recreation of the first level of Nintendo's Super Mario Bros. 3 , intended as a realistic prototype of the adaptive tile refresh concept. The team of future id Software employees, still working for Softdisk, then completed the replica of the entire game, which was pitched to Nintendo for licensing for the PC. Nintendo declined the pitch after id Software finished the prototype. [4] [5] [1]

The first release of Carmack's adaptive tile refresh came in id Software's first installment of the Commander Keen game series, Marooned on Mars.

Technical details

EGA has several features that enable the adaptive tile refresh effect:

  1. The framebuffer can be slightly wider than the screen and arbitrarily high, subject to video memory limitations.
  2. The position within this buffer from which the screen is drawn can be offset by 1 pixel increments, either horizontally or vertically.
  3. It has enough video memory to store two such screen buffers, plus tiles, and sprites.

Carmack used these capabilities to create a buffer that is 64 pixels wider and taller than the screen, leaving room for two extra rows and columns of tiles in the buffer off the edge of the screen. He used the offset capabilities of the card to let the screen slide through the buffer for smooth scrolling, which partially reveals the extra tiles.

When the visible portion reaches the end of the buffer, the buffer position is offset back by one tile, and the changed tiles are redrawn. [6] This made the technique reliant on repeat tiles in order to limit the number of tiles being redrawn. [7]

Another version of the technique introduced in Commander Keen in Keen Dreams wraps around EGA memory to show data from the other side of the buffer. [7] In order to scroll through an entire level, when the scrolling amounts to a whole tile's worth, the next row of tiles from the level is then drawn into the buffer, just off the edge of the screen, ready to be displayed when the scrolling continues in that direction.

Since only the edges of the screen are being redrawn at any time, sprites in the visible portion of the screen would not get redrawn until they reach the edge of the screen. To counteract this, the code calculates which tiles a moving sprite had previously covered and redraws them to erase the old sprite image, then draws the new sprite image in its new position. This allows sprites to be animated independently of the scrolling with minimal computational effort.

Because moving a sprite in this way involves first erasing it and then redrawing it, the image of the erased sprite may be visible briefly, causing flicker. The final part of Carmack's technique is to use the same EGA hardware scrolling features to also implement double buffering. This establishes a second buffer into which the code can draw while the first buffer is being displayed, which is then switched out during screen refresh. This ensures that no frame is ever displayed mid-drawing, which yields smooth, flicker-free animation.

Related Research Articles

<i>Wolfenstein 3D</i> 1992 video game

Wolfenstein 3D is a first-person shooter video game developed by id Software and published by Apogee Software and FormGen. Originally released on May 5, 1992, for DOS, it was inspired by the 1981 Muse Software video game Castle Wolfenstein, and is the third installment in the Wolfenstein series. In Wolfenstein 3D, the player assumes the role of Allied spy William "B.J." Blazkowicz during World War II as he escapes from the Nazi German prison Castle Wolfenstein and carries out a series of crucial missions against the Nazis. The player traverses each of the game's levels to find an elevator to the next level or kill a final boss, fighting Nazi soldiers, dogs, and other enemies with a knife and a variety of guns.

Commander Keen is a series of side-scrolling platform video games developed primarily by id Software. The series consists of six main episodes, a "lost" episode, and a final game; all but the final game were originally released for MS-DOS in 1990 and 1991, while the 2001 Commander Keen was released for the Game Boy Color. The series follows the eponymous Commander Keen, the secret identity of the eight-year-old genius Billy Blaze, as he defends the Earth and the galaxy from alien threats with his homemade spaceship, rayguns, and pogo stick. The first three episodes were developed by Ideas from the Deep, the precursor to id, and published by Apogee Software as the shareware title Commander Keen in Invasion of the Vorticons; the "lost" episode 3.5 Commander Keen in Keen Dreams was developed by id and published as a retail title by Softdisk; episodes four and five were released by Apogee as the shareware Commander Keen in Goodbye, Galaxy; and the simultaneously developed episode six was published in retail by FormGen as Commander Keen in Aliens Ate My Babysitter. Ten years later, an homage and sequel to the series was developed by David A. Palmer Productions and published by Activision as Commander Keen. Another game was announced in 2019 as under development by ZeniMax Online Studios, but was not released.

<span class="mw-page-title-main">Parallax scrolling</span> Technique in computer graphics

Parallax scrolling is a technique in computer graphics where background images move past the camera more slowly than foreground images, creating an illusion of depth in a 2D scene of distance. The technique grew out of the multiplane camera technique used in traditional animation since the 1930s.

<span class="mw-page-title-main">Scanline rendering</span> 3D computer graphics image rendering method

Scanline rendering is an algorithm for visible surface determination, in 3D computer graphics, that works on a row-by-row basis rather than a polygon-by-polygon or pixel-by-pixel basis. All of the polygons to be rendered are first sorted by the top y coordinate at which they first appear, then each row or scan line of the image is computed using the intersection of a scanline with the polygons on the front of the sorted list, while the sorted list is updated to discard no-longer-visible polygons as the active scan line is advanced down the picture.

<span class="mw-page-title-main">Video Graphics Array</span> Computer display standard and resolution

Video Graphics Array (VGA) is a video display controller and accompanying de facto graphics standard, first introduced with the IBM PS/2 line of computers in 1987, which became ubiquitous in the IBM PC compatible industry within three years. The term can now refer to the computer display standard, the 15-pin D-subminiature VGA connector, or the 640 × 480 resolution characteristic of the VGA hardware.

<i>Catacomb 3-D</i> 1991 video game

Catacomb 3-D is a first-person shooter video game, the third in the Catacomb series, the first of which to feature 3D computer graphics. It was developed by id Software and originally published by Softdisk under the Gamer's Edge label, released in November 1991. The player takes control of the high wizard Petton Everhail, descending into the catacombs of the Towne Cemetery to defeat the evil lich Nemesis and rescue his friend Grelminar.

<span class="mw-page-title-main">Multiple buffering</span> Use of more than one buffer to hold a block of data

In computer science, multiple buffering is the use of more than one buffer to hold a block of data, so that a "reader" will see a complete version of the data instead of a partially updated version of the data being created by a "writer". It is very commonly used for computer display images. It is also used to avoid the need to use dual-ported RAM (DPRAM) when the readers and writers are different devices.

Dangerous Dave is a 1988 computer game by John Romero. It was developed for the Apple II and DOS as an example game to accompany his article about his GraBASIC, an Applesoft BASIC add-on, for the UpTime disk magazine.

<span class="mw-page-title-main">Attribute clash</span>

Attribute clash is a display artifact caused by limits in the graphics circuitry of some colour 8-bit home computers, most notably the ZX Spectrum, where it meant that only two colours could be used in any 8×8 tile of pixels. The effect was also noticeable on MSX software and in some Commodore 64 titles. Workarounds to prevent this limit from becoming apparent have since been considered an element of Spectrum programmer culture.

<span class="mw-page-title-main">Softdisk</span> Software and Internet company based in Shreveport, Louisiana

Softdisk was a software and Internet company based in Shreveport, Louisiana. Founded in 1981, its original products were disk magazines. It was affiliated and partly owned by paper magazine Softalk at founding, but survived its demise.

<i>Catacomb Abyss</i> 1992 video game

Catacomb Abyss is a fantasy themed first-person shooter (FPS) game developed by Softdisk and released in November 1992 for MS-DOS. It is the fourth entry in the Catacomb series of video games. Its predecessor, Catacomb 3-D, was developed by id Software as part of a contract with Softdisk. When the contract ended, Softdisk kept ownership of both the 3D engine as well as the intellectual property of Catacomb 3-D. The company formed a new, in-house team to develop three sequels, known as the Catacomb Adventure Series. This trilogy consists of Catacomb Abyss, Catacomb Armageddon and Catacomb Apocalypse. Softdisk published a shareware version of Catacomb Abyss, which could be freely distributed and played to encourage gamers to purchase the full trilogy.

A side-scrolling video game is a game viewed from a side-view camera angle where the screen follows the player as they move left or right. The jump from single-screen or flip-screen graphics to scrolling graphics during the golden age of arcade games was a pivotal leap in game design, comparable to the move to 3D graphics during the fifth generation.

<i>Catacomb</i> (video game) 1990 video game

Catacomb is a 2-D top-down third-person shooter created, developed, and published by Softdisk. It was originally created for the Apple II, and later ported to the PC. It should not be confused with The Catacomb, which is the second game in the series. It supports EGA and CGA graphics.

<i>Commander Keen in Keen Dreams</i> 1991 video game

Commander Keen in Keen Dreams is a side-scrolling platform video game developed by id Software and published by Softdisk in 1991 for DOS. It is the fourth episode of the Commander Keen series. The game follows the titular Commander Keen, an eight-year-old child genius, in an adventure in his dreams as he journeys through a vegetable kingdom to defeat the evil potato king Boobus Tuber and free enslaved children from the Dream machine. The game features Keen running and jumping through various levels while opposed by various vegetable enemies; unlike the prior three episodes, Keen does not use a pogo stick to jump higher, and throws flower power pellets to temporarily turn enemies into flowers rather than shooting a raygun to kill them.

<i>Commander Keen</i> (video game) 2001 video game

Commander Keen is a side-scrolling platform video game developed by David A. Palmer Productions and published by Activision in June 2001 for the Game Boy Color. Part of the Commander Keen series, it was released ten years after the first seven episodes in 1990–91. The game follows the titular Commander Keen, an eight-year-old child genius, as he journeys through three alien worlds to collect three plasma crystals to prevent the weapon they power, built by several enemies from previous games, from destroying the universe. The game features Keen running, jumping, and shooting through various levels while opposed by aliens, robots, and other hazards.

<span class="mw-page-title-main">Tandy Graphics Adapter</span> Computer display standard for the Tandy 1000 series

Tandy Graphics Adapter is a computer display standard for the Tandy 1000 series of IBM PC compatibles, which has compatibility with the video subsystem of the IBM PCjr but became a standard in its own right.

<i>Commander Keen in Invasion of the Vorticons</i> 1990 episodic side-scrolling platform game

Commander Keen in Invasion of the Vorticons is a three-part episodic side-scrolling platform video game developed by Ideas from the Deep and published by Apogee Software in 1990 for MS-DOS. It is the first set of episodes of the Commander Keen series. The game follows the titular Commander Keen, an eight-year-old child genius, as he retrieves the stolen parts of his spaceship from the cities of Mars, prevents a recently arrived alien mothership from destroying landmarks on Earth, and hunts down the leader of the aliens, the Grand Intellect, on the alien home planet. The three episodes feature Keen running, jumping, and shooting through various levels while opposed by aliens, robots, and other hazards.

<i>Commander Keen in Goodbye, Galaxy</i> 1991 video game

Commander Keen in Goodbye, Galaxy is a two-part episodic side-scrolling platform video game developed by id Software and published by Apogee Software in 1991 for DOS. It consists of the fifth and sixth episodes of the Commander Keen series, though they are numbered as the fourth and fifth, as Commander Keen in Keen Dreams is not part of the main continuity. The game follows the titular Commander Keen, an eight-year-old child genius, as he first journeys through the Shadowlands to rescue the Gnosticenes so they may ask the Oracle how the Shikadi plan to destroy the galaxy, and then through the Shikadi's Armageddon Machine to stop them. The two episodes feature Keen running, jumping, and shooting through various levels while opposed by aliens, robots, and other hazards.

<i>Commander Keen in Aliens Ate My Babysitter</i> 1991 video game

Commander Keen in Aliens Ate My Babysitter is a side-scrolling platform video game developed by id Software and published by FormGen in December 1991 for DOS. It is the seventh episode of the Commander Keen series, though it is numbered as the sixth, as Commander Keen in Keen Dreams is outside of the main continuity. The game follows the titular Commander Keen, an eight-year-old child genius, as he journeys through an alien world to rescue his kidnapped babysitter. The game feature Keen running, jumping, and shooting through various levels while opposed by aliens, robots, and other hazards.

<i>Slordax: The Unknown Enemy</i> 1991 video game

Slordax: The Unknown Enemy is a vertically scrolling shooter developed and published by Softdisk in 1991. The developers of the game left to found id Software soon after its creation, and Slordax was also marketed by Softdisk as part of The Lost Game Collection of ID Software along with several games created by id on contract for Softdisk.

References

  1. 1 2 Kushner, David (2004) [2003]. Masters of Doom: how two guys created an empire and transformed pop culture. New York, NY: Random House, Inc. ISBN   9780375505249. OCLC   50129329.
  2. Kushner, David (August 1, 2002). "The Video Game Software Wizardry of Id". IEEE Spectrum. Retrieved April 13, 2018.
  3. Aycock, John (May 9, 2016). Retrogame Archeology: Exploring Old Computer Games. Springer. p. 45. doi:10.1007/978-3-319-30004-7. ISBN   978-3-319-30004-7. S2CID   20655963 . Retrieved November 27, 2017.
  4. Super Mario Bros. 3 Demo (1990). John Romero. 1990. Retrieved December 15, 2015.
  5. Orland, Kyle (December 14, 2015). "Here's what id Software's PC port of Mario 3 could have looked like". Ars Technica. Retrieved December 15, 2015.
  6. Carmack, John. "Tweet 6:53 PM · Jul 11, 2020". Twitter. Retrieved 19 January 2024.
  7. 1 2 Carmack, John. "Tweet 9:52 PM · Sep 14, 2018". Twitter. Retrieved 19 January 2024.