How do you add a mesh component without the large overhead entailed?

Apologies if this is a noob question. I am wanting to add lots and lots of meshes to an actor. For reasons that would take too long to explain, I do not want to use instanced static meshes (ISM) or the MASS entity system.

As seen in the screenshot in the right sidebar, a basic mesh component has a massive amount of data associated with it. I might be using a small fraction of that data in my game, and the rest is literally just sitting in RAM doing nothing, wasting space, for absolutely no reason.

EDIT: I’m sure Unreal Engine has some sort of tree shaking algorithm to get rid of some of that excess data. However, when I tested this in a preview build, each newly spawned mesh was still generating way more memory in RAM than what would be expected for a simple mesh/collision.

What’s worse is that each actor likely has some CPU overhead as well. (I’m not an expert – I don’t know what this would be or how severe it is, but it worries me nonetheless.)

How do you add a simple mesh component that does not have any of this overhead? Something that is “naked”, minimal, from the beginning, and has functionality added to it rather than being there by default? Is this possible?

Hi @JR_Miller,

You still have some options outside of ISMs and MASS, I’ll go over them briefly here:

  • If you’re dealing with skeletal meshes you can merge meshes to reduce draw calls.
  • Expanding on the above, Mutable is a more feature rich way of dealing with this, particularly for the use case of customisable characters.
  • Merging Actors is another route you can take, which by the sounds of it may be more in line with what you’re looking for. Just note that this can involve some tweaking of settings to get an output you’re happy with.
  • The approach I would recommend first is using Static Mesh Components under the same Actor. You’re correct that Actors have some overhead, as with components themselves to a degree. You should be able to make your static mesh components fairly light, however, by disabling a variety of things that you may not need that can be enabled by default. E.g. collision, physics, implementing LODs, etc. Here is a very good resource on this topic.

I personally would probably not go for taking the approach of implementing a more minimal Static Mesh Actor class, but of course that should also be possible.

I hope this gives you some paths forward.

Thanks,
Hayden

1 Like

thank you for the elaborate and thoughtful response!

I’ll try some of these things out and do some research.

1 Like