/me bumps the thread with a slightly different but related topic...
I was thinking about how sending coordinates values as longs eats so much network bandwidth when I stumbled in a really simple idea to avoid it. It's so simple that either it's likely to be wrong and just don't work (although I must confess I cannot see why not) or somebody else already had this insight and I didn't realize it

. Anyway...
Let's say that we split the world in a three-dimensional grid of cubic sectors with 8192 units side, the first sector starting at the lowest coordinates values (
'-maxx -maxy -maxz') and the last sector starting in the highest (that's it,
'maxx-8192 maxy-8192 maxz-8192'). Then, when we want to send a coordinate, instead of sending 3 longs (12 bytes) we do some math and send instead the corresponding sector index, and 3 shorts representing the coordinate
offsets inside this sector. In the client side we apply the inverse calculation and restore the x, y and z values corresponding to the sector and add the offsets to this to get the final coordinate values. I did a quick math, and assuming a 256 sectors grid (so the index would fit in a single byte) we can have coordinates ranging from '-32768 -32768 -8192' to '32767 32767 8191', the biggest drawback in this case is that Z values couldn't be as big as the other axis (but frankly, I don't think it's a big deal, and one willing to expand it could just use a short to send the sector index instead and still would save a good ammount of bandwidth).
Anyone here can see a reason why this would not work ?