Copy Link
Add to Bookmark
Report

A word about pseudo 16x16 tiles

Nintendo's profile picture
Published in 
SNES
 · 4 years ago

Several games (including 'Mario World', 'Metroid', 'Zelda'...) use a little trick to make levels appear more detailed than they really are. Although the physical playfield (where your character, any items, and the enemies all interact) is actually made of large 16x16 tiles, the visible tilemap is composed of four smaller 8x8 tiles. The reason for this is to have a large variety of blocks without using up too much memory; only so many tile graphics can fit into the small 64k of VRAM. So, larger tiles are broken down into smaller parts based on what is redundant. For example, a simple block with a shadow on the bottom is symmetrical horizontally, so the same two tiles can be used for both sides if they are simply flipped. A perfect 16x16 sphere could be made up of just a single 8x8 tile if it was flipped all four directions. Another advantage of subtiling is that more colors can be used per tile. Rather than only fifteen colors (assuming it was using video mode 1) for the entire tile, each of the four subtiles can have its own fifteen color set from the palette.

'Mario World' may be the best example, since the blocks in its levels fit into a distinctly visible grid, unlike some later games which do much better of blending their levels together, sometimes well enough to not be able to tell just where the tile boundaries are. Even the old NES games used this same trick to build their levels and make them look better, so it is nothing new.

The games use a large lookup table in the ROM to turn simple blocky levels into something worth looking at. Each unit in the tilemap is actually a pointer multiplied by eight to index into to the table. Just how large it is depends on how many tiles can be addressed by the unit. If it is a byte as in 'Mario World', the maximum number of tiles of 256; so the table could not be larger than 1024 bytes (256*8). 'Zelda' uses words in its Overworld map. So theoretically up to 65536 different tiles could be used, but in reality, it never uses more than 4096 tiles. Of course, a mere 4096 is more than plenty! It uses 12 bits per word, so the size of its table would be 32768 bytes (4096*8). That is just right, as anything larger than 32k would not be addressable in a single bank (while using the Low ROM memory mode).

The eight bytes for the four subtiles are always grouped together in the table, but just what order they come in seems to be a matter of choice. For example, 'Zelda' stores its four tiles in the order, top-left, top-right, bottom-left, and bottom-right. Otoh, 'Mario World' stores its vertically first, then horizontally, in the order top-left, bottom-left, top-right, bottom-right.

 
Tilemap unit: (x)ƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒø ll≥mm mm≥nn nn≥oo oo≥pp
≥ --≈-----⁄ƒƒƒƒƒø-----≈--
ROM table: abcdefghijklmnopqrstuvwxyz qq≥rr rr≥ab cd≥tt tt≥uu
⁄ƒƒƒƒƒ¡ƒƒƒƒƒø qq≥rr rr≥ef gh≥tt tt≥uu
Four 16bit words: ≥ab cd ef gh√ƒƒƒƒƒƒƒƒƒƒ¡ƒƒƒƒƒŸ-----≈--
¿ƒƒƒƒƒƒƒƒƒƒƒŸ vv≥ww ww≥xx xx≥yy yy≥zz

Frank Dwayne (FDwR@hotmail.com) Feb 23,1999
members.tripod.com/FDwR/snes.htm

← previous
next →
loading
sending ...
New to Neperos ? Sign Up for free
download Neperos App from Google Play
install Neperos as PWA

Let's discover also

Recent Articles

Recent Comments

Neperos cookies
This website uses cookies to store your preferences and improve the service. Cookies authorization will allow me and / or my partners to process personal data such as browsing behaviour.

By pressing OK you agree to the Terms of Service and acknowledge the Privacy Policy

By pressing REJECT you will be able to continue to use Neperos (like read articles or write comments) but some important cookies will not be set. This may affect certain features and functions of the platform.
OK
REJECT