About collision detection

Questions, comments and discussion about the Game Editor development.

About collision detection

Postby Thanx » Sun Apr 04, 2010 5:16 pm

I remember those good old, oh I mean bad old :lol: glitches with the collision detection, when an actor leaped through another, when the one was supposed to bounce back from the other.
I know that GE's collision detection is by the pixel, I remember reading that somewhere. Now I don't have the codes for GE, but based on its behavior I suspect that the collision detection first tests the actors' bounding rectangles, and then does further detection to the pixel, to sort even preciser. I can also imagine, that it uses only the outmost pixels of the different sprites, for detection, to further speed the process.
Now my idea is, that to prevent the bug to happen: when using rectangles at highest level: The rectangles the engine should use, should be not only the one the actors are currently contained in, but also, they should contain the space the actors went through, since the last collision detection. That way, if the actor was going so fast, that within a frame, it jumped over the obsticle, the engine says: Hey, now you just go back to that obsticle, and go in the other direction!

So if the actor is contained in a 10px by 10px rectangle, and is going at xvelocity = 75, heading towards a 10px obsticle, then the rectangle for speedy, is actually, as wide as 85px, to include everything the actor has gone through. That way the engine realizes, that there are intersecting rectangles.

Now at that point it won't detect anything again, because the obsticle is only 10px. So I say, that the actor's body should also be stretched. In such a way, if it let's say, a ball, then half of the curve is left in the point the actor was originally, then for the next 70 or so pixels the pixels are all considered the actor's, and then at the last pixels, is the remaining part of the curve that would make the circle round.

I hope that can help, and once be used... It was just an idea, as I was working around on the computer :)
http://www.youtube.com/watch?v=XyXexDJBv58
http://www.youtube.com/watch?v=Be4__gww1xQ
These are me and playing the piano (second one with a friend/fellow student)
Hope you watch and enjoy!
User avatar
Thanx
 
Posts: 314
Joined: Sat Jan 26, 2008 10:07 pm
Location: Home sweet home! :)
Score: 24 Give a positive score

Re: About collision detection

Postby makslane » Sun Apr 04, 2010 7:25 pm

Thanks!
Game Editor is an open source game creator software that's wants to pay it's developers to keep evolving.
If you like Game Editor, make a review!
makslane
Site Admin
 
Posts: 3947
Joined: Sat Apr 05, 2003 6:47 pm
Score: 182 Give a positive score

Re: About collision detection

Postby chrisevil » Tue Apr 27, 2010 9:06 am

=P yeah I have noticed that it isn't always perfect but uh...

I never really got what you were saying?
chrisevil
 
Posts: 14
Joined: Sun Apr 25, 2010 1:31 pm
Score: 0 Give a positive score

Re: About collision detection

Postby Hblade » Tue Apr 27, 2010 1:39 pm

Yeah, it would be an awesome feature to enable a different method of collision detection.

Also if you can, fix up the "ChangeAnimation" thing so that even in draw actor it doesn't repeat the action.

Example:
Code: Select all
ChangeAnimation(bleh bleh... REPEAT); where repeat can be yes or no :3
Subscribe to my YouTube? - Yes| No
User avatar
Hblade
 
Posts: 4455
Joined: Fri Dec 08, 2006 11:14 pm
Score: 181 Give a positive score


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest