How to manage rooms in room-based games?

Hi everyone!

I want to create a room-based game like PUBG.
The game will have multiple rooms. Suppose there are 100 rooms and each room has about 20 players.
How can I create and manage multiple rooms like that with Netcode for Entities?
Is there any solution to this?

You need to use lobby and some services that create these rooms, and each room would probably have its own dedicated server running.
Looks at Multiplay, Lobby and Relay

Hi Marastoni,

So we need to run 100 server instances for 100 rooms and when a room ends, we need to stop its server instance, right? Is there any way to create and manage 100 rooms with only one server instance?
And could you give me some docs about how to connect these services to Netcode for Entities?

Services has their own documentations Game Development Software: Build a Multiplayer Game | Unity. Integration is up the developer at the moment, but pretty straightforward.
Multiplay is a possible hosting solution but you can host on Google or Amazon or whatever. This is up to you.

You don’t technically need to have 100 of server instances (in term of virtual or bare metal machines), It may be plenty possible to have the one instance supporting more than one room (so multiple server on the same instance, maybe one per core)
But in case you are sharing the instance with multiple servers running on the same machine (so multiple processes) I you have to play around with containers to properly deploy that scenario, as well as matchmaking and/or service assignment for the room.

Hi Marastoni,
Thanks for your answer!

Is there any way to support more than one room in a server? Or is it mandatory for each room to have its own dedicated netcode server?
For example, one server instance - one netcode server - multiple rooms.

Having one server instance (the VM) servicing multiple room should definitively be possible. That instance should then host multiple servers, on servers per room, each with different address/port. Then is is a matter of targeting the right server (that is mostly matchmaking or similar problem).
If you instead want a single server per instance, managing all the rooms, that seems not the greatest setup and may be a little complex to handle properly.
In that second case, you may want to create multiple server worlds, one per room, all living in the same process but each with different address/port, or having a proxy server on the instance (single address to connect to) that will dispatch the messages to right server under-the-hood. The latter, is not really supported out of the box, and requires some special handling to understand which I the target room (you need a custom protocol or at least adding more information in the current payload).

Thank you very much!
I know what to do now.