Sorry for the delay, we’ve both been away this weekend, so writing the blog post had to wait until today. Work is slowly moving away from weekends and more during the weekdays, so Sunday blog posts are becoming less relevant. We plan on posting two dev diaries in quick succession in the upcoming weeks to move this weekly update to Fridays or Wednesdays. But not for now.
Anyway, this week I’ve seen some amazing things going on. Our new collaborator Benoit is quickly getting the hang of both Unity and our voxel engine (which we decided to call the Brix engine, like the first dev name of Castle Story). So with his help, new and exciting features have been emerging at a faster rate. Here’s a few of them:
Implemented a form of cellular pathfinding. Last week we talked about an improvement that would significantly speed up our pathfinding algorithm. Well that’s it. Basically we divide the entire walkable universe in a set of large “cells”; large, self-contained groups of tiles that know their neighbor cells. Before letting the pathfinding loose in the single tiles, we make a run in the cells first. This way we eliminate the vast majority of the cells that you do not need to walk through to get to you destination. This way, we can do our path search in a much smaller universe, for a lower cost to the CPU.
Started work on arbitrary path liberties. This is probably the most vague phrase ever, but that’s because we don’t really have a name for what we’re trying to describe. Path liberties is what the pathfinding uses to spread around the universe and find out where it can go, and if two places are linked by a route. At the moment, if you are standing on a tile, the liberties will tell you that you can go forward, backwards, left and right. Unless you are facing a wall. In this case, forward will not be part of your liberties. Arbitrary path liberties is a significant upgrade to our system in that it allows a tile to have an arbitrarily large amount of liberties in any direction possible. An example of this is if you are standing at the bottom of a ladder (yes! ladders!) you can walk backwards, left, right but also upwards! But let’s say the ladders extends downwards as well, this becomes quite complicated, right? Arbitrary liberties helps with that. Also it would help making portals that link faraway places.
Implemented a Level Of Detail (LOD) system. This is probably the most exciting this for me as an artist. Basically, LOD selects different geometry of objects depending on the distance they are from the camera. For example, a tree currently has something like 191 triangles. By itself, this is not a problem, but there are hundreds if not thousands of trees in the world at any moment. This is really bad for your computer and it limits the number of trees we can put on screen. Instead, we create 3 or 4 versions of a single tree with different levels of complexity, and select what version we use according to the distance to the camera. In effect, we hope that the uglier tree will not be so ugly when you look at it from far away. Here’s an example of what I mean:
By the way, you’re not supposed to ever see a LOD3 tree from up close. Don’t worry, you’ll never have to feel that pain. What’s really fun about this is that once we’re done testing this on trees, we’ll be able to scale this system to any object; trees, plants, rocks, terrain and characters. This will allow us to have vast worlds, with lots of objects, and the engine will not crumble under the sheer number of triangles it has to render. Huzzah!
Soundtrack of the week
This week we needed to concentrate, so something a bit more chill felt welcome. In this case, our favorite soundtrack has been Zero 7’s When It Falls.
For appropriate levels of groove, a sound system with good bass is a must.
Thanks for reading,
and keep your stick on the ice!
The Sauropod team
44 Comments for Dev diary number three : Levels of Detail and Awesome