Download

Performance difference between BP and Static Mesh/Paper Sprite

Another performance question. Bear with me.

I’m wondering if there is any difference in performance with blueprints vs sprite.

My 2d game is going to have a random generated world with alot of objects, Everything from ground to things (enemies, trees and so on). Think a little like terraria. The easiest way for me to interact with these objects is by using blueprints. I want actions when objects are clicked and if all the objects are blueprints I only have to use OnClicked to interact with them. But will this affect performance? Would it be better performance with a lot of papersprite objects instead that I somehow interact with from the cursor blueprint? Most of the objects will just be still and dont do anything until they are clicked. A few may be moving or rotating. The blueprints are created from the sprites by “create blueprints using this”.

I want to ask the same question about 3d games.
Is there any performance gain in using static meshes instead of blueprints created from this meshes?

The blueprint will still have a static mesh as it’s base, so that won’t make a difference. The only downside to having tons of blueprints in a scene is that their combined memory footprint can start to make the engine stutter, but that is with extreme quantities(hundreds of thousands, or maybe less if the blueprint file sizes are in the megabytes).

You could probably get away with using blueprints if each one contained a bare minimum of data, such as all it would need to be interact-able and store it’s own grid information.

Generally though, if you are procedurally generating your tiles, especially if there are more than a couple hundred loaded at any given time, then you are going to want to use instanced meshes. Or maybe sprites, but I haven’t dealt with them so I do not know the pros and cons in that area. A Terraria clone is probably going to have a few thousand tiles loaded at any given time, and that number of draw calls will require you to use instancing or something much more efficient than plain static meshes.

Hmm, ever since a few months ago when I was a beginner in UE4, I thought the actor/BP count could only be in the thousands before the stutter, I spawned 10k cube blueprints and was dropped down to like 5 FPS during gameplay, I must’ve been doing something wrong :\ Good thing you mentioned that though, I will no longer worry about placing actors everywhere in my level.

Were your blueprints visible? I was talking about invisible data actors.

If your blueprint has a visible static mesh it is going to have the same effect as having a normal static mesh spawned in the world. The only difference that I have seen between a mesh and a blueprint(with mesh) would be the additional overhead from the blueprint itself, which from my testing isn’t a problem until you get extreme with it. In my case, I would have needed up to 80,000 actors in the world with more than 1MB per actor, and that was more than it could handle. What I experienced was a normal frame rate, but it would take a hit every few seconds. Either way it wasn’t going to work.

Ok thanks Zeustiak. I have started to look in to the whole instanced meshes but havn’t figured it all out yet. Right now the limit when just spawning blueprint blocks is somewhere between 50000-70000 before it starts dropping fps to much.

If they are set as not visible does that help fps alot? Can you have a lot of objects that are not visible without any performance drop or is the a limit there as well? Just thinking how im going to load and unload blocks.

There is a limit to the number of invisible actors, but I have not seen a limit to invisible instances yet. If I have 200k tree instances in my scene fps gets pretty low, but when I make them invisible fps is back to normal.

Ok. I tested a bit and it makes quite a difference if there invisible.

It can’t really find good helpful documentation on how to create instanced meshes or in my case sprites. Am I just bad at searching through the documentation?

I ran into the same issues trying to find documentation on HOW to work with instanced static meshes. I finally came upon this video which explains it quite nicely. I’m not sure if your still having a hard time with instanced static meshes but if not this may help someone else as well.