Godot Version
4.3
Question
How can be implemened that feature of some multiplayer games where a player creates a code so others can join their multiplayer instance? I was wondering if it’s necessary to save this code on a database so it can be retrieved. Makes sense?
Using a architecture server-client, should I create a server just for this group of players that will join the same game?
For this you would have to set up a server that contains all the open lobbies and then assign a code to each lobby.
Then you can request a lobby with a certain code on the server from the client
this lobby would be another server? a different instance of ENetMultiplayer created with create_server() method?
I guess so. What exactly do you plan on creating?
I think the Among Us game is a good example. A player hosts a game session, generating an ID and pass it to the other players so they can join. I figured out how to generante the string, and I think I can imagine ways to store this code, but I’m not sure how this compartimentalization occurs.
I guess I would have the game server running the entire time, and then when someone decides to host, I create a new server just to handle the game session with the host and the players that joins that particular game. Makes sense?
Yeah you would need a central server running the whole time and when a new game is created you need to store the code and lobby there