Hello everyone,
I’ve come with a rather complex issue, and I’m still unsure if it has anything to do with code base or not, but I’ll explain the situation.
An FPS game that I’ve been working on for a couple years at this point started having issues a bit ago, that I thought I’d revisit. The primary issue I’m having is below:
- Whenever a Players Character is being loaded into my game, the server seemingly freezes (all Player replication, translations of Parts/Models suffer from said freeze).
It takes about ~3.5 seconds to stop spiking the server. I should also note that the Player who was being spawned in suffers a complete FPS drop on their client as well when loading in, which also resolves after about ~3.5 seconds.
All my friends have reported the ping spiking up to as high as 300ms whenever it starts to settle and the game becomes responsive, so it seems the results are relatively consistent for everyone. My friend group is pretty spread out.
Here is a video that accurately displays what happens whenever ANYONE spawns into the Test Place experience (Place file used for testing features before they’re pushed to the main game).
So, that’s the problem. This issue only started occurring in my Test Place of my game, and the current version doesn’t seem to be affected by this problem at all. The server doesn’t suffer any spikes and the spawning Player also does not experience FPS drops to flat 0, whatsoever.
I’ve constantly compared my code base (especially the round spawning functions) to the older version of the game, and could not find any significant changes other than a few new added spacing between lines. The code has been untouched since the last version, but for whatever reason the Test Place suffers from this problem.
This issue seems to be fully reproducible on both Roblox Studio, as well as Roblox Player. Upon checking the Task Scheduler within Roblox Studio, whenever the issue occurs, everything goes down to 0% activity with the rate taking a huge dip in performance too. This completely locks up Studio for those roughly ~3.5 seconds.
I’m not performing any crazy changes to the Character, or running several loops or adding tons of content whenever the Player spawns. All it’s really doing is adding Body Colors + Accessories to the base R6 rig on Spawn, which shouldn’t cause EVERYTHING to basically stop working for a few seconds.
The issue only ever occurs when calling game.Players.Vyntrick:LoadCharacter()
, so it has to be something related to this function, and I’m stumped for ideas. I’ve tried reprogramming things, switching to module scripts, checking for yielding, etc. just to be met with no resolution.
Any ideas on what I could do to get myself out of this mess?
P.S, you can try testing this yourself by comparing the Main place file to the Test one.
[OA] Claw In The Chamber - Roblox
[CITC]: Public Test Branch - Roblox
Update!
So apparently, when attempting to construct a local repro file for others to test the issue, I ended up finding the source of the lag. It was coming from the Main Menu ScreenGui that is present in the showcase video of the problem. I’m currently investigating to see what I can remove or redo to mitigate this lag. Keep in mind that no scripts were running at the time of testing, and it appears scripts have absolutely nothing to do with this issue at all.
I’ll mark this as a solution when I end up finding a resolution to the problem.