gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

Beginners > Why do the pros only use 16 color tiles?

#20173 - CyberSlag5k - Mon May 03, 2004 7:07 pm

I heard somewhere (probly on this forum) that most professional games use 16 color tiles instead of 256. Is this true? And if so, why?
_________________
When you find yourself in the company of a halfling and an ill-tempered Dragon, remember, you do not have to outrun the Dragon...

#20174 - niltsair - Mon May 03, 2004 7:29 pm

Takes half the space in Cart.
Can have 2x as many Tiles.
_________________
-Inside every large program is a small program struggling to get out. (Hoare's Law of Large Programs)
-The man who can smile when things go wrong has thought of someone he can blame it on. (Nixon's Theorem)

#20175 - NoMis - Mon May 03, 2004 8:43 pm

The color indices of the image are 8 bit wide in 256 color mode because you need at least 8bits to for 256 possibilitys.
In 16 color mode the color indices only need half the space becase 4 bit can have 16 possibilities.
So the images only need half the space in VRAM and you can have more tiles loaded.
You can still have 256 colors onscreen cause every tile can have one of 16 16-color palettes.

NoMis

#20176 - sajiimori - Mon May 03, 2004 8:58 pm

Space is not a sufficient reason in itself, because there is a theoretical tradeoff in image quality. The question is: how often do you want to exceed 16 colors in an 8x8 tile? In practice, not very often.

Moving past the space consideration, there is actually a benefit of using 16 color tiles: you can change the palette used by a map cell without affecting other instances of that tile.

#20177 - CyberSlag5k - Mon May 03, 2004 9:01 pm

Now that makes a bit more sense. How tell the tiles what palette they should use? just overwrite the main background palette as you load each one?
_________________
When you find yourself in the company of a halfling and an ill-tempered Dragon, remember, you do not have to outrun the Dragon...

#20180 - col - Mon May 03, 2004 10:25 pm

sajiimori wrote:
Space is not a sufficient reason in itself

space surely is a sufficient reason - on a commercial project, the difference between using a 64mbit cart and a 128mbit cart could be the difference between making a profit or a loss !!

Quote:

... because there is a theoretical tradeoff in image quality. The question is: how often do you want to exceed 16 colors in an 8x8 tile? In practice, not very often.

The image quality issue is debatable - colour reproduction on the gba is pretty poor, so the difference there is not very noticable. On the other hand, if you use 4 bit colour backgrounds, you have the option of having more unique tiles on show at one time, giving you a greater detail level and potentially a more immersive experience.

Quote:

Moving past the space consideration, there is actually a benefit of using 16 color tiles: you can change the palette used by a map cell without affecting other instances of that tile.


yes.
Another potentially significant reason why 4bit colour backgrounds are a good thing is speed. If you are using any kind of dynamic tile management system, it will go a LOT faster with 4bit tiles :)

cheers

Col

#20185 - sajiimori - Tue May 04, 2004 1:25 am

Quote:
space surely is a sufficient reason

You missed the logic. "Because it's smaller" is an incomplete answer -- monochrome would be smaller still. A real answer is "the benefit of reduced size exceeds the cost of having fewer colors per tile."
Quote:
On the other hand, if you use 4 bit colour backgrounds, you have the option of having more unique tiles on show at one time

Yup, 139 more. That and the speed thing are 2 more benefits of low-color tiles.
Quote:

How tell the tiles what palette they should use? just overwrite the main background palette as you load each one?

No, that doesn't really make any sense. When you copy a tile to VRAM, it doesn't stuff a copy of the palette in its suitcase for safekeeping. ;-) You choose the palette number in the map cell. See the usual docs.

#20198 - tepples - Tue May 04, 2004 4:49 pm

Another reason is tradition. The Super NES and the Sega Genesis used 16-color tiles. Heck, Sonic Advance uses only four of the GBA's 16 different 16-color palettes for backgrounds, possibly because Sonic Team's graphics tools were originally designed for a Sega Genesis platform that had only four 16-color palettes shared between backgrounds and sprites.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#20200 - col - Tue May 04, 2004 6:15 pm

sajiimori wrote:
Quote:
space surely is a sufficient reason

You missed the logic. "Because it's smaller" is an incomplete answer -- monochrome would be smaller still. A real answer is "the benefit of reduced size exceeds the cost of having fewer colors per tile."

"Because it's smaller" is an incomplete answer - but I didn't say "Because it's smaller" ;)
I did qualify this POV later in my post by suggesting that any difference in quality between 4bit and 8bit on gba hardware is very slight.
Maybe I should have said that keeping memory usage down is a 'valid motivation' for using 4bit tiles...
Quote:

Quote:
On the other hand, if you use 4 bit colour backgrounds, you have the option of having more unique tiles on show at one time

Yup, 139 more. That and the speed thing are 2 more benefits of low-color tiles.


139 more?

my (possibly very wrong ?) calculations suggest theoretically you can get 896 more !

mode 0; 4 32x32 tile maps - 1 per layer - leaves 57344 bytes of bg vram for tile data so 1792 4bit tiles or 896 8bit tiles.
Each layer can only address 1024 tiles at a time however, each layer can address a different section of the tile data, so it is theortically possible to display all the 4bit tiles at one time in the visible screen area.


Of course, in practice, at any one time, many of the tiles will be partially or totally covered by tiles in other layers, but if you are using an alpha layer, and tiles with a lot of holes in them, combined with parallax scrolling, it can still make a big difference to whats possible...

cheers

Col

#20203 - Miked0801 - Tue May 04, 2004 6:56 pm

Only 31x21 tiles are ever on the visible screen at a time though so 651 4-bit tiles shown.

#20204 - sajiimori - Tue May 04, 2004 7:43 pm

Quote:

"Because it's smaller" is an incomplete answer - but I didn't say "Because it's smaller" ;)

I posted first, so I was defending mine not attacking yours. :)
Quote:

Only 31x21 tiles are ever on the visible screen at a time though so 651 4-bit tiles shown.

We both forgot that there are 4 layers, so with holes and alpha and all that the figure is 2604. As col mentioned, there's space for 1792 4-bit tiles after using 4 screen base blocks.

col, I see your 1792 tiles and raise you 64 more! If you only use 3 backgrounds, that leaves screen space for 1953 tiles, which still exceeds the number of tiles we can fit in VRAM, which is now 1856.

Using 8 bit tiles, we can drop one more background and settle for 1302 tiles of screen space, and fill the 3.75 char base blocks with 960 tiles.

And the final difference comes to... 896?? :o

#20226 - col - Wed May 05, 2004 12:53 am

sajiimori wrote:
col, I see your 1792 tiles and raise you 64 more! If you only use 3 backgrounds, that leaves screen space for 1953 tiles...

you got me there :)
Quote:
...And the final difference comes to... 896?? :o

:-D

col