Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / Sparky's group collision does not always work

Author
Message
Mireben
16
Years of Service
User Offline
Joined: 5th Aug 2008
Location:
Posted: 29th Mar 2009 12:50
I have a problem with Sparky's collision detection (2.05 version, and I am using DarkGDK without the November 2008 upgrade, if that is important). I want to check collision between the player and several ghost characters. I create collision boxes around the character models, register them with SC_SetupObject. I assign all the ghost collision boxes to group 1, and update all boxes after every movement with SC_UpdateObject. Then I check collision with the SC_GroupCollision command. Problem: sometimes it works, sometimes - often - it does not work. See the attached screenshot: the ghost is flying right through the character model, all the collision boxes are in the good place, and still "OK" status is indicated by the SC_GroupCollision command. If I change the position of the player, then maybe it works the next time (with the very same ghost object). The problem is very easily reproducible and seems to happen mainly in certain squares of the playing field.

Please help because I can't solve this on my own. There seems to be nothing wrong with my code. The only thing I can still try is to check collision individually instead of using group collision, but that would be a big change on the code. Thanks in advance for any advice.

Attachments

Login to view attachments
Mireben
16
Years of Service
User Offline
Joined: 5th Aug 2008
Location:
Posted: 30th Mar 2009 23:33
Update: I think I have solved this after all. The collision boxes of the two models were exactly the same size. It seems that, if the boxes overlap each other pixel-perfect, then the collision is not indicated. I made the player model box a few pixels different size and now it works. I still need to test if it works always, but I hope this was the solution.

Login to post a reply

Server time is: 2024-09-30 21:17:31
Your offset time is: 2024-09-30 21:17:31