Hubbry Logo
search
logo

Adaptive tile refresh

logo
Community Hub0 Subscribers
Write something...
Be the first to start a discussion here.
Be the first to start a discussion here.
See all
Adaptive tile refresh

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. Carmack designed the software engine based on a scrolling display for large images from the 1970s.

The IBM PC graphics generation previous to EGA is CGA, which lacks features for smooth horizontal scrolling in hardware. Therefore, CGA scrolling is usually done in software, by redrawing the entire screen for every frame, which early IBM PC 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.

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.

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.

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

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. This made the technique reliant on repeat tiles in order to limit the number of tiles being redrawn.

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. 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.

See all
User Avatar
No comments yet.