Please let me start by saying that it is absolutely critical that I resolve this issue. If this issue is not resolved, our entire game design will not be feasible.
Summary of the problem:
Adding instanced static meshes in a random order by location gives 25% of normal frame rate, compared to adding them in order by X,Y,Z location.
It took me days to track down exactly why I was getting 30 fps when spawning 100k blocks using a random location, but when I spawn then in a grid, iterating over x and y, the fps is over 100. Everything else is exactly the same. PLEASE help me fix this problem. I would have to find another engine if this can’t be fixed. I am providing a github link and screenshots.
Steps to reproduce the bug:
1.Load the attached project.
2.Begin Play.
3.Observe fps.
4.End Play.
5.Enable the bool “Use Random Order” in my ism_spawner blueprint.
I have, and I think it has something to do with the way the physics engine handles collision. This project is very bare bones, so there isn’t anything I can change. There needs to be a way to add and remove instances at random locations.
This is critical for cutting down a forest in game and having it grow back, or placing blocks for bases. If you were to say “try using less blocks”, then we are simply ignoring this bug. There is no good reason that we get 4x performance for placing the instances in a specific order.
We have a situation where the number of blocks must be hard capped at a very low number, because the complexity of adding additional blocks becomes greater than O(N). See image below.
Thank you for submitting a bug report. I have reproduced the issue and logged it as UE-43692 which you can track on the following link: Unreal Engine Issues. Please be aware that since the issue must be reviewed and prioritized by our development staff, it may be a while before it can be addressed.
Thank you for this attempt. Would it be possible to post a screenshot of the blueprint? I don’t know enough about scanning files like this for malware.
In the bug report UE-43692, step #1 says “linked removed”, is this normal for non-staff? I’m not sure if they will be able to understand the bug without the content of this post.
Sorry for late reply. This attempt gave me different results because I’ve used high poly meshes with LOD enabled (I don’t really know why the hell) Since then I’ve tried nearly every possible way to get it working, generated fully new array from the provided data (without any loss of the original array not like before) but it gave me the same result. Your problem will be with the engine itself if we can call this a problem. The engine is simply reading ordered data faster(only in case of having the same numbers through several datablocks) Sorry for the inconvinience that I’ve made. Have a nice day
So it’s been nearly a week with no answers. This post have over a hundred views. It was acknowledged by and many other people that were able to reproduce the problem. My team literally cannot continue making our game until this problem is fixed. The fps is unplayable. What is it going to take to get this resolved?
It appears they have done something in 4.16.1, but the problem is still not fixed. If you look at these two screenshots, you’ll see that there is an intolerable amount of frame rate jitter when using the random order mode.
Please note that the problem does not occur if the camera is not translating it’s location. You must be moving to notice the effect.
If the rendering is the problem, then there’s functionally no difference between spawn type one and spawn type two except that when spawning in an orderly way, the instanced meshes are probably batched together more intelligently.
Wouldn’t it be reasonable to assume that totally random spawning at runtime will cause the batching of meshes (and therefore your culling, occlusion, LOD’s) to become intertwined in undesirable ways?