Game Development Community

client server commands causing due to how they are handled

by Joseph Bosch · in Torque Game Builder · 08/12/2012 (11:19 am) · 1 replies

currently I have a function to send data to a client

function sendBattleInfo(%index)
{
for(%cl = 0; %cl < ClientGroup.getCount(); %cl++)
{
%x = getWord($entityList[%index].battlePosition, 0);
%y = getWord($entityList[%index].battlePosition, 1);
%del = $entityList[%index].delete;
%index = %i;
%client = ClientGroup.getObject(%cl);
commandToClient(%client, 'drawBattle', %x, %y, %index, %del);
}
}
which tells the client when something has updated, the only problem is this things are updating so often that its causing problems, the client will attempt to move on and do other things before its finished processing the all the client commands (like load the next level because the battle is completed) causing not only the client to be a minute behind the server until it can catch up but it causes all sorts of problems with the next level. Please note the function that calls this from the server checks for changes before calling the function so it only sends data that has changed(testing shows changes averagely occur once ever 10th of a second per object). the only thing I can think of is to send the client every bit of data it would need to process the battle sequence its self which on the large scale i was hoping for would be in the neighbor hood of 1440 (as apposed to this method which would send 120 variables)(the hole idea being the server calculates movements and pretty much everything and then just reports the 4 variables to make the client look like its doing what the server does but limiting massive variable sending).

#1
08/12/2012 (4:02 pm)
"Please note the function that calls this from the server checks for changes before calling the function so it only sends data that has changed(testing shows changes averagely occur once ever 10th of a second per object)."

same thing i have done yesterday.but in t3d.


nothing know about t2d.
there should be some callbacks.
try to find out if any callback will make this better for u.
or
any condition on which it will be called.
i think in clientCmddrawBattle() u can do some condition to return back.