How do I reduce lag, despite having a massive map and an even larger amount of parts?

Hello! So I’m working on a large game, and I want it to be an open world that could realistically be a thing (with different biomes and stuff). Here’s the photo of what it looks like from the top:


(Still working on making the different areas flow better, I know it looks a bit weird)
Anyways, this isn’t super laggy for me (surprisingly) but I wanted to add a forest into the section of grass that you can see in the middle right. Due to the area of that chunk, the amount of trees needed is insane. It’s too many to count. This forest was so bad it lagged my studio. A lot. Is there any way I’d be able to reduce the lag but still add a forest? For reference, I’m using two sizes of redwood tree from Roblox’s forest pack.

2 Likes

workspace.StreamingEnabled is the best tool you have for making larger maps.
Just make sure you don’t try to reference streamed out parts on the client.

I have streaming enabled on though, and the forest lagged out my studio more than it did my test play. Is there any way around it? At the moment I just have it in serverStorage and I might make a script to move the forest out of there when a player spawns in. Would that work?

2 Likes

It could, or you could lower your studio graphics settings in File > Studio Settings > Rendering.

1 Like

Basically Atmosphere or FogEnd so rendering isn’t too severe.

Could you link the forest pack?
Also, if the trees uses some form of mesh then the mesh’s polygon count could be a factor.
Polygon count is just how many faces a mesh has.

image
This has 24 faces and is clearly not a ball.

image
This is a ball but has 15872 faces.

You see how both cases can create a lot of lag if scaled up, but the lower polygon count one will create less.
You might find custom meshes to be usefull in this case (or just use parts/unions).

Or it might just be the part count. And if your tree has a lot of parts, then you could try making a union out of them to lessen the gpu usage.

2 Likes

Here it is: (1) Forest Pack - Roblox

Sorry late reply: internet went down.

Allright, i got one of those trees and spammed it in a 500*500
stud grid and got some interesting results.
image
Also this :slight_smile:

With performance fidelity i got 300 avg fps. (maximum roblox allows with unlocker)
With automatic and precise my pc cried for help at 50-70 fps.

Also with large maps you might want to use the following:
image
The atmosphere is the more interesting one (But you need both for it to work).
Inside atmosphere you have:
image
Density is how close the fog is.
Offset just fades out the parts that are far into the fog. (so roblox doesn’t have to render it)

Tinker around with it.
But with the best graphycs the game could offer and twice the amount of trees with performance fidelity i got a stable 80-100 fps. (since the ones far away weren’t rendered)

So you might wonder “omg i have to redo all of the trees? one by one?”
Not so. I created a command to automate things.

local children = workspace.Folder:GetChildren(); for i = 1, #children, 1 do local innerChildren = children[i]:GetChildren() ;for j = 1, #innerChildren, 1 do innerChildren[j].RenderFidelity = Enum.RenderFidelity.Performance end end

Just put all the trees into a folder in workspace called Folder and run this. If you don’t trust this code you can back up the place first.
Or change the path local children = workspace.Folder:GetChildren(); here, and press enter.

References:

2 Likes

Thanks so much!!! I’ll throw the trees back into the game and try this, I’ll update you with my results!

2 Likes