Search code examples
node.jsmultiplayer

Technique for building a Multiplayer Server


I'm looking to write my own multiplayer game server (most likely in nodejs) and I was wondering what protocol I should be using to transfer data? Are Datagrams the norm to send information (i realize they don't confirm delivery like HTTP, that can written on top of the protocol)? Any suggestions of performant proven systems would be a real help.

I guess I'm looking for successful techniques in handling the data transfer quickly and effectively (maintaining state on the server and scaling are a separate issue that I have a solid understanding of).

I'm looking to initially support desktop/mobile games (MacOS, iOS, and Android).


Solution

  • For all your protocol needs take a look at socketIO.

    Basically your best solution is to rely on websockets which are TCP sockets. socketIO is just a nice cross-browser compliant abstraction.

    Either you use standard long pulling techniques or html5 websockets. There is no access to UDP for browser <-> server.