Ability to move parts without lag

As a Roblox developer, it is currently impossible to have meshes in the game without suffering immense lag
If Roblox is able to address your issue it would let me have decent meshes

So first off, originally we had the mesh to the right as the generator but then we switched to the one on the left hoping that lowering the tri count would improve performance
The right mesh has ~20k tris while the left mesh has ~5.5k tris

The game is pretty much fine for decent GPUs until parts start moving: at this point the fps drops from 60 to like 15?

This is both in studio and in game

It is especially problematic for my game because players can build their own base (and move machines around) as well as shoot bullets
If you look in this next clip, you can see that there isn’t lag when the bullets are shot away from the base, but FPS drops insanely when I shoot at the base

Right now I create parts for bullets, but I will switch to beams to improve performance whenever possible
However, I can’t switch to beams for the rocket launcher in game and moving machines will create unplayable lag

The base above has only 4,115,942 tris
If you know of something I can do besides waiting for Roblox to optimize their engine please let me know (I don’t really want to lower the LOD though xd)

4 Likes

You might want to consider reducing the max amount of moving parts and trigs, as well as considering offloading Network Priority to other players or the server to prevent the client from having to render that many physics interactions, which would explain the lag.

2 Likes

Out of curiosity, is there a reason you don’t want to reduce the level of detail when people are further away from your base?

One thing you might try is disabling shadows when they’re not necessary (especially for small parts), as they can cause serious frame issues (according to PeteyK473, for example, disabling the shadows of parts on Temple of Wookong in 2018’s egg hunt made the stage go from completely unplayable to running just fine on android devices).

2 Likes

Pretty sure the post is a bit misleading and this is not related to rendering but to collision calculations. You should set CollisionFidelity to Box and maybe even CanCollide to false and add extra invisible parts as a replacement for the collision. This explains why other objects cause performance issues when moving near the meshes, because a ton of calculations will be going on at once and the client can’t keep up.

8 Likes

The solved hulls are probably part of the problem, but from the few pixels I can see of the performance stats, it looks like cpu and gpu are both stuttering at the same time. The examples do contain a lot of transparent parts and particles that are often the primary offenders of low render step rate from my experiences. I think there’s a combination of factors contributing to the slowdown.

I recently learned that it can be rather easy to break the draw batching without realizing it, and there are some hints here that could be happening. My problems revolved around forcing instances into a cluster that was being constantly invalidated by moving parts. The clip of the bullets not causing noticeable latency while firing at smooth terrain without any parts around, but then the latency occurring when firing at clustered parts, would suggest there could possibly be a batching problem.

Without seeing the microprofile details or the separate step rates of physics and render, nobody can really say for sure if the hangs are from the collision calculations, cluster invalidation, render latency, or possibly a combination of the three.

‘Moving parts around without lag’ has always been a feature and major selling point of Roblox, but developers unwittingly sabotaging their games performance due to sparsely documented (if at all) internal systems is a very common occurence. I lost the majority of my weekend to my cluster invalidation problem, and it wasn’t until I decided to dig into trying to learn how draw call batching worked that an obscure OpenGL thread made me realize that my Humanoids were forcing all relative parts to cluster.

The turnkey performance provided is already very very impressive, but the lack of documentation on all the ways you can wreck it forces us to devote lots of time and energy on blindly debugging mostly black box systems.

3 Likes

What is network priority? I made all of the parts local to each player hoping it would improve performance

Its a possibility in the future but right now there is no lag when you are away from bases so I think Roblox does a fine job there

I tried switching to voxel lighting from shadowmap and the lag still persisted, but I can try again

I’ll try this out thank you

Theres only one transparent cancollide false 3x3x3 Part for each model that is its primary part, and there were only particles when making the bullet hit effects but those were made with attachments parented to workspace.Terrain

Sorry, I will post the microprofile log when I get home in ~7 hours

Yeah I agree a lot with this statement
Do you by any chance still have the link to the opengl thread?

Thank you so much, changing collision fidelity to box solved it like @Zomebody said!

@Dekkonot performance is the same on both shadow map and voxel lighting for me

Here is the microprofiler dump for this video https://streamable.com/zxprn
microprofile-20190530-150536.html - Google Drive

I’m going to mark this thread as solved because there’s not much lag anymore but if you have any suggestions I would still really love to hear them

Another thing you can do is to completely nullify physics interactions between those moving parts and the bullets. Switching to Raycast and eliminating projectiles that have to be calculated by the client might be your best bet here, along with some manual LOD things.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.