Unclassing some PolyVox code

I visited Munich a couple of weeks ago and traveling by train was the cheapest and easiest option when coming from the Netherlands. It was still a lot further than I initially expected (at over 10 hours each way) but I was pleasantly suprised to find the trains had power sockets for each seat. This meant I was able to keep my laptop running and crack on with the ‘unclassing’ work which has been mentioned a couple of times in the forums.

So what does this involve? Well, most of the algorithms in PolyVox are used by declaring a class and then calling the ‘execute()’ method, but in many cases it seems that a single function call would provide a better interface. For example, the Raycast class was typically used as follows:

RaycastResult result;
Raycast<SimpleVolume<int8_t>> raycast(
    &volData, start, direction, result, isPassableByRay);
raycast.execute();

if(result.foundIntersection)
{
...
}

It seems like overkill to have to declare a class (two if you include the RaycastResult) for something as simple as performing a raycast. So I’ve modified the code such that you can now do the following instead:

RaycastResult result = raycastWithDirection(
    &volData, start, direction, raycastTestFunctor);

if(result == RaycastResults::Interupted)
{
...
}

As well as being conceptually cleaner, note that you no longer have to specify the volume/voxel type as it can be deduced from the first parameter which you pass. The old version of the code also needed to store the callback so that it could later be called by execute(). This required the use of std::function, but now that there is no need to store it we can use the regular STL callback approach instead.

I made some other improvements besides simply unclassing this functionality. There’s been confusion in the past over whether the two vectors passed to the raycast should represent a start point and a direction or a start point and an end point. Both are useful, and the naming of ‘raycastWithDirection()’ and ‘raycastWithEndpoints()’ should make it clear which one is being used.

There’s also no longer a separation between a version which uses a callback and a version which doesn’t. A callback must always be provided, and is responsible for determining whether a ray can continue as well as performing any other logic such as changing the state of voxels along the ray.

It is likely that some other PolyVox algorithms will be unclassed in this manner, but as shown on our mindmap we only wanted to do the Raycast for the next release. Actually I also did the AmbientOcclusionCalculator (now calculateAmbientOcclusion()) as it serves as a good test of the raycasting functionality, but in general we want to see whether this process has any drawbacks. So let us know what you think…does it make sense to unclass more PolyVox algorithms?

Share

Updating the PolyVox documentation

Lack of documentation has long been a thorn in the side of PolyVox users, and it’s something we’ve been promising to improve for a while now. In particular we wanted to make a special effort before the next release of the library. I’ve spent some time on this over the last few weeks because I’ve been traveling quite a lot and my laptop isn’t really powerful enough for any real development. We’ve uploaded a preview so you can see the work-in-progress documentation for the following areas:

The API documentation for the CubicSurfaceExtractor has also been updated to include more details and diagrams about how it behaves.

Hopefully it is already useful although it is a long way from being finished. We don’t expect to get it all done before the release but we do want to show that some progress is being made in this area. Getting proper documentation in place will be important to improving the accessibility of the library and allowing people to decide if it is the right choice for their projects.

The index pages for the manual and API docs are below but be aware that some of the entries are just stubs:

We’re interested in feedback on how it’s shaping up (you can ignore typos for the moment as we’ll come back to those later) so do let us know if it makes sense, if it’s the right technical complexity, and whether it covers relevant material. Suggestions for the FAQ are also welcome.

Share

Some PolyVox Updates – Git and CMake

We’ve been very busy here over the last few weeks with Voxeliens related things so I though I should send an update on what’s been going on in the area of PolyVox. There’s been two main changes recently which I hope will help make things easier for people as we move forward.

CMake Folders

The first thing we’ve done is to start using a nice little feature of CMake to make working in Visual Studio a little nicer. Before this change, the Solution Explorer looked like:

Obviously, this is a little hard to work with since all the tests, as well as internal targets like ZERO_CHECK and _PolyVoxCore are included in the list. What would be ideal is if it were possible to organise the targets into a hierarchy which matches how the code is logically organised. I found a blog post showing how CMake can do this. First of all, you must enable a global CMake property to turn on this feature.

set_property(GLOBAL PROPERTY USE_FOLDERS ON)

Then, for each CMake target, you mush set a property which defines the “folder” in which it will appear. For example, for the PolyVoxCore target, we add the following line to its CMakeLists.txt file:

set_property(TARGET PolyVoxCore PROPERTY FOLDER "library/PolyVoxCore")

