Why is UE4 so sluggish with 4200 cubes?

Ok so this is how I would build that game:

I’d build about a dozen different meshes shaped as above and just mirror and rotate them to build the level. This way the meshes can be optimized (unseen faces deleted) and the engine would be able to render them much more quickly. Then I’d create a single cube mesh that can be used to fill out the shapes. This way the individual cube could be made into a destructible mesh and could be used in random places to pad out the edges of the level to give the effect of being able to blast apart certain parts of the level if you wanted to be able to do that. You can also use the cube to make the dozen or so wall pieces more varied by just adding one or two in interesting places for a more unique pattern.

An alternative method would be to build a frame around the outside of your level using cubes that are non-uniformly scaled and then fill in the inside of the level with other non-uniformly scaled cubes. You could even use a combination of the two methods I suggest. This would give you much better results than simply building the world out of individual cubes.

I color coded the “cubes” just to show you exactly how I would place them in the world.

Cool man. Glad I could be of some help. You could still generate the level through an algorithm but using the dozen or so larger pieces would really help make everything more optimized. Make it so your level uses only 20 or so of the major block meshes to build the entire level and then fill in or pad other portions with the cubes. You always have to think about how you can boil everything down into its most basic form :slight_smile:

Good luck with the rest of the project. Hit me up whenever you finish it!

I’m curious… why are you making the levels auto generated rather than building them by hand? Is it because you want to create an infinite number of levels or is there another reason? Cause I’ve personally always been a fan of hand crafting levels and I’d bet you could make an entire level in less than an hour if you were to build it by hand. i.e. you’d likely be able to create a few hundred levels in a month or two.

I’m a total noob when it comes to blueprints to be honest so I can’t be much help there.
What I’d likely do is create a “universal” block blueprint with a public static mesh so you can quickly swap out the mesh it uses. Then I’d add some public bools to apply positive or negative value for the scale for randomized mirroring in X and Y (i.e. “Mirror X” and “Mirror Y” bools) and then just drag in a dozen or so to the scene and save it as “MissionBase.umap”. Then Save As again and call it “Mission01.umap”, move the blueprints around in the scene, set your rotation snap to 90 and your grid snap to whatever the scale of a single cube is and very quickly move the blocks around till you’ve got a level built out. If you place the pivot point of all the blocks in the top left corner of the mesh everything will snap together easily. You could probably build out a complete level’s layout in 5 - 10 minutes. Then open the MissionBase map again, Save As “Mission02” and repeat. You could easily block out a dozen levels in a day and then go back and detail them up with another 50 mins.