简体   繁体   中英

How many “world snapshot packet” do I need to send per second in multiplayer game (or transfer frequence)

I'm trying to develop my own Server/Client real time multiplayer game architecture. I know that I can't send update packet everytime that server update (High cpu & bandwidth limit). So my question is how many update should I send every second to all clients in Local network/internet.

As many as you can without choking either the client nor your server while keeping a bandwidth margin for sudden peaks of activity...

I believe you need to monitor each connection (socket client) and adjust to the amount of data they can receive - by monitoring the time it takes to write to the socket on your server-, so you need to tailor the number of messages/second per client.

In a local network you can send all the "public environment" packets (ie public chat, public events) via UDP (in case of network high load some packets will be discarded but that is not a big deal). It can be tricky to handle republishing of lost udp packets (this can be done with a temporary normal TCP call). public environment packets are those which are sent to all the players in the same area, the idea is that with udp you only send them once to all players, instead of once per player.

In general you should try to think of ways of minimizing the amount of packets you need to send (make the client require the least possible dynamic data to operate)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM