DontAsk_
DontAsk_

Reputation: 182

How do I make a multiplayer game with code join in godot?

I want to have a lobby type thing. One player would press host and would get a game key. And the other player would type that code in and join the game. Something like in Jackbox party pack.

Upvotes: 1

Views: 2461

Answers (1)

Bugfish
Bugfish

Reputation: 1729

The godot docs have a example for lobby code in their documentation here: https://docs.godotengine.org/de/stable/tutorials/networking/high_level_multiplayer.html

There is also a part for running godot as a dedicated server : https://docs.godotengine.org/de/stable/getting_started/workflow/export/exporting_for_dedicated_servers.html#doc-exporting-for-dedicated-servers

There are also enough tutorials out there on youtube like: https://www.youtube.com/watch?v=TGIWD24QIvY&list=PLKCbXu2bxxqa2PtT2rYNb4t5QUsotrTlP

The first link shows you a way to create simple server lobby in godot. To do the password way you have to create some kind of server application which does the routing for you.

For example:

  1. Host creates new Game by calling a server
  2. Server creates an Instance (dedicated Server with ip and port) and a unique Passcode.
  3. Clients connect to the server by entering the passcode.
  4. The server searches with the passcode for the right ip and port the Clients have to connect to.

Upvotes: 2

Related Questions