Page 1 of 1

Optimization

Posted: 03 Nov 2011, 17:26
by louissi
Hi there!
I am looking for a way to optimize my game as much as possible.

Right now we are around 6-7kb/s outgoing data by user and it is obviously a bit too much.

My game is a real time 3 players coop defense game. One user sends the position and states of the enemies as they change state/action.

I think I made all I could to reduce the amount of information sent, but I was wondering if there is a smaller way to send it.

I know sfx2 uses binary protocol...

Lets say I have a unit with the id 102.
I am trying to send its x and y coordinates and a new state id.

Normally I would create an SFSObject, put some ints into it with the according keys and send it as an extension request.

Would it be worth it to reduce all my parameters to a big string (ex: #i|102-x|200-y|200-s|2) instead of sending SFSObjects of the type int?

I know it would be more complicated code-wise, but I can spare some time if it really would help.

Posted: 05 Nov 2011, 15:06
by Lapo
No, don't over complicate things. There is no difference in speed in the transmission of 100bytes vs 150 or 200, your message size don't affect network lag, unless we're talking about orders of magnitude (i.e. 100 vs 1000)