The
Legend of Pixelda: An 8-Bit Awakening (Presented in Techinicolor)
A Feature by Vampiducki
The exact technical limitations of 8-bit consoles have been the subject
of much debate on the internet, in your local comic book stores, in
your head, and in the OHR community itself. Today, I will be discussing
some of these EPIC, yet limiting, limitations. I will only be talking
about color limitations for sprites and tiles on the NES. I am only
focusing on the NES and I'm not discussing sprite size or game memory
limitations for these reasons: 1. Most people in the OHR community seem
interested in the NES more than other systems such as the Sega Master
System, and 2. Things like sprite size and memory limitations in the
OHR are completely unrelated to those of any console. Now, on with the
show!
All the visual information on the old NES/Famicom or "Family Computer"
is handled by the PPU, or "Picture Processing Unit" (Ricoh RP2C02). The
PPU is extremely limited, but its capabilities could be augmented by
whatever cartridge was being used. For the sake of everyone's patience
(and my sanity) I'm only going to list the BASIC PPU's limitations. The
NES's base palette is 64 colors, 9 of which are black, two of which are
grays that are nearly identical, and two of which are white, leaving it
with only 54 truly usable colors. Sadly, only a small portion of those
can be displayed on screen at one time (supposedly, more colors
are possible with some programming tricks, but let's pretend for the
sake of argument that you aren't a genius NES programmer and limit it
to the minimum). 16 colors can be used for sprites and 16 can be used
for tiles. "But wait, Vampi! Doesn't that mean you can have 32?" Not
exactly... The NES handles colors in a weird way. Here is a picture of
how the palettes work. the top row is for tiles and the bottom row is
for sprites.
Now I'll explain about how it works with sprites and tiles, in that
order.
Each sprite is limited to 4 colors! That's 3 usable colors (from the
sprites' pool of 16 possible) plus 1 for transparency. Here's the
kicker though; each sprite doesn't just get its own palette of any 4
colors from your total of 16. The palette of 16 colors is broken into 4
smaller palettes of 4 colors each (that's 3 colors and one
transparency). D: That's right, it means you can only have 4 different
sprite palettes on screen at one time. Sad but true... BUT, there is a
neat trick to spruce up the blandness that I'll tell you about later.
And before you ask, yes, layering sprites IS ok! It's been done in many
NES games, probably most notably in the Mega Man series. Mega Man,
himself, is composed of two layers; 1 is his body(black, blue, and
light blue) and 2 is his face(beige, white and black). Here is an
example I made myself: on the left, a simple 4 color sprite using only
the first sprite palette, and to the right, the same sprite redrawn and
layered using the first and second palettes.
Big difference, huh? Now the NES is limited by how many sprites it can
display on one scan-line at a time (8 being the max). If there were
more than 8, the NES had an interesting way of dealing with this, it
would cause the sprites to flash. Naturally, layering sprites takes
more time to process and because the PPU might not have time to process
all the information on one line before proceeding to the next frame of
animation, it might flash. With the OHR, we don't have this problem,
but for the sake of keeping your game retro looking, I wouldn't layer
any more than 2 sprites at a time. If you're layering more than two, I
think you might as well make it a 16 bit game.
Now, on to tiles. Tiles are limited to 4 colors each (from the tiles'
pool of 16 possible), and their palettes are also divided up into 4
smaller palettes of 4 colors (just like sprites). Unfortunately, the
NES can't layer tiles like it can sprites. I DO want to point this out,
though: Tiles CAN appear in front of a sprite. That
is 100% possible: At 0:31, Mario is behind 3 color bushes (black,
dark green, and light green). BAM! It's there! You saw it, and you
can't un-see it. For this trick to work, however, one of the colors has
to be a background color (transparency). Only 3 of the tiles colors can
appear in front of a sprite. If you notice, Mario appears in front of
the light blue color. This is the transparency. To apply the same
effect in the OHR, however, it requires the use of layers. "But...
Vampi, are layers ok in an 8-Bit OHR game?! Isn't that against the
rules?" Whatever, dude! Do it! If you're making an 8-bit NES style
game, you're not just trying to emulate the limitations of the NES.
You're also trying to emulate its capabilities. As long as the visual
output is in the realm of possibility for the NES (or whatever system
your trying to look like), do it!
I'd like to interject a bit of fun info here. both sprites and tiles on
the NES are 8x8 squares. Tentatively, someone could make a 16x16
character or tile block, intended to be seen as one sprite or tile, and
split up the palettes to have all the colors seem to be part of one
bigger piece. Here's a simple example using top colors (for tiles) from
the palettes I showed you before:
If you're wanting to use this idea in the OHR, I'd suggest augmenting
the parameters to 10x10 squares, since the OHR's "16x16" is in fact
20x20.
Now, for something else fun and tricksey! So, about those palette
limitations... The colors of any active palette can be swapped out with
other colors from the master palette at any time. This means ALL the
instances of that color on the current map will change, but it also
means you can have more than 4 sprites with different colors on one
map, just as long as the sprites sharing the palette in question are
not on screen at the same time. If they are, then the colors for one of
them will be wrong. These switches go on in the background where the
player never sees them (between rooms in an RPG or as the screen is
moving along in a side-scroller). It's pretty easy to emulate with the
OHR. Just fix your NPCs to zones so no more than 4 NPCs with different
palettes end up on screen together.
Well, it's been fun. That's all I have for this article, but I
hope it will open things up for those of you out there interested in
making 8-bit NES style games. Have fun, be creative, and allow the
limits to help you grow!
P.S. For those interested in trying it out, here is the NES's full 64
(54) color palette. This is the most correct version you can find at
the moment.