Turn based online games in meteor

Anyone used meteor for an online game, that syncs data between the players using mongo and meteor pubsub?

Are there any gotchas to be aware of attempting something like this?

The idea is the entire game state is stored as a document in Mongo that both players subscribe to. When a player takes their turn, the game reactively updates state for both players.

I’ve been attempting this for some time now with mixed results.

I realise this is not the best way to make a game, but I wanted to learn/ keep sharp with meteor.

Your bottle-neck will be mongodb. You can check something like meteor-streamer (I don’t have production experience with it) or if you need something with a “cache” saved somewhere, redis-oplog’s Vent.

The idea is to only use DDP and keep the sync document in-memory for performance

2 Likes

For specific use cases you might also want to check out the meteor-timesync package. When running a game you might run into a situation where you want players to have timers run on the screen (for example time until end of turn) and have those timers more or less syncronised on every connected device. This is where this package helps.

1 Like

thank you, will look into meteor-streamer and meteor-timesync

1 Like