BUG: Collision detection
by Jonathon Stevens · in Torque X 2D · 05/15/2007 (4:05 pm) · 7 replies
OK. So I'm not quite sure where to chalk this bastard up, but here's what's going on. A little while back I discussed how in Simian Escape, you could 'bump' a tree object by running into it with the player. It would move slightly, but then stop you like it should.
This was irritating, but livable. Now I've got a serious issue. If two players both run into the tree at the same time, it sometimes bumps as above, but if one player bumps into the back of another player who's bumping into the tree, the entire tree MOVES with the players, collecting other trees as it goes indefinately....
If a video is needed, i can make one but hopefully i made it sound obvious enough.
This was irritating, but livable. Now I've got a serious issue. If two players both run into the tree at the same time, it sometimes bumps as above, but if one player bumps into the back of another player who's bumping into the tree, the entire tree MOVES with the players, collecting other trees as it goes indefinately....
If a video is needed, i can make one but hopefully i made it sound obvious enough.
About the author
With a few casual games under his belt as CEO of Last Straw Productions, Jonathon created the increasingly popular Indie MMO Game Developers Conference which. Following the success of IMGDC a new MMOG fan event called LFG Expo will debut in June of 2010.
#2
That'll show those damn elephants that hide in the trees.
Seriously though, I assume that player 2 is hitting player 1, bouncing him back into the tree and that is nudging the tree along. Which function are you using in ResolveCollision?
As you just want the player to stop and the tree to do nothing, Maybe consider writing your own function to handle it?
05/16/2007 (2:09 am)
Emergant gameplay. Sounds great.That'll show those damn elephants that hide in the trees.
Seriously though, I assume that player 2 is hitting player 1, bouncing him back into the tree and that is nudging the tree along. Which function are you using in ResolveCollision?
As you just want the player to stop and the tree to do nothing, Maybe consider writing your own function to handle it?
#3
I was thinking this is a problem with the actual physics in the engine itself. What's probably happening is that the player has a higher velocity and therefore can push the tree since he's not actually touching it, which shouldn't be the case.
I'm going to play some more with it tonight, but I believe this could be marked up to the physics engine inside TX.
05/16/2007 (8:48 am)
They are not elephants, they are mamaths damnit!I was thinking this is a problem with the actual physics in the engine itself. What's probably happening is that the player has a higher velocity and therefore can push the tree since he's not actually touching it, which shouldn't be the case.
I'm going to play some more with it tonight, but I believe this could be marked up to the physics engine inside TX.
#4
i only briefly tested it to do basic prototyping, but perhaps if you back up a bit and try doing similar testing in a very simple environment you'll find out what works and what does not.
hope that helps!
05/16/2007 (6:04 pm)
When i was playing with physics, I noticed that if I had various non-conformities (such as collision bounds outside of the sprite rectangle, ie with points with points greater than 1) that certain aspects of the collisions wouldnt behave properly. i only briefly tested it to do basic prototyping, but perhaps if you back up a bit and try doing similar testing in a very simple environment you'll find out what works and what does not.
hope that helps!
#5
05/23/2007 (3:29 am)
I had an epiphany on this dealing with my own collision issues...what's value do you have for inverse mass on the two objects that are colliding?
#6
05/23/2007 (7:48 am)
1.0 for all objects in question
#7
05/23/2007 (12:01 pm)
Try changing the tree to zero
Torque 3D Owner Will O'Reagan
Modern Intrigues
Or.
Best advice I can give, re-check your objects collision settings, you know, object types, collision types, etc.