I’m planning to develop a multiplayer poker game in Unity and would love some advice on choosing the best multiplayer solution. My main requirements are:
- Low Cost - Budget is a major consideration, so I’d prefer a solution that offers reasonable pricing or free tiers for small-scale testing.
- Scalability - I want to ensure that the solution can scale well as the number of players grows.
- Security - Security for player data and game integrity is essential.
I’ve considered solutions like Photon, NGO, fish networking , but I’m open to other recommendations. If anyone has experience with these or other networking frameworks and can share insights on cost-efficiency, scaling capabilities, or security measures, I’d really appreciate it!
Thank you!
Poker is a turn based game. It has minimal game events per turn (eg player draws or plays a single card, announce, raise, pass).
Given your criteria you’re best advised to implement a simple stateless WebRequest REST API and a backing server-side script to handle this very simple game logic. Anything else and you will need something like Cloud Code and that won’t be nearly as low cost.
At most, you may want to look for a networking framework that specializes in turn-based games, ideally using REST technology. Can’t say if those exist but I wouldn’t be surprised given the popularity of turn-based card games played on the web.
As to security, any framework is only as secure as you make it to be. You can easily pin big holes into any supposedly “secure” software just by doing the wrong thing, such as embedding credentials in the app.
And the architecture requires you to have a server-side component to handle the game logic and validate player actions, otherwise it won’t be cheat safe.
Building on some of @CodeSmile’s points, here’s a simple online architecture for a budget-friendly, turn-oriented poker game…
- Lobby → ensure the right players are playing and coordinate a simple multiplayer state machine (ie, who’s turn is it). It also has some basic room browse and quick match functionality. It features data-change updates, so you can react to turn and membership changes in realtime.
- Cloud Code → validate and commit turn actions… this ensures the game has integrity and players can’t cheat. You can write the game state to Cloud Save or Lobby directly.
- Cloud Save → use 'protected` and ‘private’ writes so only the service logic can update critical data. You can write the game state here if you want the game to take place over a longer period of time than a single play session. You can also store your player profile/career data here.
- Game Clients → login, read Cloud Save profile data, manage game browse/join, react to Lobby game state changes, & send turns to a Cloud Code function.
This shouldn’t have trouble scaling for most poker game formats I’m aware of. Costs will be light (free to develop), mapping closely with the amount of service-side validation and data transmission you specifically require once there’s significant traffic. We can say this is “realtime” in the sense that turns are still likely to be sub-second from the view of the player.
– But why not a netcode framework? –
Getting started with a client/server netcode system may be slightly easier. You can use server RPCs to centralize game validation… and you can even synchronize interesting visual information like realtime mouse and card positions. It’ll be snappy. BUT, you will ultimately have to decide how to host the server. If it’s client-hosted, your primary costs will be Relaying data to and from the client host (which may be reasonable
), but you won’t necessarily have competitive integrity… after all, the hosting game client is in charge of what happens.
If you then went to host the server online, (for a turn-oriented use case) it’s likely that optimizing an engine server runtime to bring down costs is going to take time and ultimately be more expensive per game than taking the event-base service-logic approach described above (Cloud Code).
So if you did still want to synchronize some visuals (I would recommend NGO + Relay myself but I don’t think you can go wrong with the ones you listed), I’d still use the above service-authoritative turn system in order to validate actions and ensure the game’s integrity at the right price, avoiding server hosting if you don’t require it.
here, Alteruna is good, Photon fusion pun 2 and… The ultimately easy multiplayer is here: coherence !
also watch bobsi’s tutorial and get to know how to simply set it up
Best Regards