Add DisableFastClusters property for models and prevent fast clusters from including sub-models

As a Roblox developer, it is currently impossible to make visual changes to a player’s character during gameplay without causing lag spikes due to invalidated fast clusters.

This has been an ongoing problem for years and it is making my game unplayable. I’m doing everything in my power to avoid invalidating these fast clusters but there are cases where it just can’t be helped.

My problem

I have a character that can switch between two forms, a humanoid form, and a form that can swim. When the player switches between forms their avatar is first made invisible and a transitionary form is made visible (boom, invalidated fast cluster,) a transition animation is played, and then the transition form is made invisible and their final swim-form is made visible (again, invalidated fast cluster.) This means there are two lag spikes for a single transformation and players are expected to use this mechanic as often as you might use a sprint function in other games. The transition takes less than a second in total.

Additionally, in this swim-form, when players enter the fluid they can swim in it makes their swim-form invisible (lag spike,) and visible again when they exit the fluid (lag spike,) and then every time they start or stop moving within the fluid a sort of “wake” mesh appears or disappears (lag spike.) This means every time a player starts moving there is a lag spike, every time a player stops moving there is a lag spike, every time a player presses left shift there is a lag spike, every time a player releases left shift there is a lag spike, every time a player enters a certain region there is a lag spike, every time they exit this region there is a lag spike, jumping out of and then back into this region causes two lag spikes, and this is just the basics of the problem.

The lag spike is made significantly worse the more complex the player’s avatar is. Layered clothing and lots of accessories make these lag spikes absolutely massive. The lag hasn’t been as bad for me in testing since my game’s AI characters have very simple appearances and my own character’s appearance is also fairly simple with no layered clothing. Once we’re in the real world with real players, however, the lag gets unbearable.

I could work around this issue by moving the swim-form out of the player’s avatar and into its own model in the workspace and then welding it to the player from there so it wouldn’t share a fast cluster with the player’s avatar but that seems like a very messy and poor practice to follow and would only solve the issue of the lag spikes occurring when a player starts and stops moving and enters and exits the swimmable fluid. It wouldn’t help with the transformation lag spikes or any other sources of invalidated clusters I’m experiencing.

Proposed solution

Here’s where I get to my proposed solution: placing parts of the player’s avatar outside of the player’s avatar seems like a very bad practice and would add a lot of mess since this external model wouldn’t automatically get destroyed along with the player’s avatar. Instead, I propose models within the player’s avatar should not share the same fast cluster as the player’s avatar. This would mean I could keep things relevant to the player’s avatar within their character but still ensure that changes to them won’t invalidate the entire cluster.

Additionally, it would be nice if models had a boolean property named DisableFastClusters which would prevent a fast cluster from being made of its descendants that aren’t themselves in a sub-model so visual changes could be made to the contents of this model without worrying about invalidating any fast clusters.

I understand Roblox doesn’t want things to get too complex and for new developers to have to worry about weird properties like this but I truly wish Roblox would show some faith in its developers and occasionally give them the tools to enable and disable some performance features depending on their game. The current system is very opaque and encourages bad practices like welding things to the player’s avatar from outside their character in order to avoid invalidated fast clusters.

22 Likes

This happens with anything that contains a humanoid, no documentation really warns us about this. The boom of UGC with high poly counts are causing more and more issues.

4 Likes

Just today, I accidentally left a humanoid inside of workspace, and the lag was horrible. Since it seems to originate from humanoids, the property could possibly be applied to humanoids, with the possibility of being disabled in games where the FastClusters things is more harmful than beneficial

4 Likes

My understanding is that meshes get clustered anytime there’s a skinned mesh or a Humanoid in use. Since this functionality isn’t exclusive to Humanoids, it doesn’t make sense to make it a property of the Humanoid. In both the case of the skinned mesh and the Humanoid, both are parented to a Model so that is the most logical place to put the property.

Not to mention I don’t really want to have to disable FastClusters for my player’s entire characters just because I have a sub-model in their character that gets regular visual updates. I would rather disable the FastClusters for the sub-model but leave it on for the main character Model.

Another benefit of this addition would be that since the Workspace inherits from Model, the workspace could have DisableFastClusters true by default so Humanoids accidentally left in the Workspace wouldn’t cause the entire contents of the Workspace to be clustered.

At the very least, if Roblox doesn’t want to add this property, making it so FastClusters won’t include sub-models within a model that contains a Humanoid would be a huge boon, wouldn’t break any existing games, and would likely improve performance in many games since putting models inside the player’s character is a common and intuitive way to keep track of things relevant to the player’s avatar such as visual effects.

5 Likes

We have been trying to tackle lag in our game for a long time, weapon switch, doing a special action, respawning, changing character, dying. The biggest microprofiler label always ends up being this very annoying fastcluster invalidation. I really hope Roblox considers a way to fix this.

3 Likes

Just a reminder,
If you see this issue and want it fixed, please respond to this post so it doesn’t fall off and staff can actually see this is an issue…

2 Likes

Unfortunately, this seems to be a topic that - while it would benefit everyone - covers a not very well-known part of Roblox so it probably won’t get the attention of most Roblox developers.

Bump, this is incredibly annoying. Not even using LocalTransparencyModifier fixes it.

1 Like

There is hope.

1 Like

Still no update on this? This is an incredibly annoying issue in my game since I have lots of accessories I put directly under characters for convenience. I’m now having to put all accessories in a separate folder instead and change a lot of code to account for that.