I couldn’t resist the urge to implement the so-called smooth lighting which is also used by other voxel worlds. Basically it is an interpolation of the lighting values that gets received by a vertex. At first, I implemented some very slow naive algorithm, but I soon discovered the splendid article on Ambient Occlusion from 0fps. It also explains how to correctly interpolate your lighting values. The added benefit is that you get ambient occlusion for free. It looks really nice, and realistic in a scary way.
It is a dark place out there, especially at night. I’ve made some huge progress on the engine the past few weeks. I threw away my threading code and started focusing on getting some rendering features working. Instead of using threads, I currently just use a work queue where maximum one task is executed per frame. After some clean ups I will identify the critical sections and create a more robust threading/worker system. But for now, it works well enough apart from some hiccups.
While implementing the lighting code, It took me some effort to get the flood fill algorithm working across chunks. The problem with chunks is that you have to think twice, because there are a lot more (literally) edge cases
Yes, I’m still working on this. Some screenshot of the latest version of the terrain generation:
The advantage of having periods where you don’t touch your code for a long time is that you will get fresh insights on it. The downside is that it takes more time to pick up where you left. I am quite happy with my terrain generator, but I think it lacks some pretty trees…
Please let me know if this works for you. It probably still has some small bugs, but the basics should work. I also ported the complete Level Editor. I still have to find a way to allow saving your own levels. It would be awesome to be able to share your own designs and play levels from other people. Suggestions on this part are also appreciated.
Have fun playing Oemfoeland 5!
Today I have relocated this website to another host. As a result, some images and downloads will be temporarily broken. If you really want to download something and it’s urgent, don’t hesitate to let me know
Currently I’m working on ambient occlusion. I finally fixed a long standing bug involving color arrays. In the end it was something really stupid. Some new screenshots soon!
To generate the terrains of Oemfoeland, I use Simplex noise. A noise function gives always the same result for a given set of coordinates. You can do a lot of interesting things with this noise. With some tweaking on the numbers, you get landscapes like these:
These landscapes are very promising, I lost some time myself exploring this endless world. It’s very addicting! It’s an infinite sea with islands, coasts, bays, grasslands and mountains. Now it’s time to add some real content and gameplay. The next big thing on my list is physics. Now you just fly through the world without any collision detection or gravity.
I secretly submitted the demo Voxeland (a non-interactive version of Oemfoeland) as a PC demo competition entry with some nice music at Revision 2011. It currently only works on Windows, sorry. (Mac and Linux availability are for my next showcase.)
You can press G anytime to stop the camera. You can navigate the infinite world yourself by using the keys W, S, A, D, Space and C. You can also place and destroy blocks by clicking your right and left mouse buttons.
Download Voxeland (28 MB)
It has been a long time since I last updated this blog. This is because I didn’t make any progress for some months. Some problems that were difficult to solve and transparency bugs stole a great deal of my motivation.
Transparency is a real bitch when you are developing a 3D scene. When looking through some transparent blocks, half of my chunks were not rendered at all! This week, a colleague pointed out that you have to render all your transparent objects at the end. You also have to sort them from far to near and render them in this order. I tried the first remedy and yes, it worked! Sorting, on the other hand is more difficult and only remedies the fact that you cannot see some other transparent objects. I will solve this issue later.
Another motivation killer was the fact that I didn’t like the performance of my virtual world. I have some separate thread that loads chunks into a VBO in a queued fashion but it gives me huge performance hiccups. Another performance eater was the visibility optimizer. What it does is this: it removes all faces that are facing a solid object, as you cannot see them anyway. Every time I loaded a chunk from disk, I recalculated those extra data. To solve this performance hit, I just save an extra file containing the visible faces with each chunk. The result was very noticeable, but I still have the VBO construction spikes.
By the way, I still didn’t had time for creating my own textures. I think that I first want the engine to be stable enough before I can begin to think about fancy stuff like this.