It is currently Sun Nov 19, 2017 2:49 pm

All times are UTC - 7 hours





Post new topic Reply to topic  [ 24 posts ]  Go to page 1, 2  Next
Author Message
PostPosted: Tue Aug 08, 2017 2:33 am 
Offline
User avatar

Joined: Fri Jul 21, 2017 4:38 am
Posts: 31
Hey folks,

I'm just wondering, if I use 16x8 sprites do I still get 8 per scanline? Or because the sprites are double the width do I only get four?

The reason I ask is my ship is 3 sprites wide, bullet is 1 with max 2 bullets on screen so that only leaves me with two sprites for any enemies without having to code in some ugly flicker. If I get 8 bigger sprites that seems the way to go.

Sorry, I'd test it myself but not near my dev machine.


Top
 Profile  
 
PostPosted: Tue Aug 08, 2017 2:46 am 
Offline
Formerly WheelInventor

Joined: Thu Apr 14, 2016 2:55 am
Posts: 1012
Location: Gothenburg, Sweden
You don't get double width (unless you turn your monitor 90 degrees), you get double height.

Even if one sprite is made of two tiles in this mode, it's still one sprite. You get 8 per scanline, since the special internal/indirect scanline memory in PPU can hold up to 8 sprites.

16x8 8x16 mode increases the likelyhood of sprites intersecting the same scanline geometrically (since they're bigger), but lessens the amount of sprites doing so. It varies a lot if it's beneficient or not, depending on game design.


Edit: 8x16

_________________
http://www.frankengraphics.com - personal NES blog


Last edited by FrankenGraphics on Tue Aug 08, 2017 8:20 am, edited 1 time in total.

Top
 Profile  
 
PostPosted: Tue Aug 08, 2017 2:50 am 
Offline
User avatar

Joined: Sun Jan 22, 2012 12:03 pm
Posts: 5822
Location: Canada
mantanz wrote:
Sorry, I'd test it myself but not near my dev machine.

Every NES emulator emulates the 8 sprite limit.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Aug 08, 2017 2:56 am 
Offline
User avatar

Joined: Fri Nov 12, 2004 2:49 pm
Posts: 7266
Location: Chexbres, VD, Switzerland
There's no such thing as 16x8 mode, there's only 8x8 and 8x16.
(Convention for counting pixels is always Horizontal x Vertical)


Top
 Profile  
 
PostPosted: Tue Aug 08, 2017 3:10 am 
Offline
Formerly WheelInventor

Joined: Thu Apr 14, 2016 2:55 am
Posts: 1012
Location: Gothenburg, Sweden
^ that too. But i always seem to mix them up.

_________________
http://www.frankengraphics.com - personal NES blog


Top
 Profile  
 
PostPosted: Tue Aug 08, 2017 7:25 am 
Offline

Joined: Tue May 28, 2013 5:49 am
Posts: 866
Location: Sweden
The PC Engine's sprite system (which allows for 16 sprites on a scanline) counts sprites with double width as two sprites when it comes to the scanline limit. On the other hand sprite size is set per individual sprite, so you can mix and match sprite sizes however you want.
In Nintendo's consoles, sprite size is usually a global setting but each sprite is always counted as one sprite towards the scanline limit I think (I mean for Game Boy, SNES etc).


Top
 Profile  
 
PostPosted: Tue Aug 08, 2017 7:48 am 
Offline

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 19229
Location: NE Indiana, USA (NTSC)
Like the NES, the Game Boy has only one sprite width. But it allows ten 8-pixel-wide sprites on a 160-pixel-wide picture, or 50% coverage. This is twice the effective coverage of the NES, which allows eight 8-pixel-wide sprites on a 256-pixel-wide picture, or 25% coverage.

Like the TurboGrafx-16 (aka PC Engine), the Sega Genesis and Super NES have a sprite coverage limit close to 100 percent of a scanline. But they also limit total sprite count per scanline regardless of size. And because they allow 8-pixel-wide sprites, sprite count can become the limiting factor on a scanline that contains mostly 8-pixel-wide sprites.

  • Genesis in 256px mode: 16 sprites or 32 8-pixel-wide slivers
    Coverage with 8x8 pixel sprites is 50%; coverage with larger sprites is 100%.
  • Genesis in 320px mode: 20 sprites or 40 8-pixel-wide slivers
    Coverage with 8x8 pixel sprites is 50%; coverage with larger sprites is 100%.
  • Super NES: 32 sprites or 34 8-pixel-wide slivers
    Coverage with 8x8 pixel sprites is 100%; coverage with larger sprites is 106%.
    But because all sprites are square, sprites often have to include more blank space at the top or bottom, reducing coverage on adjacent lines. TG16 suffers from this as well because of the 16x16 pixel minimum sprite size.


Top
 Profile  
 
PostPosted: Tue Aug 08, 2017 11:54 am 
Offline
User avatar

Joined: Fri Jul 21, 2017 4:38 am
Posts: 31
Ah sorry, I had my dimensions around the wrong way. Carry on, nothing to see here :P


Top
 Profile  
 
PostPosted: Tue Aug 08, 2017 11:55 am 
Offline
User avatar

Joined: Fri Jul 21, 2017 4:38 am
Posts: 31
FrankenGraphics wrote:
You don't get double width (unless you turn your monitor 90 degrees), you get double height.

Even if one sprite is made of two tiles in this mode, it's still one sprite. You get 8 per scanline, since the special internal/indirect scanline memory in PPU can hold up to 8 sprites.

16x8 8x16 mode increases the likelyhood of sprites intersecting the same scanline geometrically (since they're bigger), but lessens the amount of sprites doing so. It varies a lot if it's beneficient or not, depending on game design.


Edit: 8x16


Ah you answered another question I had... whether sprites had to be at the exact same height or any part of them on the scanline would count.


Top
 Profile  
 
PostPosted: Tue Aug 08, 2017 12:19 pm 
Offline

Joined: Sun Apr 13, 2008 11:12 am
Posts: 6444
Location: UK (temporarily)
(deliberately off-topic trolling) Unless you're decided to target the VT03. That's like an NES but has a toggle to switch sprites to either 16-pixel wide 2bpp or 8-pixel wide 4bpp.


Top
 Profile  
 
PostPosted: Tue Aug 08, 2017 12:58 pm 
Offline
User avatar

Joined: Fri Nov 12, 2004 2:49 pm
Posts: 7266
Location: Chexbres, VD, Switzerland
Pokun wrote:
In Nintendo's consoles, sprite size is usually a global setting but each sprite is always counted as one sprite towards the scanline limit I think (I mean for Game Boy, SNES etc).

I don't know for other Nintendo's consoles, but the SNES there is two limits, one for number of sprites (32 per line), and one for number of equivalent 8x8 sprites (34 per line). So it's effectively false to say each sprite is counted as one sprite towards the scanline limit. Using a size larger than 8x8 is basically hardware metasprites made of 8x8 sprites, and you only gets two extra 8x8 sprites per line doing that. Still better than nothing, considering 34 sprites allows to simulate for a horizontally scrolling background, wheras 32 sprites only allows to simulate a non-horizontally scrolling background.

Quote:
This is twice the effective coverage of the NES, which allows eight 8-pixel-wide sprites on a 256-pixel-wide picture, or 25% coverage.

While this is true, the coverage doesn't indicate everything. For example if you know your metasprites are going to be 16x16, Gameboy only allows 5 objects, one more than the NES.


Top
 Profile  
 
PostPosted: Tue Aug 08, 2017 2:52 pm 
Offline

Joined: Tue May 28, 2013 5:49 am
Posts: 866
Location: Sweden
Oh I see, it's not much different from PC Engine then which is also effectively using hardware metasprites to make bigger sprite sizes then the default one by combining neighbouring patterns in the pattern table into a metasprite. Although the PC Engine's smallest sprite size is 16x16 instead of 8x8 (which is both good and bad I guess).


Quote:
Ah you answered another question I had... whether sprites had to be at the exact same height or any part of them on the scanline would count.

I remember wondering about this for the longest time too. Everyone said "you can only have 8 sprites on a scanline". On a scanline? A sprite is bigger than a scanline so what does it mean exactly? Then I learned it means that more than 8 sprites can't have any of their pixel lines sharing the same scanline at the same time.


Top
 Profile  
 
PostPosted: Tue Aug 08, 2017 3:06 pm 
Offline
User avatar

Joined: Sat Feb 12, 2005 9:43 pm
Posts: 10113
Location: Rio de Janeiro - Brazil
As far as the PPU is concerned, sprites are only one scanline tall, because it draws the picture line by line. The PPU does a little math in order to know which lines of which sprites it has to show on each scanline (if scanline - sprite_y < sprite_height, that's the line to show), but it only has time to draw 8 sprite lines per scanline.


Top
 Profile  
 
PostPosted: Wed Aug 09, 2017 1:38 am 
Offline

Joined: Tue May 28, 2013 5:49 am
Posts: 866
Location: Sweden
Yeah that makes sense, thanks.


Top
 Profile  
 
PostPosted: Wed Aug 09, 2017 3:13 am 
Offline
User avatar

Joined: Fri Nov 12, 2004 2:49 pm
Posts: 7266
Location: Chexbres, VD, Switzerland
A nice trick is to have each sprite one pixel below its neighbour, and it becomes possible to have as many sprites as you want diagonally, as there will always be exactly 8 sprites per line. This effectively allows to write any arbitrary text with sprites only, at the only "cost" that is should have this weird diagonal lining.

On the other hands, sprites partially hidden by the 8-sprites per scanline limitation are useful to partially hide sprites, as seen in Castlevania II - Simon's Quest when simon enters a swamp and his feet are hidden, for example.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 24 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