It is currently very difficult for Roblox developers to test if features work properly when a player leaves and then rejoins the experience.
In Roblox Studio, local servers (AKA studio servers) are very useful to test how your code will work in a multiplayer setting. However, the control panel for this feature is very limited.
Here is an example of a problem that would not be caught using the current studio server setup, where local players are unable to rejoin after their window has been closed:
Many scripts create tables with Player.UserId
as the index to serve as a completion condition, like so:
loadedInventory[player.UserId] = true
The scriptâs author can often forget to remove these entries when a player leaves the experience (and they should just use player instances for the indexes). When the same player rejoins the server, things could break if some important code doesnât get run because it was reliant on the Player.UserId
entry being nil
:
if not loadedInventory[player.UserId] then
loadInventoryRemote:FireClient(player, ...)
end
Sidenote: This is not how you should load player inventories.
The only way for the developer to notice that this system breaks for players rejoining the game would be to observe it breaking in live multiplayer servers.
Itâs also very difficult to test how features perform when someone joins much later than a previous player. Consider this sequence of events:
- Player1 and Player2 join
- Player1 and Player2 build a base together
- Player3 joins after a few minutes
- Player3 doesnât see any of the things Player1 and Player2 built
This could happen because the developer didnât think to replicate new building blocks to clients who join the game after they were placed.
Because the option to connect a player to the local server midway through wasnât there to begin with, the developer will not observe the issue until it starts happening in live servers, at which point it is more difficult to debug and already impacting players.
Currently, the only way to test both the "late join" and "rejoin" conditions is to use two devices to test in a live Roblox server instance under a published test experience.
It is imperative that developers be able to test how their code handles these conditions, and the âtest experienceâ way adds a lot of headache that could be avoided.
A solution to both of these problems could look like this:
Studio toolbar in edit mode, before starting a local server:
Studio toolbar in the window of a running local server: