Gameboy Development Forum

Discussion about software development for the old-school Gameboys, ranging from the "Gray brick" to Gameboy Color
(Launched in 2008)

You are not logged in.

#1 2022-01-06 15:09:17

kfmush
New member
Registered: 2021-12-25
Posts: 9

Is there a different tile limit for 16x8 and 8x8 Sprite modes?

I found an answer that said the limit is 40 sprites, either way.  What's throwing me off is how 16x8 sprites are represented in BGB.  If you load 1 16x8 sprite, the top half takes one 8x8 spot in BGB and the bottom half takes the 8x8 spot directly to it's right. 

If the first and second VRAM banks represented in BGB are accurate to how many sprites can be loaded into VRAM, one should be able to use only half as many 8x16 sprites as 8x8 (which makes sense if an 8x16 sprite takes up just as much data as 2 8x8 sprites, which it would make perfect sense that it does).

If this is true, are there any benefits to using 16x8 sprites over 8x8 sprites, beyond being simpler to code a 16x16 meta sprite?  I could see there being more utility in 8x8 sprites, though.  If you made a long metasprite, like a snake, that wasn't taller than 8 pixels, it would take up twice as much space if it was 16x8 sprites.

I have a lot of sprites that would fit on 8x8 tiles, but, since I have larger sprites, too, everything is on 16x8 tiles.  I guess I want to clarify if I'd save space, instead, with smaller sprites on 8x8 tiles and larger 16x16 sprites on 4 8x8 tiles, before I go back and tear up my code again.


EDIT: I think I was confusing something about the on-screen sprite limit.  Unless the game boy can do magic, how on earth could it store as many 16x8 sprites in VRAM as it could 8x8 sprites...  And that's the biggest benefit, obviously, more sprites on screen

Last edited by kfmush (2022-01-06 19:47:34)

Offline

 

#2 2022-01-07 23:31:57

nitro2k01
Administrator
Registered: 2008-02-22
Posts: 249

Re: Is there a different tile limit for 16x8 and 8x8 Sprite modes?

Are you talking about the tiles? Yes, the tiles that you use have to be an adjacent pair of even/odd tiles. So 00/01 or D6/D7 or whatever.

The main advantage of 8x16 sprite mode is that you use up to half as many of the 40 entries in OAM, assuming your metasprites are big enough to take advantage of it. Hopefully some of your sprites are identical so you can reuse the same tile entries for multiple sprite instances! So if your game is centered around 16x16 metasprites, you should generally use 8x16 sprite mode.

If your sprites are mostly 8x8, 8x16 mode can become a disadvantage. For one thing, you need to fill up one of the tiles that make up each sprite with transparent dummy data. But also, a more subtle effect is that even the transparent part of the sprite counts toward the 10 sprites per scanline limit. In other words, that transparent dummy part of one sprite, might cause another sprite to become (partially) invisible.


Blog: Gameboy Genius
"A journey of a thousand miles begins with one small step"
Old Chinese Proverb

Offline

 

#3 2022-01-07 23:54:56

kfmush
New member
Registered: 2021-12-25
Posts: 9

Re: Is there a different tile limit for 16x8 and 8x8 Sprite modes?

Yeah. Thanks for clarifying.  I figured that out, because it simply didn't make sense.  I was just confused on what "sprite limit" some lost forum post I read was talking about.  They were talking about the on-screen limit.  I've gone back to 4x4.  I don't think I'll have that many large metasprites on screen.  Just a little more tedious, now.

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2005 Rickard Andersson