Wednesday, July 4, 2007

Tiles in games

For a while I have been trying to figure out the best way of covering this topic, which is fairly important to the understanding of how Coffee Quest Revenge in particular and tilemaps in the CQFS engine will work. My problem is that I want my blog to be of interest to three different groups of people. Those who are curious about how games work but don't want to actually make games themselves. Those that want to make games but are just learning how to program. And those who know what they are doing. All three groups require different levels of detail so trying to please all three groups is not an easy task. So what I am going to do is focus primarily on the second group with a hope that I can make things interesting enough that the first group can skim through the posts and get an idea of what is going on. The third group can consider this a refresher or a drive down memory lane.

Tiles are actually quite common among games. Especially 2D games developed for older game machines and computers. In their most basic form they are simply a way of making an image out of a series of blocks. Why is this useful? From a graphics perspective, this allows you to potentially greatly reduce the size to an image. A 256 pixel by 256 pixel image requires that you define 65,536 different pixels. If you were to break this image up into 8x8 tiles, you can describe the image using only a 32x32 grid of tiles meaning you only need information for 1024 tiles.

When your machine didn't have very much memory to begin with, this was a significant savings. "But Billy, aren't you forgetting..." Yes, there is an important detail I am forgetting, but will talk about that next post.

No comments: