Our team is currently encountering an issue in which adding layered clothing accessories (non-Roblox-UGC) into our game causes our frame times to spike, with around 1,500ms for RenderJob. This makes our game go from running smoothly to running at almost 1 frame every 2-5 seconds.
We were able to figure out that textures were not the issue, as we stripped the accessories down to simple MeshParts, with the following properties, and still encountered this issue:
CastShadow = false
CollisionFidelity = Box
CanCollide = false
CanTouch = false
CanQuery = false
The meshes before converting them to Skinned Accessories using the Roblox-provided Avatar tool did not cause any noticeable lag.
Expected behavior
Layered Accessories shouldn’t be taking up this much processing time.
Hello and thank you for reaching out. We are currently working on performance improvement that may address some of the issues you are seeing. The system is complex, so we are still ironing out some issues, but it is coming soon!
Is this by any chance related to the performance improvements aforementioned? Are you guys working on decreasing lag associated with layered clothing? Would be good to know
I have just checked it out again in Studio and can confirm the issue still persists. I have sent V4_Ap3Dud3 some more details as well as a link & place file in the attached PM. Hope this helps!
So after some more investigation and deep diving into the MicroProfiler, I found that buildSkeleton was taking up the most time, in the PrepareBound stage.
I managed to find this bug report from 2021 outlining a similar issue, and the marked solution (more of a workaround) managed to eliminate the lengthy frame time issues we have.
TLDR: Moving the boned-meshparts into model instances rather than Accessories / Folders fixed the issue.
This is only a workaround though, and I suspect the root issue is related to what the engine tries to “consider” when calculating bone updates. As this has apparently been an issue for 3 years, it would be great to have this listed somewhere as a known bug as it is very likely to affect other games.
Hello, good find, I believe I posted about it in the past as well.
When skinned meshparts are added to the workspace directly, the engine end up treating the workspace as the root for the skeleton. Which means that any operation on that, will cause the “skeleton” to rebuild. Placing them under a model instance, makes that model be the root, and reduce the thrashing on the skeleton.
Thank you for posting an update and for your patience and support!
I still feel like this is something that needs to be addressed, as our entire team really didn’t know about this quirk, and it caused significant delays in production timelines.