Skip to main content
2 of 5
added 274 characters in body

Developing a general use multiplayer API

I'm tasked with the development of a general use multiplayer API in JavaScript, with a Node.js back-end. The goal of the API is to provide a service to JavaScript mobile game developers so they can develop multiplayer games with an easy to use API and existing back-end.

The project also includes the development of implementations, a Node.js server and a test game, otherwise I can't test it ofcourse. So it's more accurate to call it the development of an entire library.

The problem I'm having is trying to figure out how to provide a nice mechanism for game synchronization. The library can provide room- and connection-management, friendlists, registration and soforth because those things are using the same mechanism in every game. However, game synchronization logic can be very game-specific and that is absolutely not allowed in a general use library and server.

So for the main question: is it possible to provide an easy to use synchronization mechanism for multiple types of games with different coding habbits? Or should I just provide a way to easily broadcast messages in an active game room and to specific clients (friends), and leave the actual synchronization mechanism to the developer? How would you go about it?

I'm using the following libraries/frameworks for development:

  • Node.js as a game server.
  • Socket.io on client- and server-side for websocket communication.
  • Require.js client-side to enable modular development.
  • Redis as a database for persistent storage.