Kamis, 03 Januari 2013

Block Colours

I've started adding vertex colors to the blocks, this is actually the first time I'm differentiating between block types which is exciting, also it shows the terrain generation a lot better along with it's flaws. I think I'll be sticking to these block colors for the time being as mobile platforms won't be able to show the textures anyway.


And in first person:

templates-office.com Voxel Dwarf Game

Terrain Generation

I've started using Perlin noise instead of a height map to generate the terrain to have infinite generation and be able to generate caves and caverns as well as the surface of the terrain. The results have been encouraging but there's still a lot to be done to ensure that it creates a realistic surface with mountains and plains and other natural elements such as rivers and lakes.

First thing I generated was some rolling hills with a 2d Perlin noise function, looks good but too boring for gameplay.

Then I generated some 3d noise which made this alien landscape.

I modified the 3d noise function to create a slightly more realistic terrain, here by changing the thresholds for what makes a solid block dependent on elevation so that the lower levels are almost solid with more caves on the way up to the surface, then the surface gives way to mountains and floating islands. It's not realistic enough but if I hadn't used a linear change it might have worked better. 


Lastly: Layers upon layers of 2d Perlin noise generated terrain on top of each other, this is how I plan to make realistic terrain. Starting with a mountain layer I got tall mountains and large valleys, then I placed a layer of stone starting from the bottom replacing all air blocks in the way up to around 30 meters, then a layer of dirt replacing air up to 34 meters and lastly adding a layer of dirt on top of everything with a between 0 and 4 blocks deep to put dirt on the mountains and add some more noise to the surface.


templates-office.com Terrain Generation, Voxel Dwarf Game