Download

Looking for Multiplayer Networking Solution...

Hi everyone, I’m currently writing a simple turn-based social game. Already finished setting up game logic and single player etc, but unfortunately I don’t have a lot of knowledge regarding multiplayer, so I’m here asking for suggestion on the overall framework, and hopefully can find some good insight!

Game:
The game is a turn-based game, and each turn the player submit its result which consists of three (1-2 digits) integers, and then server host calculate how the result affects everyone and notifies everyone about the update, 1 progress integer (xPlayer count, max 6), and a bool to state if the game is over.
So as you can see, the data its transmitting is quite light weight (at least by my understanding, please correct me if I’m wrong). Each game probably lasts for 3-5 minutes.

Current Solution:
So currently my plan which I already started testing, is a peer-to-peer connection, where the host can host and play the game as client as well. Pseudocode as following:
Server:
[SUB]Player creates a session-> A server code is generated from encrypting the player’s public ip-> send this server code to the client via external apps (fb, whatsapp etc).[/SUB]
Client:
[SUB]receive server code from host externally-> paste to join menu, and join server by ip (open {ip})[/SUB]

So to disregard some concern first, the game probably will be play by a circle of people instead of “meeting strangers online”, and latency, while important, doesn’t have too big an impact on the game as long as the timeout duration is long enough. Cheating, there’s not really any reward system implemented in the game, it’s mainly just the joy of winning, and since again circle of people, person who cheated will probably just get diss by the gang.

Currently I’ve already tested the hosting and joining on LAN (join by ip etc), and already saw several great tools of getting player’s public ip. In theory, this solution could work.
However my concern starts to raise, which is the cyber-safety of the player. Sharing out one’s public ip is definitely not the safest thing ever, even if encrypted, which I’m pretty sure people can get the solution key by tearing apart the game.

I wouldn’t want any of my players to get hacked for playing my game obviously. So I’m really hoping to find a safer way to implement this multiplayer mode.
Any insight is appreciated!

Note:

  • I’ve considered something like playfab, which seems to be very ready to use. However, the cost is simply too high, and the game can be repetitive after a while, so I doubt people will keep playing it for a long time.
  • The game is cross-platform for PC, Android, IOS, steamworks wouldnt be suitable in this case.

That would be extremely light weight.

Unreal Engine uses a Server-Client model, not a peer-to-peer model. Every client is only communicating with a server, and if the server is also a client it is called a listen-server.

Encrypting the host IP is pointless for public games although you should not advertise the public IP’s to anyone except those who need it… the players.

The only way you can hide client IP’s is if you use a dedicated server.

If you are very concerned with sharing IP’s then you should consider making games only visible by friends of the host, but to be honest I think most players playing a non-dedicated server game already accept that their IP is being shared to the public and if they want to “hide” it they could always use a VPN.

Hi thanks for replying! That did give me some kind of reassurance.

True, but it’ll probably be very time consuming, and might be an overkill for this project cuz I’m really making it for the sake of “finishing a game”.

Yea, probably will just go with the current plan, and hopefully people won’t share it to random strangers, I’ll include a warning message in the widget as well.

Hi,

Did you manage to finish this project?
If so, can I have a link? I just want to see how it works.