Removing instanced static mesh component instance

Hello,

I am currently making a game with procedural maps and I found a problem when I try to remove an instance from a component with lots of instances (like 30k). The game freezes for around 3 seconds and then the instance is gone.

How should I remove the instances to avoid this freezing? Maybe removing them in another thread?

Thank you very much.

Hello raDii,

You could try removing them in another thread. This way the calculation is not as intense. However, removing 30K+ instances will take a moment for your computer to calculate. The process is generally as follows: Calculate where the mesh is and what is derived of, how you are removing it, ie the blueprint, the fact that you removed it and what to draw in it’s absence, removing the mesh itself, rendering the result back to your screen. With that many instances that will cause performance issues. I believe this is why you are seeing the brief freeze before removing the instance.

Hello ,

Thank you for your answer. I will try doing the process in another thread but I want to show you the way I am doing this process, so you can correct me if something is wrong.

Thank you very much!!

Hello raDii,

Were you able to get this process to improve on another thread?

There is a known issue with instanced static meshes. With large numbers of them, deleting one means the array of remaining meshes needs to be reallocated. This can cause the pause like the ones you see.

Hey raDii,

I haven’t heard back from you yet. For tracking purposes I will be closing this thread and marking it as answered. If you are still experiencing this issue please refer to my previous post. I will continue to investigate this issue at that time.

Hello ,

I’m sorry I didn’t answer for too long but I’ve been without an internet connection in my PC for almost 2 weeks. I’ll continue with the development and I will post the result.

Thank you very much.

Is this something that will be adressed in the future? There seems te be no such problem with hierarchical instanced static meshes…