Sprite colours

A place for your artistic side. Discuss techniques and tools for pixel art on the NES, GBC, or similar platforms.

Moderator: Moderators

Chasersgaming
Posts: 42
Joined: Thu Feb 08, 2018 11:08 am
Location: London
Contact:

Sprite colours

Post by Chasersgaming »

Hi all, looking for a bit of advice. 4 colours for the 16x16 draw, from what I have read it's the same for sprites, so when doing characters is it possible, to have 4 different colours in a different 16 x 16 that are attached to the same Sprite. Il post a pic that may show what I mean.ignore the colours displayed, I know there not nes, I'm just experimenting.
Attachments
image.png
lidnariq
Posts: 11432
Joined: Sun Apr 13, 2008 11:12 am

Re: Sprite colours

Post by lidnariq »

All sprites are 8 pixels wide and one of 8 or 16 pixels tall, selectable at any time (but is shared across all sprites).
Each sprite has three colors, plus transparent.
Each sprite can choose one of four three-color palettes, entirely separate from the background.
Multiple sprites can be overlapped.
Games almost always combine multiple sprites (even without overlap) in order to make something larger; on this forum we call those things "metasprites"
User avatar
nesrocks
Posts: 563
Joined: Thu Aug 13, 2015 4:40 pm
Location: Rio de Janeiro - Brazil
Contact:

Re: Sprite colours

Post by nesrocks »

In other words, there's no such thing as a 16x32 sprite, that is the game's code (you), making sure they move together to give the illusion of a bigger sprite. This means that the NES doesn't know any difference. It treats mario's feet the same way it does mario's head and goombas: single, independent sprites.

Just remember, there is a 8x16 sprite mode in NES, in that case both the upper and lower part of that sprite use the same palette.
https://twitter.com/bitinkstudios <- Follow me on twitter! Thanks!
https://www.patreon.com/bitinkstudios <- Support me on Patreon!
Chasersgaming
Posts: 42
Joined: Thu Feb 08, 2018 11:08 am
Location: London
Contact:

Re: Sprite colours

Post by Chasersgaming »

Ok I think I get what your saying. Unlike the background loading up 16x16 that uses only four colours in 8x8 tiles from the 16 available background pallete(1 colour in each pallete of 4 being the same. The sprites 8x8 tiles can use 1 pallete of 4 colours from the 16 available colours(1 same colour being used for transparency in each) unless I would use the 8x16 Sprite mode, in which case 2 8x8 tiles next to each other horizontally or vertically would have to use the same 4 colour Pallete?

most of or all the NES games I have seen at least would suggest that the 8x16 Sprite mode was used a lot, why is that, PAL systems? Be interesting to know.

I appreciate your comments helping and I apoligise if you are find yourselves going over old stuff here. I'm not a nes dev, I'm just amateur pixel artist learning the trade, and trying to create genuine looking nes assets, so I want to get it right as much as i can, so your advice is crucial to my research and learning. :)
User avatar
tokumaru
Posts: 12427
Joined: Sat Feb 12, 2005 9:43 pm
Location: Rio de Janeiro - Brazil

Re: Sprite colours

Post by tokumaru »

Chasersgaming wrote:The sprites 8x8 tiles can use 1 pallete of 4 colours from the 16 available colours(1 same colour being used for transparency in each)
Sprite palettes really do have 3 colors only. There's no physical memory to hold anything for palette entries $3F10, $3F14, $3F18 and $3F1C... whatever you write to those addresses will overwrite the values at $3F1x (i.e. the background palettes).
unless I would use the 8x16 Sprite mode, in which case 2 8x8 tiles next to each other horizontally or vertically would have to use the same 4 colour Pallete?
Sprites are either 8x8 or 8x16 (vertical), 16x8 (horizontal) is not possible on the NES. Also, this is a global setting, so ALL sprites on screen must be the same size.
most of or all the NES games I have seen at least would suggest that the 8x16 Sprite mode was used a lot, why is that, PAL systems? Be interesting to know.
Early games tended to use 8x8, which are conceptually simpler to work with, but as time went on people started expecting video game characters to be bigger, and using 8x16 meant, in theory, that the coverage was doubled. In practice, that was not the case, since some of the sprites would contain empty space.
User avatar
Kasumi
Posts: 1293
Joined: Wed Apr 02, 2008 2:09 pm

Re: Sprite colours

