- Home /
Networking 2 player game - use MasterServer?
I'm just looking for advice on the best way to design the networking for my 2 player game and if it's a good idea to use a MasterServer for this.
Basically I have a game where two players play against each other in a turn based nature and as such we need to communicate the turn each player makes each shot (they take it in turns).
In case it influences your advice, I'm targeting mobile devices (Android and iOS, etc).
The high level idea is that users can request to play and they are then paired up with another player (probably in a FIFO manner).
So the mechanisms I need seem to be:
Server: handle the waiting queue for players wanting to play.
Server: handle 'joining' the two players to play a game.
I'm trying to see how the MasterServer provided by Unity will help here - if it's a good place to start extending (I expect I'll need to) or if I should take a completely different approach.
I expect that in each player pair one will have to be designated as the server and one as the client - I expect that some players will not be able to be a server due to NAT (or does NAT punchthrough fix this issue?) Or do I need to have some logic in the MasterServer to never match two NAT'd players (?)...
Sorry lots of questions here, I'm just looking for any insight and ideas that you may have.
I have done some searching and most resources are geared towards multiplayer games (FPS etc) and didn't relate to my problem well.
Note: I already have a VPS (Linode) that I expect to run the MasterServer on.
I'm not really up to answer your question, but the only thing I'll tell you is that if you choose to use the $$anonymous$$asterServer provided by Unity to make your game, it is not a definitive solution. This exists only to test your game.
Have a look here to make your own $$anonymous$$asterServer.
@$$anonymous$$iraSensei - Thanks - Yep, I already have the $$anonymous$$asterServer built and running on my own VPS. Thanks for the heads-up anyway!
Your scenario sounds exactly what the Unity networking component was intended for, and yes, use your instance of the $$anonymous$$aster Server to allow players to find each other.
Thanks Graham, I don't think I explained myself well - I don't want users to have to find each other, I want this all to happen automagically at the master server end.
Also what about the issues with NAT deter$$anonymous$$ing if a given user has the capability to be a server (for the opposing client) when pairing users?