Problem about player bounding box and first person view weapons
by Güvenç Şahin · in Torque Game Engine Advanced · 05/27/2009 (2:44 pm) · 5 replies
Hi guys! We're trying to make an FPS game with TGEA. We're having some problems with the first person view weapons going through walls. We have yet to find a proper solution. We tried scaling the gun down(like scaling a sniper rifle to look like a uzi) and using a larger bounding box for the player. Obviously these suggestions had their drawbacks. The rifle looks like a toy and the players cannot stand close to the walls as they should be able to.
We would be more than grateful if anyone could point us to a solution. Thanks for looking.
We would be more than grateful if anyone could point us to a solution. Thanks for looking.
About the author
#2
05/30/2009 (1:29 am)
Yes, I'm pretty sure it works in stock TGE, so I don't see why it shouldn't work in TGEA. The CSK changes, as far as I know, were supposed to change the player collision box to include the weapon, so you wouldn't have the ugly push-back effect.
#3
05/30/2009 (5:26 am)
Thanks for the info guys, we'll definitely look into the pushBack node.
#4
@Emre: I forgot about this, but that "pushback" node: it's called a "retractNode".
@Daniel: The CSK kind of had their own workaround (called weapon back-fraction) but they left it disabled. After experimenting with it I found out why -- it had horrible problems. Such as mounting a small weapon and being able to see through walls and/or objects. Not only that but sometimes it would cause collision to fail all-together and you would fall through the object/wall and then through the terrain when you bumped into something. But when it worked it worked just like the retractNode is supposed to work, ie. pushing the weapon backwards in your hand instead of protruding through the wall which is far uglier in my opinion. Of course they never acknowledged the problem, just a "well don't use it then!" and now they're history.
05/30/2009 (8:25 am)
Hah, never noticed the Forum category. I'm a click "View all Unread" kind of guy and then I answer/read things almost at random ;)@Emre: I forgot about this, but that "pushback" node: it's called a "retractNode".
@Daniel: The CSK kind of had their own workaround (called weapon back-fraction) but they left it disabled. After experimenting with it I found out why -- it had horrible problems. Such as mounting a small weapon and being able to see through walls and/or objects. Not only that but sometimes it would cause collision to fail all-together and you would fall through the object/wall and then through the terrain when you bumped into something. But when it worked it worked just like the retractNode is supposed to work, ie. pushing the weapon backwards in your hand instead of protruding through the wall which is far uglier in my opinion. Of course they never acknowledged the problem, just a "well don't use it then!" and now they're history.
#5
05/31/2009 (8:31 am)
Oh, okay. I thought I saw something about weapon collision boxes on their feature list - I don't actually own the kit. I agree that the retraction almost looks worse than having weapons go through walls, but it avoids people being able to shoot through doors/walls. I'm working on a solution similar to GRAW, where if you're too close to a wall, you just aim the weapon at the floor. Another possible solution does involve using the weapon's bounds as a collision box since I've implemented convex collision and penalty collision resolution for Players, this could work quite simply with rotation).
Associate Michael Hall
Distracted...
EDIT: but does it work? I don't know. The CSK also had a poor hack in place for this very thing that introduced more issues than it solved.