TCPObject compression
by Guimo · in Torque Game Engine Advanced · 01/23/2008 (4:19 pm) · 2 replies
Hi all,
I was reading a post about TCPObject compression and I was wondering... es the TCPObject capable of compressing (not encription, just compression) the data which is sent?
I mean... i have to send a list of int numbers to the client, something like:
13423 15638 13409 44376 62346
In this case, sending this 5 numbers will use 29 bytes or the TCPObject will compress it and decompress on arrival? If it does compress it, how much will the string be compressed?
I make this question because I was writing an specialized version of TCPObject for my game which usually sends a series of objects codes. The codes are usually short ints so they only require 2 bytes for each one so in the previous sample, sending the data as binary will only require 10 bytes.
I guess I can live without encription in this case and in the worst case I guess a simple bit transformatin on send and receive can do the trick. But if Torque can already compress the data then it will save me the job of writing this BinaryTCPObject.
Luck!
Guimo
P.S. For those curious, TCPObject already allows for binary data transfer, the point is replacing the onReceive function so that it can understand the received packet information and send it to the console.
I was reading a post about TCPObject compression and I was wondering... es the TCPObject capable of compressing (not encription, just compression) the data which is sent?
I mean... i have to send a list of int numbers to the client, something like:
13423 15638 13409 44376 62346
In this case, sending this 5 numbers will use 29 bytes or the TCPObject will compress it and decompress on arrival? If it does compress it, how much will the string be compressed?
I make this question because I was writing an specialized version of TCPObject for my game which usually sends a series of objects codes. The codes are usually short ints so they only require 2 bytes for each one so in the previous sample, sending the data as binary will only require 10 bytes.
I guess I can live without encription in this case and in the worst case I guess a simple bit transformatin on send and receive can do the trick. But if Torque can already compress the data then it will save me the job of writing this BinaryTCPObject.
Luck!
Guimo
P.S. For those curious, TCPObject already allows for binary data transfer, the point is replacing the onReceive function so that it can understand the received packet information and send it to the console.
About the author
#2
Luck!
01/29/2008 (3:43 am)
Thanks Henry... then my approach is fine. More work but saves bandwidth.Luck!
Torque 3D Owner Henry Garle