Weird lag jitters when near my castle

Also worth noting the following does nothing to reduce or stop the lag spikes

~ Reducing Graphics
~ Doesn’t matter if im in-game or in studio the lag still occurs.
~ I tried deleting all of a specific furniture type to see if the source was one prop. (e.g destroying every couch, bed, bookshelf)

1 Like

Hello, @yoolurs, does your build have many unions? Like the holes for the doors? If so, you should replace them with meshes made in Blender. Unions create unnecessary triangles and sometimes mess up the object’s box, therefore lowering performance, especially on lower-end devices.
Try some of these tips for smoother performance:

  • Set CanCollide property to false for objects that don’t need it, such as the swords on the table,
  • Set RenderFidelity property to Performance, unless you need precise quality for a specific object or it just messes it up
  • Try to reduce part and triangle count,
  • Inspect the developer console and check for errors.

Does the castle also have any scripts?
Are you sure this issue comes from the build and not your computer? Try using a different computer or ask a friend to test to see what it looks like from their end.

Please notify me whether this resolves your issue or not.

2 Likes

Yea the build does use unions for the doorways and stuff and the collisionfidelity is set to PreciseConvexDecomposition for them all so that theres no issues with players or projectiles going through. I also dont see “performance” as an option under RenderFidelity only precise and automatic.

The castle does not have any scripts. Also when I remove all the furniture and props the issue gets resolved but thats obviously not a viable solution.

Try making a script that turns the collision off of or completely despawns models when you get far away, always works for me!

2 Likes

Isn’t that what streaming enabled pretty much does? Also it wouldn’t matter since this lag only occurs while you are inside the castle so you’d be close to it at all times when the lag occurs.

just a ran a test by setting all the unions within the castle to have a default collision fidelity and the issue still occurred and didn’t even seem to be reduced at all.

Streaming enabled kind of does it, but a dedicated script does it better. If you’re inside the castle, streaming enabled would unload some far away objects, but not all of them. A script could unload everything that isn’t inside the castle, and while it doesn’t seem like much at first, it will make a huge difference in performance in the long run.

1 Like

Does your game have a large number of unnecessary Welds attached to other objects by any chance?

If so, try deleting all of them and seeing if this occurs again.
I believe it isn’t a part of performance and graphics as we obviously would be having lag the entire time instead of a perfectly timed sudden lag jitter.

In case you’re too lazy, here’s a command that you can execute in the Command Bar.

for _, v in ipairs(workspace:GetDescendants()) do if v IsA:("Weld") then v:Destroy() end end 

Usually the issue is encountered if Join Surfaces is turned on and you’ve built a lot of stuff on your game that welds itself to other objects. It’s generally a huge deal since it’s enabled on default.
image

1 Like

I don’t have any welds on the map.

Definitely a good idea just to overall improve performance but this doesn’t solve the issue with the castle specifically.

1 Like

What about if you placed all the stuff you removed into a fresh map?

If the problem still happens maybe you can delete items on the fresh map, one at a time, until you find the specific item that is causing the problem.

1 Like

Just took your advice and had a friend try as well and he experienced the same exact lag.

I am going to try and do things to boost performance and see what comes of it.

Ok so I just made a performance enhancement
I had a LOT of these torches and similar props like chandeliers and fire pots that had unions

image

For example I highlighted all the unions on this wall torch. They had collisions on and the collision fidelity was PreciseConvexDecomposition which is brutally unnecessary so I ran some code (and confirmed that it worked) to set all the unions in these props to have a collision fidelity of box and disabled collisions, cantouch, and canquery and that didn’t reduce the lag issue in the slightest. Literally zero change at all. This is hundreds of unions that have been adjusted and still literally nothing.

I’ll continue testing but hopefully this can help someone help me find a solution.

1 Like

Is there anything I should check in the F9 console that could help me diagnose this issue? What should I look for when near the castle and away?

Edit: Also if it were excessive parts or something why does it just lag spike every few seconds? I feel like if excessive parts or an issue with the unions it’d constantly be at a low FPS.

Could you please publish the castle, so I can take a look (just in game, not in studio of course :grinning:)? I believe that it would be quicker to identify the problem directly instead of wasting your time like this.

1 Like

I don’t want to leak my assets unfortunately but I am going to try converting some of my props to meshes and see if that helps.

Turning them into meshes and reducing tri count significantly reduced the problem but didn’t get rid of it entirely. It is obvious now though that all I have to do is reduce the tri count even more.

Any tips to reduce the amount of tris, vertices, etc in blender? I’m not super blender savvy and I was only using limited desolve before.

Edit: it got rid of the problem 100%, the rest of the lag was due to a roblox bug relating to layered clothing so I thought it was still there but subtle. Thank you so much for the help!

You can reduce the triangle count of already existing meshes by using the Decimate modifier and setting the ratio to a number smaller than 1 (it goes from 0 to 1). For newly created meshes, I recommend you to avoid subdividing parts and not going into detail so much. Try to keep it as plain and as simple as possible. If your mesh still has too many triangles, you can of course still use the Decimate modifier to reduce them. This is extremely important for objects that are used repetitively, such as the torches on your wall. If you wish to merge vertices (for example, if two vertices are in the same spot), you can press Tab to go into Edit mode and press M > Merge at center. There are more types of merging in the same popup, but I believe that this is the most useful one.

Wow, it really surprised me that layered clothing was causing this lag. This is a fairly new feature and has apparently not been tested well enough yet. You might also expect some performance issues with the new dynamic heads as they’ve just been introduced and haven’t been tested by the players yet.

Good luck with your builds!

2 Likes

Thanks for the advice. Layered clothing wasn’t causing the lag but it made me think it was still there after converting to meshes.

This is the bug if you are interested.

1 Like

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