#How to proceed with multiplayer implementation?

1 messages · Page 1 of 1 (latest)

abstract ruin
#

Hello, I've been working on a simple turn based game (think chess with dozens of pieces to choose from) that I'd eventually (probably next year) like to publish.

So far I've been testing it as an offline game, with one player controlling both sides, but I'm at a point where I'd like to test the game with other people.

To preface this, I know a little bit about making single player games, but almost nothing about networking.

My understanding is that setting up p2p multiplayer with godot's built in tools would be the fastest and easiest way to start playing the game with people online, but long term the game will need to be server authoritative to prevent cheating.

My main question is, would it be worth figuring out how to set up p2p multiplayer first, or should I jump directly into something like playfab, that I intend to use eventually anyway?

A related question, is playfab a good choice for this or maybe overkill for a turn-based game where latency doesn't matter and only a few dozen messages are sent back and forth per game?

dim raven
#

for an authorative game server, i would recommend using something like node.js and socket.io. you can create lobby instaces when a player connects to the main server using websocket, associate some id with the player, and have full control over how packets are sent back and forth between the server and the clients

#

because you’d be using node.js youd have access to all of its convenienr libraries to do a lot of things for you (socket.io being one of them, for real-time networking between clients) and you can also make a web page/app where the user can create an account

#

it was very valuable for me personally for learning multiplayer game networking. godot offers multiple solutions for networking, and if you want to go with this approach you can use the websocket api. just remember that youll need an extension if you want it to work on desktop instead of web https://docs.godotengine.org/en/stable/tutorials/networking/websocket.html

abstract ruin
#

I'll check this out, thank you! I was under the impression that websockets were more suited to real time action games rather than turn-based, are they fine to use for both?

dim raven
#

yeah

#

idle websockets will just poll with a heartbeat every once in a while

#

they’re handy because you can just send messages with specific names back and forth from the server and client

#

with any arbitrary data

#

then call some function on the server or client

#

ie rerender something on the client to show the updated state on the server side

#

or ask the server if i may move my player, then the server can decide to update the game state or not and send the new game stare to all players in the lobby

#

because it’s versatile like this, yoi can use it for any kind of architecture almost. mmo, 1vs1 turn based, party games, etc