Feature 01: The Voxel World

I have a confession: my current implementation of the voxel terrain system uses a Unity Plugin called VoxelPlay. It is a great piece of work by the team at Kronnect and has saved me hours of development work on the base terrain engine. I managed to pick it up in a winter sale for half-price so if you are looking to roll a similar game, look out for it then!

As with all plugins like this one, I have had to do significant work to modify, extend and integrate it with my existing system, so please don’t think this is just a run of the mill asset flip. In fact, I did extensive development on Voxel engines prior to plumping for a third-party Development around Voxel Worlds for me went from:

  • Iteration 1: Creating a semi-realistic marching cubes implementation that was overly complex and required a lot of time to maintain.

  • Iteration 2: Creating a simpler more cartoon looking block world similar to VoxelPlay, with less features, but precalculated into my terrain database. This worked well for me and you will be able to see it in some early screenshots, but it was optimised for small arenas only, and I really wanted to model a large more open game world for my story campaign.

  • Iteration 3: Integrating VoxelPlay with heavy modification, plugins, partial classes and wrappers. Kronnect’s code can be hefty in places and their use of partial classes is a downside in my eyes, but I have managed to rewrite some areas, and modify others so that it is seamlessly integrated with my own world engine, game framework, character controllers etc.

The main reasons for using VoxelPlay is that is performant, scalable and I have to do less maintenance on it than my own custom terrain engine. These are some key design criteria so I wanted to be able to mature without spending serious time on terrain to the neglect of the rest of the game. Introducing this system at a later stage is not without its cost however. I have switched off VoxelPlay’s version of a lot of already inbuilt features to my game and prettied the world up with some of Kenney.nl‘s great textures. I have had to rewrite my construction system for buildings and rework hit mechanics, AI and attack systems to play nicely with it.

One of my extensions to the world is to combine terrain file loading with a layered procedural terrain over the top to allow for procedural tweaks to a real world terrain map. For my story mode, I am using a map of the UK and I overlay (or underlay) this with procedural underwater terrain, exaggerated mountains and a cave system. Other extensions I have made include prefab building mechanisms (rather than blocks), randomised procedural villages, noise based biomes and biome clutter.

In the end the whole system seems to work well, and features such as far terrain visibility and clouds are things I had not got round to implementing on my previous iterations that I effectively get for free. I am glad I took the leap to VoxelPlay as it has freed me up to get on with more of the game making in my limited free time as a solo indie developer.


Posted

in

,

by

Tags:

Comments

Leave a Reply