Building system (Satisfactory like)

Hey guys,
I’m trying to create a snapping-building game, something like the Satisfactory building system.

I still have to actually implement the whole system BUT the main problem I have right now is about performances.
Before starting this project I want to be 100% sure that even an enormous building will not impact the perfomances, so I decided to do some tests.

I tried with Instanced Static Meshes and with a wall actor (I ran 2 for loops - 1 for Height and 1 for Lenght of the wall) composed by 4 million (2000 H x 2000 L) instances (a single instanced mesh is 50x200x200) and I drop from 120 fps to 75/80 fps.

Yes I know, considering all those instances it’s quite good but it’s just an empy map with no landscape, foliage or whatsoever.

So I tried with Hierarchical Static Meshes and it pumped up the perfomances so much that I was very impressed.

Unfortunately I discovered that when a HISM actor has many instances it begins to flicker (image below) and sometimes it also “forgets” to “remove” the culling and the actor appears as an incomplete-tetris-like wall[*]: there are some missing meshes but the collision is there (I have no image for this since I wasn’t able to replicate the bug at the moment of the post).

I also tried to “paint” the meshes as foliage during run time (see example here: Unreal Engine 4 - Place foliage at run-time - YouTube ) but it happened the same thing that happened with the HISM: the meshes out of the camera view disappeared and Unreal “forgot” to make them visible again when in sight[*] (again I wasn’t able to replicate the issue at the moment of the post).

So my questions are: what is the best performance and bug-free way to make a building system with hundreds of thousands of meshes?
Do you have any concrete example/tutorial/suggestion/advice on how to make this possibile?

Thanks! :slight_smile:

P.S. I was not sure what was the correct section for my question. I apologise if it’s in the wrong one.

Choose one - Blueprints or Performance. You can’t have both.

what is the best performance

clever c++ code

bug-free way to make a building system
with hundreds of thousands of meshes

Can’t be done. Pick one Bug Free or Hundreds of Thousands of Meshes

I’m not being cynical. I actually do mean it. Blueprints come with serious limitations. You can put a game together, sure. But making a complex, performant game in blueprints only - I say can’t be done.


You best bet is to write the performance hungry stuff in code and blueprint high level stuff.

Thank you for the reply.

The only blueprint script I’m actually running is in the construction script to generate 4 milion instances (used only for test purposes).

Do Unreal consider that as a running blueprint in-game or is it the whole “actor” system that slows down the perfomances in-game?

HISM seems to be the real solution but those bugs ruin everything and it’s really sad.

Speaking as someone who does sometimes do things that require large amounts of meshes, or something that would normally run like a dog with a wooden leg on the first few obvious attempts…

I’d say the main thing is clever thinking.

You’re not going to find an out of the box solution for this, you have to not only explore all possible engine avenues, but also examine your own thinking around the issue.

There will be assumptions you’re making already, that are actually holding you back.

You can ask yourself, what is really necessary, what isn’t really necessary. What can I do that will ‘look’ like that, or have the same effect etc.

Because at the end of the day, end users aren’t going to care about how you did it, and so on. If you really want a wall of millions of meshes, it only has to look like a wall of millions of meshes. In fact that’s the main thing.

Thanks for the reply!

I did some other testing and I found out that the instance limit per HISM actor is 1.535.
If you add one more instance you get the flickering bug.

After that I put 1.000 actors with 1.535 instances of HISM each and then ran the same test but this time with ISM instances.

The results were quite similiar: with 1.535.000 instances total (clearly I couldn’t fit them all in one screen) the worst FPS I got were around 55.

Surely they are far more less than milions of meshes but all in all I’m satisfied and as @ClockworkOcean said the end users won’t care about the “how” but just about the result, and visualizing milions and milions of meshes all at once is almost impossible and I’m sure the result is going to be good enough anyway.

Also in my specific case, for optimizations purposes I still think HISM is the way to go since with them I can use LoDs while with ISM I cannot.

Thanks again for the replies guys, you helped me to rethink what I was doing and to take into account other things that previously I was not considering! :slight_smile: