Tuesday, March 02, 2010

Network progress

Hey everyone,
I'm making some good progress on a new network sync platform, but I still have some ways to go.  I found that some of the current problems are due to the ordering of network messages; it's TCP so they arrive in order, but unfortunately I didn't write my code in the first place to "absorb" network messages in certain locations of operation.  Right now there's only one point in each cycle where I catch messages and interpret them, and this is causing some things to get out of sync if say, a message causes a unit to die before it receives its last location update (which can make a bullet miss or a carryall fail to deliver or who knows what).  So, it's back to the drawing board on a few fundamental things in the strive for perfection.
On the plus side, next release will have a massive improvement in network performance.  I've done a lot of testing and found that the game was requiring enormous bandwidth in some circumstances.  Previously I was sending out unit updates on an all-or-nothing basis, where if a unit had any of its stats changed, it sent all of its relevant info in the update.  I've since rewritten things so that each unit will track each of its own stats, and will only update those specific stats that change.  That part of things is going very well and should lead to a 90-95% reduction in net traffic (yes, you read that right).
Stay tuned in the next couple weeks.