Monday, April 30, 2007

Tileset Design Tip

Older games such as the early Ultimas had one tile for each type of terrain. Here's a screenshot of Ultima IV:



The look of the terrain improves dramatically if we add transitions from one type of terrain to another. Here's Ultima V:



Adding transitions can greatly increase the number of tiles required.

Here is a simple terrain consisting of two types of locations: ground and water. As in Ultima IV, there is one tile for each terrain type; the white lines indicate the boundaries of the tile bitmaps.



To add artistic transitions, a natural progression from the Ultima IV-style tiles is to turn the ground tile into a set of ground tiles and the water tile into a set of water tiles. Each tile in a set corresponds to a different configuration of neighbor terrain types. This solution looks something like this:



The terrain types are effectively defined at the centers of the tiles. This is not a good solution; it creates a combinatorial explosion because the tile's appearance is affected by nine different grid locations.

It is much better to define terrain types at the corners of the tiles:



Now each tile is defined by only four grid locations.

Addendum (5/13/07)

I got a comment about how foreground tiles should be aligned relative to the background tiles. The commenter is exactly right; foreground tiles are generally centered on the background tiles' corners. Here's an example with programmer art by me (except for the character which is from Zelda: Minish Cap):



The road, forest, and castle tiles are all offset so they are centered on the corners of the background tiles.

3 comments:

Worthstream said...

You have a good point, but it leaves a lot of question...

How do you position foreground sprites, for example?

If you use the same data structure, you should draw the foreground tiles on the corners of the background tiles...

I guess you should keep two separate structures for the background and the foreground, right?

James McNeill said...

Worthstream,

You're exactly right; the foreground tiles generally need to be offset so they are centered on the background tile corners. I added an example to the article.

jimmy jam said...

The particular landscape types are usually efficiently described in the facilities from the floor tiles. This is simply not a great choice; celebrate the combinatorial surge since the tile's appearance will be impacted by 9 various main grid areas.