How to make a varied procedural map?

Hi all,

I have managed to make a big block out of small blocks by modifying the puzzle template which works great but i would like to make it varied like this talented developer has done [WIP] Procedural Voxel Generation In UE4 - C++ - Unreal Engine Forums . The map im going for can be seen in the screenshot in the first post. Unfortunately this map was generated in C++ and i would like to do it in blueprints. I would like to be able to control the generation wit a seed but i have no idea how to do it.

This is how the blocks are being placed at the moment.

Any help is appreciated.

I am not sure you are going to be able to pull off voxel worlds in blueprint anytime soon. A lot of the things they are doing in C++ on the performance side with their voxel meshes is the only thing making it possible to have that many boxes in the world.

As they mention in the thread, using InstancedStaticMeshes uses 10x more RAM than what they are getting in C++.

In my own maps, when I have tens and hundreds of thousands of instanced meshes on the map the performance really takes a hit. This is fine since I basically don’t need that number for my project, but I am not sure how you can get around it in a voxel world.

If you need maybe a few thousand meshes, you can use blueprint. If you need tens of thousands then you are going to have to dive into C++ or wait for Epic to bring a better solution to blueprint.

Or maybe the people making the voxel solutions in C++ will have some blueprint crossover before Epic gets to it. You might try and work with them to see how feasible that is.

Thanks for the reply Zeustiak,

I wasnt aware that C++ had so much performance leg room over blueprint. My 20’000 box grid freezes for about 30 seconds when you go to play. Thank you for the advice.

C++ is about 10 times faster than blueprint, but that is more on the logic side and isn’t an issue for the vast majority of systems.

The area where the C++ people have the advantage in voxel worlds is that they can draw geometry without having to rely on static meshes which just take up too much memory for hundreds of thousands of them to be in a scene.

You are probably using plain static mesh actors, but if you switch to InstancedStaticMeshes then you should be able to handle 20K boxes with a small bit of lag. It gets worse from there though.

Unfortunately i thought of that but i am spawning BP’s not just plain static mesh actors. I might see if i can use static mesh instances instead of BP’s. It should be possible to keep the logic of the boxes by shifting it to the character BP.

Spawn a BP that then spawns the instances, and which can also spawn more instances as required. As long as you index each box in an array you can use that information to do whatever you need on the location of that box.