Performance issue with UE4.27.2

Hi All,

I need some help to understand and figure out where the issue is.

I have attached a couple of screenshots with 150 units and FPS drop from 60 to 10 FPS.

I have tried to disable SSGI, it leads to more performance issues.

Disabling all Tick Events also makes no difference.

Changing Dynamic lights to Static also makes no difference.

Disabling Occlusion mask , did improve frame build from 80 to 76 ms, but still not much.

Removing Cast Shadows from all actors, also makes no big deal.

So, I’m quite confused what is going on with the game and why am I having this slow down in performance.

I have lowered textures of units to 128x128, cannot say it helped, but also know that this mesh isn’t so high quality anymore.

In Navigation I’m using CrowdManager, nothing custom there.

If anyone knows where to look and how to deeper debug it, I will really appreciate this.

Thanks
Alex.

TLDR: Most likely you are CPU bound because you have too many/too cpu heavy units, you can use unreal frontend to drill down on the CPU performance.

Hi, from the looks of stat unit in your second image you are CPU bound by the game thread, not GPU bound (SSGI, shadows and texture resolution affect the GPU, not the CPU). The GPU time will always be larger than the CPU time, since the GPU will stall to wait till the CPU finishes. You can make sure that you’re not GPU bound by setting the screen percentage to a really low value (you can set it via console command: r.screenpercentage 10 for example to set it to 10%). If your frame rate does not improve, then you’re not GPU bound.

To get some more info on the game thread, you can use the console command: stat game

To really analyze the game thread time you can use unreal frontend. That will show you all the times down to the individual assets and individual functions called. Here is some documention on how to use unreal frontend: https://www.unrealengine.com/en-US/blog/how-to-improve-game-thread-cpu-performance

Basically you run stat startfile to start recording and stat stopfile to end recording. Then you can open the recording in unreal frontend (you can start unreal frontend from the executable in the engine binaries directory).

Also always profile at least in standalone, better in a development packaged game. Performance in editor or play in editor will be arbitrarily wrong. CPU performance will also be better in a shipped build of the game compared to a development build.

1 Like

Thanks for the reply, looks like you are right, and it is more CPU-related, however, I see the load on GPU, and not on CPU on my PC.

I wonder why there is no difference when I do disable all functions on the TickEvent on my actors.

Also, can it be related to the fact that all my units are different meshes with skeletons?

Thanks

Tick time includes things that run under the hood, not only things called on tick in the blueprint. For example animations, movement, particle systems, collisions, landscape, timers and also every code that is executed in your blueprints, whether it’s on tick or not. The good news is that most of your time (around 40ms) comes from blueprint time. Those are things that you call in your blueprints.

To find those specific blueprints / blueprint functions, you could either use unreal frontend, that will show you the exact blueprints and the exact functions and events that take up time and you can optimize or remove that functions. Or you could make a copy of your level, and then start removing actor types from it one by one and see which one reduces the time. Then look into that blueprint to figure out which functions use up that time.

To be honest, I do not get what exactly is going on in my game:

The game is for Windows and Mac, why do I see so many Android-related calls?

Or am I looking into the wrong place here?

Thanks

Now it makes more sense to me:

The question is, what is KismetTraceUtils? Or are the relevant functions below the utils?