Creating a Voxel-based world

Hi,

I am trying to create a voxel-based world (e.g. Minecraft) and I would like to know how to implement the Perlin Noise/Simplex Noise for use with jMonkeyEngine.

I know there is the cubes plugin for JME but it does not seem to support heightmaps (?).

So far I managed to create normal terrain by using heightmaps (following the tutorial on the wiki), water and a skybox.

Do you have any ideas/reasources on how this can be done?

Cubes supports heightmaps:
http://wiki.jmonkeyengine.org/doku.php/jme3:contributions:cubes:tools:heightmaps

And even, if you don’t want to use a height map, you can generate the noise yourself and place the blocks “manually” according to the data:
http://wiki.jmonkeyengine.org/doku.php/jme3:contributions:cubes:build_your_block_world

For the algorithm itself: It hasn’t to do anything with jME as engine or voxel worlds themselves, google how it works (there is also pseudocode out there I think) and implement it. How you display the data in the end (cube world, jme terrain system map, …) doesn’t matter for the algorithm.

Thanks… completely missed the heightmap tutorial for cubes… couldn’t find it!

What would be your suggestion, using simplex/perlin noise or creating a world from a height map?

What I want is a destructible terrain which has buildings etc … Also, I want to split the map into parts (think of a country in a world map).

You might also be interested in having a look at IsoSurface Demo - Dev blog experiment... (released)

@pspeed wrote a nice demo for isosurface extraction for a voxel based terrain. Links to source etc should be in that thread as well.

Thanks, will look into it tonight!

Note: IsoSurface is not like minecraft blocks. It’s smooth. It does have a noise based fractal terrain generator, though.

Neither Minecraft or my terrain generator create height maps, though… because heightmaps are only 2.5D and our noise terrain is real 3D (ie: you can have overhangs, tunnels, etc.).

Ahh sorry. What I meant is generatea 3D map based on a height map.

You can’t create a 3D world with 2D data. You need more than a heightmap. Several noise generators are used in minecraft, but giving examples of how to go about doing this is far beyond the scope of a single reply. There are huge tasks to overcome such as object count, greedy meshing… The only “out of the box” solution is cubes as described above.

This is an example of greedy meshing done in JME.

1 Like

…so not like Minecraft at all. Yeah, that was confusing then.

1 Like