Very high frame times after adding Layered Clothing Accessories into game

Hello!

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.

A private message is associated with this bug report

6 Likes

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!

8 Likes

I just reverted a recent change. Could you check again and let us know if this fixed the issue?

Thank you! And sorry for the noise.

4 Likes

Not the OP, but I have a question:

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 :upside_down_face:

1 Like

Yes, it is indeed. It won’t fix all cases, but will improve many of the current spikes and impacted frame rate drop cases.

2 Likes

Hello, thanks for the swift response.

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!

Quite an odd one :slight_smile:

1 Like

@RoyallyFlushed we will follow up in the PM, as well as post updates here as possible when we have them.

Thank you again for your patience and support!

2 Likes

Thanks for the info!

Anything I can do just give me a shout :smile:

Hey,

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.

:slight_smile:

1 Like

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!

1 Like

Ah, I figured as much.

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.

Anything I can do to help, just let me know :slight_smile: