How are the UDP and TCP protocols used in MMORPG client/server communication?
For example:
Does the client broadcast (player position, etc) via UDP to the server? or vice versa?
Or is it more like using TCP where the Client requests that the server move the player. The server receives the request, moves the player and sends back to the client that the player is now at position xyz?
The chat channels must be implemented using TCP?
Are there any good articles/books on this? I've found bits and pieces but it seems the real meat and potatoes are won from experience.
A lot of games use UDP for movement related activities--so, like, when you are walking, chances are, a bunch of UDP requests are being sent. The server still ultimately controls whether that's valid, but you don't necessarily care whether every single packet gets to the server. This is why a lot of game clients also use some kind of prediction mechanism.
In terms of your second mention, yes, it's very common for all control to be managed by the server. You don't want clients to be broadcasting anything to the server; you should do error and input handling server side to prevent people from hacking. You might also limit input per second.
Anyway, a combination of UDP and TCP would be appropriate--you just need to ask yourself, "Do I want reliability or speed?"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With