Building online multiplayers games with Meteor [codes + tutorials] - 1


Meteor is a full-stack javascript framework. I started off using it 2 years ago before its 1.0 release. My experience with Meteor is fantastic. One of the key features of Meteor is reactivity — data is synchronized between clients and server in a seamless way. Because of this feature, I found it extremely suitable for building online multiplayers games.

Mattle ( is an online board game platform I built with Meteor. In short, it’s a real-time game site where players are connected and matched to play digital version of board games / card games over the Internet. Below is a short list summarizing the core features of Mattle:

  • Cross-platform
    • web version, android and iOS hybrid apps
    • all built with a single Meteor app
  • Single server deployment
  • A.I. players
  • Game-matching lobby
  • ELO ratings/ ranking system
  • Game timers
  • In-game chat
  • Discussion board

As of today, there are around 400 active players with 1000 games completed each day. I’m very happy with what Meteor offered, without which building and hosting such platform could take me 10x more effort and cost.

To give back to the community, I would like to start a series of blog to share my experiences along the way, for whoever interested in building online multiplayer games but don't know where to start.

What to expect?

The whole series is divided into two major parts. Part A will be tutorial based. We will build a simple online version of Tic-Tac-Toe together with step-by-step instructions. No prior knowledge of Meteor is required, but a bit experienced on React would be helpful to understand some frontend code. Again, it won't be too complicated since interface isn't our primary focus.

The final application of part A contains mainly two views. The lobby view looks like the first picture below. Users can create or join games, and "enter" a particular game, which is shown on the second picture.

While the part A will be focused on demonstrating the power of Meteor in terms of the ease of building real time multiplayer games, part B will be focused on the system architecture and design philosophy behind a complicated game platform. I will share my experiences on transforming a bare-bone Meteor game (as in Part A) into a production-ready game site, which is hosting multiple games across multiple platforms.

You are also welcome to use the source as a boilerplate for kickstarting your own game. At the end of part A, I will show you how the Tic-Tac-Toe game can be changed to a Nim game with around 200 lines of changes.

Topics covered

Below is the tentative table of content:

Part A - First online game with Meteor

  1. Synchronizing data (game) between server and clients
  2. Implementing game lobby (game matchings)
  3. Implementing account system (players login)
  4. Encapsulating game logics (ORM in Meteor)
  5. Validating game actions in server (avoid cheating)
  6. Wrapping up
  7. (maybe) Implementing ratings/ ranking system
  8. (maybe) Implementing In-game chat
Source Code

Source code can be found at this Github URL:

I have also included releases for each parts:

Part B - System architecture of online games platform

  1. Dividing complex system into components to archive modular design and micro-services architecture

  2. Compiling multiple hybrid apps with a single Meteor application hosted in a single server container.

  3. Serving multiple games (each with its own subdomains) with a single Meteor application hosted in a single server container.

Getting Start!

Next post: