It is currently Tue Dec 12, 2017 3:02 pm

All times are UTC - 7 hours





Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: Mon May 23, 2016 4:51 pm 
Offline

Joined: Wed May 19, 2010 6:12 pm
Posts: 2422
Has anybody had the idea of splitting the BG layer into collision-objects and then checking collision with each object? At first glance it might sound like it would be too CPU intensive, but if we reduce the number of distinct collision objects (like having the floor being an object, and the walls being another) as much as possible, it might be even faster.

Instead of computing the tile number for each block from the top to bottom of a character, it would only have to check if it went through a wall or not. You wouldn't have to deal with characters out-running the tile grid.


Top
 Profile  
 
PostPosted: Mon May 23, 2016 4:59 pm 
Offline
User avatar

Joined: Sat Feb 12, 2005 9:43 pm
Posts: 10164
Location: Rio de Janeiro - Brazil
I believe many modern games model their levels using objects. As for doing this on old consoles, I guess it could work well if there are no slopes, otherwise things could get weird. I think this would almost always be slower than using grids of blocks though, since you'd constantly be testing objects that are far away from the objects. Also, the CPU load would vary a lot depending on the complexity of the levels.


Top
 Profile  
 
PostPosted: Mon May 23, 2016 5:44 pm 
Offline
User avatar

Joined: Sat Jul 12, 2014 3:04 pm
Posts: 950
Excess BG checks could be avoided by x-sorting (if sidescroller) the BG objects in the level data when you make it. (Ideally, sort non-BG objects too, then you can collide by a mergesort-ish sort of thing...)


Top
 Profile  
 
PostPosted: Mon May 23, 2016 5:57 pm 
Offline

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 19335
Location: NE Indiana, USA (NTSC)
psycopathicteen wrote:
Has anybody had the idea of splitting the BG layer into collision-objects and then checking collision with each object?

Haunted: Halloween '85 does exactly this for its X-sorted list of platforms above the floor.


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: No registered users and 9 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