Hello. I'm new to nesdev and bit confused when it comes to color limitations of sprites. So... backgrounds use 16x16 tiles that may use 3 unique palette colors + black. What about the limit for character sprites? Most use just 3 colors, can I use black as the 4th color? Here's a sprite of on-guard sword knight from Kirby's Adventure, which uses 6 colors (3 for the knight and 3 for the sword). Are they just 2 separate sprites?
It is multiple separate sprites overlayed on eachother. This is nothing special/uncommon on the NES, since you already have to use multiple sprites to form a metasprite, overlaying them is just the next step.
Also backgrounds uses 8x8 tiles, not 16x16. The colour palette granularity is 16x16, and it is common for games to simulate 16x16 tiles by assembling groups of 4 tiles, "metatiles".
Does it mean that if my character is 8x16, upper 8x8 tile can have completely different colors than lowe 8x8 tile?
In the case of 8x8 hardware sprites, yes. If 8x16 hardware sprites are used, no.
However Contra have 32x16 player with 8x16 hardware sprites and different colours for the lower part (pants) and the upper part (body).
Friendly_Noob wrote:
can I use black as the 4th color?
No. The reason NES sprites are only 3 colors is that one of the colors has to be sacrificed in favor of transparency. The only way to have sprites with more than 3 colors is to overlay sprites (like in the Kirby example) or to use different palettes in non-overlapping sprites (like in Contra).
One more way to get another sprite color: Plain old black background everywhere. Not all that infrequent.
Another thread proposed modifying the background tiles around the player character to draw black pixels there, using an RPG hero as an example. This would help against the sprite limit and add forced black pixels to the character. If white was forced into every background palette, you could get White that way too.
Dwedit wrote:
One more way to get another sprite color: Plain old black background everywhere. Not all that infrequent.
This worked pretty well in the fighting sequences of the Famicom Dragon Ball Z games.
Quote:
Another thread proposed modifying the background tiles around the player character to draw black pixels there, using an RPG hero as an example.
This is quite an extreme solution, and very impractical in most games that don't use tiny sprites whose movements are limited by a grid.
tokumaru wrote:
Dwedit wrote:
One more way to get another sprite color: Plain old black background everywhere. Not all that infrequent.
This worked pretty well in the fighting sequences of the Famicom Dragon Ball Z games.
Fun fact: Only one of the two characters in those fighting sequences is made of sprites. The other one is drawn onto the BG. That's why they never flicker even when the bigger characters do a kick.
Thanks for answers everyone!