How much data per second can I allow my engine to send?

Started by
8 comments, last by GuyWithBeard 11 years, 6 months ago
I am working on a game engine for real-time action multiplayer games. I have a client-server architecture where the server ticks at some fixed rate (eg. 15 ticks per second) and the clients at some other (eg. 60 ticks per second). Those game objects whose transform are set as propagated are automatically sent from the server to all clients at the end of every tick. In between, the clients do client side prediction etc. All the normal stuff.

Currently in a scene with about 20 objects being synchronized across the network, I need to transform 15-20 kB of data from the server to all clients. The amount of data going from a client to the server is much smaller, perhaps 1 kB. Does this sound like too much? As far as I know, console games are expected to stay around the 10 kB/s mark, but I am not sure if that's a requirement anymore. Of course, the game engine I am developing is designed for PCs with decent network connections, but still, I would like to know if this sounds bad.

I am using ENet for the low-level networking. The data amount is the total data as reported by the lib. I am unsure if this includes the IP headers, etc.

Thanks!
Advertisement

How much data per second can I allow my engine to send?
...
I need to transform 15-20 kB of data from the server to all clients.

So you need a constant flow of about 200Kbps upstream for the server.

Also consider that you are not the only software using the Internet connection; many homes have multiple devices all concurrently using the same cable or DSL connection.

It is up to you to know your demographics, and to realize if that fairly big slice of bandwidth is acceptable or not.

[quote name='GuyWithBeard' timestamp='1350571122' post='4991438']
How much data per second can I allow my engine to send?
...
I need to transform 15-20 kB of data from the server to all clients.

It is up to you to know your demographics
[/quote]

Unfortunately I don't, and that us why I am asking. What sort of connection can you generally expect people to have? Having 20 objects moving around and getting propagated is probably extremely rare. Most likely you would only be propagating the position of the players and some gameplay critical objects. Also, I have not spent that much time thinking about compression etc. I can probably get the data rate down by 20% or so, if needed.

It's okay if you don't have any definite answers for me. I am just interested in this topic on a high level. Of course if you have some numbers and/or rules of thumb regarding this, all the better!
What sort of connection can you generally expect people to have?[/quote]

Google for "Steam hardware survey" and "unity3d hardware survey" to find some snapshots of the gameplaying public.
enum Bool { True, False, FileNotFound };
Keep in mind that your demographic requirements seem to be very different for users running a client versus a server.

Your client seems to need about 20kbps down, 10kbps up - that's within the range of a decent dial-up connection. Your server seems to need ~200kbps up and down, which should be easily attainable with a good DSL, or average Cable connection (assuming, of course, that the user isn't streaming HD video or running a torrent server at the same time).

Tristam MacDonald. Ex-BigTech Software Engineer. Future farmer. [https://trist.am]


Your client seems to need about 20kbps down, 10kbps up - that's within the range of a decent dial-up connection.


I think you're off by an order of magnitude there ;-) The OP said kB, not kb.
enum Bool { True, False, FileNotFound };
Thanks for your replies! Unfortunately hplus is correct, it's indeed kilobyte, not kilobit. smile.png

So my clients need roughly 200 kbps down and 10 kbps up. If those speeds can be reached with DSL then I guess that's acceptable. I don't see why the server would need 200 kbps down since the data going to the server is fairly small. Also, this sort of synch data that keeps the environment consistent is sent as unreliable packets, so no acks need to go back to the server. Of course, depending on the number of clients connected to the server, the requirements go up.

I don't see why the server would need 200 kbps down since the data going to the server is fairly small.

I may have misinterpreted that as well - I read it as 10kbps per client.

Either way, internet connections are at best symmetrical, and more typically have greater downstream bandwidth than up, so if you have 200kbps up available, you should have at least that much down.

Tristam MacDonald. Ex-BigTech Software Engineer. Future farmer. [https://trist.am]


So my clients need roughly 200 kbps down and 10 kbps up. If those speeds can be reached with DSL then I guess that's acceptable. I don't see why the server would need 200 kbps down since the data going to the server is fairly small.


So, if each client needs 200 kbps down, that means that the server needs 200 kbps up per client. Additionally, if the clients send 10 kbps up per client, then the server needs 10 kbps down per client. How many clients? Multiply, and add some safety margin.

FWIW: Residential internet does not make for a good permanent server solution, even if you get a "static IP" from your ISP. The service level just aren't at the level of reliability you get from a co-location or hosting datacenter. There are fairly cheap "full" hardware solutions with significant bandwidth (10 Mbit or so) for $50/month, and you can get similar pricing, including bandwidth, for virtual servers if you can live with the scheduling latency/jitter.
enum Bool { True, False, FileNotFound };

[quote name='GuyWithBeard' timestamp='1350622943' post='4991679']
So my clients need roughly 200 kbps down and 10 kbps up. If those speeds can be reached with DSL then I guess that's acceptable. I don't see why the server would need 200 kbps down since the data going to the server is fairly small.


So, if each client needs 200 kbps down, that means that the server needs 200 kbps up per client. Additionally, if the clients send 10 kbps up per client, then the server needs 10 kbps down per client. How many clients? Multiply, and add some safety margin.

FWIW: Residential internet does not make for a good permanent server solution, even if you get a "static IP" from your ISP. The service level just aren't at the level of reliability you get from a co-location or hosting datacenter. There are fairly cheap "full" hardware solutions with significant bandwidth (10 Mbit or so) for $50/month, and you can get similar pricing, including bandwidth, for virtual servers if you can live with the scheduling latency/jitter.
[/quote]

Exactly, this still does not explain why the server would need 200 kbps down. Although, with all clients (4-8) it might end up being something like that, so let's leave it at that.

The game I am working on uses so called "listen servers". At least that seems to be the term that is used. In other words, they are not "permanent" since they only act as a server for one game session at a time. I have a matchmaking server running on a virtual machine with a static IP. This server runs matchmaking, NAT-punch through and possibly score keeping services. Whenever someone creates a game, he/she becomes the host for that game and starts up a game server in the same process as his/her client. The game is registered on the matchmaking server and others can join.

I am sure that this probably won't work with all NAT setups, but it has worked in every network that I have tried. I might add some intelligence to the create/join logic, so that people with problematic NAT setups get a warning message, or cannot create games or something similar. The game is supposed to be free anyway, so I am not that concerned with covering every single case. Also, it's actually designed to be played among friends at a LAN party or similar. smile.png I do want the game to be playable on the net, however. The engine is designed to be pretty generic, and the next game might not be designed for LAN...

Anyway, thoughts?

Thanks for your posts thus far! It's nice to ventilate these things with someone every now and then.

This topic is closed to new replies.

Advertisement