Game development, the movement of other players on the interface can be seen in real time, how is this backend realized?

such as
how do online games save the real-time location of user roles and Synchronize?
now design a game combined with the actual map
database using mongoDB
data table with a location field to record the user"s current location so that others can get
when they get the surrounding online players. But the user moves very frequently, so it should not be the user to move on the update database.
how should it be designed / implemented here?
just ask for ideas!
Thank you!


suggest to know: the keyword "online game Synchronize mode (frame Synchronize and status Synchronize)"


has not played a game, explain my understanding, Daniel do not spray
this kind of real-time game memory database redis is not enough.
this storage database does not need to be accessed in real time, about every 1-2 seconds. According to the game, you can judge
as long as it is consistent in the end.
as for the problem of loss, I personally think it is less likely and the loss is not particularly great.


it is recommended to take a look at socket. For example, the use of websocket, in web games is the same principle as the chat room. One is the single text of the broadcast. A broadcast is a packet with integrated attributes such as user roles. Search the websocket chat room and you will see


this must be socket.. In any case, your
1 is not real-time
2 server pressure.


under a long connection, the location data is broadcast

.
Menu