Once these are added to all the targets you want to categorise, you will see something more like this in Visual Studio:

Which has put everything in a more logical place. This was added to Git a few weeks ago in this commit.

Git Branching Model

The second “feature” we’ve recently added is a new way of working with our Git repository. Up until now, we’ve simply done all work in the master branch (perhaps with the occasional local topic branch) and so it’s sometimes been the case that the version of the code in the Git repo hasn’t been in a compilable state. As we’re currently working towards making a proper release of PolyVox, we decided that we should be more structured with our usage.

I’d heard good things about Vincent Driessen’s “successful Git branching model” and after reading it through we decided that it would be a good model to follow. Even better, he provides a cross-platform set of Git extensions called git-flow which make the whole process painless.

As of today, we will be using the new branching model. The master branch will now only contain released versions of the code and if you want to get the latest development version, you’ll have to check out the develop branch. When browsing the web interface at Gitorious, you’ll see that you can switch between branches by clicking the name in the grey box at the top or in the right-hand panel when browsing the source tree.

When it comes to release time, it’s simply a few commands to merge the develop branch into the master branch and tag the commit.

What this means for users is that we’ll be making more regular, stable releases and the git repository will be in a much more stable state for you to use.

Share

Desura, IndieCity, Greenlight… Voxeliens is everywhere now!

So we’ve had a pretty busy week! We’d been meaning to add Voxeliens to Desura and IndieCity for a while now and we finally got around to it. But then Valve suddenly launched Steam Greenlight so we had to make a quick dash for that as well. We were very keen to be on Greenlight as soon as it went live because it had an inevitable wave of publicity which we wanted to ride.

So you can now buy Voxeliens through Desura and IndieCity, and these are both very popular indie distribution platforms with a wide range of games. You should probably check them out even if you’re not after Voxeliens. The idea of Greenlight is to eventually get the game on Steam, but there’s still an air of mystery around the process and whether it will achieve this end result. But a vote would certainly be appreciated!

Desura Digital Distribution

I think this more or less wraps up our attempts to push Voxeliens onto distribution platforms. Matt’s had a busy summer between CERN and Fermilab but is hoping to get back to the Linux version soon, and I’ve also got a few loose ends to tie up. One thing we’ve learnt from this process is that making the game is only half the battle… and there’s plenty still to be done after it’s ‘complete’. Still, we do feel that the dust is finally starting to settle 🙂

Share

Voxeliens is now on Indievania

Just a quick note to say that Voxeliens is now available to buy on Indievania. I don’t think this site is as well known as the likes of Desura, but I must say they were really easy to work with. It only took an hour to set up the account and upload information about the game, without any messing about emailing contracts and that kind of stuff. So if you’ve got a game you want to distribute I’d recommend at least giving them a look.

In related news we were unfortunately rejected by Steam, but this wasn’t a big surprise considering they are in the process of switching to their new Greenlight system (which they suggested we try instead). Greenlight will be going live in the next few weeks, so if you’re a Steam user then do come and vote for us when the chance arises 🙂

Share

PolyVox on Android

Following a previous post about PolyVox on iOS, I’ve spent some time over the last few weeks experimenting with RIM’s gameplay engine as a basis for future projects. Naturally this has involved integrating it with PolyVox and today I have some initial results to present. The video below shows gameplay and PolyVox working together on my Samsung Galaxy S Plus:

The voxel world is one of the levels from Voxeliens but this doesn’t necessarily mean we are bringing Voxeliens to mobile (we might, but we’re just experimenting for now). It was basically just the data I had closest to hand, and the volume dimensions are 128x128x32.

To be honest I’m pretty amazed at how well it runs! I’m seeing a steady 40-50 frames per second and this seems to depend on how many pixels are being drawn. I need to do more investigation into the performance bottlenecks though. Also, be aware that this is a debug build as I’m new to Android development and I don’t know how to do release builds yet (it requires some kind of signing I believe).

Getting PolyVox to build on Android was not too difficult. The only problems were complaints about std::function and about throwing exceptions. For now I just cut out the offending pieces of code but we’ll have to come up with a proper solution in the future.

I really like RIMs gameplay engine, and if we do decide to use it for future projects then it opens up a lot of platforms for us. And after all the work we did on Voxeliens it’s great to be getting back to playing with technology again 🙂

Share

PolyVox on iOS

