Voxel Plugin For UE4

**Edit

I am doing all progress updates on a dedicated thread now, I have been avoiding posting in here because I didn’t want to spam the marketplace section.

Updates thread is here: https://forums.unrealengine.com/showthread.php?102020-UE4-Voxel-Plugin-Progress-Updates-Thread&p=481581#post481581**

So I have had a Voxel Plugin working in UE4 using a PolyVox back end for close to a year now and have just been sitting on it (was used to acclimate to the engine). I was never intending on releasing it as multiple other efforts were underway and it was a passion project, however all other solutions appear to have either dropped off the map or in Voxel Farms case have a little above indie level costs associated with them.

I also ended up implementing several higher level features that are missing from most packages even in other engines, due to recently received multiple requests for it I started working on the code base again to clean things up and make it viable for others to use.

I just wanted to gauge total interest in it, if it is large enough I would put a lot more framework effort into it and release it, otherwise I would probably just get it clean enough to be satisfied with and give it out to a few with no ongoing support or strings attached (wife keeps telling me to stop putting all my time into things that I do for free :rolleyes:).

Some of the current features:

  • Voxel actor and Voxel Terrain UObjects
  • Colored Cube volumes (24 to 16 bit color support)
  • Textured cube volumes
  • Removed, I no longer think I want to go in this direction
    Has support for marching cubes smooth terrain, feature set is currently inactive as other features get ironed out for the cubic portion (would need more work)
  • Highly multithreaded extraction
  • Gravity support for when voxels are removed below others (currently missing from fracturing but can be added easily enough)
  • A subtractive / additive CSG style brush system that will support copying and moving
  • Flood fill
  • Pseudo Voronoi Fracturing (not using actual Voronoi diagrams as they are too slow, custom octree solution with clumping points used instead, may be changed later).
  • Volume serialization with compression
  • Full Nav mesh support (though a decent performance hit currently, will need to work on it more)
  • Qubicle and Majicka Voxel file format importing
  • The beginnings of an in editor terrain editor
  • Settings to control voxels in a volume and how they break up into chunks
  • An option to group chunks into master render chunks to reduce draw calls or draw them each alone (DX12 would make this defunct).
  • Removed, dynamic in engine lighting is good enough I feel
    A voxel light propagation system (would need more work)
  • Rough multiplayer support with streamed chunks from server to clients.

