Performance - thousands of 1x1x1 cubes VS. hundreds of individual cube meshes (1x1x1, 2x2x2 .etc)

Given that the engine only renders what is visible on screen is there any advantage in making large individual meshes/multiple smaller ones for cube/grid based games? My project is topdown so would only render a small handfull at any given moment if the render works how I think it does.

Everything in my project is 100 unit based. By this I mean my character has a jump height of 100 units and a distance traveled in jump of 200 units. Everything is based off of 100 unit steps as far as world placement goes. Cliff face could be 800 units high, no in between, for example. So would I see a significant reduction in performance with a map made of 100x100x100 unreal unit cubes? Lets say I want to build a raised area of 300x300x200, one mesh of these dimensions vs. 18 small ones. Would it be that significant for a large map of say 500-800 small cubes (cubes having 12 tris, 34 verts)?

Current software is a nightmare for making UV’s consistently (Zbrush…) and I can’t afford something more suited for the task at the moment. So I would love to get an idea of how this could affect the performance on a large scale before I create more dynamic assets than just 6 sided cubes.

Initial testing shows that 1000 flat cubes in a wall doesn’t seem to change much but the more complex the terrain the more I start to feel a slight lag. If I could find a way to tile textures perfectly on x,y and z while scaling uneven dimensions none of this cube talk would be necessary, but as far as I am aware this isn’t possible.

I would be concerned with the number of draw calls you’ll be generating with a high number of objects. That’ll probably be your bottleneck before verts/faces start slowing you down. You can reduce draw calls substantially by combining areas of cubes into one mesh. UE4 has the ability to do this for you. You can also take advantage of instance meshes to reduce things too, for anything that doesn’t move. Even if you have blocks that must be destroyed, there are ways to cast and figure out which instance is to be removed, and destroy it individually.

As for your UV situation, you should check out World Aligned Texture nodes. It won’t solve your problem for moving objects, but it might make your life a lot easier for the rest of your world.

This is why I love this community, I hadn’t even considered merging into one mesh in UE4 even though I have used it in this project a few times already for making quick n dirdy assets using Basic shapes.

Ramas Victory Plugin though will be the godsend I need, just watched a demo from him of it in action and it will seriously help my project. I might even be able to manage a seamless map if I group instances into zones, although I can see that getting messy fast with blueprints and variables, especially if I need to debug a difficult to replicate error…

Anyway, thanks to both you (for sharing this) and (for making it)

I’m one happy chappie!

Edit to add: ‘World Aligned Texture’ nodes for texture and normal… Another life saver, my had like 30 nodes doing what this does in 4, and this has Z axis too. Again, thank you

No problem :slight_smile:

I’ve solved thousands of UE4 problems by Googling, posting in the forums and using the Answer hub. Gotta give back in the rare instances when might I know the answer.

Good luck with your project!

Yeah, fortunately the community for UE4 is huge so a lot of my problems are either solved online through google or just before I hit post on a forum submission. Not sure why but writing down your problem outside of the editor seems to get the old brain gears going.

Thanks! You too with whatever you are working on :slight_smile: