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.