Post by Kasumi »

The posts above are correct. But just to add a visual, the lower right corner of this image shows how >3 color characters work:
Image
Chasersgaming
Posts: 42
Joined: Thu Feb 08, 2018 11:08 am
Location: London
Contact:

Re: Sprite colours

Post by Chasersgaming »

Ok, No colour for transparency, just nothing written to those pallete entry's.

8x16 vertically, not horizontally, gotch ya.

So if I have a Sprite that's uses 9 8x8 tiles to create a boss character, I have to use the same amount of tiles for another character even though it's smaller in size let's say 4 8x8 tiles the rest is just empty tiles. That sounds odd. Or do you mean if I use the 8x16 Sprite mode then every other Sprite needs to use the same, that sounds right. Just making sure I understand what your saying.:)

Just going back to what I posted first, can I use a different pallet selection for each 8x8 tiles when using sprites, and if in 'Sprite mode' different pallete for each 8x16.? (See pic) sorry for the scribble. Have I got it right?
Attachments
image.png
lidnariq
Posts: 11432
Joined: Sun Apr 13, 2008 11:12 am

Re: Sprite colours

Post by lidnariq »

Chasersgaming wrote:So if I have a Sprite that's uses 9 8x8 tiles to create a boss character, I have to use the same amount of tiles for another character even though it's smaller in size let's say 4 8x8 tiles the rest is just empty tiles.
No.
Or do you mean if I use the 8x16 Sprite mode then every other Sprite needs to use the same
Also no.

If you have a sprite that's 16x24 pixels, that would be six 8x8 components ... but it's still four 8x16 components.

If you have a sprite that's 3x3 pixels ... that's one component regardless of whether it's 8x8 or 8x16. And all of these unused bits in both versions have to be filled with transparency, so there's a lot of empty-seeming space.

There's nothing that says the individual components have to be aligned on the grid. Skewing things sometimes can help.
User avatar
Kasumi
Posts: 1293
Joined: Wed Apr 02, 2008 2:09 pm

Re: Sprite colours

Post by Kasumi »

There are 64 sprites. In any given frame they must all be displayed as 8x8, or they must all be displayed as 8x16. The hardware is 100% unaware of what you'd consider a "character". Any character can use any number of sprites. But if the total of all the characters currently on screen requires more than 64, the NES couldn't display all of it in the same frame.

You've got it right palette-wise. But also realize sprites aren't on a grid like the background. You can put them on any pixel. Edit: Ninja'd by lidnariq.

Image
This shows boxes around where each sprite is. (That is thirteen 8x8 sprites.)
Chasersgaming
Posts: 42
Joined: Thu Feb 08, 2018 11:08 am
Location: London
Contact:

Re: Sprite colours

Post by Chasersgaming »

That's great everyone, really appreciate the help here, the background thing really through me out with the same colours being used for 16x16 grid, I wasn't sure if the same rule applied to sprites. Other than the 8x16 I'm pretty much free to draw 3 colours from the 4 pallets in any 8x8 Sprite. Thanks for clearing that up.;)
tepples
Posts: 22708
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Re: Sprite colours

Post by tepples »

For the example sprite at the top of the thread, you could have the top black-pink-white and the bottom black-blue-red.

Here are a couple more examples of Kasumi's observation that sprites don't have to be on a grid. My character from PyFHBG is carefully drawn so that his coat and cap don't extend more than 8 pixels wide.

Image
The naïve way: 6 tiles representing 16x24 pixels of each cel


Image
The smart way: 3 to 5 tiles each representing the same cels


Sometimes, as with Sendo's "Noir Guy", you might have to fudge the outlines slightly to get it to fit in fewer tiles.

ImageImage
Left to right: before (8 tiles), after (6 tiles)
Chasersgaming
Posts: 42
Joined: Thu Feb 08, 2018 11:08 am
Location: London
Contact:

Re: Sprite colours

Post by Chasersgaming »

Hi, i have read all your posts, and i think i get it, i didn't know about the sprite layering, which was great. So this is my thinking so if you could let me know, yes thats right, or no thats wrong i would really appreciate it.:)
this was a character i created last month, now with knowing what i know i had another go but ive explained my thinking behind it based on what you have all said. :)
Attachments
NES sprite temp.png
User avatar
Kasumi
Posts: 1293
Joined: Wed Apr 02, 2008 2:09 pm