Some of the missing features:

  • Infinite world support (I did not have a use for this and did not work on it yet, there are also obviously some issues with the base engine currently that also caused me to not bother yet on this)
  • Easy Terrain generation access (I have several noise libraries current attached but have not made Blueprint access to a terrain generation system, would need massive work as I feel a custom solution using some of epics noise functions would be best with the licensing problems.
  • Small memory footprint volume (Have an octree based storage system planned out but have not done any work on it yet), could also use a RLE encoded volume, both would lower total performance other flat array storage though.
  • Streaming in voxel chunks (no work in this yet)
  • Animated voxels (no work at the moment and possibly ever, passing over UE4’s animation system seems like a waste and something more suited to a custom engine that a plugin).

Some videos of testing I did:

Transparency is in

Recent Test of LODs and collisions

I love the destruction! Looks awesome, amazing work getting this all into UE4 :slight_smile:

I would be very interested in this - Would pay for providing that it will be actively maintained. :slight_smile:

Edit: Got a few questions.

  1. You mentioned an in Editor Terrain Editor - How does it work? Is it node based (Similar to the Material Editor), more like the Seed of Andromeda Biome Editor, or Just BP support?
  2. How well does level streaming work ATM? I would like to see this in action. If possible. :slight_smile:
  3. Infinite world Support - What would it take to get that working?

Do it… just do it…

1: The in engine editor I am talking about would mostly be for serialized terrain (saved to the map file) and would be brush / bsp / copy and paste like. Currently I generate a static terrain and lock it by setting it to serialize (it saves and loads from then on out instead of regenerating) and then sculpt over that base. The Terrain generation for non serialized terrain would consist of nodes much like world machine and the like work, with nodes with inputs and outputs that layer over each other to get the correct noise for the terrain required. It could be done in its own graph editor but would be easier and probably more appropriate to just make in BP nodes and send the result to a Uproperty noise variable attached to the terrain to pull the data from. For custom areas of interest Voxel Files with the data in them and the terrain calling a “Custom Generation” delegate event would be the best choice for control from the user I believe.

2: Level streaming with the current setup and serialization should work as expected and as it does with other actors (I will make a note to test this though), the multiplayer chunk streaming I was referencing regards compressing and sending chunk data to clients live so that they can load the world from the server on join.

3: Unreal engine doesn’t support very large actor locations (all actor locations are basic float FVectors instead of something with more capability like a Double), there is work towards supporting it through base world rebasing but as far as I am aware this is an unfinished feature set and is not multiplayer compatible with something where the clients are likely to be in very different locations. As far as the voxel plugin working with it, would have to finish up work on a streaming voxel volume for the server, not the hardest thing ever to do but without multiplayer rebasing working better I am not sure if it is worth the time investment yet.

Awesome - I have posted this on r/voxelgamedev in order to get more people interested. :slight_smile:

  • HeadClot

https://www.reddit.com/r/VoxelGameDev/comments/3p582p/voxel_plugin_for_ue4_give_him_your_support/

I would make great use of this!

I think you should do it :smiley:
there’s very little options for developers to make anything via unreal and i think this would help the niche of devs greatly!

got my support!

Oh that isn’t really needed, those guys generally don’t use Unreal Engine and I don’t want outside support, i’m asking how users of the engine would want it.

Making an voxel RTS and I would like to hear more of this

Yes I am interested as long as the minimum voxel size can be scaled from 1cm UE4 scale on up.

It has a uproperty to set the voxel scale for each actor / terrain to any value. Granted you have to keep in mind that the smaller the voxels are the more memory is consumed per square meter of the stored volume. 1cm scale voxels are not very useable in large (world space) volumes because of the memory and extraction overhead. My test levels are generally 1/10th of a meter cubed per voxel though.

That is pretty much the exact thing that this would off the bat be best for, is map based destructible and buildable voxel projects.

Would be really happy to use that tool! I’ve been working on my own kit for a year or something, and couldn’t get anything to work like I want… You have my interest!

With marching cubes , count me !

Yes! More than yes! Actually I just want some of that sweet source code. I too am playing with UE4 and PolyVox 0.3.1 (Dev) and I can get some basic stuff rendered, but I have weird sine wave issues and I still can’t figure out texturing at all. I really like figuring things out for myself (If it wasn’t so frustrating), but would love to see someone else’s implementation of PolyVox in Unreal!

If you are getting waves then you likely have an off by one error in your generation / filling.

Yeah I didn’t quite fix it, but I found that making chunks with a size of 64^3 or 128^3 give me perfect results, but 256^3 gives me weird sine wave artifacts. I still have zero idea about texturing though, every example I’ve seen online does texturing by manually feeding the verts in idecies to a vertex factory. All of that completely bypasses the class Unreal has given us (which is nice and easy to use) and just makes things complicated. For now i’m just using vertex colors with the MaterialDensityPair.

Exactly what I need in order to start with my Minecraft in UE4 tutorial series :smiley:

I use a my own custom mesh component from before the official one existed, it uses less data per vert and I pass in additional information in the U/V mapping variables as I don’t need them for Triplaner Texturing. Theirs is more for smaller procedural things, you kind of have to roll your own with this.

Ahh, well poo, I was really hoping someone had figured a way to do the per pixel normal using the material editor. Guess I’ll have to figure out how to do it using the “old” method (its not really old, its just the method before Unreal’s). Thanks for the replies, and i’m still interested, that’s for sure!

I am interested will it come with source code to play with?