0 votes

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.

in Engine by (27 points)

1 Answer

0 votes

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 getuniqueid().

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

by (427 points)
edited by
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.