Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Ask HN: What stack for a multiplayer board game?
10 points by tsp on July 11, 2022 | hide | past | favorite | 28 comments
What tech stack would you use today for a multiplayer board game?

- 1-6 players per game - Round based - Only one player can be active at a time - Multiple games happen at the same time - Optimally, non-technical players can spin up their own server to play on (e.g. via Electron app) - Optimally relatively cheap

For communication I was thinking about websockets, but this would limit the amount of parallel connections / games a lot.

I am thankful for every comment mentioning libraries / stacks and why I should consider them.




This looks very good and well-fitting for my use-case. Will have a closer look. Thanks!


Have you looked at Vassal? https://vassalengine.org/

It's a board game engine and has multiplayer support. There's also boardgame.io which looks hipper (npm), but I didn't see any screenshots of games being played.

Regarding scaling, there's articles about lots of stacks doing 1M websockets on a host; if that's limiting you, you've got a lot of players, so that's a nice problem to have.


I wasn’t aware that so many parallel websocket connections were possible. I would like to enable ~500 people to play at the same time. So using websockets might work after all.


Boardgame.io looks fantastic! JavaScript based frameworks / libraries without a view layer are exactly what I am looking for!


If it were me, and if there is a graphical component I would use this as my stack. (Note: I am a hobbyist game dev).

- Unity + mirror (multiplayer library) for the server client. The library documentation will help with a mental model of a multiplayer game. Export the binary of whatever your target OS will be. I prefer linux. - Unity for the game client. I prefer webGL export for the client so I can host the HTML/JS/WASM like a normal static site. However; you can (also) export windows, Mac desktop apps too. - nginx to host the static site and reverse proxy to the multiplayer - systemctl units for nginx, and the multiplayer binary on some linux OS. I prefer Ubuntu.

For the code; it's all about developing a mental model of what things exist in your system and what interactions those things have with each other.

It being me, there is a CICD system somewhere running tests for pretty much anything.


This sounds like a great solution for visually complex 3d games. In my case I would take care of the UI layer on my own, so am looking more for state-syncing, management of user-turns, broadcasting and so on.


Depending on your goals, Tabletop Simulator could be a good fit.


Nice! For my game I want full control over the UI, so this won’t be an option, but for future ones this looks like a great one!


Absolutely this, at least for prototyping


If I was building a game side project, I would personally go:

- React Native frontend

- .Net Core backend

- NGINX webserver, on a bare metal Linux VM of course

- SignalR for web sockets

- Mysql for long term data storage

- Redis for caching

- Mailgun for sending app emails

Did I miss anything?


You could look in peer to peer interactions for some actions on the board and websockets for keeping state of the board in sync for everyone.


Personally I would try Server Sent Events if its just a hobby. https://html.spec.whatwg.org/#server-sent-events

Supports compression easier, less issues with proxies, multiplexing etc. And have found that they're much more simple to play with!


Interesting! I never used SSE, because I read that it is more complicated than websockets.


Are there any peer to peer protocols in particular that you can recommend for this use-case?


You mentioned electron so I suspect you're interested in games playable via browser, in that case these two come to my mind in the javascript/typescript ecosystem:

- https://boardgame.io/

- https://www.colyseus.io/


They both look like great options! Do you know any games being made with them?


Any game engine with a decent networking component will be able to handle this (if Tabletop Simulator doesn't fit your needs). Which one you choose will depend on 2D vs 3D, language preference, etc. Unity is always a safe bet when you don't have unusual requirements.


I am planning to create a very simple game (visually), using a front-end framework like Vue or React. I don’t think I will need an engine like Unity.


I'm surprised nobody suggested Godot.

I have developed several 2d games with it, as a hobby, used a python server for mp, it was very intuitive and understandable. And it is completely free, no ads or restrictions.


This platform looks very cool! https://www.boardible.com/


Doesn't look like it's a developer platform though.


Hello, I'm Augusto from Boardible, thanks for pinning us here! We do have plans to make it open for game designers to make their own games in our platform in the future, but we are still far from it.

But answering your question, the nice thing about turn based is that you don't really need everything to be synced all the time. So it can be really easy on your network just by sending which actions each player took on their turn. Simulation can be all done in each client device.

Just be careful to sync the random seed at the start of the game (and only use the synced random on things that happen the same amount of times on each client. Leave animations and other visual random effects, with a separate random that is not seeded).

Another thing that you need to consider is how are you going to handle reconnects. You have 2 options. You either have a way to query every state of each component, parse it and send it. Or you can have the actions saved and "replay" the game on re-connection. The first option is faster to reconnect but the second option is easier to implement and has the benefit of being able to replay a given game for debug.

With all this info in mind, any kind of messaging system will be enough for your application, especially if you plan on doing this a hobby. I would prioritize something that you are already familiar and its easy to implement. Websocket seems like a good and easy option, and you can easy scale by adding another server if needed in the future, since you don't need every user on the same server, just need every player in a room.


Elixir/Phoenix should be good for backend.


Any specific reason for this?


Are you trying to make money with it? If not, just make a Tabletop Simulator mod.


No, just for fun, likely open source. Tabletop simulator looks great, but I want to create a custom 2d interface, so I don’t think this is an option.


You can add scripting to handle game logic. The UI will be buttons that appear on the table but it’s got a full API that lets you control everything in the game.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: