Game Development Community

Racing game - inaccurate collision in multi-player

by Mike Stoddart · in Torque Game Engine · 04/11/2004 (10:49 am) · 2 replies

Thought I'd hook up the racing game on my local lan for some quick action. The collision detection between buggies in multi-player is quite inaccurate. A buggy can get stuck inside another one.

Is this an engine issue or a vehicle model issue?

#1
04/11/2004 (10:59 am)
I haven't tested my game online with the buggy, but I can see how it could get stuck, in between the wheel and vehicle body...

EDIT: Maybe have the wheels more closer/under the vehicle, than it might help.
#2
04/11/2004 (12:59 pm)
Vehicle on vehicle collisions aren't implemented in the engine. There is some code in the Rigid class to support this, but it isn't used currently.

Whenever a vehicle collides with another, the vehicle that is ticking goes through collision calculations, while the second vehicle is inert and behaves no differently from a wall for collision calculations.

I have some experimental code that implements vehicle on vehicle collisions with collision calculations for both vehicles. Note that this is far more complex than simply calculating physics changes for the other vehicle(s), since changes to the second (and more!) vehicle's physics may cause it to collide with other objects, those other objects may also cause collisions, and so on, and it may require several iterations to work through all collisions.

I've been working on this for the last bit and hope to have a patch for others to experiment with soon. This experimental code also contains 'improvement' in friction calculations and the iterative collision solver.

In the meantime, try cranking up the collisionTol in the buggy's datablock, maybe to 0.6 or so.