It is currently Fri Nov 24, 2017 9:10 pm

All times are UTC - 7 hours





Post new topic Reply to topic  [ 22 posts ]  Go to page Previous  1, 2
Author Message
PostPosted: Fri Jul 21, 2017 9:23 am 
Offline
User avatar

Joined: Fri Nov 19, 2004 7:35 pm
Posts: 3952
Using 8x16 sprites to represent a very small object basically wastes a tile in video memory, and wastes vertical screen space for the 8 sprites limit.
If you don't mind the waste, go wild on 8x16 sprites.

_________________
Here come the fortune cookies! Here come the fortune cookies! They're wearing paper hats!


Top
 Profile  
 
PostPosted: Fri Jul 21, 2017 10:10 am 
Offline
User avatar

Joined: Sat Sep 07, 2013 2:59 pm
Posts: 1474
Alright, I checked my UpdateAllSprites function, i.e. the function that is used to turn the meta sprites into their actual hardware sprites. I enabled one of the intensity bits from $2001 mid-frame when the function starts and set it back when it stops.

This is the result:
Attachment:
UpdateAllSprites.png
UpdateAllSprites.png [ 3.89 KiB | Viewed 462 times ]

Rendering everything in this scene takes 48 scanlines. Those are four characters and a sum of 38 hardware sprites.

Does your rendering function take longer? If yes, maybe I should post the source code to my function.

_________________
Available now: My game "City Trouble".
Website: https://megacatstudios.com/products/city-trouble
Trailer: https://youtu.be/IYXpP59qSxA
Gameplay: https://youtu.be/Eee0yurkIW4
German Retro Gamer article: http://i67.tinypic.com/345o108.jpg


Top
 Profile  
 
PostPosted: Fri Jul 21, 2017 10:13 am 
Offline
User avatar

Joined: Mon Jan 03, 2005 10:36 am
Posts: 2981
Location: Tampere, Finland
Contra uses 8x16 sprites, so the "lots of small bullets" problem may not be as bad is in practice as it would first seem.

_________________
Download STREEMERZ for NES from fauxgame.com! — Some other stuff I've done: kkfos.aspekt.fi


Top
 Profile  
 
PostPosted: Fri Jul 21, 2017 12:39 pm 
Offline
User avatar

Joined: Sun Jan 22, 2012 12:03 pm
Posts: 5842
Location: Canada
When I wrote an article about NES sprites, my best example for efficient/effective use of 8x8 sprites was Blaster Master's Sophia III:
Attachment:
ex1_blaster.gif
ex1_blaster.gif [ 12.34 KiB | Viewed 431 times ]


Of course, Blaster Master uses 8x16 for the interior game segments where the characters are bigger.

The only critical issue in my view is that 8x16 becomes necessary once you want a certain amount of screen coverage. Everything else besides that seems a minor/manageable issue, and pretty debatable which is better.

8x8 for the micro managers, detailed control, efficient use of tile space, etc. (with no CHR-banking it seems helpful in that respect).

8x16 for coarse and easy control.


Top
 Profile  
 
PostPosted: Fri Jul 21, 2017 1:40 pm 
Offline
User avatar

Joined: Sun Nov 09, 2008 9:18 pm
Posts: 987
Location: Pennsylvania, USA
DRW wrote:
Alright, I checked my UpdateAllSprites function, i.e. the function that is used to turn the meta sprites into their actual hardware sprites. I enabled one of the intensity bits from $2001 mid-frame when the function starts and set it back when it stops.

This is the result:
Attachment:
UpdateAllSprites.png

Rendering everything in this scene takes 48 scanlines. Those are four characters and a sum of 38 hardware sprites.

Does your rendering function take longer? If yes, maybe I should post the source code to my function.


Mine takes a little bit longer (I checked for a case of 39 sprites total), but roughly comparable relatively speaking. 48 scanlines is still a lot larger than the other portions of my engine, so it seems that this is where I need to focus optimization effort if I'm going to try to save some time in my engine.


Top
 Profile  
 
PostPosted: Fri Jul 21, 2017 1:53 pm 
Offline
User avatar

Joined: Sun Nov 09, 2008 9:18 pm
Posts: 987
Location: Pennsylvania, USA
Actually, I just took another look with the monochrome bit. It seems I was wrong. The collision detection (which is a separate step from the update logic) is the most expensive step overall. Maybe that's where I need to focus attention instead.


Top
 Profile  
 
PostPosted: Sat Aug 26, 2017 1:30 pm 
Offline
User avatar

Joined: Sun Nov 09, 2008 9:18 pm
Posts: 987
Location: Pennsylvania, USA
I just completed refactoring my game to use 8x16 sprites. I got a rather substantial speed boost from doing this, and the flickering and such that had been present previously (not much) really looks just the same.

It occurred to me the approach I've taken to art, in collaborating with my artist pays very very little attention to optimal use of chr space. So we don't bother to try to mirror things in multiple ways horizontally or vertically etc. Almost everything is unique. As a result, deduplicating our graphics as 8x16 took up approximately the same number of tiles (maybe 1 to 3 extra in some cases) in the pattern table.

So echoing one post above, yeah, unless you're planning to make an NROM game or otherwise have a strong desire to optimize the hell out of how many patterns you use per object, 8x16 is probably the best option for an action game.


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

All times are UTC - 7 hours


Who is online

Users browsing this forum: No registered users and 8 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