In dungeons the game will sometimes start sending a lot of data upstream to the server.
There are numerous reports of this such as:
http://forums.spiralknights.com/en/node/4917
http://forums.spiralknights.com/en/node/5175
http://forums.spiralknights.com/en/node/4565
Sometimes I can play a few levels with a reasonable amount of upload data sent, but almost always the problem comes back. This is especially troublesome since most ISP's cap upload speeds much lower then download speeds.
I used a protocol analyzer to see what is going on at the packet level. In dungeons under normal conditions, I am sending about 20-25 UDP packets per second with a size ranging from 90 bytes to 218 bytes. On the low end that is only 1800 bytes/sec (14kbps) and on the high end that could reach 5450 bytes/sec (42kbps), but in real-life usage it settles around the average of 3542 bytes/sec (~27kbps).
Under the above described excessive upload conditions, the client is still only sending about 20-25 packets per second but they grow in size until they reach a max size of 1434 bytes! That's 32982 bytes/sec or 257kbps which happens to be close to my capped upload speed. The data of these packets
seems very redundant with about 90% of the packet repeating which may indicate these large UDP packets are probably fragmented by the stack. If any of the fragments become missing or corrupted, the whole datagram is discarded. For that reason, it's not a good idea to use large UDP packets.
Without knowing exactly what's going on under the hood I can only speculate why the client is sending such large amounts of redundant data back to the server. A few ideas are that:
- One client is chosen at random to be a "Main" which keeps track of mobs and such and sends this info to the server, which then relays it to the other players.
- High latency causing the client to retransmit lots of data to catch up
- It could just be a bug
Nobody really knows except for the devs or anyone that wants to try to reverse-engineer the netcode.
Any other thoughts or investigations would be appreciated.
This game uses UDP? I'm surprised people would still go to that protocol in an online action game where latency can vary significantly. It would explain the packet inflation and redundant packets being sent which would lead to inefficient use of bandwidth.
One client is chosen at random to be a "Main" which keeps track of mobs and such and sends this info to the server, which then relays it to the other players.
I don't think that's what's happening as I'm pretty sure all players are seeing a high amount of upload usage.
What I think is happening is, because UDP is an unreliable protocol, 3R basically decided to overcome this by getting the client to spam packets (20-25 per second? Good Looordy!) to the main server (hence the high upload usage). All players' clients would essentially be doing this and the server would be tasked with sorting out which one is the correct information and relaying it back to the client and telling it 'This is the correct location and state of everyone'.
So, I'm sure you can see what happens when there comes a time that there's lots and lots of enemies on the screen and your upload bandwidth can't keep up with the spam (Jelly King, I'm looking at you). The point of UDP is that it's fast and has low a overhead so long as you don't care about reliability, but if you're going to spam packets because you actually do need some reliability, you've sorta negated the whole reason for going UDP in the first place. You could probably fix this problem somewhat by reducing the games requirement to have to spam packets which aren't that important for gameplay. I can make the game upload 40 kBytes/s just by making my character spin around on the spot, that definately needs a throttle to its update frequency. Imagine if half the players in Haven did that at the same time. This is probably the biggest cause of packet spam I see so far.
So are the majority of these connection problems everyone's been having just a case of poor protocol choice?
Edit: Upon further thought, this is probably just a case where there isn't a limit to how often things get updated, or the limit is too high (like keeping track of which direction a player is facing). If there were some reasonable limits placed on spammy things like this, you would see a vast improvement with little detriment to gameplay.