
Ask HN: Advice for Multiplayer Back End - houseinthewoods
Lately I&#x27;ve been yearning to make simple multiplayer Javascript games with as much ease as simple single player games, for the sake of prototyping with friends. I have a sneaking suspicion that for discrete (turns or timers) match-based games, you could have a Firebasey store synchronized between clients and an authoritative server built on top of web sockets, such that the programmer doesn&#x27;t have to design a new protocol for every game. The reason I don&#x27;t reach for Firebase immediately is partly due to lock-in&#x2F;pricing concerns, and because I imagine there would be a simpler tool with the above constraints in mind.<p>I&#x27;ve stumbled across https:&#x2F;&#x2F;colyseus.io&#x2F;, but it doesn&#x27;t look like it quite fits my needs.<p>Does anyone know of a library out there with the mission of Colyseus, the behavior of Firebase, and simpler than both? Alternatively, has anyone had a pleasant experience building a discrete game with Firebase?
======
ArtWomb
>>> doesn't have to design a new protocol for every game

There may not exist any level of abstraction sufficient to encapsulate ALL
turn based strategy mutliplayer internet games ;)

I kind of think you want to design a new engine specific to each game. First I
don't think you will save much effort via code re-use. Second you need that
flexibility when changing game parameters, rules, board size, player mechanics
etc

The other possibility is to design bottom up. Observe what's possible at
current public cloud latency and cost. And then design the game around those
constraints.

For private hosted game rooms with limited numbers of players, any in-memory
cache will do on the host vm. Use any realtime API gateway to sync. Or host
static HTML5 assets on S3 and Cloudflare KV for "live" game state, dumping
finished game data to plain disk files.

Best of Luck!

------
m0dE
I just open sourced my multiplayer game engine. Give it a look:
[https://github.com/moddio/taro](https://github.com/moddio/taro)

~~~
nooyurrsdey
nice work!

------
marshmellman
I went with Colyseus for my multiplayer bananagrams prototype. It’s not quite
the use case, but it did make life easier after figuring out how to model the
game with Colyseus’s state mechanics.

Basically you apply game logic on the server to mutate game state, which is
automatically synchronized to each client. It’s been a few months and I don’t
have the code in front of me, but can give more details later if you’d like.

------
advaita
I dont have answers to your questions but you might want to prefix the post
with "Ask HN: ". It will drive better reach.

------
konaraddi
You might find [https://boardgame.io/](https://boardgame.io/) helpful

~~~
kopos
Boardgame.io is good but it doesn’t have timers, iirc

------
bird_monster
Playfab offers multiplayer servers as a selling point, but does not solve your
vendorlock concern.

The combination of Playfab's player data + multiplayer server functionality
sound like what you're looking for though.

------
sali0
Check out Nakama by Heroic Labs.

[https://heroiclabs.com/nakama-opensource/](https://heroiclabs.com/nakama-
opensource/)

------
lecarore
I'd build it with meteor, mostly because I'm used to it. It's excellent for
prototypes and real time by default

~~~
lecarore
There's some lock in in terms of framework specific code but no lock in of
your data,it's just a mongo dB. The reliance on mongo means it's always a bit
tricky to make join-like calculations, but otherwise I'd really recommend the
meteor stack. For hosting as a side project I'd recommend a shared digital
Ocean droplet, you'll get much better performance than heroku. Use "meteor up"
to deploy. It will be 5usd per month but you can host many small apps on one
droplet

