Advanced Search

Author Topic: 8-Bit Mega Man Color Rules  (Read 3539 times)

0 Members and 1 Guest are viewing this topic.

September 19, 2013, 05:23:34 PM
Read 3539 times

Offline Deviddo

  • Standard Member
  • Date Registered: July 29, 2010, 02:29:39 AM

    • View Profile
8-Bit Mega Man Color Rules
« on: September 19, 2013, 05:23:34 PM »
Not sure if this belongs here or not, but I'll ask anyway, and if this is in the wrong place, then that can be solved simply.

I just wanted to know, in terms of Mega Man games, how do the rules work?  3 colors per sprite, right?  And the head is technically a different sprite or something?

September 19, 2013, 10:24:12 PM
Reply #1

Offline NemZ

  • MM8BDM Extender
  • ****
  • Date Registered: October 13, 2010, 03:00:53 PM

    • View Profile
Re: 8-Bit Mega Man Color Rules
« Reply #1 on: September 19, 2013, 10:24:12 PM »
Oh boy... Let me see how clearly I can explain all this stuff once and for all.

Fill Layer

This is just a big block of a single color, usually black but sometimes a sky blue or something like that, that goes behind everything else.  For example, in Ducktales when you go through secret walls in Transylvania you can see scrooge through the black areas of the tiles, and this is because the black isn't actually part of the tiles, but rather the background fill.  For another example, Centaur Flash makes the fill color briefly change to white, which is why the screen flashes like that.

Tiles

A background is composed of tiles that can make use of up to 4 palettes, each with 3 colors (and usually taking advantage of the fill whenever possible to make it look like it actually has 4).  These are composed of 8x8 squares, though because the processor can only assign a pallete to a 16x16 area they tend to be designed around that size anyway, with special exceptions for games like Castlevania 3 which had a special in-cartridge graphic chip.  The gameboy stages tend to be a lot more detailed precisely because they didn't have to worry about this restriction and thus they were much more free with how they used those 8x8 tiles.

Making careful use of screen transitions it's possible to use more than 4 pallettes in a stage (blue>red sky in skullman for example), but the limit still holds for any given screen (the FC7/8 guys screw this up all the time, btw).  Most animated backgrounds are actually the result of a cycling pallet, not new tiles, as doing the other way tends to produce slowdown.  If there is a sharp straight-line cut you can also have different areas of the screen scroll at different rates.  Usually this done for hud displays like in Castlevania or Zelda, but it can also be used sometimes for a parallax effect.

Sprites

These also use the rule of 4 palettes with 3 colors each.  Because it has to stand out from the background however these usually include black (and often white as well), making them look significantly less colorful.  On the other hand sprites don't have to follow the 16x16 color block rule and can be made of 8x8 of 8x16 (wide) slices so their arrangement can be much more interesting.  

With careful positioning multiple sprites can be arranged to act as a single object, and this is indeed how mega man is so much more colorful than most other NES heroes.  There is one palette of black/white/peach that is always fixed, which is used for faces, health items, normal shots, and both Dr. wily and Dr. light.  Mega man's second palette, defaulting to black/blue/cyan, is the one that changes colors with weapons, and this is why 1-ups, e tanks and weapon energy pellets change color with you, and your equipped weapons are always in the same palette.  That leaves only 2 palettes free for all the enemies, which is why some guys change color between stages and those that don't (like mets) tend to be used only with other enemies that are also always that color and often only show up in particular parts of a stage... the palettes have to change for different groups of enemies.

palette

The NES has a very strictly limited list of available colors.  It's kind of a mess in all honesty... some of the colors available are completely indistinguishable from others, they aren't spaced out all that well in the spectrum (way too much green, really lacking in yellows and reds, and a few more shades of grey would have been awesome), and a large portion of it is taken up by transparent 'colors'.  Another consideration is that because of the way colors were processed directly to the screen (and thus would look slightly different depending on the tv model) there is actually no one single correct RGB value for any given color.  you can see this for yourself just by running the same rom on different emulators side by side... they will often have slightly different shades.  

Your best bet is to just download a palette sample online somewhere and use that as the consistent basis for all your sprites.

Other notes

Too many sprites on the same line causes the processor to bug out a little, which results in slowdown and flickering.  For this reason most large enemies like GutsDozer are actually backgrounds scrolling back and forth using that partitioned screen thing I mentioned earlier.  Only the moving parts and a few details are actually sprites, and if you look carefully when you bring up the weapon screen you can see this as all the sprites will briefly disappear.This effect can also be used sparingly to add extra details just to backgrounds, usually in some part of the screen where nothing else is going on so it doesn't add to the sprite flicker problem.

In some rare cases the sprites can be displayed on a layer behind the tiles, such as in world 1 of Super Mario 3 where you can use a trick to fall behind the blocks and get a whistle.  This arrangement is why the background is so flat in that level... they couldn't put any background details in as they would overlap the sprites, so it's just the fill color all on it's own.

By far the best way to sort this out if you're still confused about any of this is to play something on an emulator that has a PPU viewer function (check under debug tab).  This will open a separate window that will let you see all the sprites and tiles currently in system memory, along with all the palettes in use, and it updates in real time with the game as you play it.  This is especially good for making sense of how animated tiles work such as in Metal Man's stage, or for seeing how palettes shift mid-stage such as in Charge Man's stage to offer both red and green cars along the way.

September 20, 2013, 09:54:53 AM
Reply #2

Offline Deviddo

  • Standard Member
  • Date Registered: July 29, 2010, 02:29:39 AM

    • View Profile
Re: 8-Bit Mega Man Color Rules
« Reply #2 on: September 20, 2013, 09:54:53 AM »
Okay this explains quite a bit, thanks a lot.

September 20, 2013, 10:03:55 AM
Reply #3

Offline PressStart

  • MM8BDM Contributor
  • ****
  • Date Registered: August 13, 2009, 03:06:04 PM

    • View Profile
    • http://minimega.tumblr.com/
Re: 8-Bit Mega Man Color Rules
« Reply #3 on: September 20, 2013, 10:03:55 AM »
Dang, really cool write-up NemZ! I had some vague ideas about that kind of stuff, but I learned a lot reading your post. Really liked the examples you gave, too!