Script_PlayerListManager seems to be causing severe CPU spikes on mobile despite the Leaderboard CoreGui being disabled and the Roblox menu closed.
I have recently been working on many optimizations for SCP: Roleplay and while analyzing possible causes for lag on mobile when in a 40 player server, I noticed that Script_PlayerListManager is eating up a considerable amount of time per frame and some times even results in spikes causing FPS drops.
This is extremely problematic, because in SCP: Roleplay, despite heavy optimizations and techniques already being in place, mobile players still suffer from bad performance, which is noticeable in our metrics where Computer has 58~ average fps and Phone sits at a measly 39 at the moment.
SCP: Roleplay is a visually demanding experience, despite our best efforts at optimizations. It runs many performance heavy tasks such as night vision goggles, gun laser replication, SCP recontainment, detailed armor and vests, and more.
Despite all this, SCP: Roleplay still runs relatively well even on low hardware. That is, until you join a server that is full in player count.
Testing on my phone, I achieve 60 FPS at the Security Department spawn.
In a full server, that number drops to 30.
That is a drastic difference and causes a lot of players to quit, as it makes the game nearly unplayable with how fast paced some of the reactions have to be when playing a game of this nature.
While investigating this in detail, I have come to the conclusion that when it comes to an empty server and a full server, the GPU frame time barely changes. (for which I’m also including the rendering stage of the CPU etc.). What does change considerably is Heartbeat
.
An obligatory note to avoid any confusion: Controller
is a game-essential local script that handles gun and camera movement and controls, as well as replication of things such as lasers, equipped radios, etc., and is expected to increase in frame time usage with player count - even so, this increase should not warrant such a drastic drop in FPS, which is justified instead by Script_PlayerListManager, of which does indeed take a long amount of frame time much more considerable than Controller.
This is the frame time in an empty server:
Controller
: 0.387ms
And this is the same experience but on a full server:
Controller
: 1.324ms
While it is true that Controller
having an increased frame time will contribute towards lower FPS when the CPU is already the bottleneck, the fact that there is computation being done for a player list that is not even visible to the player just makes matters worse.
We are working on optimizing these scripts as much as we can, but there are certain things that we can do nothing about and this is one of them. Having the player list be changed to not run when the leaderboard is disabled, or at the very least run less heavy code, would assist tremendously for people who run on lower end devices.
I am not a Roblox engineer so there is only so much I can guess as to Script_PlayerListManager’s nature, but it might be related to the Roblox menu instead of the Leaderboard CoreGui, or something else entirely.
ScriptProfiler taken from Desktop:
CoreScripts/ExperienceChatMain
seems to also be affected.
This could possibly be related to the fact most characters in-game have an armor morph. We already have it where the most tri-heavy components of the morphs are welded to the character and in a separate folder rather than in the character. This applies to helmets and vests. There are some accessories that would be very difficult (albeit not impossible) to move out of character which are merely cosmetic / visual, but this would represent a big undertaking that could be avoided if this could be solved on the Engine’s end.
Most of these accessories are the equivalent of having an UGC item in the character, so it does not make a lot of sense that they’d be responsible for this.