E
E
Egor2014-08-04 14:59:47
Game development
Egor, 2014-08-04 14:59:47

How to implement correct processing of MMO server packets?

Good afternoon, I am currently developing an MMO game, the client is in Unity, the server is in Java. We decided to implement data transport from the client to the server on our own. We use sockets (TCP).
The data distribution algorithm is simple, during the movement the player notifies the server about a change in his coordinates, the server broadcasts the event to all other players.
The problem is the following. Suppose client 1 sent client 2 30 messages in 1 second, client 2 could only receive 15 messages in 1 second, and the remaining 15 messages are no longer relevant, because. client 1 sent new data during this time. But, since TCP is used, data will come and client 2 will spend resources and time to receive them.
What is the best way to build data transport architecture? Use the request-response format so that the server knows that the client has received the message and can send the next actual message ?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
L
lookid, 2014-08-04
@lookid

> TCP
> Use "request-response" format
> while moving, the player notifies the server about the change in his coordinates
Calm down, finish your studies at school, graduate from the university and go to work. In 10-15 years, maybe you will understand that your approach is complete nonsense and they didn’t write it like that even in the 90s. Position in the scene, TCP, request-response... I don't even have words. Deuce. Go learn the difference between TCP and UDP.
Hint:
TCP - for requests like "issue a task", "complete a task", "transfer loot" and other REST
UDP - coordinates in the scene, for this the "answer" is not needed, they already change 100 times per second. Sent and everything, let the client figure it out. Fuck packages, more will come in the next frame.

E
Egor, 2014-08-04
@ese

Yes, I am calm, I studied at school, graduated from the university, worked for 10 years. I'm writing a client, not a server. The server code is already being rewritten to UDP.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question