Jump to content

Adaptive tile refresh: Difference between revisions

From Wikipedia, the free encyclopedia
Content deleted Content added
m grammar
Added info
Line 3: Line 3:
'''Adaptive tile refresh''' is a [[computer graphics]] technique for [[Side-scrolling video game|sidescrolling games]], famously used by [[id Software]]'s [[John D. Carmack|John Carmack]] to compensate for the poor graphics performance of PCs in the early 1990s. Its principal innovation was a novel use of several [[Enhanced Graphics Adapter|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 have been required for redrawing the entire screen.<ref name="Masters of Doom"/>{{rp|50}}
'''Adaptive tile refresh''' is a [[computer graphics]] technique for [[Side-scrolling video game|sidescrolling games]], famously used by [[id Software]]'s [[John D. Carmack|John Carmack]] to compensate for the poor graphics performance of PCs in the early 1990s. Its principal innovation was a novel use of several [[Enhanced Graphics Adapter|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 have been required for redrawing the entire screen.<ref name="Masters of Doom"/>{{rp|50}}


Because [[Color Graphics Adapter|CGA]] (the previous generation of PC graphics hardware) lacked features for scrolling in hardware, scrolling would previously have had to be done in software, by redrawing the entire screen for every frame – a task that PCs of the time lacked the performance to carry out. Adaptive tile refresh minimized the computing power required for sidescrolling games to within the reach of available hardware, and thus made such games possible on the PC for the first time.
Because [[Color Graphics Adapter|CGA]] (the previous generation of PC graphics hardware) lacked features for scrolling in hardware, scrolling would previously have had to be done in software, by redrawing the entire screen for every frame – a task that PCs of the time lacked the performance to carry out. Adaptive tile refresh minimized the computing power required for sidescrolling games to within the reach of available hardware, and thus made such games possible on the PC for the first time. This worked by flagging bitmap tiles and redrawing only the graphics on the screen that actually updated.<ref>{{cite book |last1=Aycock |first1=John |title=Retrogame Archeology: Exploring Old Computer Games |url=https://books.google.com.mt/books?id=NasqDAAAQBAJ&pg=PA45&lpg=PA45&dq=%22Keen+dreams%22+%22graphics%22&source=bl&ots=DlYIHsYXT_&sig=gCkdPOmvvGz0-VVK9zU6tC3QAEE&hl=en&sa=X&ved=0ahUKEwirl5qIpd7XAhUSyKQKHUEGC344HhDoAQgxMAI#v=onepage&q=%22Keen%20dreams%22%20%22graphics%22&f=false |language=English |publisher=Springer |publication-date=May 9, 2016 |page=45 |doi=10.1007/978-3-319-30004-7 |isbn=978-3-319-30004-7 |access-date=November 27, 2017}}</ref>


The technique was eventually used to create the PC sidescroller ''[[Commander Keen]]''.
The technique was eventually used to create the PC sidescroller ''[[Commander Keen]]''.


==History==
==History==

Adaptive tile refresh using hardware scrolling made its first appearance in an unreleased test game dubbed ''"Dangerous Dave in Copyright Infringement"''. ''[[Dangerous Dave]]'' was a title previously used by [[John Romero]] while programming games for [[Softdisk]]. The new game was a recreation of the first level of [[Nintendo]]'s ''[[Super Mario Bros. 3]]'', intended as a realistic test bed for the adaptive tile refresh concept, and was developed within a week. The team of future id Software employees, still working for Softdisk, then recreated the entire ''[[Mario]]'' game, hoping that Nintendo would license the game for PC. Nintendo declined the offer to release the game after id Software finished it.<ref name="SMB3 demo at IFD">{{cite av media | title=Super Mario Bros. 3 Demo (1990) | date=1990 | publisher=John Romero | url=https://vimeo.com/148909578 | accessdate=December 15, 2015}}</ref><ref name="SMB3 demo at Ars">{{cite web | title=Here’s what id Software’s PC port of Mario 3 could have looked like | date=December 14, 2015 | first=Kyle | last=Orland | publisher=Ars Technica | url=https://arstechnica.com/gaming/2015/12/heres-what-id-softwares-pc-port-of-mario-3-could-have-looked-like/ | accessdate=December 15, 2015}}</ref><ref name="Masters of Doom">{{Cite book|title = Masters of Doom: how two guys created an empire and transformed pop culture | first = David | last = Kushner | publisher = Random House, Inc | location=New York, NY | year = 2004 | origyear=2003 | oclc=50129329 | isbn=9780375505249}}</ref>
Adaptive tile refresh using hardware scrolling made its first appearance in an unreleased test game dubbed ''"Dangerous Dave in Copyright Infringement"''. ''[[Dangerous Dave]]'' was a title previously used by [[John Romero]] while programming games for [[Softdisk]]. The new game was a recreation of the first level of [[Nintendo]]'s ''[[Super Mario Bros. 3]]'', intended as a realistic test bed for the adaptive tile refresh concept, and was developed within a week. The team of future id Software employees, still working for Softdisk, then recreated the entire ''[[Mario]]'' game, hoping that Nintendo would license the game for PC. Nintendo declined the offer to release the game after id Software finished it.<ref name="SMB3 demo at IFD">{{cite av media | title=Super Mario Bros. 3 Demo (1990) | date=1990 | publisher=John Romero | url=https://vimeo.com/148909578 | accessdate=December 15, 2015}}</ref><ref name="SMB3 demo at Ars">{{cite web | title=Here’s what id Software’s PC port of Mario 3 could have looked like | date=December 14, 2015 | first=Kyle | last=Orland | publisher=Ars Technica | url=https://arstechnica.com/gaming/2015/12/heres-what-id-softwares-pc-port-of-mario-3-could-have-looked-like/ | accessdate=December 15, 2015}}</ref><ref name="Masters of Doom">{{Cite book|title = Masters of Doom: how two guys created an empire and transformed pop culture | first = David | last = Kushner | publisher = Random House, Inc | location=New York, NY | year = 2004 | origyear=2003 | oclc=50129329 | isbn=9780375505249}}</ref>


Line 14: Line 13:


==Technical details==
==Technical details==

EGA had several features that enabled the effect:
EGA had several features that enabled the effect:



Revision as of 08:19, 27 November 2017

Adaptive tile refresh is a computer graphics technique for sidescrolling games, famously used by id Software's John Carmack to compensate for the poor graphics performance of PCs in the early 1990s. Its principal innovation was 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 have been required for redrawing the entire screen.[1]: 50 

Because CGA (the previous generation of PC graphics hardware) lacked features for scrolling in hardware, scrolling would previously have had to be done in software, by redrawing the entire screen for every frame – a task that PCs of the time lacked the performance to carry out. Adaptive tile refresh minimized the computing power required for sidescrolling games to within the reach of available hardware, and thus made such games possible on the PC for the first time. This worked by flagging bitmap tiles and redrawing only the graphics on the screen that actually updated.[2]

The technique was eventually used to create the PC sidescroller Commander Keen.

History

Adaptive tile refresh using hardware scrolling made its first appearance in an unreleased test game dubbed "Dangerous Dave in Copyright Infringement". Dangerous Dave was a title previously used by John Romero while programming games for Softdisk. The new game was a recreation of the first level of Nintendo's Super Mario Bros. 3, intended as a realistic test bed for the adaptive tile refresh concept, and was developed within a week. The team of future id Software employees, still working for Softdisk, then recreated the entire Mario game, hoping that Nintendo would license the game for PC. Nintendo declined the offer to release the game after id Software finished it.[3][4][1]

The first market appearance of Carmack's adaptive tile refresh came in id Software's first installment of the Commander Keen game series, Marooned on Mars. Commander Keen was an immediate shareware success, due to its groundbreaking features and gameplay.

Technical details

EGA had several features that enabled the effect:

  1. The screen buffer could be slightly wider than the screen and arbitrarily high, subject to video memory limitations.
  2. The position within this buffer from which the screen was drawn could be offset by 1 pixel increments, either horizontally or vertically.
  3. It had enough video memory to store two such screen buffers, and still have room left over for tiles and sprites.

Carmack used these capabilities to create a buffer that was 64 pixels wider and taller than the screen, leaving room for one extra row and column 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 would partially reveal the extra tiles.

Scrolling was limited to the buffer size, and scrolling further would wrap around to show data from the other side of the buffer. So in order to a scroll through an entire level, when the scrolling amounted to a whole tile's worth, Carmack's code would then draw the next row of tiles from the level into the buffer, just off the edge of the screen, ready to be displayed when the scrolling continued in that direction.

But since only the edges of the screen were being redrawn at any time, sprites in the level would not get redrawn until they reached the edge of the screen. To counteract this, the code calculated which tiles a moving sprite had previously covered and redrew them to erase the old sprite image, then drew the new sprite image in its new position. This allowed sprites to be animated independently of the scrolling with minimal computational effort.

Since 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 was the use of the same EGA hardware features used for scrolling to also implement double buffering: setting up a second buffer into which the code can draw while the first buffer is being shown on screen, 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

  1. ^ a b 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. ^ 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. Retrieved November 27, 2017.
  3. ^ Super Mario Bros. 3 Demo (1990). John Romero. 1990. Retrieved December 15, 2015.
  4. ^ 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.