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)
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.
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.
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.
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.
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
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.
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 )? I believe that it would be quicker to identify the problem directly instead of wasting your time like this.
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.