Gracefully dealing with client lag-related freezing
by Vijay Myneni · in Torque Game Engine · 02/22/2005 (10:33 pm) · 3 replies
Hi,
Recently started doing non-LAN tests of our game over the internet. By and large, everything is working well. Occasionally though, one of the clients will freeze up for 2-10 seconds or so, even though we all have very fast connections (the guy who froze the most was on a T-1 or T-3 at Stanford).
Is this just natural and unavoidable? I remember seeing stuff like this when playing Warcraft III. The game would pause, as everyone waited for the client to get back into it. Or am I potentially doing something that is causing it or making it more likely? If so, what kinds of things cause this?
And if it is just natural and unavoidable, what are graceful ways of dealing with it? Obviously, you don't want to have everyone else be able to run around while the poor frozen guy is stuck. So I guess you would want everyone to stop and wait. Has anyone had to implement this kind of forced "pause" in their game?
Thanks.
Recently started doing non-LAN tests of our game over the internet. By and large, everything is working well. Occasionally though, one of the clients will freeze up for 2-10 seconds or so, even though we all have very fast connections (the guy who froze the most was on a T-1 or T-3 at Stanford).
Is this just natural and unavoidable? I remember seeing stuff like this when playing Warcraft III. The game would pause, as everyone waited for the client to get back into it. Or am I potentially doing something that is causing it or making it more likely? If so, what kinds of things cause this?
And if it is just natural and unavoidable, what are graceful ways of dealing with it? Obviously, you don't want to have everyone else be able to run around while the poor frozen guy is stuck. So I guess you would want everyone to stop and wait. Has anyone had to implement this kind of forced "pause" in their game?
Thanks.
About the author
#2
02/23/2005 (12:56 am)
I'm pretty sure you could track the last time a packet was transmitted between them ... they probably all have timestamps on them. However, I haven't delved into Torque's net code that much yet.
#3
I'm willing to make a resource on this if anyone would find it helpful.
02/23/2005 (6:27 am)
Okay, I figured out a better way to do this than what I posted above. Basically, there's already code in there to detect lost connections, so you can leverage a lot of that to help you detect lag. Once you've detected the lag, you can do whatever you want with it on both the server and the clients. In our game, we're just pausing the whole game until the client has a chance to catch up. In my testing so far, the client only loses about 2-3 seconds of actual game time, no matter how long he is frozen for. I haven't yet tested it with multiple clients, just with the simulated lag deal. More testing tomorrow.I'm willing to make a resource on this if anyone would find it helpful.
Torque Owner Jeremy Alessi