Original question was:
How much data is too much?
MikeUpchat wrote: I am in the early days of adding multiplayer to my game and hoping for some advice. How much data is the max I should expect to send a second. Is it in the 10's of kb/s, 100's or 1000's?
https://forum.unity.com/threads/how-much-data-is-too-much.1020673/
And my response:
I recommend that you flip your thinking and design the multiplayer portions of your game to be represented with the LEAST amount of data sent with the LEAST FREQUENCY possible to not impact your user experience. Think in bytes not kb.
If you want your server to simulate a real time experience, your server will most likely end up being the bottleneck. It will need to keep up with the framerate of your game to maintain sync between what is drawn on the screen and what the server's memory representation of things. You can fake this a little on the client side with prediction and lerping of late data data, but people will notice the impact of that quickly. For some math -- consider that your server will have to do all of the following within ~16.6ms to keep up with a 60FPS game:
- receive all of the various type of data from all of your users
- do things like simulate physics, calculate rays, update positions, etc. for every one of those users
- send all the results back to all of your users
- and the user has to unpack and process all of that data as well, all within 16.6ms
If you send 1kb of data every second from one user to a server, that isn't so bad to unpack that data, process it, and send the results back -- but what if your game has 10 players? What if you plan to have each of your servers hosting 4 games at a time with 10 players each? You have to multiply the amount of data coming in across every player that you expect a single server to host.
Also, if you are going to be running your own servers (as apposed to doing a player+host setup), the beefier the server, the more it is going to cost you every month to host that number of players. Is your game designed to guarantee that you'll make enough money from that number of users each month to afford the servers to host them?
Nothing will kill the success of your multiplayer game like a laggy multiplayer experience, so don't burn a ton of time making multiplayer code if you don't do everything in your power to minimize that load on your server.
And nothing will kill your drive to keep your game online quicker than the monthly server bill for hundreds of dollars when your income from your players isn't enough to pay for the upkeep.
With all that said, if you are looking to do things like voice or video chat (which are both heavy data streams), don't put that on your game server -- use separate services for those, and again, keep your server's data workload a light as possible.