Update sizes
by Ian Omroth Hardingham · in Torque Game Engine · 12/19/2003 (8:51 am) · 8 replies
Hi,
On my project it's necessary to sync around 200-400 extra bytes of data between client and server for each player as often as position and velocity are synced. The player limit is significantly lower than Tribes (certainly no more than 8), but what kind of effect am I going to see on latency, packet loss, and general feel if I add this data to packUpdate/unPackUpdate?
Further, I know that Torque simulates movement for the control object on a client, but does it simulate other players? Specifically, when you see another player moving on your screen, are you *only* seeing the player moving whenever you get a state update from the server or is your Torque client simulating his movement between updates?
And finally, if I wanted to have an update slightly less often (once every second or so) is there an existing packet with that kind of frequency which I could include data in?
Cheers,
Ian
On my project it's necessary to sync around 200-400 extra bytes of data between client and server for each player as often as position and velocity are synced. The player limit is significantly lower than Tribes (certainly no more than 8), but what kind of effect am I going to see on latency, packet loss, and general feel if I add this data to packUpdate/unPackUpdate?
Further, I know that Torque simulates movement for the control object on a client, but does it simulate other players? Specifically, when you see another player moving on your screen, are you *only* seeing the player moving whenever you get a state update from the server or is your Torque client simulating his movement between updates?
And finally, if I wanted to have an update slightly less often (once every second or so) is there an existing packet with that kind of frequency which I could include data in?
Cheers,
Ian
About the author
Designer and lead programmer on Frozen Synapse, Frozen Endzone, and Determinance. Co-owner of Mode 7 Games.
#2
The Torque client does do some prediction on the client's movement, aswell as other objects in the world in the clients scope.
So if you miss a few packets, you will still see the player moving. However, if you miss too many packets, you get the nice lag icon showing up and everything pauses :)
My question is, why do you have 200-400 extra bytes being sent? What could be so wasteful?
And do you really have to send the data every tick? Or is this critical voice data or something?
If you want to update less often, you could send a custom NetEvent i suppose.
Or alternatively, add a new Mask to the player object (if thats where your data is), and set it "once every second" to update.
12/19/2003 (10:23 am)
Ian,The Torque client does do some prediction on the client's movement, aswell as other objects in the world in the clients scope.
So if you miss a few packets, you will still see the player moving. However, if you miss too many packets, you get the nice lag icon showing up and everything pauses :)
My question is, why do you have 200-400 extra bytes being sent? What could be so wasteful?
And do you really have to send the data every tick? Or is this critical voice data or something?
If you want to update less often, you could send a custom NetEvent i suppose.
Or alternatively, add a new Mask to the player object (if thats where your data is), and set it "once every second" to update.
#3
Lol, as I was writing the post my Artist and I were amused by what people would guess as the reason for needing 400 extra bytes. In short, we're trying to keep as much about our project under wraps as possible until the unveiling next month (fingers crossed), but we're taking a different approach to some things than have been done before.
A further question, how often does packUpdate happen? Is it simply defined in a file somewhere?
Ian
12/19/2003 (10:46 am)
Quote:My question is, why do you have 200-400 extra bytes being sent? What could be so wasteful?
And do you really have to send the data every tick? Or is this critical voice data or something?
Lol, as I was writing the post my Artist and I were amused by what people would guess as the reason for needing 400 extra bytes. In short, we're trying to keep as much about our project under wraps as possible until the unveiling next month (fingers crossed), but we're taking a different approach to some things than have been done before.
A further question, how often does packUpdate happen? Is it simply defined in a file somewhere?
Ian
#4
packUpdate should happen every 32ms i presume. (on server)
There is a whole section of comments in the source of the appropriate classes. You can also build the documentation with doxygen if you want a more navigatable documentation set. (though i think a copy is on GG somewhere)
12/19/2003 (10:50 am)
Ian,packUpdate should happen every 32ms i presume. (on server)
There is a whole section of comments in the source of the appropriate classes. You can also build the documentation with doxygen if you want a more navigatable documentation set. (though i think a copy is on GG somewhere)
#5
Go read the docs, it'll explain this in some depth. :)
12/19/2003 (11:13 am)
Not true. packUpdate happens whenever dirty bits are set and the ghost system needs data. Might be every 32ms, could be more, could be less.Go read the docs, it'll explain this in some depth. :)
#6
12/19/2003 (11:32 am)
Edit: double post, dodge
#7
So, further:
To what level does one client simulate ghosts of other clients? Does it collide them with stuff? I guess it must collide them with the terrain but does it collide them against each other?
I'm trying to get a handle on what extent one client is simulating the world and only error-checking with the server, and to what extent the client is parrot-fashion copying what the server tells it to do.
Ian
12/19/2003 (11:39 am)
Hey everyone, thanks for the replies. Ben, I have read the relevant docs but I'm just trying to get my head around some stuff because I'm doing some quite deep engine editing.So, further:
To what level does one client simulate ghosts of other clients? Does it collide them with stuff? I guess it must collide them with the terrain but does it collide them against each other?
I'm trying to get a handle on what extent one client is simulating the world and only error-checking with the server, and to what extent the client is parrot-fashion copying what the server tells it to do.
Ian
#8
Simultaneously, it also continues to run the client object just like it was a normal object, which includes calling processTick and such. So the simulation is only as half-assed as the code that's in processTick makes it (for instance, by not doing stuff if(isClientObject()).
12/19/2003 (12:33 pm)
The client gets updates and applies them.Simultaneously, it also continues to run the client object just like it was a normal object, which includes calling processTick and such. So the simulation is only as half-assed as the code that's in processTick makes it (for instance, by not doing stuff if(isClientObject()).
Associate Kyle Carter
Interpolation is done for updates... as for simulation, processTick is called on every object, all the time, so simulation does occur on everything. The control object gets more frequent, more detailed update information (via writePacketData/readPacketData), so it should be very reliable.
"existing packet with that kind of frequency"? Torque doesn't work that way... I guess you could set up a SimEvent to call you back every n ms so you can send a NetEvent. Perhaps it would be more efficient to just play with updatePriority or send a NetEvent when the thing you need to synch is ready to send...