ServerConnection and Client Questions
by James Laker (BurNinG) · in Torque Game Engine · 02/08/2008 (6:14 am) · 2 replies
I'm trying to get Pings show on my Score Gui (PlayerListGui).
Now for a start I just wanna see the pings of the clients.
Now the above code doesnt work, an I'm wondering where exactly ClientGroup is kept and the scope is? I see it being used in the server scripts. Is that visible for just with the server? I do get id's when I run it in the Client scripts. So I'm thinking it might be 2 different groups? I'm I right or wrong?
I've also added the How to Identify Objects from Client to Server or Server to Client resource.
So what am I doing wrong or not understanding?
In the end I want to run a scedule on every client that checks the other players' pings.
Please assist
Now for a start I just wanna see the pings of the clients.
// Get Pings
function UpdatePings()
{
for( %clientIndex = 0; %clientIndex < ClientGroup.getCount(); %clientIndex++ )
{
%cl = ClientGroup.getObject( %clientIndex );
%servercn = ServerConnection.ResolveGhost(%cl);
echo(%servercn.getPing());
}
}Now the above code doesnt work, an I'm wondering where exactly ClientGroup is kept and the scope is? I see it being used in the server scripts. Is that visible for just with the server? I do get id's when I run it in the Client scripts. So I'm thinking it might be 2 different groups? I'm I right or wrong?
I've also added the How to Identify Objects from Client to Server or Server to Client resource.
So what am I doing wrong or not understanding?
In the end I want to run a scedule on every client that checks the other players' pings.
Please assist
#2
With my tests so far I've notived that it causes a noticable hitch when sending the (ping) data to all clients at once, so I'll split the updates sent eg only if the Ping changes more than 10ms or something to that extent. And also send the updates to 1 or 2 clients at a time every few seconds... Lemme get to work :)
02/09/2008 (8:41 am)
Cool. Thanx for the help.With my tests so far I've notived that it causes a noticable hitch when sending the (ping) data to all clients at once, so I'll split the updates sent eg only if the Ping changes more than 10ms or something to that extent. And also send the updates to 1 or 2 clients at a time every few seconds... Lemme get to work :)
Torque 3D Owner Robert Blanchet Jr.
The way other Torque games have done this is to, on the server do what you are doing above, maybe once every 15 to 30 seconds, temporarily store the information some way and then invoke a commandToClient for each client and send the information that way.
Then on the client end, you store the information in a place your GUI can get at it.
This means that on the client end the ping information is only updated as frequently as the server chooses to update it. I would recommend to keep to a low update frequency to minimize any impact sending this huge chunk of information could have on the client's connection.
Tribes 2 was done this way, and it sent information such as score, ping, and packet loss.