This is the first in a multipart series on Wang tiles. The current sequence of topics covers a wide range: the Background of tiled maps, Terminology, Aperiodic tiling, Wang tiles, how to make your own Wang tiles, and how to procedurally generate a Wang tile map. And (if I get really ambitious) how to generate Wang tiles procedurally from a larger texture. Of course, all of this is subject to change since I haven’t written any of the articles yet.
Anyway, onward to our first topic: the background of tiled maps.
What are tile maps?
A tile map is a picture created by placing sub regions (a.k.a. “tiles”) at fixed intervals to form a grid. Good examples would be tiled floors, a checker board, tessellation artwork, the board from Settlers of Catan and the world map from any game in the Civilization series.
How are tile maps used in games?
Tile maps are primarily used for both world and level maps in games. Of course, with current games that frequently depends on how strict of a definition is being used for a tile… Can a repeating 3D space be called a tile? Does drawing a repeating texture on the surface of a 3D object count? In any case, many games use tiled maps, and nearly all games for the good old NES and SNES used them.
Why use tile maps in games?
Since my cursory search of the Internet provided no resources on why tile maps were originally adopted in games, I get to speculate wildly (hehe). The most likely reason that tile maps were originally used is actually rather blase: resources were extremely limited. Let’s start with storage space. Tile maps allow a much larger space to be rendered than could be stored by a system if it was a single image. For example, let’s consider the Nintendo Entertainment System which has 2 kB of on-board ram and a game everyone should be familiar with The Legend of Zelda which clocked in at < 100 kB. If the world map in The Legend of Zelda was stored as a single 24 bit RGB image it would occupy 23,000 kB (world 16 x 8 screens and each screen is 256 x 240 pixels) of memory. It’s clear that some form of image compression needed to be used to create larger worlds on the NES. One of these compression methods was the use of a tile map to build the world.
Other resource limitations to consider are money and time. Specifically, even paying a lowly artist to draw all of these images would become incredibly expensive and be a massive time sink. Let’s just look at what it would cost if the artist was paid per screen of images drawn. If the tile set used occupies approximately one screen you could reduce the cost of the art by 99% and use it to make the game mechanics better – or increase your profit! That number is if you estimate that there are ~38 unique tiles in the over world map and a screen is 14 x 10 tiles. Of course, you can also reduce the number of unique tile drawings required by just changing the tile color.
It’s also possible that the use of tiles provide some additional benefits at the hardware rendering level. But, since I’m not familiar enough with the hardware and graphics implementation in these systems, I’ll stop my speculation with the obvious advantages I mentioned above.
I think this is enough for now stay tuned next time where I’ll discuss the terminology and shortcomings of tiled maps.