Best voxel library

I know this question may be a bit contentious, but after googling and searching for the forums, I couldn’t really discern which is the best voxel library for Jme, or even if there is one that, is relatively complete and good enough to make a game with. I found a few, but without testing them all out, I can’t work out if they are working or any good. Any pointers would be much appreciated. Thanks.

I know there is one in the contributor repository called bloxel or something. Not sure about any others, though.

I think the reason there aren’t many is because it’s actually really hard to make one. I think people see blocks and presume the graphics quality relates somehow to its simplicity. In a way they’re right; the amazing thing is how the multitude of problems were overcome in a simple and elegant way, but those problems are vast and complex in their design. Greedy meshes, cellular automata, picking, ambient occlusion, materials, data packing, water simulation… the list goes on and on. In all honesty it’s one of the most complicated of games I could think of to attempt. I’ve seen many tech demos but none that have them all except mythruna.

It might be quicker to YouTube some searches for jmonkey voxel demos and see if they are signed up here to ask them directly.

If all else fails you could take a look at Paul’s muthruna and use a java decompile to see the code as an educational reference to see his design structure; it often gives insight.

Other than that there are open source implementations for Minecraft servers and clients that again will help you understand how all of these problems were solved. The Minecraft wiki also helps a lot. It explains how they pack data and again provides insight on the inner workings.

I realise this isn’t the answer you wanted, but these were the processes I went through whilst making a terraria clone for fun.

jmonkey contrib repo

Spout - minecraft client

Paul Speed’s voxel game written using jmonkey:

Minecraft wiki chunk format (an example of freely available information): Chunk format – Official Minecraft Wiki

SpigotMC - a plethora of voxel-oriented java code:

1 Like

Thanks a lot for the detailed reply. It explains why there’s no “complete” JME voxel engine. Despite this, I’m going to attempt to create my own. :slight_smile: No doubt I’ll find out soon what the real roadblocks are!

There’s the cube engine is I think one of them.

I guess the issue is that making a basic array to blocks implementation is pretty straight-forward… but then everything after that is a design choice with significant ramifications. Like, the cubes framework everyone always complains it doesn’t have paging support built in, etc…

In the end, it’s all of the other stuff that matters. I wrote the original Mythruna engine over a weekend. It was still never a game… never had mobs, weapons, etc…

And all of that is basically the same in a non-block world. Anyone who can’t make all of those parts in a non-block world is going to end up stuck at that. I know how to do that and still didn’t get it in… kind of needs to start from the beginning.

1 Like

recent experience: it took an evening to author a “voxel” mesh generator out of my head, and mouse interactions to select boxes or neighbors, then add or remove boxes. It’s very simple and IMHO worth doing from scratch.

Right, I had a go at creating my own ultra-simple voxel engine, and it was pretty straightforward to create something that used 6-sides quads and hides a side if there are two blocks next to each other etc… However, it wasn’t too long before I ran into memory issues, so I abandoned that.

I then came across the pretty excellent Blocky (GitHub - boogie666/Blocky: Voxel Engine for jMonkey) which seems to do everything I need, and with very simple code, so I forked that. I’ve just added a modified version of it to my multiplayer FPS engine, and I now have a multiplayer FPS with players running about in a voxel world. Wahoo! :slight_smile:

Cool. Now comes the really hard part. :slight_smile:

I thought I’d done the really hard part…?

So you already have mobs and items and game and stuff? If so then that’s cool. But that’s the really hard part.

I’ve written two Mythruna engines so far and don’t have any of those things. (Well, the first engine sort of had items.)

1 Like

I’ve already got a regular multiplayer FPS game with mobs and collectables (nothing like Minecraft but thats not my aim). I’m going to use the voxel code to add destructable walls to it:-

1 Like

Greedy meshing is something you should really look into. The youtube link below also has a github repository - and it’s even made in jmonkey.

And for collision it’s relatively nonsensical since you’re using blocks - just use the normal :slight_smile:


I did have a quick look at GreedyMesh, but when I ran it, it just drew a wireframe cube so I didn’t investigate any further. I was rattling through lots of repositories, so I didn’t spend too long on each one.

Looking over the code by eye it looks like it creates a chunk of voxels and then invokes the greedy method. So what you see is a chunk of voxels merged into a single quad. If you change one of those voxels and invoke the greedy method again that’s basically all there is to it. Off the top of my head the code sets a type integer which I presume is an identifier for what that voxel is (dirt, stone, etc), including being able to set a material upon it, most likely a texture atlas or array - which you’ll have to set up yourself. You could just use colours directly in the shader to start.

It’s a nice little setup tbh. It has a lot going for it in terms of a starting point.