Download

Foliage Instances Harvesting - removing causes huge fps drop / lag

Hi i hope someone can help me with this problem:
Iam try to make trees harvestable and yes its working, but it gives me a huge fps drop / lag when i try to remove a Tree Foliage Instance (cutting down a tree) - this fps drop multiplies with the count of trees and foliage instances in my level :confused:

Does anyone know any work arround or possible fix how to do this better using the foliage tool? (its a very large map, it would be impossible to place every mesh by hand)

hit.JPG

This happens everytime when the engine convert the instance back to a mesh to destroy it

My plugin doesn’t cause any spikes like that. You must be doing something wrong with the way you are removing the instances.

Can you maybe post a screenshot of the Unreal Frontend Profiler tab running at the time you are cutting the trees?
I mean full-screen of the profiler with details of which tasks are taking the most milliseconds.
Perhaps that could give us a way of identifying the culprit.

@XilenceX
I think you want this :slight_smile: :

Idk , Android is disabled for this project… why is there an android task?

Here i did this again at another location:

Did you find a reliable solution ? I have the same problem and I don’t know what to do. When I use the “remove instance” in a blueprint, the CPU stalls. My profile data look exactly the same as yours ! :frowning:

Did you check you lighting? Sky or directional light set to movable = performance hit

The Game thread explodes, not the rendering.

Instead of removing the instance, set the scale to 0 and see if you still get the performance hit :slight_smile:

I tried to move it and realized that the “physics” are stressing. I think it’s having a hard time re-adjusting the collisions. Weird, since some of the resource foliage don’t take physics collisions.
I managed to reduce the lag by shrinking the Tile Size and increasing the Unique Tiles number so it won’t really look tiled.
I’m wondering if my world is “sliced” enough (world composition). A sub-level “tile” is ~1500m long.

I’m suffering with the same problem, couldn’t find any topic related to this issue either. If there are too many foliage instances in the game, removing foliage instances or any instance in the game causes FPS drops. For example, I’m using hierarchical instance mesh for my building system. If I build or remove a building part in the environment map which is full of foliages, it causes huge FPS drops even though I don’t touch foliage instances.

Is you RAM filled or is it the CPU thread ?

Sounds to me like this issue isn’t with foliage, but with the BETA procedural stuff?
​​​​in which case the problem is both the fact its still in Beta after ages, and the fact that it doesn’t take kindly to BP when GC is involved.
you should probably script a remove function in Cpp to call in BP.
or just stick to using foliage.

I’ve never checked that before. I’m working on other things right now but I’ll use profiler and try to figure out what’s going on soon. I’ll share my results.