Advertisement

Network traffic

Started by July 04, 2014 06:32 PM
4 comments, last by hplus0603 10 years, 3 months ago

Hey guys&girls,

I've made my custom multiplayer system for my game, but I am not sure about thingy:

For five minutes of testing, I've noticed that client sends ~700kb for 5 minutes of playing with no another clients. Is it good for game trafic?

Clients sends it's position, lastmessage data per game frame. ( 125 fps usually ).

EDIT: with 32 clients (bots) client receives 700 kb less for 2 minutes. sad.png

sending ~700Kb for 5 minutes translates to ~2.3kb/s. that's not too bad for a game(using a deterministic game setup with sending only inputs can get you down into the byte range depending on how frequently you send inputs.)

receiving ~700Kb for 2 minutes translates to ~5.9kb/s. still not terrible for a game. if you don't have central game servers and have a player act as the host, then this setup can be usable over the internet pretty easily(with a dozen or so players at a time). however if you have a Central server to facilitate all your games, then you'll likely want to reduce the amount of bandwidth used by an individual client, as even a few dozen of clients can add up and saturate your bandwidth very quickly.

Check out https://www.facebook.com/LiquidGames for some great games made by me on the Playstation Mobile market.
Advertisement

Oh, thanks for the answer and tip.

Note that 125 fps for network traffic is generally way more than optimal. 20 or 30 Hz network packets is usually quite enough. Even twitch-action games with custom servers, like high-end Counter-Strike games, will seldom have a network tick rate above 60 Hz.
enum Bool { True, False, FileNotFound };

Note that 125 fps for network traffic is generally way more than optimal. 20 or 30 Hz network packets is usually quite enough. Even twitch-action games with custom servers, like high-end Counter-Strike games, will seldom have a network tick rate above 60 Hz.

I have two main frame functions.

First one is game, it has value com_fps which is 60-120.

Second one is server, it has value server_fps which is 10-20 fps.

What if I make one common network_fps function which will manage server and client frames? I guess, network_fps will be 20, 30 nor 60 fps.

Is it right?

Note that there are likely three frame rates in your game:

1) The rendering frame rate.
2) The simulation/physics frame rate.
3) The network packet frame rate.

These are typically all de-coupled from each other. You can separately use multiple mechanisms, such as "display latest" or "interpolate between two latest" or "extrapolate from latest," to go from network to simulation, or simulation to display.

For each network tick, you will typically collect all the player input that has been seen for all simulation ticks since the last network tick. You may also collect the latest state dump of objects being updated, and/or events that have been generated since the last network tick. Then send all of those messages in a single packet (with appropriate per-message timing information.)

The network packet frame rate and the simulation frame rate are typically fixed, whereas the display frame rate depends on the performance of the computer running the particular game instance.
enum Bool { True, False, FileNotFound };

This topic is closed to new replies.

Advertisement