Game Development Community

Is Multiplayer Collision Physics Supported Yet?

by Mark Barry · in Technical Issues · 09/12/2003 (9:36 pm) · 4 replies

In April 2003, Tim from GG told me that the TGE does not yet support multiplayer collision physics for racing type games. For example, in a multiplayer racing game if car #1 hit car #2 the physics would not transfer the engery to car #2. Instead, car #1 would act like it hit a brick wall. Does anyone know if the TGE supports this yet? If not, does anyone have a solution?

Regards,
Mark Barry

#1
09/12/2003 (10:18 pm)
I've implemented something like that outside of the racing mod (I'm working off the FPS mod as my base). What I did was implement collision handling with DTS objects and players and DTS objects and other DTS objects in scripting. I can run into an ammo box, which will stop my player and cause the next object to get my energy instead. And if it collides with another DTS object, then the same process happens.

However, I'm not sure if the oncollision event for the vehicles could be done the same, but it's worth checking into. (Sorry I can't give a definite answer on that one :-) Also - if it's not supported, why not just add the support for it, either by exposing the oncollision even to scripting, or just putting it directly in the C++ side. It shouldn't be too hard (I didn't do it, because I wanted to handle DTS collisions on a case by case basis.)
#2
09/12/2003 (10:54 pm)
Hi Davis,

Thanks for the quick reply. Are you doing this in a multi-player network game or single-player? You make it sound easy and if it's that easy I'm wondering why GG hasn't implemented this in the past few years. I emailed Tim on this and I'm waiting for his reply.

Regards,
Mark Barry
#3
09/12/2003 (11:04 pm)
Yes, I'm doing it both in single player and multi-player. I will say this though - there IS a downside to doing it in script. If there's a lot going on, there's lag time. In TZ, there's A LOT going on at times (projectiles goin' all over the place ;-), so you can see it in there. However, for the gamestyle, it's not a big issue. For a racing game, it could be an issue.

As for making it sound easy... well, doing it on the C++ may not be so easy. I've never dived into the vehicles - they weren't a part of the engine when I first started with it (past few years? Vehicles aren't THAT old - TZ has only been in development for 14 months now, and it wasn't in there when I started on it I don't think.) So there could easily be something about it that I've missed that increases the complexity level of vehicle based collisions. However, I have my doubts, since adding collsion detection to particles, for instance, was something like 5 lines of code IIRC. Of course, the key is knowing where those 5 lines went ;-) (And I got that from a resource, and did a little modification to it to improve how they bounced.)

I'd poke around on the C++ side, and just see what's there for collision detection, and see what can be done to improve what ya' need.

Thinking about it - there is one thing... transferal of energy will probably require a bit more work than how I did it on the TZ side with scripting, since you also have the possibilities of skewing the other vehicle during a collision, etc. I guess it all depends on how realistic you want to get with it.
#4
09/13/2003 (12:05 am)
Hi Davis,

I've been using the TGE since 2001 but it's been a while since my last game. I'm going to drop you an email and we can talk more there. I would like to tell you more about the project I'm working on for a motion simulator.

Regards,
Mark Barry