Jump to content

  • You cannot edit this iotd

Voxel Engine  by gavanwoolery    *****


Time Spent: A few weeks
Date Added: Jan 09 2012 07:08 PM

This is a voxel engine I am working on, as a general purpose engine (maybe) and for a game (more likely).


I am building an RPG / Sandbox game - not really a Minecraft "ripoff" per se, since I have been working on RPG Sandboxes since 2004 Posted Image
Beyond the superficial aspects, I want to create a game with really convincing AI and emergent gameplay. Also, I want to implement strong RPG mechanics (like Rogue, Diablo, Dungeon Master, etc).

Some of the features you see in this image are ambient occlusion, ray-casted soft shadows, voronoi diagrams (3D), simplex noise, polygon-based voxel rasterization.

It also performs mipmapping on the voxel dataset, and utilizes all cores/threads to their fullest for procedural generation. Gets from 60-200 FPS based on view distance and other settings on a mobile chip (Radeon 5970M). Chunks are generated in threads on the fly while the chunks that are ready are rendered without interruption.

It is also cross-platform (uses OpenGL and other cross-platform libs); it will run on Mac and PC with possible Linux support.

You can find out more about this project at http://www.gavanw.com

Also, you can follow me on Twitter: http://twitter.com/#!/gavanw

[Quick update, added a grass image]  
C++, OpenGL

  • You cannot edit this iotd


Jan 10 2012 10:53 AM
if you really do cross platform development, then Linux porting should be easy. I may help you in that.
Btw it looks real nice!!! I really like that doesn't try to look like minecraft. Is there a reason why the rocks in the foreground look pixelated?
Jan 10 2012 12:32 PM
Looks really nice! Are you using the same approach as in Silvermans Voxlap?
Is the ray casting done on CPU or through shaders/cuda etc?
Also are you approximating the AO with a volume texture?
I look forward to seeing more from you about this project,
I abandoned my shader-raycaster after accomplishing everything i wanted in terms of rendering, because i found that my technique was too slow for mainstrem hardware.

Keep up the good work!
Jan 10 2012 12:35 PM
Just saw the polygon-based voxel raster bit! Incredible! What is your polygon count and your point count, respectively? (I asdume you have some particle based voxeks in there, too!) :-)
Jan 10 2012 04:23 PM
@Yours3!f -
Yeah Linux should be very easy - I currently compile on a Mac with g++. The rocks in the foreground look pixelated, but they are actually "voxelated" - that is, you are just seeing each voxel that the rocks are composed of.


It does look a lot like Silvermans Voxlap but is completely different in code (he uses very advanced software rasterization, I use relatively primitive hardware/polygon-based rendering techniques). I too did try to do raycasting, but found it to be too slow (at least without crazy optimization). The polygon count is very high, I dont have an exact figure on hand (I will determine it soon), but it is able to pump out a lot of polygons because they are (kind of) sorted front to back (on a per-chunk basis), and very little pixel/vertex shader code on each one.

AO (and all lighting) is semi-static (can be updated every couple minutes though, for daylight changes), and baked into the voxel/polygon color, another reason for the speed :)
Jan 10 2012 07:01 PM
A couple questions:

So how much memory would all this procedural generation take up in a save game or etc.? It sounds like a lot more info than minecraft, and I'm imagining savegames possibly getting rather bloated.

Also, any plans on texturing?
Jan 10 2012 07:16 PM
@ "Frentic Pony" ( Nice name :] ) -

So here is how it works:

Almost all data is generated procedurally, but there are special entities where the voxels are explicitly specified (mostly things like in-game items such as weapons, armor, food, etc). Overall, the minimum footprint for the game will be pretty small (everything together is currently less than 50k in size!! - but will probably be quite bigger in the future).

Saved game states will not take up a huge amount of data - almost everything is generated from much smaller data (i.e. a building only stores location of the walls, height of ceilings, materials used, etc). Damage/digging/modification is stored on a per-instance basis though. Most over-arching actions in the game are stored at a higher level (for example, one political faction over-taking another). But this stuff is a ways off still, obviously :)

So what takes up the most space? Caching. The player can allocate how much disk space - and even which disk - they want to use to cache the data. This will store every block (locations are implicit though) of any procedurally generated data (at least the CPU-intensive part of it). On the plus side, cached chunks load almost instantly. :)

As far as texturing goes, the every voxel will have material properties (how much light is reflected, ambient lighting, etc). Each voxel forms its own 3D texture - if I wanted to, I could vary each of the voxels in the image with a bit of perlin noise to give them a more "textured" look. There will be no 2D (or surface) texturing) - this is good because I do not run into many problems with UV coordinates - rather all textures are based on the object space of the voxel.