Turn Based Game Multiplayer

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By TomShar

I’m working on a turn based card game. I’ve been reading through most of the documentation but I can’t seem to get a grasp on how exactly the multiplayer functionality works and how it is expected to be used.

What I want to achieve is an authoritative server which is hosted by me which can accept new ‘matches’ between two clients. The documentation makes the multiplayer functionality of godot seem like it is peer-to-peer where one of the players is also the server - which is not what I want.

Perhaps I am misunderstanding or am I correct and therefore need to write my own netcode as a c++ module.

:bust_in_silhouette: Reply From: hungrymonkey

Godot multiplayer basically makes one client the server while everyone else a normal client.

You can basically create two code path within the godot api.

The server will always have an unique id of one. Clients have a target greater than 1.

When the target is 0, the network sends data to the server peer than to everyone else.

You can create a client that test whether or not its the server with get_unique_id().

Edit: i am not sure about the details of your goals.