WaitForRenderThread (UpdateInvalidatedFastClusters) causing massive lag spikes

Players have been reporting massive lagspikes while playing SCP: Roleplay since kill effects were added. Microprofiler from the players (which I’ve also been able to reproduce myself) shows that this is caused by WaitForRenderThread / UpdateInvalidatedFastClusters.

This seems to be related to UpdateInvalidatedFastClusters, as it seems to trigger when effects are applied on player characters. (such as particles being added or color being changed)

We had ran into a similar issue in the past for another project of ours, and our solution ended up being moving parts of the morph away from the character. Unfortunately this triggers with things as simple as part color changes, so this solution wouldn’t work without affecting other elements of the game (such as highlights) or requiring a codebase rewrite.

Important note: despite what was written above, we have managed to move morphs outside of the character, but updateFastInvalidatedFastClusters is still plaguing the game.

I’ve also found that unusually long WaitForRenderThread can occur even without UpdateFastInvalidatedClusters in the same frame.


5 Likes

This has been an issue for a long time. From what I understand/remember, it’s caused by an optimization with humanoids, and UpdateInvalidatedFastClusters happens when you modify stuff with a humanoid, usually a player character.

Other threads:
updateInvalidatedFastClusters/updateEntity triggers on character descendant part property changes, causing spikes (This one is marked as fixed?)
Moving and resizing small parts causes geometry to lag
Layered Clothing Attachment Problems
Layered Clothing Has SERIOUS Performance Issues
updateGeometry (fast clusters) consistently lags horribly
(this was from a quick search)

This issue gets worse as the characters get more complex (aka layered clothing)

2 Likes

We had adopted a new optimization system where characters in locations where the player wouldn’t possibly be able to see them would be set to invisible, in order to reduce the total amount of triangles being rendered. Our game uses heavily detailed morphs and as such this was necessary for lower end devices.

Now we unfortunately find ourselves having to completely disable this system because of updateInvalidatedFastClusters. Setting the character to invisible or back to visible causes enormous lag spikes (12ms~ on the device I’m currently testing this on), which makes this more damaging than useful.

1 Like

This is just an acknowledgment announcement!

We’ve filed a ticket into our internal database for this issue and will start investigating, we will update you when we have further information.

Thanks for flagging!

3 Likes