Hello,
let me introduce myself. I am Remy, 28years old and ~5years working as a JAVA consultant. When seeing the rise in populariy of minecraft, I was intrigued that this game was written in JAVA, knowing that the general assumption is that JAVA is slow - I am sick of hearing this -…
So I looked around a bit, and noticed JME. Looking at the projects (Mythruna = awesome!, Cubes was also very helpfull!), I bought the book a few months ago and started playing around with the engine.
After getting to know the basics of jme, and reading some info on voxel engines, I wondered if could pull of a very basic voxel-engine (cartoony look and feel with only vertex coloring) on my own.
This is what I have after ~25hours:
this is what I have already done, and what I would still like to do:
* Arange blocks in chunks (ok)
* generate a mesh of the chunk, instead of rendering the blocks seperatly (ok)
* optimize the generation of the mesh, so unneeded triangles are removed (ok)
-
Rendering 4 chunks (16x16x16) containing blocks
Okay, we have something. But rendering 4 chunks with such a complex mesh is not good. Let’s apply some optimization when calculating the mesh of the chunk. -
Rendering 4 chunks (16x16x16) containing blocks, but remove the blocks that are not visible (enclosed)
This is better, but the mesh still contains a lot of triangles that could be removed. Let’s calculate the mesh of the chunk, based on the faces of the blocks that are visible. -
Rendering 4 chunks (16x16x16) containting blocks, rendering only visible faces of the blocks
Okay, now we are getting somewhere. At this point, the mesh of the chunk is not containing any ‘unwanted’ triangles. But we still could merge the triangles of the faces next to each other. -
Rendering 4 chunks (16x16x16) containing blocks, merging the faces of the visible blocks.
Okay, I think this is already quite awesome.
At this point, I noticed that the mesh generation, depending on the complexity of the chunk, could take some time, resulting in some framerate drops.
When I placed the generation of the mesh in a different worker thread, the framerate was stable again.
* create a chunk repository implementation, so the chunks can be persisted and loaded again (ok)
I opted for a file-based repository. I serialize and deserialize a small portion of the chunk - only the basic information that is needed to recreate the chunk - to file. I am happy with the speed so far (loading a chunk takes around 20ms, writing around 45ms).
* use a noise function to create procedural terrain (wip)
This is what I have so far, but very far from done.
todo:
* add some vegetation, trees, flowers, …
* create a day/night cycle
* block picking / adding - removing blocks
* look into LOD
* enable physics
- …