0

How often should the clients send requests to the server? And how often should the server send updates to the clients? Are there any recommendations?

firemeaway
  • 68
  • 6

3 Answers3

3

Don't even worry about this until you get there. Start with frequent messaging and then as you scale you can start reducing the frequency of your messaging if it is warranted (by this point you should be using profiling to identify hot spots).

If you really want to know then fire up whatever game you had in mind and test it out. Also, odds are that most large MMORPGs aren't using standard web request/responses and likely have a direct socket connection with a very optimized binary protocol.

However, this is another thing that you can switch to once you figure out it is needed.

Pace
  • 41,875
  • 13
  • 113
  • 156
2

As two fellow users pointed out, your question is quite vague. The kind of MMO you're implementing and what kind of information you pass along is important.

That being said, on a MMORPG world, even when there is only one player online in such a location, much need to be worked out between client and servers.

First, you should avoid transmitting pictures and audio between client and servers. The client should already have everything it needs.

Second, every time something changes in the world (that the user can see), the server shuold tell it to the client (new monsters, new players, movement, attacks). Every action the client takes, should be informed to the server.

Third, you should try to keep it only to the needed information. Don't send anything multiple times and avoid sending what is already known (if someone attacks, but don't move, don't send in location information. It's redundant and you're wasting bandwidth and processing time).

Hope it helps!

Sergio Moura
  • 4,888
  • 1
  • 21
  • 38
1

Frankly, it depends on the nature of the game. People perceive round-trip-time over 0.1s as delay, and round-trip-time over 1s as a significant problem.

http://www.useit.com/papers/responsetime.html

Your message rate needs to take that into account. However, if you're able to establish a real bidirectional communication (generic TCP channel suffices) it might not be even relevant.

If I were to write such a game, I would establish a 25ms event collection delay:

  • Basically if an event needs to be communicated, I would wait another 25ms to collect all subsequent events that might end up being lumped into the same network packet.
  • Then you have another 25ms of network delay if you're on the same continent (and on broadband), 25ms event collection delay on the receiving side, and 25ms network delay back to server.
qdot
  • 6,195
  • 5
  • 44
  • 95