We’ve been busy, in fact we’ve been very busy and now the game is looking more awesome than ever. The latest development see the start of the inventory system along with some major changes to the “world engine” aspects of the game. Now we have the function to add fully differentiated world types which are procedural generate. Here is a list of the recent updates.
- New terrain system
- Splat Maps
- World Types
Check out that view, it is my first attempt at making a different world type – “dessert”. What you are seeing here is a fully procedurally generated world. So far testing has been done with just a single world type, so the only thing that ever changes was the terrain. It has always been the plan to create more world types, as you would expect in a vast universe. The really cool thing is what has been developed behind the scenes, I’ve set the code up to now make world type generation very easy. All I need now is themes, ideas and assets.
In addition to adding different visuals for each world type I also need to start thinking about different resources. So different worlds generate different types of resources.
New terrain system
Another major change is how we are handling the terrain. The game originally emerged from my Minecraft clone which evolved to a low poly style terrain. That terrain was made up from plane meshes with vertices modified based on the terrain height. Anyway I decided to change direction with it. The decision was down to two reasons, firstly some technical limitations and secondly, user feedback. I still use the chunk style mentality for asset management but now the terrain is based on Unity’s terrain. I simply project my terrain map on to the terrain and it works fantastically well.
Another change I have made to the terrain is in how it is procedurally generated. I wanted the terrain to be more feature-ful, in short – more little bumps rather than just the big smooth bumps.
By using Unity terrain I’ve been able to extend the map very quickly, now each world is 2km wide.
This week I’ve also been able to add dynamic splat maps to the terrain. The splat map is used to paint different textures on to the terrain to give it a more realistic feel. The first test was putting wet sand around the edges of water (as above).
The system now gives me the ability to start adding advanced features to the terrain such as painting rocks on steep hills, different textured areas and maybe even paths and trails.
Optimisation has been planned from a long time and I was going to leave it a little later but as the game expanded I started facing some issues with performance so it became a priority.
First thing I’ve done is make use of the chunk system I created ages ago. Basically each object belongs to a chunk and now only chunks closest to the player are loaded. The advantage is that I have been able to reduce the number of vertices in view from 3 million to 1 million, that is a massive performance boost. The disadvantage is that hills in the distance have nothing on them until you get close. This happens in a lot of game, but when I’m looking at it I am not happy. Some games use fog to limit the effect, I could use this but I have some other ideas to try first.
Another change I’ve made is passing the loading and unloading of each chunk to a separate thread. This reduces the impact of loading each gameobject into the scene. You also get a nice view of distant objects slowly getting populated which is nice.
The final thing on this I have changes is some scripts. I had an update script running on each of the scene objects, it was simply checking a could of things. As the I added more and more objects to the scene it became more of an issue. Long story short – I changed it and now it is better 🙂
I’ve made a lot of progress with the invertory. My biggest headache was using one of Unity’s layout functions and when I moved something the layout messed up. So I created my own layout.
One thing I’ve notices about the inventory is how important it is to the game. Without the inventory system working there is no game. There is still plenty to be done for now.