Going down hallways and up stairs
by Ray Depew · in Torque Game Engine · 01/27/2005 (3:34 pm) · 5 replies
This sounds like a dumb question with a simple answer, and maybe it is.
One of our team members has created an interior with stairs and hallways, and we are trying to make our character navigate inside it.
The character was created using MilkShape and exported using the old DTS exporter. Collision detection was enabled, and the exporter created a simple bounding box. (I know that, because I did it myself.)
The interior was created using QuArK. Stairs were created using Q's built-in stair tool. The DIF exporter was used to create the DIF file for TGE's use.
The character had a problem going through the main entrance of the interior, so we enlarged it. The character did fine in large rooms, but could not navigate narrow (3-4 feet wide) hallways or stairs.
Turning off collision detection is not a good idea, because we don't want players to walk through walls. So the only knob we know to turn is the size of the bounding box. We've edited it until it's like a big shrink-wrap rectangular container around the character, and now he can do hallways and stairs, but he can also see through walls if he gets close enough to them.
I'm thinking there's another knob or switch we can use, but I have no idea what it is. What am I missing?
Ray
One of our team members has created an interior with stairs and hallways, and we are trying to make our character navigate inside it.
The character was created using MilkShape and exported using the old DTS exporter. Collision detection was enabled, and the exporter created a simple bounding box. (I know that, because I did it myself.)
The interior was created using QuArK. Stairs were created using Q's built-in stair tool. The DIF exporter was used to create the DIF file for TGE's use.
The character had a problem going through the main entrance of the interior, so we enlarged it. The character did fine in large rooms, but could not navigate narrow (3-4 feet wide) hallways or stairs.
Turning off collision detection is not a good idea, because we don't want players to walk through walls. So the only knob we know to turn is the size of the bounding box. We've edited it until it's like a big shrink-wrap rectangular container around the character, and now he can do hallways and stairs, but he can also see through walls if he gets close enough to them.
I'm thinking there's another knob or switch we can use, but I have no idea what it is. What am I missing?
Ray
#2
in exportGeometry.cc
This seems to work...as a word of warning, it may have a couple gotchas we haven't run into...
-Josh
01/27/2005 (4:29 pm)
I modified Map2Dif to do additive collision brushes... this way we can make nice smooth ramps up visually appealing stairways, etc...in exportGeometry.cc
// Build the interval trees and convex hulls for solid collisions...
//JMR: additive clip brushes
if (1)//mSpecialCollisionBrushes.size() == 0)
{
for (U32 i = 0; i < mStructuralBrushes.size(); i++)
exportHullToRuntime(pRuntime, mStructuralBrushes[i]);
for (U32 i = 0; i < mDetailBrushes.size(); i++)
exportHullToRuntime(pRuntime, mDetailBrushes[i]);
//JMR : additive clip brushes
for (U32 i = 0; i < mSpecialCollisionBrushes.size(); i++)
exportHullToRuntime(pRuntime, mSpecialCollisionBrushes[i]);
}This seems to work...as a word of warning, it may have a couple gotchas we haven't run into...
-Josh
#3
But seriously, for a lot of FPS situations you don't want to cramp players so much that the bounding box would be an issue. Especially online, it really sucks when a hallway is one person wide and somebody parks there, blocking you. Not to say that Torque's player collision system is "good so stop complaining", but simply that it's often good design to keep things fairly spacious...
01/27/2005 (5:22 pm)
You could try replacing the bouding box with a cylinder or capsule; pretty fast to calculate and would give much more consistent results. Or just, you know, axis align your hallways. :PBut seriously, for a lot of FPS situations you don't want to cramp players so much that the bounding box would be an issue. Especially online, it really sucks when a hallway is one person wide and somebody parks there, blocking you. Not to say that Torque's player collision system is "good so stop complaining", but simply that it's often good design to keep things fairly spacious...
#4
01/28/2005 (9:52 am)
The problem with the box is the corners. They get stuck once in a while, interrupting the sliding behavior. Is there any good resource/post/whatever out there covering the collision system? I know how to perform collisions using cylinders and ellipsoids, but applying that to Torque is another story...
#5
The guys are going to get cranky when I tell them "Torque can't do this right out of the box." I had them convinced that TGE can do anything. 8)
I'll try some shape other than a box and see what difference it makes. The only reason we need a bounding box is so the player can't walk through walls. Maybe if we change our paradigm to eliminate the need for a 3P POV, we can eliminate the 3P POV entirely, and then play fast and loose with the model to make the 1P POV work correctly.
--
Regards
Ray
01/28/2005 (5:26 pm)
That all matches my experience with other games. The Doom, Quake and HalfLife series all have wide corridors in their interiors, except for the ductwork and crawlspaces, and then perhaps the bounding box gets smaller because the player crouches? Dunno. C&C:R has some narrow openings, and while UT2003 has some interesting tight squeezes, its gameplay model requires lots of wide-open spaces.The guys are going to get cranky when I tell them "Torque can't do this right out of the box." I had them convinced that TGE can do anything. 8)
I'll try some shape other than a box and see what difference it makes. The only reason we need a bounding box is so the player can't walk through walls. Maybe if we change our paradigm to eliminate the need for a 3P POV, we can eliminate the 3P POV entirely, and then play fast and loose with the model to make the 1P POV work correctly.
--
Regards
Ray
Torque Owner Erik Madison