It is currently Sun Jun 25, 2017 11:53 pm

All times are UTC - 7 hours



Forum rules


Related:



Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: Sat Mar 25, 2017 1:38 pm 
Offline

Joined: Wed May 19, 2010 6:12 pm
Posts: 2171
I wonder if there is a way to have non-overlapping sprites switch priorities so that "back-most" sprites appear to drop out first when they're not overlapping. The problem is it would need ~8000 collisions per frame, unless you sort the sprites out by region, or check if there is any drop out to begin with. I still think it would be extremely slow anyway.


Top
 Profile  
 
PostPosted: Sun Apr 02, 2017 3:38 pm 
Offline

Joined: Wed May 19, 2010 6:12 pm
Posts: 2171
I thought of another way to do this. For each sprite check collision with every previous sprite going down, swapping it with it's previous sprite, until it finds an overlapping sprite, then do the same with the next sprite.

Take this sequence:
12345

Let's say 2 and 4 overlap, and 1 and 3 overlap.

2 does not overlap 1
21345

3 overlaps 1

4 does not overlap 3 and 1, but overlaps 2
24135

5 does not overlap any of them
52413


Top
 Profile  
 
PostPosted: Mon Apr 03, 2017 1:42 am 
Offline

Joined: Tue Oct 06, 2015 10:16 am
Posts: 450
That sounds an awful lot like bubble sort, one of the slowest sorting algos.


Top
 Profile  
 
PostPosted: Mon Apr 03, 2017 8:49 pm 
Offline

Joined: Wed May 19, 2010 6:12 pm
Posts: 2171
I just found this information.

https://wiki.superfamicom.org/snes/show/Sprites

Apparently if the there is more than 32 sprites on a line the rear-most sprites drop out, but if there's more than 34 8x1 slivers per line, the front-most sprites drop out. If this is accurate, then that means I can avoid dropping front sprites by doubling front sprites.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC - 7 hours


Who is online

Users browsing this forum: Google Adsense [Bot], Sintendo, Yahoo [Bot] and 11 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