I was experiencing a rather difficult lag problem for a while, which was only present on my mobile, which was bought only a few weeks ago. The fact that there was no problem on PC left me scratching my head.
The issue was that lag was occurring on various actions (when PIE started or game was opened on device, when a weapon was fired). The lag would not go away until a menu was opened. I still don’t know what causes this behavior.
Then, I decided to make a duplicate of my level and I started deleting content. First I axed most of the content not strictly essential to gameplay. The lag was barely present. Then I starting deleting objects individually. Though it took a while since I was launching on mobile each and every time, I narrowed the issue down to one problem*: The 8 static meshes laying around in my level, acting as the floors and walls.
By putting these 8 static meshes into a single Blueprint, the lag went down quite a bit (once again, only on mobile; PC ran smooth as usual).
*There were other sources of lag that I could identify easily, such as the Gaussian Blur effect present on most of my widgets that had a heavier cost than I had anticipated. Meanwhile, there was still lag present in after placing my static meshes into the blueprint. Unlike before, the lag would only last for a few seconds before returning to smooth.
Sounds like BS.
Static meshes added to the level are automatically turned into a static mesh Actor.
Unless there’s a severe issue with that process/class in the version you are using - which there could be, but you didn’t mention what you are using. No one can check it or verify - then no. Static meshes, thrown into the level are perfectly fine on anything and everything. In fact, they cost a lot less than almost anything else having near nothing to them.
No on tick, no loading/unloading, no added functionality of any kind.
Another thing to consider. It’s not the mesh, but rather the bad material you applied to the mesh that causes non CPU delays.
Obviously you would get that information right away by using profiling tools to see where the load is happening.
This is a fair response. I feel a bit silly now, so I will change the name of this discussion to something a little more oriented towards my problem.
Also going to edit (or rather, replace large swaths of) my original post because my statements like this:
Are false. I was probably a bit too exited when writing this.
For reference, I am using Unreal Engine 5.0.1, the mobile device I was testing on was a Samsung Galaxy Tab A8.
The main reason I posted this was that this happened to solve my problem, namely some rather strange lag problems.
The issue was that the frame rate would go from smooth to choppy on various instances, namely when the game starts, the weapon is fired for the first time, the game is started (no level is loaded), when the tutorial starts (level is loaded).
What was even more strange for me was that the lag would instantly stop the moment some menus were opened, most notably the pause menu, which makes sense regarding the fact that it sets Global Time Dilation to 0. While the pause menu made sense, the other menus did not pause the game and yet still temporarily fixed the lag.