Tile engine
From Wikipedia, the free encyclopedia
This article is orphaned as few or no other articles link to it. Please help introduce links in articles on related topics. (November 2006) |
A tile engine is a computer graphics technique which generates a larger graphic from re-using a number of smaller graphics to save RAM and increase real-time rendering performance.
[edit] Basic tile map history
In the early days of computer game development, proper RAM economy was a must for a successful game engine, much more so than it is today. One of the largest problems, graphics rendering performance, came down to the amount of RAM dedicated to storing graphics for the game worlds and characters, and fetching these graphics and displaying them on screen in as rapid and smooth a way as possible. An early hack which not only stored larger game worlds in less RAM, but also made use of fewer, smaller sized pieces of graphics rather than the full scale overall image was the tile map, a technique taking the stance that if you are rendering a grassy field, chances are most of that field is going to look the same anyway, hence the smart approach would be to re-use one small graphic over and over to shape the grassy field. This approach became widely used in specific game genres such as platformers and RPGs, and reached its peak during the 8-bit and 16-bit eras of consoles, with games such as Mega Man (NES), The Legend of Zelda: A Link to the Past (SNES) and Shining Force (Mega Drive) being prime examples of tile-based games, producing a highly recognizable look and feel.
[edit] Simple theory
The typical tile map consists of a 2-dimensional array/matrix containing references to a tile object. This tile object holds information such as the type of terrain, if it is possible to walk on it, if it causes damage to the computer game character etc, as well as the identity of the graphic to be rendered whenever that tile is to be drawn. This approach allows for simple, visual map data, letting level designers create entire worlds with a simple text editor and a tile reference sheet, though most if not all accomplished tile-based games utilize dedicated world editor software and highly optimized map formats.
The tiles themselves are usually simple geometric shapes, ranging from the simple square to more complicated shapes such as hexagons or even circles in some cases. These tiles are drawn at intervals dictated by a uniform height/width, though in many cases the interval is decided by the size of the tile to be drawn.
Examples of three most popular shapes: