I'm personally developing a massive multiplayer server for the FPS game genre. (Ex: such as battlefield series or call of duty series) In general, people usually use a server and client structure to prevent client data manipulation(such as memory cheats). so the server can check user data whether it is legit or not.

However, the above case has a data traffic issue. For example, a large number of users (100 or more) connect to the server and exchange data with server every seconds. The amount of data will grow enormously. Also, the server has to send updated player data to all other users. As the amount of traffic increases, the cost of the service will be increased as well.

Therefore, In my opinion, users share real-time game data using a peer-to-peer method using UDP or other protocols. And user data validation should be done by a dedicated server.

For example:

  • Total Player counts : 100
  • Interval time of the scen update: 20 milliseconds
  • Number of scenes in a second: 50
  • Data size of the every scene: 64 byte
  1. If server collect all user scene data and send back to all other users

    • Server side inbound data per second = (Numer of users) X (Data size of the scene) X (Number of scenes every second) = 312.5 KByte
    • Server side outbound data per second = ((Numer of users) X (Data size of the scene) X (Number of scenes every second)) X (Numer of users) = ((100) X (64byte) X (50)) X (100) = 32,000,000 byte = 30 MByte/sec => 75 TByte/month
  2. Dedicate server only validate user data in every second

    • Server side inbound data per second = (Numer of users) X (Validation Data(64byte)) = 6.25 KByte
    • Server side outbound data per second(send validation result to each player) = (Numer of users) X (Validation Result(64byte)) = 6.25 KByte/sec => 15 GByte/month

If the server control all user data then server traffic will be massive. however, if the server only checks the validation data then traffic size will be acceptable.

I wanna know above idea is really used in this game business. and If the people are using the above structure how do clients share data? (like p2p using UDP socket??)

  • 3
    \$\begingroup\$ "Oh, I don't like that other player, Joe, so since I have his IP because it's a P2P game, I can DDoS him during the game's tournament... Then I'll screw him when he'll be twitching his Mario party game session." You need to spend a significant amount of work on figuring out what you do not need to send to the clients. And this is one of the reasons why it's very hard for a single dev to release an MMO. \$\endgroup\$
    – Vaillancourt
    Nov 11 '21 at 3:54
  • 1
    \$\begingroup\$ "((100) X (64byte) X (50)) X (100) " it looks like you think you need to send all players data to every player. That's not correct. A player that can't be seen because they are behind a wall does not need to be broadcasted. \$\endgroup\$
    – Vaillancourt
    Nov 11 '21 at 4:10
  • 4
    \$\begingroup\$ Generally we'll be able to give you better answers to "I have a problem, how do I solve it?" than "I have a solution to a problem, is it good/does it have precedent?" — Want to try reframing your question as "How to reduce server costs for a 100-player FPS?" \$\endgroup\$
    – DMGregory
    Nov 11 '21 at 12:33
  • \$\begingroup\$ Good luck -- the idea of peer-to-peer massively multiplayer gaming has been around since at least the days of Everquest, and I haven't heard of anyone succeeding at it. \$\endgroup\$
    – Mark
    Nov 12 '21 at 3:32
  • \$\begingroup\$ You can also find ways to decrease the 64 bytes by a lot! No absolute values, only deltas. Send the absolute values every 200 frames or something. Don't send the position delta unless the player moved and don't send the rotation delta unless they rotated. Certainly don't send the player's armour and weapon status 50 times a second unless they actually changed it! \$\endgroup\$
    – user253751
    Nov 12 '21 at 13:08

You must log in to answer this question.

Browse other questions tagged .