Add Method to Query Max Players for Place

As a Roblox developer, it is currently impossible to know the max players allowed in another place within the same game.

I think there should be a method added to query the max players allowed in a given place. This could be added to GetGamePlacesAsync (which currently only returns the place names and IDs).

For example, imagine you have PlaceA and PlaceB within the same game universe. PlaceA is the lobby, and needs to teleport players to PlaceB. However, how do you know the max amount of players? Currently, there are a few methods of doing this:

  1. Hardcode it
  2. Write it to a datastore by hand
  3. Write it to a datastore when a player enters PlaceB

The problem here is that it is either disconnected from the actual source data, or (like with #3) it might not be up to date until it’s too late. If a developer chooses to change the max players of the game while players are playing the game, this could cause quite a bit of issues.

In order to be sure that PlaceA can teleport the correct number to PlaceB, it is imperative that PlaceA is able to query the max players for PlaceB. This is crucial if developers are to create any sort of robust matchmaking system.

30 Likes

Could you explain the usecase a bit more? I can’t visualize an api for this being helpful enough to merit the Roblox engineering efforts.

Hardcoding values in a table seems quick and easy to do yourself.

Here’s a possible scenario:

You have a lobby server which does matchmaking for your game. The lobby has to collect players and then reserve a game server to which to teleport them. In order to properly do this, the lobby server needs to know the max number of players allowed.

Here’s the problem: Let’s say you have a game with 50k concurrent players, and you want to change the max players of your game server. So you change it in the place’s configuration. But this change isn’t reflected yet in the lobby servers. Thus, the lobby server might try to throw the wrong amount of people into your game.

You could write this value to a datastore by hand, but this is really bad practice. Manually reflecting data is bad & introduces errors easily. There needs to be a single source of truth.

7 Likes

Instead of getting max players per server, would knowing free slots in a reserved place be better? That way you don’t need to keep track of how many players are already in the other server for cases when not everyone is teleported at the same time, and it’d handle people leaving the reserved server and a slot becoming free.

(Disclaimer: I’ve not used TeleportService before)

You can just shut down the lobby server. It’s not like the players are in a game or anything.
The only reason why someone would need this is in case you have some kind of a co-op campaign or a set of maps which are on separate servers and players get teleported after a round is over, but that could also be served by storing server details in a datastore.

I definitely support this! This is a useful feature and will lead to less user confusion as well as slightly less hassle for developers and hopefully without much work to implement into Roblox.

Ran into this exact use case today. In my universe, a lot of my places have different MaxPlayer counts due to various gamemode-reasons. Would love the ability to retrieve this instead of coding it manually.