The blog’s pretty lively this week 🙂 Well there’s one more thing I thought might interest our PolyVox users. We were sent this on Twitter yesterday from someone we met at Develop (it was the first time we heard “Hey, you’re the PolyVox guys!”). It’s a video of PolyVox running on an iPad 2:

You can right click to watch the video on Vimeo, but I’ve reproduced the included information below:

“Met @VolumesOfFun at Develop, discovered they hadn’t tried their voxel meshing library on iOS, decided to spend an hour or two hacking something together to see how fast it ran. And then take a pretty shoddy video cap of it!

Mental note: buy an HDMI capture card.

30x20x30 voxels, constantly regenerating all 18k cells and resulting mesh; ran at 25-30hz on iPad2. (the voxel data generator was multithreaded, but PolyVox isn’t)”

Thanks for showing us this, and let us know if you do more PolyVox work in the future!

Share

A mind map of our thoughts

Despite being brothers, Matt and I actually live in different countries and so most communication is done by email or via the forums. But as we were both in the UK last week we took the chance to discuss the various things which were on our minds regarding our projects. We didn’t get as much time as we would have liked, but none-the-less it was very useful and we produced the lovely mind map below:

Of course, it’s more useful in the context of the discussion which we had but we thought it might be interesting anyway. We’re going to update it from time to time and use it as a method of tracking what we’re currently thinking about. Some of the key points:

  • Work on Voxeliens is mostly focused around distribution at the moment. Matt is talking to Good Old Games and we sent off our Steam application at the weekend. So fingers crossed for that! At some point I’m probably going to investigate the possibility of bringing the game to mobile devices.
  • PolyVox has picked up again with a lot of commits recently. We’re focused on trying to get a release out so we can then think about integrating other peoples contributions. On that note, Matt has pointed out that we are not using Git very effectively (I basically treat it like SVN) so we will investigate something like ‘A successful Git branching model‘. This should keep Git head a bit more stable.
  • We’ve vaguely discussed a future game project but with no details yet. We’ll probably look at integrating PolyVox with a complete game engine (rather than separate graphics, physics, sound, etc libraries) so we may do some investigation into the options here.

We’ve decided we should try and be as transparent as possible so do ask if you have questions about our plans.

Share

Second Day at Develop Conference

Yesterday was the second (and final) day of the Develop Conference in the UK and once again it was great fun. It was a little quieter than the first day, but this was a welcome break as it gave us more time to talk to people in depth.

We’ve had plenty more people come by to play the game, and you can see one session in action in the picture below:

A visitor to the stand plays through Voxeliens while Matt watches.

Some of the players have been really quite good, with one player in particular getting to level 10 and achieving a high-score of 55470. I’ve never got to level 10 myself and it’s a pretty terrifying place to be! By the end of the conference the high score table looked as follows:

'DTGENT' was the only player to break through the 50000 barrier. Well done!

We also got interviewed by Playr but I kept glancing at the camera instead of the interviewer so I’m not sure if they’ll use the footage. There was no preparation time so I was just making up stuff to say on the spot 🙂 Well, I’ll post here if it does get used.

Although the conference is now over, Matt and I are going to be in the same place until the weekend (we’re usually in different countries) so we hope to sit down and discuss our plans for the future. Stay tuned for more information once we’ve done this.

Share

First Day at Develop Conference

Well, we’re finally here! Matt and I both arrived in Brighton (UK) last night where the conference kicked off with welcome drinks and a screening of Indie Game: The Movie (great film for those who haven’t seen it). There was lots of socializing and it was a good opportunity to meet fellow developers.

We were up pretty early this morning because we had to set up the stand before the conference started. It all went pretty smoothly and I’m really pleased with the Voxeliens poster we had printed. We also had the idea to make a large origami voxelien but this turned out to be too much work. You can see the stand in the picture below:

David manning our stand at Develop

There has been a fairly constant stream of people coming to try the game and most seem to like it. The simple nature of the game seems to work well in a situation where people spend just a few minutes at the booth. Even David Braben (creator of Elite) stopped by to have a look!

Having to man the stand meant we didn’t get to many of the talks though. The only one I went to was a Q&A session with the Steam Team, who were talking about their plans for Greenlight amoung other things. We’re hoping they’ll find time to drop by the Indie Dev Showcase tomorrow.

Anyway, we’re both really tired after the long day and our throats hurt from talking so much! But do come and say hi if you’re around tomorrow 🙂

Share