DIF Edge Collision
by Michael "ReKTeK" Knight · in Artist Corner · 04/23/2006 (2:43 am) · 9 replies
I have a problem with the edges of brushes in respect to collisions. I think this is best shown with a diagram of the problem area and description of what I am running.
Setup:
TGE 1.4rc2 (latest CVS) - clean build, no mods (release, VC6++)
map2dif_plus.exe - clean build (release, VC6++)
Quark 6.5 Alpha
Torque script modifications:
Player.cs
maxForwardSpeed = 15;
maxBackwardSpeed = 15;
maxSideSpeed = 15;
The following image is a simple map with a long thin floor and two side walls (to keep the player within the target area - basicly support walls).

The problem in the above image is that when my player runs and jumps (strafe/bunny hopping) along that long thin floor, the player gets caught on the floor for a moment as if hitting a bump that slows you down, but the floor is completely flat and smooth, likewise with the walls.
I noticed something interesting in one of my maps, there a rooftop which has a side wall which is not 90 degrees up and down. My player never gets caught on the edge of the floor! So i decided to experiment.
This next picture is an example of the rooftop with walls that are not 90 degrees. I made a clone of the picture above in quark with modified walls.

When I strafe/bunny hop down the floor of the modified brush, my player never gets caught anymore. I spent a fair few hours/days trying to work out the problem, including many searches on the forum. I did find a couple of posts, but no solutions have worked yet.
Any help would be most welcomed :)
Setup:
TGE 1.4rc2 (latest CVS) - clean build, no mods (release, VC6++)
map2dif_plus.exe - clean build (release, VC6++)
Quark 6.5 Alpha
Torque script modifications:
Player.cs
maxForwardSpeed = 15;
maxBackwardSpeed = 15;
maxSideSpeed = 15;
The following image is a simple map with a long thin floor and two side walls (to keep the player within the target area - basicly support walls).

The problem in the above image is that when my player runs and jumps (strafe/bunny hopping) along that long thin floor, the player gets caught on the floor for a moment as if hitting a bump that slows you down, but the floor is completely flat and smooth, likewise with the walls.
I noticed something interesting in one of my maps, there a rooftop which has a side wall which is not 90 degrees up and down. My player never gets caught on the edge of the floor! So i decided to experiment.
This next picture is an example of the rooftop with walls that are not 90 degrees. I made a clone of the picture above in quark with modified walls.

When I strafe/bunny hop down the floor of the modified brush, my player never gets caught anymore. I spent a fair few hours/days trying to work out the problem, including many searches on the forum. I did find a couple of posts, but no solutions have worked yet.
Any help would be most welcomed :)
#2
04/23/2006 (4:30 am)
The player fits down the path no worries. I can move side to side with a decent sized gap between the player and the wall. The walls are only there to make sure I don't fall off the floor/rail/beam. I did have a play around with the bounding box like you suggested. Unfortunately it made no difference, aside from allowing me to fit two players side by side ;)
#3
04/23/2006 (7:06 am)
"well if it ain't broke - don't fix it". Maybe just leave it like that and document it. I do know that Torque has a problem with thin brushes. Look up "detail brushes" for those thin strips. This might increase the accuracy of the collision detection. You could also look for the keyword "integration" for the player and increase this a bit. It will sample the collision more accurately, but use it wisely because it can have an adverse effect on frame rate.
#4
Someone else who has a very similar experience.
www.garagegames.com/mg/forums/result.thread.php?qt=23901
The problem doesn't seem to be thin brushes, it also happens with large brushes as shown in the picture below.

Detail brushes are no good in this situation because the two brushes are not touching. Unless detail brushes do more than stop surface subdivision of other brushes. I did try detail brushes incase it did something else inside the engine, still the same results. holodeck.st.usm.edu/vrcomputing/scenebuilding/chapter05.shtml#_det
I had a look for integration and could only find it in vechicle.cc
If I have missed anything, or misinterpreted your post, please correct me :)
04/23/2006 (10:26 pm)
This problem is that it is breaking my game, as it relies on the ability to jump from ledge to ledge. Momentum and rhythm are the key areas needed for some of these skill jumps. If the player gets snagged on the edge of a building causing them to loose momentum, this is bad as they will not be able to get to the target area.Someone else who has a very similar experience.
www.garagegames.com/mg/forums/result.thread.php?qt=23901
The problem doesn't seem to be thin brushes, it also happens with large brushes as shown in the picture below.

Detail brushes are no good in this situation because the two brushes are not touching. Unless detail brushes do more than stop surface subdivision of other brushes. I did try detail brushes incase it did something else inside the engine, still the same results. holodeck.st.usm.edu/vrcomputing/scenebuilding/chapter05.shtml#_det
I had a look for integration and could only find it in vechicle.cc
If I have missed anything, or misinterpreted your post, please correct me :)
#5
I did notice my character gets stuck on stairs if I make the stairs too big, but this is a transition thing that would require the player to jump anyway over a certain height.
If I get time I'll try the same thing.
04/24/2006 (4:36 am)
Oh well - that's the limit of my knowledge then. It's sounds strange that you get stuck as platform games are a basic thing that torque should do well. Hopefully one of the employees sees this and can offer some advice.I did notice my character gets stuck on stairs if I make the stairs too big, but this is a transition thing that would require the player to jump anyway over a certain height.
If I get time I'll try the same thing.
#6
[ur]http://www.garagegames.com/mg/forums/result.thread.php?qt=32691[/url]
04/26/2006 (7:38 am)
@Michael - also check this thread - to get the latest map2dif compiler for your engine. It may solve the problem - I haven't had time to try your setup on my computer yet.[ur]http://www.garagegames.com/mg/forums/result.thread.php?qt=32691[/url]
#7
I should probably try a different editor and see if that helps. It could be quark causing the problem.
04/27/2006 (7:09 pm)
I'm using map2dif_plus 1.0r which is the latest version from the CVS. Mirrors are still broken :(I should probably try a different editor and see if that helps. It could be quark causing the problem.
#8
05/18/2006 (1:42 pm)
Try putting in an "invisible" brush using a detail brush with all NULL textured faces. You will get the collision surface needed to fill the gap areas.
#9
05/26/2006 (10:14 pm)
My thoughts: Perhaps the collision engine is having a math error on the brush collisions when the movement is nearly parallel to certain features? In any case this seems serious to me.
Associate Andy Hawkins
DrewFX