Game Development Community

Players That Repel

by Scott Doerrfeld · in Torque Game Engine · 09/20/2007 (7:49 pm) · 2 replies

I am thinking of a different type of player-to-player "collision" where instead of another player stopping you dead in your tracks or being pushed by your momentum, an algorithm moves you smoothly away from the other player, almost like repelling magnets. What made me think of this is how currently when two players spawn in the same spot there is this awkward span of time where they can't move. Would be nice to have an algorithm that automatically moves them away from each other.

Am I wrong in thinking that the collision in TGE doesn't already work like this?

#1
09/20/2007 (9:23 pm)
Maybe what I am looking for is a way to "dampen" the collision between two player objects? It looks like this is possible in the RigidShape and Vehicle classes using bodyFriction and bodyRestitution, but not for Player objects.
#2
09/20/2007 (11:43 pm)
Correct, TGE does not have something like this.

in vSide, we implemented sort of smushy bounding cylinders for player-vs-player collisions, which have worked out pretty well. the basic idea there is that after a collision is detected via the normal bounding box stuff, if it's two player objects then the bounding cylinger kicks in. cylinders are great because they're actually quite easy to work with. also, for our purposes it seemed bad to allow one player to actually push another player, so we made it look as if you push people only on your local client. that is, on the server, people pretty much run through each other, but on each client it appears as if you push everyone else out of the way.

another option is to implement the radial force for physical zones resource, and then attach a such physical zone to each player. - altho i wrote that resource, i haven't actually used it for generic p-v-p collisions, so it might present some issues. it works well for Special players who say have a force-field activated however.