Graphics‎ > ‎2D‎ > ‎

Tile Based

A tile map is based game puts a grid over the game world. Each grid element is called a tile and it is a certain number of pixel in size, ex 32x32. The tile can be a plot of grass or a a road in a top down game or a block or a fungus in a side scroller. Each tile only need to store a index to the type of tile it contain.

It's common to make the tile map a layered where each layer is drawn on top of the next. So in a top down game the lower layer can be the ground, then the next are the walls and the top layer is the roof of buildings. It is possible to have tiles that are larger then the standard tile size as long as a whole layer is drawn before the next. In a side scroller one can have the background in one layer and the front layer for the walls.

Collision can be selective to only act on certain layers. For example in a side scroller on does not collide with the background layer.

Streaming content for large worlds is easy in a tile based world. Split the map into chunks of a set size and load the chunks close to the player.

Using a grass tile beside a tile with forest make the edge between them a bit hard. On way to solve that is by creating a lot of transition tiles by hand and go insane and another one is to use a transition layer. So there is the base layer that is the basic terrain and the next layer above is the transition layer. That layer is filled by scanning the map, calculating what transition is most important, using a tile alpha maps to fill in the transition tiles around it. Transition tiles can be cached for less memory usage.