Re: Sprite colours

Post by Kasumi »

I'm not sure I understand all of your notes. You mention "not sprite mode", but what's there couldn't be displayed using the background, nor could it be displayed without sprite overlays. The only meaningful difference between the tops and bottoms seems to be the number of palettes used.

The top left isn't six sprites as you have it laid out.

The top 16x16 area would use four sprites of the palette marked green. This would leave a white area that needs another sprite.
The legs would be two more sprites using the palette marked red.
An additional sprite is needed to display the white in the top using the palette marked yellow. That's seven.

The bottom left wouldn't be six sprites + four sprites. It's be six + three. There's no need to draw or store a sprite that is fully transparent, so it's just the the three sprites as palette 2, and six as palette 1.

But you could optimize it further, I'd bet. Can you post it non-scaled?

For the top right, it wouldn't take eight sprites, it'd take 5. Two of the green marked palette for the top of the body, one of the yellow palette for the white area, two of the red palette for the feet.

For the bottom right, it'd take either 6 or 7. (Hard to tell when the image is scaled.) If you post it unscaled I'll break it down in a few different ways. I think you're still thinking too deeply as this being a grid.

Like, from what I can tell, the legs seem to only be eight pixels across, so they only need one sprite.
Edit: Well, nevermind on that last point. The one row of pixels at the bottom of the hands forces the leg area to be too wide for one sprite.
User avatar
nesrocks
Posts: 563
Joined: Thu Aug 13, 2015 4:40 pm
Location: Rio de Janeiro - Brazil
Contact:

Re: Sprite colours

Post by nesrocks »

This is how I would do that character, it does not require complicated overlaying, but it does use up 3 palettes:

Image

- Sprite tiles can be mirrored
- As Kasumi pointed out, make the arms 1 pixel shorter to use only one sprite for the legs (position it off grid). This is good because it reduces horizontal tile count, reducing the chance for sprite flickering.
- Only the sword is positioned on top of the other sprites

You could use 2 palettes instead of 3 if you made the shoes black and then used white instead of brown on the second palette, like so:
Image

This optimization balance is the key to good, varied NES graphics. Make the most of your resources, because they are limited.
https://twitter.com/bitinkstudios <- Follow me on twitter! Thanks!
https://www.patreon.com/bitinkstudios <- Support me on Patreon!
Chasersgaming
Posts: 42
Joined: Thu Feb 08, 2018 11:08 am
Location: London
Contact:

Re: Sprite colours

Post by Chasersgaming »

hi, sorry for my late reply.

OK, dam, i thought i had it figured out, you all must must think i'm an idiot. that's cool, me wife does as well. :)

Let me just explain what i am trying to do as i think i haven't explained myself properly. I am not creating a game, nor am i developing a game with a NES system.(i may one day, but not yet). I am trying to learn how to create genuine NES looking game assets. Assets that keep to the limitations of the systems capabilities and colour palettes. In order for me to do this i am creating them using the tools such as NESST and YY-CHR. but sometimes i have a few questions which the software im using doesn't have the answer. I understand the background, but 'metasprites' are a bit of a riddle. I understand the colour rules to some degree and i want to get them right as much as i can, or a least have it where i can be confident that it can be done. :)

The image i showed previously has been scaled, and it wasn't created in any NES software. it was a sprite sheet that was made for another game engine in mind, but using the NES colour pallete in a way that it could be seen as a genuine looking NES game asset, because it had been created as if it was being created for a NES system. Which is something i am doing as well. The assets will of coarse be available in a chr file, or bitmap file, so they could be used for guys like yourself who still develop for the NES system, they may not be your cup of tea, but hey they might help someone here oneday. :)

Which is why i ask the horrible questions, :) so i apoligise if some of you feel you may of wasted your time, but i can assure you, your advice is well received.

I am a little confused now though? so a sprite is not an 8x8 tile then? i'm sure i read it was, im writing this and i can't qoute now who said what, haha. i feel i have followed what has been posted. Some of you are alarmed by my grid in the image, i suppose you need to ignore that as its not a NES thing. i just wanted to show you how i get the 8x8 sprite tile, use the colours and how id set it up, its not perfect i know, but colour wise is it not doable?

i cant send the original unscaled version of my image i posted just yet as its on another computer, i can do it tommorow if you would still like to assist?

thanks everyone

thank for your responses. :)
Post Reply