Lockup During Collision
by Robert Seeman · in Torque Game Engine · 09/05/2006 (10:34 pm) · 14 replies
I have a flying vehicle datablock that I use to spawn a player and an AIplayer. The AIPlayer datablock is derived from the flying vehicle datablock.
Occasionally, when the vehicles collide with each other the Torque engine locks up. I have to Ctrl-Alt-Del out and kill the process from the task manager.
Has anyone experienced this issue before and can you suggest ways I can troubleshoot it or get around this issue?
Thanks for any help and I'll be happy to provide whatever additional details you may need.
-Robert
Occasionally, when the vehicles collide with each other the Torque engine locks up. I have to Ctrl-Alt-Del out and kill the process from the task manager.
Has anyone experienced this issue before and can you suggest ways I can troubleshoot it or get around this issue?
Thanks for any help and I'll be happy to provide whatever additional details you may need.
-Robert
#2
09/06/2006 (2:13 am)
There are a million (I'm not kidding) threads about this, use the search feature!
#3
Thanks anyway.
-Robert
09/06/2006 (7:28 am)
I did use the search feature. Any search parameter suggestions? I used "collision lockup", among other variations. I found one that you had participated in but it didn't resolve the issue except to bump up the integration setting.Thanks anyway.
-Robert
#4
09/06/2006 (8:04 am)
There is no fix for this Robert - which is why it was never resolved. There are small adjustments you can make that certainly help, but for most gamestyles it wont be enough.
#5
-Robert
09/06/2006 (6:54 pm)
Thanks Stefan. I was hoping against that but I'll just have to rip into the engine. Appreciate the feedback!-Robert
#6
09/13/2006 (8:52 pm)
I believe the issue is when the model is colliding against both side of the surface and can never resolve the collision. I have looked at the look that I think causes this and it is a "while" loop. You could possibly put a overriding only run this loop so many times kind of thing, but I don't know what that would do to normal collisions. I haven't looked at this in a while, but that was my impression of the problem. It is somewhere in vehicle.cc if I remember right.
#7
09/15/2006 (8:50 am)
That's a good idea to get rid of the crashes, but it will still make you travel straight trough the surface in question.
#9
Here's some reasonable productive looking threads about it:
http://www.garagegames.com/mg/forums/result.thread.php?qt=11794
http://www.garagegames.com/mg/forums/result.thread.php?qt=12069
I have no solution for it yet, either. Looking for one.
11/22/2006 (5:12 am)
I was just looking at this one the other day. It's in Vehicle::resolveCollision. It never exits the 'while' loop. I read a thread where they surmised it had something to do with double-sided surfaces. Visually, it will usually appear to allow the vehicle to penetrate something (such as the terrain or an interior), and then get stuck there as the game hangs in the while loop.Here's some reasonable productive looking threads about it:
http://www.garagegames.com/mg/forums/result.thread.php?qt=11794
http://www.garagegames.com/mg/forums/result.thread.php?qt=12069
I have no solution for it yet, either. Looking for one.
#10
It has nothing to do with double-sided surfaces, AFAIK. There are a dozen of good threads on this, and it has to do with the fact that collisions are resolved before forces are calculated which potentially breaks the collision solution.
Edit: I actually had a couple of potential fixes sent to me by a previous community member, but unfortunatly they are from 1.1.2 and in a big mess, and I have not had the time to go trough them and probably will not either. If anyone feels up to the task, send me an email.
11/22/2006 (7:25 am)
You can put a counter inside the while loop and exit the loop if the counter is too high. That will get rid of the freezes.It has nothing to do with double-sided surfaces, AFAIK. There are a dozen of good threads on this, and it has to do with the fact that collisions are resolved before forces are calculated which potentially breaks the collision solution.
Edit: I actually had a couple of potential fixes sent to me by a previous community member, but unfortunatly they are from 1.1.2 and in a big mess, and I have not had the time to go trough them and probably will not either. If anyone feels up to the task, send me an email.
#11
11/22/2006 (11:01 am)
I experimented with modifying the collision mask in the flyingvehicle code (.cc and .h). I've had some success by removing all collisions with other vehicles. The lockups disappear. Naturally this means that the vehicles simply pass through each other but for certain types of games where you need super-fast moving vehicles, collisions may actually be a bad thing (especially if they lock up Torque!).
#12
11/22/2006 (12:07 pm)
The issue is still there though. If you need collisions with the terrain or more complex interiors than simple boxes, that is.
#13
Thanks for the responses!
-Robert
11/22/2006 (3:24 pm)
If you include the counter and exclude all vehicles from the collision mask, your game will run smoothly. Like I said only good for certain types of games, not all. If you want mid-air collisions with fast moving jet fighters then you certainly wouldn't remove flying vehicles from the collision mask.Thanks for the responses!
-Robert
#14
Robert- if you're talking mid-air collisions with fast moving objects then you may get away with substituting your own simpler collision system - for example checking the bounding boxes of your vehicles for overlap, or else casting rays ahead of the vehicles right before updating their positions. You could resolve the collisions then by applying impulses to both vehicles at the point of contact.
11/22/2006 (5:31 pm)
I have managed to get collisions running in a stable and (mostly) reasonable looking way in my car game, but it took several months on-off of hacking and tweaking. The collision resolution code bears only a passing resemblance to how it started. There are actually problems with the collision detection, not just resolution, code - this causes vehicles to sometimes pass through each other or get stuck on terrain or other objects.Robert- if you're talking mid-air collisions with fast moving objects then you may get away with substituting your own simpler collision system - for example checking the bounding boxes of your vehicles for overlap, or else casting rays ahead of the vehicles right before updating their positions. You could resolve the collisions then by applying impulses to both vehicles at the point of contact.
Torque 3D Owner Max