On the Tiles

 

When designing art for the Sega Megadrive, it's important to understand how the console handles graphics. The Megadrive uses a custom graphics chip called the Visual Display Processor or VDP. The VDP is tile-based - graphics are stored in tiles that are 8x8 pixels big. Sprites are split into tiles which are then read in sequence to display them. Each of the tiles references one of the 4 colour palettes available. The above image shows how the VDP has stored the graphics from the main window and the 4 colour palettes being used. (The 5th line of colours is not in the data, but used by the Gens emulator for testing).

8x8 tiles are the basis for all the graphics. So all sprites and game tiles have to conform or fit into multiples of 8, e.g.: 16x16, 32x32, 16x48, 8x24, etc.

The VDP stores all this information in it's VRAM, which is limited to 64K. One of the tricks the Megadrive can use is to use DMA (Direct Memory Access) to copy data from the game ROM to the VDP. This takes some processing time, but used wisely it can allow graphics to be animated using data stored in ROM rather than it all being stored in VRAM. The sprite tiles are placed in a VDP location, but the actual data is copied across from ROM into that space every frame (or every few frames depending on the frame rate you want the animation to play at). This saves space in the VRAM and allows more frames of animation.

Large sprites can be animated by changing just a few of their tiles. This means that you need to be careful of how the animated sections fit into their 8x8 boundaries. Another advantage of this is that sprites can be compressed more easily if more less tiles are animated. For example this toast only animates the center tiles where the face is.

 
Another example is this cheese. The image can be compressed by only storing the tiles that are different. Tiles that are the same can just be stored once and then re-used to rebuild the original image. Here the red outline shows identical "hole" graphics, and the white outline shows tiles that can be flipped to create the other side of the cheese. The graphics need to be processed accordingly developer-side, the Megadrive won't do it for free!


So, being careful to use the 8x8 grid when designing the graphics is important! Another thing to consider is how the collision will apply. Box collision is fastest, so making sprites that fill those boxes helps. You can read more in-depth about the VDP over at Raster Scroll

Comments

Popular posts from this blog

Mega Palettes

Converting Gunslugs to Megadrive / Genesis