I've tried all I can - I'm still very limited in my games by lag

Hiya!

So I’ve been building for a few years now, but not a scripter. The games I build mostly consist of large size towns, requiring many detailed buildings and locations.
One of the absolute biggest problems I’ve had with building games is - lag.
I can’t include the detail I want, I have to shrink the map, I have to limit how many bricks I use for every thing, I’m cutting a lot of corners, missing a lot of detail. Scripting is not my strongsuit at all so I want to make the maps really cool and detailed for players.

Quite a few months back I noticed a RP game I was playing, after a big building update, was lagging to an almost unplayable point. Sort of thought 'That’s a shame" and moved on. The next week, their title had a 'LAG FIXED - rp…". I rejoined, and with no removal of any buildings, features, the same detail kept, there was now next to no lag. I was just baffled that this was possible. What’s more, they’ve still been able to add more and more detail-heavy features. They also include complex meshes with transparency for trees

I’ve seen posts here before talking about how scripters can reduce lag. I don’t even know where to start. I’ve followed as many building tips as I can, (cancollide, shadows, transparency, vertexes, unioning,stringloading, etc.) but I am still very limited. Anything related to client side/server side, scripting, I don’t know what to do.

Is there such a way to script lag out sort of? If so, how, who do I hire, what do I do?
Thanks, any replies much appreciated.

1 Like

We can only “reduce” lag by using chunk systems, loading and unloading chunks when they’re too far away. But the best way to reduce lag is not by scripting but by either using:

  • less parts
  • meshparts
  • setting the RenderFidelity to Automatic
1 Like

This is mostly true, but MeshParts on their own won’t reduce lag just by existing, it’s how they’re used that is important.

Using the same mesh over and over (in the same size? I can’t remember exactly) will be less laggy than the same amount, but using multiple different meshes. This is called Instancing, and there’s some information about that elsewhere on the devforums. It’s kind of a technical detail but it can help reduce lag (this isn’t actually related to scripting to reduce lag though).

A chunk system can definitely help (such as StreamingEnabled if your game is big enough or laggy enough to justify it), but setting RenderFidelity to Automatic should do a lot of the work for you.

@OP - could you send a link to one of your games in which lag has been a problem? Typically lag involving just building stuff shouldn’t be a big issue in Roblox games, even with a decent amount of detail.

It might require changing some of the ways you build things, but ultimately what will help you is learning how to optimise the things you build (if you use meshes, this involves making meshes which have less triangles, this also includes instancing which I mentioned before).

3 Likes