ArticleslgStudy

computer science

Adaptive tile refresh

Adaptive tile refresh is a computer science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Adaptive tile refresh rather than just read about it. In short: 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.

Key takeaways

  • Adaptive tile refresh belongs to computer science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Adaptive tile refresh to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Adaptive tile refresh from memory before moving on to harder problems.

Reference excerpt

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.

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

The framebuffer can be wider than the screen and arbitrarily high, subject to video memory limitations. The position within this buffer from which the screen is drawn can be offset by 1 pixel increments, either horizontally or vertically. 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. 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. 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.

References

Worked examples

Example 1 — a first encounter with Adaptive tile refresh

Start with the simplest possible case. Write down what Adaptive tile refresh claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In computer science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Adaptive tile refresh before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Adaptive tile refresh ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Adaptive tile refresh

In research
Adaptive tile refresh appears in computer science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Adaptive tile refresh in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Adaptive tile refresh is common in secondary-school and first-year university syllabi. It links to neighbouring topics Commander Keen, Computer graphics, Video game graphics, so understanding it makes those chapters shorter.
In everyday life
Look for Adaptive tile refresh outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Adaptive tile refresh” →

How to study Adaptive tile refresh in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Adaptive tile refresh means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Adaptive tile refresh out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Adaptive tile refresh in simple terms?

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.

Why does Adaptive tile refresh matter?

Because it connects several computer science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Adaptive tile refresh?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Adaptive tile refresh.

Tags

  • Commander Keen
  • Computer graphics
  • Video game graphics

Keep exploring