I reckon this has already been discussed a lot, but I felt like starting a new thread as I ran into several problems trying to create my own voxel terrain implementation.
There are engines like Cubiquity and VoxelFarm, but they require licenses costing 200-300$, while I don’t even know if I’m ever going to release a game at all.
That’s why I worked myself through several tutorials and tried different demos and even complete projects, but somehow all of them seemed rather impractical to work with…
First I tried following this tutorial series by Brandon Garvin. He uses the PolyVox library to create a Minecraft-like voxel world. The well made tutorial explains everything to the extent that an Unreal novice can at least reproduce it. However, it only shows you how you can use PolyVox to render a cube based terrain. PolyVox also allows smooth voxel terrain through the Marching Cube Algorithm, but the documentation of PolyVox itself is rather scarce, so this might not be the perfect solution.
I also took a look at this project, which is a pretty good implementation of a smooth voxel terrain. I managed to build it for my version and could take a look at his code, but I can’t really learn anything from it. Although he did a decent job with the project itself, there aren’t any comments to explain what’s going on. The only comments you find originate from libraries and code pieces he took from an unknown source.
What is interesting: both of these projects render the mesh at runtime. You cannot build a map and design it in the editor (which could be an important to some user). On this blog, Rune de Groot demonstrates what he created for his college projects. He also shows the editor plugin he created so you can manipulate your map like you would with a classic terrain… Sadly, he only has a demo game, and not a project. There is one link to something like “see how the voxel terrain is made”, but it’s outdated and only gives me an error.
In these tutorials on 0fps.net I learned some stuff about Marching Cubes and other algorithms, but my intellect doesn’t seem to suffice for implementing this in code. There are other interesting posts by Paul Bourke, who seems to be well-known for working on this subject. He even provided code pieces, but I am not quite sure where to put these or how to use them. Nvidia has a thread on that topic, but… well. In one of these I read that if you’re already able to render cube terrain, you can render smooth terrain in just a few simple steps… The only difference is that your voxels won’t only store a boolean (wether there is volume or not), but instead holds a float in order to move the vertices so you get a smoother mesh. Interesting, but then again, I don’t know how to implement that…
I then stumbled upon this very interesting video which shows an implementation of a voxel based terrain in Unity. I tried to rebuild this for Unreal… I don’t know if I lack the C++ skills to actually work that out (I am more a C# guy) or if Unreal just isn’t suited for voxel meshes. The first problem I encountered was the lack of a Perlin Noise function. I tried the Simplex Noise plugin by DevDad but only got build errors so I gave up on it. Then again, I’m not sure if there is anything like Unity’s “TerrainMeshGenerator” shown in the video. You basically just have to feed it a voxel data cloud and it drops you a mesh. I am not familiar with how the ProceduralMeshComponent (or Koderz’ RuntimeMeshComponent) works, maybe it really is just that easy…
I guess, with a good bit of work, I’d manage to build my own voxel system, BUT I personally think voxel games are somewhat essential nowadays, and I think there should be an ‘official’ Unreal Engine 4 system to support them. I mean, people who are familiar with C++ might come up with a solution themselves, but other who are bound to Blueprint or just can’t comprehend the background of all this (like me) get stuck.
I’m dreaming of an easy-to-use system that works a bit like the Terrain editor. You could either start a new voxel mesh and manipulate it in-editor (or during runtime), or you can choose to make it procedurally generated (Perlin noise, other functions). There would be the option to make it cube based (with a few parameters like cube size etc.) or smooth (Marching Cube or something similar). Creating ingame manipulation tools would be much easier (drills for smooth terrain like in SpaceEngineers, picks for cube terrain like in Minecraft, or other things)…
As I said, I’d probably manage to work with the stuff I listed in this thread, but it requires C++, so it’s not suited for everyone. The “We Succeed When You Succeed” principle is great, you’re doing a great job and I just love Unreal Engine 4 and all the support and assets that come with it, but I really think voxel based games make a huge portion of modern gaming and there really should be support for it!
Cheers!
Lord
TL;DR: pwease bring voxels to UE4!! :o
EDIT: As you can see, I really dealt with this subject some time, gathered some information… please don’t turn this into some pointless, unhelpfull bashing with comments like “this has been asked before” or whatnot. Let’s keep this a clean discussion, I only wanted to state my opinion on this…