Game Development Community

Local host ping - 50ms?!

by Brad Solomon · in Technical Issues · 03/11/2005 (12:54 pm) · 5 replies

When I start up a new mission in Torque and I get my ping, it's coming up between 45-60. I'm doing this in the console via echo( serverConnection.getPing() );

Shouldn't this be much lower, like 0-32 at most? I'm running over 200 fps, so it's not like my machine is getting pushed hard.

Just for kicks I set up a dedicated server on my machine, connected to it, and I get the same result. The server browser reports a 12 ping to the dedicated server though.

Anyone got any idea why this is? Is getPing() not working correctly?

#1
03/13/2005 (12:55 pm)
OK, I checked this on several other machines and Torque builds including TSE and the results are all consistent.

Is nobody else concerned that the minimum latency for Torque is 50ms?! Seems like an "award winning" networking system should be performing much better than that. It explains why firing weapons is so laggy though. If you are pinging a server at 50ms, and there's a 50ms delay on top of that, all of your input is delayed 1/10 a sec. Not too speedy for such a fast connection.

If you don't believe me, load up the engine and do a getPing() yourself.
#2
03/13/2005 (1:36 pm)
No, actually, nobody else is concerned, and there is no "minimum latency" for Torque.

Firstly: Last I checked, 50ms wasn't 1/10th of a second. It's actually 1/20th of a second, and a ping is round-trip time. So you are dealing with less than 1/20th of a second for input to go from your computer to the server. There is no noticeable delay between mouse-click and crossbow fire in the example mission.

Secondly: You are running a client and a server on the same machine. Try runnning a server on another machine across a LAN, join that server, then ping it. I just used the executable that comes with the RTS pack and pinged a LAN server in the lobby, and got results between 18 and 30ms, and the server wasn't dedicated so results would be, theoretically, faster for a dedicated server.

If 18ms round-trip isn't fast enough for you, please feel free to use another engine.
#3
03/13/2005 (7:01 pm)
Thanks for responding Pat, but you didn't give any useful info on why the local host is pinging so high. Just curious there, doesn't make sense, my machine is running at 3ghz, it's not taxing it at all. I understand if they aren't synched, it could be up to 64ms to respond if both client and server send updates on a 32ms tick, but then the results should be between 0 and 64 (theoritcally anyway), not a constant 40-60. This would be true regardless if the host is local I think.

I have, in fact tried connecting across the internet to another machine. I got 80ms ping time to it, but in-game I got a 120-150 ping. I will test some more on other machines, try on a LAN. It's wierd that an idle server takes so long to respond though.

Your 18ms ping time is not in-game. Like I said before, I get 12ms to a dedicated server, but when I connect, and query using the netConnection class, I get 50. So that's 42 ms to respond from an idle server. A little longer than a tick, so maybe this makes sense? Again, the engine is hauling ass at 200fps in this case, so it's not like the server is running slow.

I'm sorry, I wasn't clear where I was getting the 100ms figure. You are correct, 50ms is not 1/10th a second. I was adding the 50ms ping (typical) to a theoretical server (from the broswer) to the inherent (unknown) latency of the server that I'm seeing which is around 50 apparently.

The time for a projectile to show up is round-trip right? Not just to the server. So with a 100ms in-game ping, you aren't seeing the projectile for 1/10 a second. That's pretty noticable. Those crossbow bolts sometimes don't show up till a couple meters out even in a local game.

Thanks again for responding, I don't pretend to be a networking expert, and I'm not trying to be a thorn here, I'm just hoping to learn more. Maybe TNL doesn't have this issue?
#4
04/01/2005 (5:20 am)
Brad,

The network send rate is fixed and independant of the ticking or rendering, I believe that the default rate is 32 packets/s (client > server) and 10 packets/s (server > client). So when torque wants to send a ping, it queue to send at the next network update, and the reply to it also only happens when comes the time to send another update.

So in the worst case you get a "minimum" 132ms round trip time (32ms (out) + 100ms (in)), and the best case should be near zero delay, we can then say that the average RTT should be more or less 60ms.

In torque, the design is different from a ICMP ping, this one is made to reply as soon as possible, so it constantly monitors for incoming packets and reply to it instantly. But torque need to accumulate enough information to build an packet with the needed updates.
#5
05/15/2005 (3:28 pm)
If you turn up your server->client packet rate, you can have significant drops of ping time.