It is currently Sun Oct 21, 2018 9:55 am

All times are UTC - 7 hours





Post new topic Reply to topic  [ 18 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: Sprite colours
PostPosted: Sat Apr 28, 2018 2:40 pm 
Offline

Joined: Thu Feb 08, 2018 11:08 am
Posts: 22
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
image.png [ 104.54 KiB | Viewed 2624 times ]
Top
 Profile  
 
 Post subject: Re: Sprite colours
PostPosted: Sat Apr 28, 2018 2:52 pm 
Offline

Joined: Sun Apr 13, 2008 11:12 am
Posts: 7676
Location: Seattle
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"


Top
 Profile  
 
 Post subject: Re: Sprite colours
PostPosted: Sat Apr 28, 2018 2:57 pm 
Offline
User avatar

Joined: Thu Aug 13, 2015 4:40 pm
Posts: 298
Location: Rio de Janeiro - Brazil
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!


Top
 Profile  
 
 Post subject: Re: Sprite colours
PostPosted: Sat Apr 28, 2018 3:31 pm 
Offline

Joined: Thu Feb 08, 2018 11:08 am
Posts: 22
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. :)


Top
 Profile  
 
 Post subject: Re: Sprite colours
PostPosted: Sat Apr 28, 2018 4:07 pm 
Offline
User avatar

Joined: Sat Feb 12, 2005 9:43 pm
Posts: 10904
Location: Rio de Janeiro - Brazil
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).

Quote:
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.

Quote:
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.


Top
 Profile  
 
 Post subject: Re: Sprite colours
PostPosted: Sat Apr 28, 2018 4:42 pm 
Offline
User avatar

Joined: Wed Apr 02, 2008 2:09 pm
Posts: 1251
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

_________________
https://kasumi.itch.io/indivisible


Top
 Profile  
 
 Post subject: Re: Sprite colours
PostPosted: Sat Apr 28, 2018 5:13 pm 
Offline

Joined: Thu Feb 08, 2018 11:08 am
Posts: 22
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
image.png [ 90.81 KiB | Viewed 2589 times ]
Top
 Profile  
 
 Post subject: Re: Sprite colours
PostPosted: Sat Apr 28, 2018 5:32 pm 
Offline

Joined: Sun Apr 13, 2008 11:12 am
Posts: 7676
Location: Seattle
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.
Quote:
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.


Top
 Profile  
 
 Post subject: Re: Sprite colours
PostPosted: Sat Apr 28, 2018 5:39 pm 
Offline
User avatar

Joined: Wed Apr 02, 2008 2:09 pm
Posts: 1251
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.)

_________________
https://kasumi.itch.io/indivisible


Top
 Profile  
 
 Post subject: Re: Sprite colours
PostPosted: Sat Apr 28, 2018 5:58 pm 
Offline

Joined: Thu Feb 08, 2018 11:08 am
Posts: 22
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.;)


Top
 Profile  
 
 Post subject: Re: Sprite colours
PostPosted: Sat Apr 28, 2018 6:47 pm 
Offline

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 20679
Location: NE Indiana, USA (NTSC)
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)


Top
 Profile  
 
 Post subject: Re: Sprite colours
PostPosted: Tue May 01, 2018 11:11 am 
Offline

Joined: Thu Feb 08, 2018 11:08 am
Posts: 22
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
NES sprite temp.png [ 81.15 KiB | Viewed 2395 times ]
Top
 Profile  
 
 Post subject: Re: Sprite colours
PostPosted: Tue May 01, 2018 11:44 am 
Offline
User avatar

Joined: Wed Apr 02, 2008 2:09 pm
Posts: 1251
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.

_________________
https://kasumi.itch.io/indivisible


Top
 Profile  
 
 Post subject: Re: Sprite colours
PostPosted: Tue May 01, 2018 12:57 pm 
Offline
User avatar

Joined: Thu Aug 13, 2015 4:40 pm
Posts: 298
Location: Rio de Janeiro - Brazil
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!


Top
 Profile  
 
 Post subject: Re: Sprite colours
PostPosted: Tue May 01, 2018 2:26 pm 
Offline

Joined: Thu Feb 08, 2018 11:08 am
Posts: 22
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. :)


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 18 posts ]  Go to page 1, 2  Next

All times are UTC - 7 hours


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group