Search code examples
javascriptdatabasebrowsermultiplayer

How should i transfer live x and y positions in a MMO like browser game?


my difinition of "MMO" might be a little optimistic (maybe), but i have in mind to create my own online game where other players current (live) position is really important.

From my current reseach i have read that using a database for this matter will draw alot of power from the database and is quite insufficient to this live. The game will not require to save and location after you logout.

The amount of players needed to be loaded at same time would be 50 players tops, since players will be grouped into diffrent servers / lobby.

So my questions is: How should i most efficient transfer live posistions of other players to other players in a online mulitiplayer browser game?


Solution

  • You should read about "Web Sockets". It is kind of connection that once opened between server side and client side app is does not end. Every moment client can send something, and server can send something without a handshake.

    I no pro in web sockets but you will find many free articles and .pdf's on this topic.

    If you want to send it to other users think of it like a chat with global room ;) It's the best what comes to my mind as an example. One user sends a message to server (but in your case repeatedlivly like every 0.5s) and every logged user get's this data to his own browser.