Voxels! - Introducing Cubiquity, a voxel plugin built with C++ and PolyVox

This thread has moved! Cubiquity for Unity3D has been released so future discussion will be held in our thread in the ‘Assets and Asset Store’ forum.

About Cubiquity
Cubiquity is a flexible and powerful voxel engine for both the free and pro versions of Unity. It can be used to create terrains with caves and overhangs that can be edited in real time, or to create retro-style environments from millions of colored cubes.



I would be interested in the planet generator. I would use something like this to pull a skyrim; procedurally generated levels with a hand touch finish. How much would this kind of middleware cost?

Looks amazing. Voxels are quite a popular topic around here so Im guessing you will get a big response from the Unity community.

Looking great!

Thanks guys :slight_smile:

Sorry, but I’m afraid that’s not a planet generator. It’s actually just a Mandelbulb (a 3D version of the Mandelbrot fractal). We needed some large data sets for testing purposes and fractals provide a nice way of generating these while still keeping lots of detail.

There may be a procedural generator in the future (or at least an example of how it’s done) but for now we will focus on getting the core working nicely and providing tools for manually sculpting and editing the terrain.

We haven’t exactly worked it out yet. For the full system we will probably be looking at upper end of the price range on the asset store, but we would also like to offer a free version under some kind of personal or non-commercial license. I don’t know whether the asset store allows this kind of restriction though so it’s something we have to think about.

This seems promising! I’ll be sure to follow your progress.

*** Update - 20th May 2013 ***

We’ve been hard at work on our Cubiquity voxel plugin for the last couple of weeks. In our initial announcement the voxel environment was completely static, but it can now be modified in real time. The screenshot below shows some physics object bouncing around the environment while we cut holes in it:

The physics integration also let us create a very basic test game where you can drive a tank around an arena and shoot holes in the walls. This relies on raycasting through the voxel data and this is also performed by the underlying Cubiquity engine. Naturally you can shoot out the floor and then fall through it :slight_smile:

We’re keen to get a preview ‘proof-of-concept’ release out soon (next couple of weeks?) though initially it will only have an interface for programmers. ‘Edit mode’ support is something we’ll add later.

*** Update - 21st June 2013 ***
Hi guys,

We’ve released a new test version showing the integration with Unity’s physics engine. You can now destroy chunks of the environment and have debris bounce around the terrain. Check it out in the video below:

More details and a download are here:

Please also note that we now have a thread in the ‘Assets and Asset Store’ forum as a preview of the software is now available for download. That thread will probably be more active but I’ll post updates here as well to make sure they don’t get missed :slight_smile:

Looking really good! Runs pretty smooth on my old Core 2 Duo. If I blow up too many items and the draw calls get above 1000, then I start to see 15fps. Otherwise I am above 32fps all the time.

-Dane

Great, I’m glad it works well for you. Did you have to change anything to make it run or did it just work? Also, are you using Unity Free or Pro? I was a little concerned that the native code .dll wouldn’t load on other people machines, as I only tested on my dev machine.

I am running unity pro and I didnt experiences any problems when loading it. I had loaded the project and then loaded the volume data as per the instructions. Then I hit play and everything worked fine. I had not tried playing around too much as of yet, but everything ran well.

Dane

Looks amazing, kind of reminds me of minecraft

And also if you go to the edge of the voxel map, will it automatically load more to the voxel map?

Thanks :slight_smile:

At the moment it does not automatically load new sections of the map - we do have some support for this inside our C++ code but it’s not finished and still needs to be exposed to Unity.

Eventually we would like to implement this feature to support large maps (thousands of voxels in each dimension). We’re not currently aiming for ‘infinite’ maps though, unless there seems to be some demand for it.

Infinite would be cool, but Minecraft shows that after a while exploring it can get a bit buggy when it comes to infinite. Large world sizes/sizes we could set would work.

I’m going to have to hang my head and admit that I haven’t actually played Minecraft :sweat_smile:

Would you say that Minecraft really benefits from the infinite terrain? I mean, I can understand that the world needs to be big and that the player shouldn’t reach the edge of it, but surely a very large terrain would accomplish this as well. Practically speaking, how far do players travel from their start point? Perhaps it’s psychological - that the player feels more inclined to explore if they know the world goes on forever?

Anyway, I do think that voxel terrain is often associated with infinite terrain (and also with procedural generation) so we should probably keep that in mind.

This looks good, its just a shame its in C++. C# would have permitted people without Pro to make use of it.

Is there going to be any level of liquid sim or biome generation?

@DavidWilliams

Don’t feel bad! I haven’t played Minecraft either and I love working on voxel code! It is a hobby of mine but I just never had the appeal to go and play Minecraft.

-Dane

Actually this system does work with Unity Free! I know this because I have Unity Free myself :slight_smile:

There seems to be a lot of confusion about the capabilities of Unity in the regard. My current understanding (see here) is that ‘native code’ is not the same as a ‘plugin’. All plugins are native code but the reverse is not true. So Unity Free does seem to support the loading and execution of native code in .dlls, but you can’t use the ‘Low-level Native Plugin Interface’ unless you have Pro.

The restriction seems to be aimed at preventing users from extending the rendering capabilities of Unity Free through plugins, as this would allow users to add things like shadows which are supposed to be Pro only. But this voxel terrain isn’t really a rendering feature - it’s just generating the mesh and adding it to the Unity scenegraph.

Anyway, there’s a download in my last blog post so feel free to give it a try. If anyone at Unity wants to really clarify the situation then that would be appreciated.

Yes, but these things will be provided as examples rather than as core features.

The programming interface to this system is really simple. It basically provides a function to create a volume, and then a couple more functions to get and set the colours of individual cubes. Anything higher level than that will simply be provided as examples (or maybe higher level frameworks), building off existing extensions where possible.

For example, Unity already has extensions for both fluid simulation and for procedural generation. You just need to know how to integrate these into the voxel system, and then you have a lot of flexibility over what kind of game you will create.

Yep, I feel the real world would be a better place if it was made of voxels :sunglasses:

Hey guys,

Over the last couple of weeks we’ve mostly ben doing back-end work (optimisations, mamorry-managment, etc) but we now have some cool new screenshots to show! We’ve used the awesome Detonator asset for Unity to add some really nice explosions, which go well with our destructible environment. We’ve also loaded in a new map (courtesy of ‘Influx’ on the Build Shoot forums) and got a better tank model from the asset store. Check it out!




Driving round and shooting up this environment is really fun :slight_smile: I’ll make a video and demo in the coming few days.