Game Optimization (Related to Tree Amounts)

Yesterday, I test-ran my game to see how performance would be had I removed all the trees & bushes.
For context, here is an aerial view of the map with trees:


The game ran near-perfectly.

Currently, the trees and other misc stuff are handled by a chunk loader which takes them out of Rep Storage and into the camera for only a chunk that surrounds the player. Streaming is also enabled, and I believe does affect the trees.

Unfortuntately the trees seem to lag a lot and there is a 20% crash rate. I don’t know why they lag if they are only loaded in at a certain radius. Perhaps it is something with the chunk loader itself. What optimization tips could I use to further optimize the game without resorting to getting rid of most of the trees?
Any help is appreciated, thanks!

(On a side note, I should add that the trees themselves are models with 2 meshes inside, one for the trunk and one for the leaves. Both have collision fidelity set to box, leaves have castshadow on false, and both are rendered to the performance setting. A small amount of them use either more meshes/or parts for the leaves.)

image
I have checked and ummmm
theres 36,453 trees.

omg that a lot of trees

must use :
Mesh level of detail on Performance
IF POSSIBLE put StreamingEnabled inside your game in Opportunistic mode and LowMemory (it does a chunk system like in minecraft for short)
disable all collision on leaves (CanCollide, CanTouch) and put the CollisionFidelity to Box for the Trunk

you could even remove shadows from them, but could be ugly
You should gain some FPS and reduce the crash rate

This really helped!.

No seriously.

Game fps was averaging 2.6> instead of 60. now it averages 57 fps. The thing that really helped the most was removing cancollide

Just checked. I forgot to disable touch and it averages 59 instead of 57-58 maximum

optimization is crucial, if you wanna learn more check out this video that was made for the RDC 2024 :wink: