0

I have been working on a voxel game for some time now, but all that I have really accomplished was the main menu and an Item system. Now its time to make the voxel engine. I have been searching for a while now to find some tutorials or an ebook that will teach me such, but the best i could find were someones tutorials in c++, but I am making mine in Java. I have dabbled in c++ and c# in the past but it was too difficult to translate i.e. it relied on a class that java doesn't have. What I know is that there are different methods for voxel engines, they all begin with rendering a single cube, and Perlin and Simplex noise can be used to randomize terrain generation.

If anyone could point me in the correct direction, most appreciated. I will be checking back at least once a hour incase someone feels this thread is dead.

SemperAmbroscus
  • 1,308
  • 2
  • 12
  • 23

2 Answers2

2

I'm not entirely sure what you are asking, if you are asking how to make simplex noise, implement it in a voxel engine or how to start making a voxel engine.

If you are asking how to start making a voxel engine I would recommend practising with quads first (2D version) and focus on getting an understanding for the theory. Once you are happy with your understanding you should focus on the voxel class (one cube) - it is very important to learn as much as you can from it, and then add more so you can optimize rendering as much as you can, such that hidden faces are not rendered and even vertices are shared, voxel engines can be the most wasteful renderers if not optimized!

EDIT:
Optimization can be done through many methods, The first and most important is hidden face removal, this involves removing the faces of voxels that are touching which will mean you will need to check of a voxel exists on any given side of any voxel before rendering that face (e.g before rendering the left face, check if there isn't a block to the left). Next is the rendering method, do not render each face or each group individually, group them so they can be rendered faster, this can be done by using display-lists or the more technical VBOs, these ensure the data is in the GPU or the data can be given to the GPU faster, For example Minecraft groups them in chunks of huge 16x16x128 groups and uses display lists. If you really want to reduce every single vertex in memory you can also consider using strip drawing methods (in OpenGL), these will require you to define certain vertices at a certain time in rendering but allow you to reuse a vertex for multiple faces.

Next would be understanding simplex noise, I can relate to there not being much material online for noise generation algorithms, unfortunately I cannot link material that I used as that was years ago. You can implement your noise algorithm in the 2D version to prove it works in a simpler environment and then copy it to the voxel version. Typical usage would be to use the values as heights in the terrain (e.g white=255 = 255 high).

Lee Fogg
  • 775
  • 6
  • 22
  • I have already done a lot in 2D, if it counts, to be more specific I am asking how do you generate substantial amounts of cubes to make what is called a "voxel engine". I cant help but think that I worded that poorly – SemperAmbroscus Mar 19 '14 at 20:18
  • i already knew to make what you call a voxel class, in my case I named it BlockRender, and its responsible for creating a block (cube) – SemperAmbroscus Mar 19 '14 at 20:19
  • @FeatheredOrcian added what I know about rendering voxel engines you seem to want to be able to render as many as possible. – Lee Fogg Mar 19 '14 at 20:44
  • well sorta, i know its kinda aiming high but I am basically making a minecraft clone. but i dont care if it takes me 10 years – SemperAmbroscus Mar 19 '14 at 20:49
  • @FeatheredOrcian I assumed so, I agree it can teach a lot about 3D APIs, [I also tried](http://stackoverflow.com/questions/17155662/) and it took me just under 6 months - and that's just terrain. – Lee Fogg Mar 19 '14 at 21:21
  • I am trying to achieve this project without any outside libraries though i know about java 3d and opengl – SemperAmbroscus Mar 19 '14 at 21:38
  • I also did, I don't like to use them as I want to learn how they work instead, I only used LWJGL to interface with OpenGL. – Lee Fogg Mar 19 '14 at 21:42
  • Funny Enough I implemented blocks and items before anything else, though I cannot say It is fully Implemented until I can physically hold the item. – SemperAmbroscus Apr 20 '14 at 01:43
-6

I would recommend using Unity. The engine is already made and you can add menus and titles with just a few lines of code. All of the game creation is either in C# or Javascript which shouldn't be any huge change from C++. Good luck!

Jordan Schuetz
  • 1,036
  • 1
  • 10
  • 19
  • 2
    OP is asking how to make it in JAVA, plus probably is doing it to learn so simply using something already made is pointless. – Lee Fogg Mar 19 '14 at 19:50