Layered clothing causes lag spikes when updating unrelated part properties

We understand the source of the lags and have an improvement for that in progress, but we had not seen reports of a memory leak before this. They may be two seperate bugs, or it may be an issue specific to your setup. Do you have a simple test place you can share?

5 Likes

I made this test place. Pressing Q will create a character aura for 1 second. I encourage you to try this without wearing any layered clothing then try with layered clothing and watch GraphicsTextureCharacter rise everytime u press Q along with an fps drop.

Just so you know exactly whats going on as well. The character aura simply clones all the body parts and changes things like color, size, material, etc then welds it to the original part and parents it to that same part.

6 Likes

Hi Bedevere. I just posted a new thread regarding my issue. Below is the link to it. Please have a look at the problem. Thank you.

4 Likes

Can you please start a new thread for the memory leak issue? Thanks.

3 Likes

Like I said before I am unable to create topics in bug reports unfortunately but maybe someone can do it on my behalf.

5 Likes

Yes, I understand. Can you start a thread in Help and Feedback? For example:

3 Likes
3 Likes

I’d like to add to this issue that its severely effecting my games playability (and possibly a lot of others). The memory leak issue has been resolved but there is still SEVERE fps drops when parts are added to the character. My game (and a lot of others) has a weapon welded to your back as well as a weapon rigged to your hand (at least 1 is invisible at all times) When equipped the weapon in your hand turns visible and the one on your back goes invisible and vice versa when you unequip the weapon. Players are able to spam re-equip their weapon which causes unplayable FPS drops just by simply unequipping and re-equipping a tool.

(I also tested this with regular tools using just part handles instead of rigging anything and it also causes the severe lag spikes, this means players can lag games just by constantly re-equipping tools with layered clothing.)

What specifically causes the most lag is when parts are added to a specific kind of character in my game that has wings
image

The wings simply consist of an invisible part the same size of the uppertorso that gets cframed to the uppertorso then welded. Theres then like 3 or 4 sections of each wing that are motor6d’d together.
And yes this is the same issue as once I removed all layer clothing fps spikes wouldn’t occur so it is not a problem with the wings. The wings just amplify the lag with layered clothing for whatever reason.

4 Likes

Can confirm this is an issue. Equipping and unequipping a tool for example will cause layered clothing to rebuild. Sitting in a seat will cause it to rebuild. Rescaling a character through their scale values will also cause a rebuild. Any eta on a fix for this?

3 Likes

I do believe rescaling a character causing rebuilds is intentional. But I recently added a system in my game where when you talk to NPCs their mouth opens and closes which literally sets the transparency of 2 decals to 0 and 1 and even just that will cause noticeable FPS drops as it triggers the rebuilds every single time.

For a simple repro you can literally have a loop setting a dummy’s face transparency every second and equip that dummy with layered clothing and watch the FPS drop.

I wish we had a way to disable layered clothing rebuilds as I dont rescale the characters or change them in anyway that would even require a rebuild aside from initial spawning in. Idk why setting decal transparencies would even trigger rebuilds in the first place.

2 Likes

Hello to make this easier for staff to solve I updated my layered clothing lag test replication place to show how my use case is game-breaking and potentially help staff come to a solution quicker.

Instructions:
I recommend you use the blocky avatar although it doesn’t really matter that much. Also use a decal face if you want the face toggling to work. (and obviously wear as much layered clothing as you can)

Keybinds:
Q - adds an aura made of parts around the character then destroys it after a few seconds. This is how u essentially see the lag.

C - This is a toggle key. When enabled your faces transparency will change every task.wait(0.05) this is to show that something completely unrelated to layer clothing can still cause the rebuilds

X - This is a toggle key that will add and remove the exact wings I use on my characters which amplify the problem A LOT. I highly recommend you try this with the wings on just to see how bad it gets when adding extra rigging to the character.

B - This is a toggle. When active it changes the transparency of your lefthand every task.wait(0.05)

If you enable the wings and spam Q with layered clothes on you will almost immediately experience FPS dropping.

I appreciate any staff members time looking into this a lot! Hopefully this can help!

4 Likes

This issue has been happening to me for a while and it’s very frustrating, my game has rainbow accessories that are parented to the player’s character, with the color of those accessories being updated by the client, if the player happens to be wearing layered clothing, it causes very noticeable lag spikes.

5 Likes

was debugging a strange lag spike while equipping / unequipping tools today and led to this known issue :raised_hands: would there be an ETA on when the fix will be rolled out? it would be quite unfortunate that we couldn’t enable layered clothing due to engine performance issue :sob:

3 Likes

I asked under another post relating to layered clothing and got this response.
Hopefully this gets prioritized more as it is a game breaking issue.

3 Likes

Thank youu so much for letting me know! :raised_hands: very glad to see the issue is being actively worked on

Besides the fps dropping issue, I was encountering another very strange issue about memory usage regarding the tools being updated / altered while the character is using layered clothings :man_bowing: not sure if you could share some thought / insight Thank youu in advance!

Currently the game of mine making use of remote event to simulate gun’s motion and effect (motor 6D bolt cycling animation / sounds, etc) and there was one time when a player using layered clothings firing their weapons caused my client’s LuaHeap memory usage to an insane value and thus crashed my client

However, seems that I couldn’t replicate the same situation again regarding the luaheap memory leak again so far

2 Likes

Thanks for this example, someone will take a look. Thanks for you patience on this issue, we know the current behavior is a problem and are actively working on it, but the solution is non trivial so it’s taking time. In the meantime there are several workarounds that can be used in many cases, we will be posting more information about that soon.

4 Likes

Appreciate you guys working hard on the issue as always and the updates along the way.
By any chance could we get functionality to disable layered clothing rebuilds? Something like accessory.AllowRebuilds = false either a property or a function. This could prove useful as in my game there are custom characters and the rig size and package never changes so I really have no need to have rebuilds happening in the first place.

I initially wanted to disable rebuilds as a temporary fix for this issue when I first had it occurring but came to find out there wasn’t actually a way to stop them.

1 Like

Hey it’s almost been 2 months and I was wondering when this new information was going to be posted. I’ve been looking forward to it.

3 Likes

Sorry, many competing priorities, but this is wip. Fwiw it’s not new information, just summarizing what we’ve already posted on the forum.

3 Likes

many competing priorities? Layered clothing seems to be ur main priority right now at roblox and if ur considering rolling out layered clothings for UGC bodies I would expect this to be fixed already

1 Like