Hi, a few years ago I started working on some sort of block/voxel engine: YAVE – Yet Another Voxel Engine [Dev blog.]. I got sidetracked (oh look a squirrel!) with other game ideas and tech demos and never continued working on it.
A few weeks ago I checked out the sources again, rewrote it from the ground up and planning to release it in the coming days. I want to include some more fleshed out examples and I need to re-read the wiki pages I wrote, with a more ‘fresh’ head.
So, what is Blocks? It’s a framework to create and render block worlds. It organises block elements in chunks. Each chunk has a node holding one or more geometries. A geometry is created for each block type in the chunk.
The mesh generator also creates a collision mesh for a chunk.
Features:
Not limited to cube shape blocks, also support for slabs, pyramids, wedges, stairs, … It’s very easy to add new shapes.
Theming support, Thanks to themes it’s very easy to change the default images/textures (diffuse textures, normal map textures, parallax map textures).
Pager implementation, Blocks comes with a pager implementation to easily create ‘endless’ terrain. Set your location, and the surrounding chunks will be attached.
Looking around for different solutions for terrain, finally, seeing how nice a block terrain can look after watching this gameplay video I have decided to go with blocky terrain for my next project.
Please do not forget to add Blocks to JME store.
Thanks.
Yeah, I had the same thought when looking at Dragon Quest Builders or Ocean Horn! You can really create beautiful worlds with block-like elements.
The default PhysicsPager creates bullet rigid bodies and attaches them to the physicsspace. see:
But in the end you can use the framework of your choice. The ChunkMeshGenerator creates a collision mesh and you can do whatever you want with this mesh…
I haven’t looked at PBR yet, I kinda avoided it on purpose to avoid getting side-tracked. Again… But it is definitely on my todo list.
It is however possible to add a PBR material and use it on a block:
// register the PBR material
TypeRegistry typeRegister = BlocksConfig.getInstance().getTypeRegistry();
typeRegister.register("my-pbr-material", "/path/to/my/pbr-material.j3m");
// create block that uses the PBR material and register it
Block pbrBlock = Block.create("my-pbr-block", "my-pbr-material");
BlockRegistry blockRegister = BlocksConfig.getInstance().getBlockRegistry();
blockRegister.register(pbrBlock);
In the end the MeshGenerator will create a geometry of the mesh with the PBR material. You will still need to to whatever light calculations you need to do to render it, but I guess it should be possible! Feel free to try it out and let me know
Putting it on the store is on my checklist once released.
Just saw these videos on YouTube, which describe a technique to round sharp edges of a box. I thought you might find this useful for your Block library.
It glances over how to take advantage of SDF (Signed Distance Field) representation of geometry in order to round any shape’s corners and edges.
I have some items on my list to investigate like, LOD, texture atlas support, greedy meshing, etc. I won’t promise that they will make it to the lib at some point, as I do not know yet how feasible they are.
But I definitely plan to improve or add stuff to Blocks. At the moment I’m improving the meshing algorithm to look ‘beyond’ the chunk boundaries. Now when 2 blocks are adjacent to each other, but are in different chunks, the face between them get’s rendered. This improvement will be in the next release of Blocks.
Apart from bug fixes, I expect that new features will mostly come from my own needs in small games or tech demos.
But I really do hope to receive input from people using it, things that work, things that don’t work, things that could be improved, … I guess it’s the same as with your particle library
A new version of Blocks is released. Blocks v1.1.0 is pushed to bintray and is available on the jmonkeystore.
The highlights of this version are:
Updated the chunk mesh algorithm to look for blocks in neighbouring chunks. When blocks are adjacent but in different chunks, the shared face between them isn’t rendered anymore.
Added a lot more blocks
Updated the default theme
Added a new theme ‘Faithful’. This theme has smaller texture sizes and doesn’t use normal or parallax maps. Good for low-end computers.
The complete release notes can be found on github.
I’m planning on releasing one more version of Blocks in the coming weeks before moving on to something new. This next version will probably contain some changes to the BlocksManager and Pager implementations. I’m also playing around with the rounded blocks concept, but I don’t know if this will make it in the next release.
Regarding theming, it might be a good idea to provide an automatic texture packing tool.
So rather than packing the top, side and bottom images into one image in an image editor, we can provide each texture separately and let the texture packer does this automatically using texture atlas.
(Note, I do not mean to pack these into a new image file to be exported to hard disk, I mean that we can register images separately into BlocksTheme builder so it can generate atlas at runtime. The benefit is we can, for example, reuse the side texture with different top textures and also we won’t need to deal with an external image editor tool )
For example,
for top:
for side:
Note, I am not sure if this would be feasible to do in JME, but anyway I hope you find the idea useful.
I love how this voxel engine looks, and therefore I would like to use it in my own project. My problem is that I don’t use Gradle. Is it possible for you to get a .jar version, or tell me how I could get one myself? I completely understand that this may be really annoying, but I would love to use this project!
Even if you don’t make a .jar version, still looks amazing!