Colyseus, an uncomplicated library for multiplayer games

A couple of weeks ago we released our latest game, Mini Pool. It has been a success and Colyseus.io has contributed a lot to achieving this. Our programmers had less stress dealing with server issues and could concentrate on developing game play.

 


We considered to code the server side directly with node and websockets. It isn’t an incredible amount of work but why reinvent the wheel? Colyseus is above all easy to understand and implement. It takes care of the rooms creation, matching and player’s disconnection handling. One of the strengths of this framework is how it manages the room state. Basically we create a custom data structure for the room state and every time those data are changed by the server all clients are informed and act correspondingly. This feature means less messages and less code in the server side.

 

For example the state object of the Room in the server side has a field called “currentTurn”. If the server logic change its value both clients are notified that the turn has changed without having to broadcast manually a message.

 

 

Due to performance reasons the physics engine is implemented in the client side. However the server is authoritative, each turn it validates balls positions and makes sure that both clients are synchronized and positions are consistent.

 

Another interesting feature of Colyseus is that is coded in TypeScript which is precisely the language we use in the client side.

Colyseus is open source, the project is well maintained and has a forum where usually all doubts are solved in matter of hours.

5 replies
  1. jokergaming
    jokergaming says:

    I got this website from my pal who shared with me about this website and
    now this time I am visiting this web page and reading very informative posts at this time.

    Reply
  2. Lorie
    Lorie says:

    Having read this I thought it was very informative. I appreciate you spending some time and effort to put this short
    article together. I once again find myself personally spending a
    significant amount of time both reading and
    posting comments. But so what, it was still worth it!

    Reply
  3. Merry
    Merry says:

    I think this is one of the such a lot important info for me.
    And i’m glad studying your article. But want to remark on some
    general things, The website style is great, the articles is in reality excellent :
    D. Excellent job, cheers

    Reply

Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.