MMO - Sending to Client with Max Bandwidth

Started by
1 comment, last by hplus0603 15 years, 8 months ago
Hi, i have a little question and maybe a big problem. Let me try to explain our situation. There are 1001 players connected to the mmo-server. Each of the connected client creates update-informations, like position-packets, etc. These informations are all gathered together by a logic, we dont want to know about right now. Now assume, one client receives all other updates from the other clients: for e.g. all players are very close to each other ( this would be 1000 packets). The problem is that the player can only receive 200 packets / update-cycle, with 10 update-cycles in a second. (These numbers are all imaginary.) Just filling up a send-queue and stop filling it when it is full wont work. this would cause, that client-update-infos for 1-200 are transmitted, and in next step again, again, and again. But the other 800 players will never be transmitted. So we decided to add a second queue, which takes all packets, for example 1000 or 2000 packets and on each update cycle there are 200 packets transmitted from this second queue until it is empty. If it is empty, it is filled again by the main-update cycle. -> this causes loss of packet informations. This is why we decided to create a difference of important packets and unimportant packets. Important packets are added on every update-cycle to the send list at first, the left space is than filled with stuff from the second queue. Unimportant packets are packets like the position update. This would cause, that 1000 players are updated correctly, but with a larger time-interval. I mean, if there are only 100 players close to each other, every player is updated as fast as defined, maybe 25 times a second. if there are 1000 players, the complete update of all 1000 players are done in 5 times in 2 seconds (2,5 /sec). This wouldn't cause to overflow the clients packets-queue, which would happen, if everything without a limit is sended directly to the player/client. I hope you understand what i try to explain. Now my little question: Is there any better solution for this?
Advertisement
You can send information less frequently, or you can send less information. Consider only sending updates for the nearest N characters. Or make update frequency inversely proportional to distance. (Or both.) You can reduce the value of N or increase the effect of that distance-proportional value as you see a player's theoretical bandwidth approaching 100%.

I'd be quite concerned if your important packets were so numerous as to constitute a bandwidth problem though. I'd say that most of the time, only 2 parties (the actor and the target) ever really need to know about any given event, and anything sent to bystanders is typically cosmetic.
The networking part of an MMO is an exercise in priority scheduling. You have X amount of bandwidth, and Y amount of data to send through it in as timely a manner as possible, where "timely" means something different for different objects -- a monster you're fighting needs to be updated ASAP when it changes, whereas an AFK player that's a kilometer away doesn't need to be as timely.

How, specifically, you decide to schedule your available bandwidth depends on your game design and your specific goals. You can start with two round-robin channels, one high priority for aggro mobs and your group, and one low-priority for everything else. Fill each packet with a bit of each for each packet.
enum Bool { True, False, FileNotFound };

This topic is closed to new replies.

Advertisement