Download

Avoid FPS drops when spawning much actors by spawning them earlier, but invisible?

Hello,

if there are much actors spawning at a specific time in a game, this can cause a FPS drop. Is it a legit way to spawn them earlier in the game but make them invisible, maybe on the loading screen, and when they are “spawned” later in the game just set the new transform and make them visible? Would that help with the FPS drops?

Thank you,

Thilo

It might help. If you make them ‘hidden in game’, because the system doesn’t have to draw them. You would still get the ‘hit’ from spawning a lot of actors though, actors cost FPS.

Give it a go!

Yes, it works. Could go even further. In a presentation about performance in Robo Recall they said that they even “recycled” actors to avoid FPS drops, so for example made a pool of projectile-actors and didn’t destroy them if they hit a wall, but made them invisible and put them back into the pool.

Object Pool Plugin in Code Plugins - UE Marketplace

( not mine ).

Other approaches worth benchmarking / testing out:

Place a pool of hidden actors in the level / map before the game even starts.
Spawn in-game, but Disable Collision + Disable Tick + Set Hidden In Game…
Monitor DeltaSecs and if game not under high-load, then Spawn-in bunches…

Wasn’t too hard to implement it by myself. Currently looking for people having a look at it since this will be a critical point in my game: Please have a look at my actor pool implementation - C++ Gameplay Programming - Unreal Engine Forums