Tile
Based Levels
We have all played games
that use levels constructed from reusable tiles. When we think of tile based
games, Mario usually comes to mind along with countless other classic Nintendo
games. Isometric games and even fully 3D games can be made from tiles. In the
case of 3D games the tiles are not sprites, they are carefully constructed
models that fit together seamlessly. There are many advantages to building
games using tiling graphics. First, they allow for greater reusability. A very
large level can be built from a relatively small number of unique tiles. This
not only saves the developer a lot of work, but it helps to make the game load
faster and take up less disk space. The reuse of graphics allows each tile to
have more detail (higher resolution, or increased polygon count in the case of
3D models). It is also far easier to construct a level editor for tiled
environments. This can allow developers to ship level editing software with the
game.
The very simple example above uses a sprite sheet so
that all the tiles are stored in one image file. A large image could contain
hundreds of tiles, and loading one large image is much faster than loading
hundreds of small images. In this example, the level is very small and consists
of one “patch” of tiles. Tile based levels are usually divided into many small
square shaped patches. That way, we only have to render the patches that are on
the screen. If we were to render a large level as one big array of tiles, we
would be rendering many tiles that are off the screen which can cause the game
to run slowly. Likewise, if we were to try and test whether each individual
tile is on the screen before rendering it, this could cause the game to run
slow. With the world divided into patches, one simple test can eliminate an
entire patch allowing the game to run smoothly even when the level is extremely
large.
TileBasedLevels.zip
33KB