Player Object Collisions with Vehciles or RigidShape problem
by Ronald J Nelson · in Torque Game Engine · 05/10/2007 (4:01 pm) · 6 replies
I am fully aware that this has been an issue for a while now and I want to see what can be done to fix it. Hopefully the GG guys will take a look at this.
The long standing problem has been collision physics in TGE. However, almost all of these can be easily dealt with in script. I have perfectly good collisions with rigidshapes and vehicles. However throw a player object into the equation and at some speeds the object will pass right trough the player object.
The following picture was taken driving the standard buggy and the freeby soldier. Now I drove up to the AI Guard nice and slow and you can see what happened. Then I got out. I have duplicated these results multiple times with other players, and different meshes for each.

What I would like to know is if there is some sort of fix for this without completely changing out the physics engine ( would seem ridiculous ) to get what should be a reliable collision with player objects?
The long standing problem has been collision physics in TGE. However, almost all of these can be easily dealt with in script. I have perfectly good collisions with rigidshapes and vehicles. However throw a player object into the equation and at some speeds the object will pass right trough the player object.
The following picture was taken driving the standard buggy and the freeby soldier. Now I drove up to the AI Guard nice and slow and you can see what happened. Then I got out. I have duplicated these results multiple times with other players, and different meshes for each.

What I would like to know is if there is some sort of fix for this without completely changing out the physics engine ( would seem ridiculous ) to get what should be a reliable collision with player objects?
#2
I also failed to mention this is in TGE 1.5.1 which means Ben Garney's player/vehicle collision fix from:
www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=12174
Has alreasdy been integrated into the engine code. I will say this. I saw the problem all the way back in 1.3 and his new extrudedpolylist code is a drastic improvement, but it still has this one little problem.
05/10/2007 (4:16 pm)
Gary Briggs asked me a question that I thought I needed to add the answer here. It does register and smack the hell out of the player character at higher speeds most of the time. However at slower speeds this is a very consistent result.I also failed to mention this is in TGE 1.5.1 which means Ben Garney's player/vehicle collision fix from:
www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=12174
Has alreasdy been integrated into the engine code. I will say this. I saw the problem all the way back in 1.3 and his new extrudedpolylist code is a drastic improvement, but it still has this one little problem.
#3
05/10/2007 (8:32 pm)
OK it seems that I was terribly mistaken in what I said earlier about it working successfully at higher speeds. Repeated testing has shown me that the successful collision takes place only when the collision does enough damage to kill the player and it has to switch states. When it is a corpse on the ground, collisions are flawless, I can even push the dead body anywhere.
#4
Or, you could do what I did: Treat the Player as (for the sake of collisions only, not for normal moving physics) a Rigid object with no angular velocity by invoking a custom version of Rigid's overloaded (and commented out in stock) collision solver function.
I think you'll probably have more luck with the first solution, or something script-based, unless you want to devote a decent chunk of time to this. For my project, having realistic collisions with every entity in the game was critical, so I took a few weeks and pounded it into shape.
05/11/2007 (2:52 am)
Issues with the Rigid collision solver aside (that's a whole other discussion), I think the real issue you need to deal with for what you're doing is how the vehicle vs. player collision is handled. The default behavior is to treat the Player object like a solid part of the environment. What you'll probably want to do is completely bypass this and set up some method for the vehicle pushing the player out of the way. As you noted, you can push the corpse -- so take the code that handles this and apply it to vehicle->player collisions.Or, you could do what I did: Treat the Player as (for the sake of collisions only, not for normal moving physics) a Rigid object with no angular velocity by invoking a custom version of Rigid's overloaded (and commented out in stock) collision solver function.
I think you'll probably have more luck with the first solution, or something script-based, unless you want to devote a decent chunk of time to this. For my project, having realistic collisions with every entity in the game was critical, so I took a few weeks and pounded it into shape.
#5
05/11/2007 (10:06 am)
www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=12174 has some information on the issue here. Henry's right - it doesn't resolve the collision for player vs. vehicle.
#6
Don't get me wrong, TGE has been the programming learning experience of a lifetime for me. I have learned so much from this that college never came close to covering. But I really would like to see a solution to this, my game needs it.
05/11/2007 (8:00 pm)
Well I must admit I am totally willing to pay for a working solution. Even though it should have been there in the first place since it was advertised as such. Don't get me wrong, TGE has been the programming learning experience of a lifetime for me. I have learned so much from this that college never came close to covering. But I really would like to see a solution to this, my game needs it.
Torque Owner Ronald J Nelson
Code Hammer Games