Welcome to this development update. This time we look at what has changed beside the engineering 2.0 update. Less noticeable but absolutely relevant for the success of the further development.
Triplanar world mapping
The code which is procedurally generating the world’s mesh is one of the oldest systems in the game. I started working on it back in 2012. Since then I learned a lot about programming – in general and related to Unity. So the system got reworked several times because it has to process as fast and efficient as possible. You can’t get away with lazy coding if you are dealing with a performance bottleneck.
Now I came to the point where I want to improve it once again. But first I had to prepare a new, more efficient mapping technique. So I’ve changed the level shader to ignore the mesh-uvs and instead generate triplanar mapping coordinates.
Triplanar mapping means we generate texture coordinates procedurally and in our case: directly in the shader. Here is a nice explanation. Here it visually does not change the look of the world but it gets rid of the need of texture coordinates stored in memory. For a big voxel world this can be a lot. Implementing triplanar mapping is just the first step to the next level of world rendering. But it’s an important one.
Everything is an entity
A difficult to visualise new feature is the one regarding the entities system. It’s now responsible for most objects in the game and it allows me to handle them all in the same way when it comes to the core functionality. Now every tree, every character, every sword or rock are sharing the same core logic. So creation, destruction, networking etc. is handled by a shared system which makes it more consistent to work with and thereby less error prone. I’m glad I have it now and a bit angry about myself that I didn’t set it up earlier.
Over the past couple of month I had to come up with a solution that would help me keep track of the constantly growing number of entities. The engineering update alone brought along a whole range of new asset types. So the new entities toolbox allows to quickly configure multiple objects and additionally throws errors if something is misconfigured. Basically it’s a combined spread sheet / hierarchy viewer / editor with a configuration checker.
Beside that there where several smaller additions and improvements to my development tools whenever something could be automated.
So far for today. Thanks for reading and I hope it was of some interest for you. If you want to check back in a week or so the next part of the Pre-alpha 0.2 news series should be online.