Public servers vs. reserved servers

I am now to the point in my game where I am ready to teleport players to servers in the lobby using TeleportService. In reading the documentation, I am not sure if I should just use the normal teleport to a server, or if I should use reserved servers. When the players are teleported to a new server using the queue functionality, the new server uses MemoryStoreService to publish it’s game.JobId along with other parameters so the lobby can pick it up. Here are the list of the requirements:

  • If the players go through the queue, a new server must be spun up. As mentioned earlier, the game servers publish their information using the memory store service so a list of available servers that players can join after the fact are presented.
  • If the player selects a server from the list of available servers, they must teleport to that server.
  • If the player selects a server their friend is on (different list, same available server data), then they must teleport to that server.

In doing my research, I have found that if I use public servers, the transfer uses Roblox’s match-making algorithm to do so, which will break things because part of the queue is map and game mode selection. So the players cannot teleport to an existing server. However, if I use reserved servers, you get a new server every time, but nobody can join after the initial teleport is made, which will work for the queue system, but break joining after the fact. All of this is according to the documentation. I know that games do this on a regular basis, so how do I do it?

2 Likes

You can join a reserved server later, you just need to keep the code around.
When making the server as in the documentation, they call the variable “code” if I remember correctly, if you keep this in the memorystore or datastore with a way to find it using the serverid, then any player can teleport to it whenever a serverscript wants.

1 Like

So if I understand this correctly, each reserved server for a PlaceId has it’s own unique code then? If that’s the case, when all players leave and the server shuts down, if a new batch of players get teleported to the server, does it start as new or does it pickup from where it left off?

If all players leave then it shuts down and when you join that server it start up from scratch like joining any server.
If you wanna keep the state of the server, I think Save Place API does something like that

1 Like

Ok. I do NOT want to safe the server state. So that’s good to know.