December 2013

It’s no surprise to myself that my attempt to get into the November game jam spirit was a failure. I’ve discovered a newfound love for Unity, but maintaining work on a collaborative project when I struggle to get out of bed in the morning is difficult.  Throwing myself into a large project, like developing a game in a month, was probably not the best way to get out of this rut I’ve descended into since my graduation.  I’m a creature of habit and since leaving University, I’ve not had a routine; to make matters worse, getting into one without an external structure like full-time education or a job is something I’m just not very good at.  The knock-on effect from this is a dire lack of energy and motivation, which is in turn impeding, well… everything.

For December, my task is going to be getting to grips with CUDA, NVIDIA’s GPGPU platform.  I’m going to be working through the exercises in the book “CUDA By Example” and hopefully getting comfortable with parallel programming in the process.  The goal is simple; every day, I’m going to do a bit of programming.  Hopefully I’ll be able to keep that up for the month and maybe move onto something more than just reading stuff out of a book.  Maybe I’ll even rediscover a demonstrable passion for programming that will help me capture that mythical creature known as the “job”.


The proof, however, will be in the proverbial pudding.  I’ve already started pushing some initial exercises to a GitHub repository that I’ve set up for the “project” (, so if I fall behind in making regular commits, can someone please give me a metaphorical slap on Twitter?  Thanks.

Tagged , ,

Spreading Some Delicious Game Jam

*Blows the dust off the keyboard*

After many months, I’m finally writing another blog post.  This feels… strange.  However, I’m going to gloss over my absence from this particular aspect of my online identity and focus on something productive (or something that hopefully will be productive).

I’m going to make a game.

November seems to be the month of the game jam, with GitHub running their second Game Off and Edinburgh Hack Lab running Make a Game Month.  There’s also going to be a TIGA event near the end of the month which will be a more traditional weekend-long game jam, but I’m not sure that kind of time constraint suits me at the moment.  So, with these two game jams staring me in the face, there’s no better time to get off my increasingly padded behind and start producing demo-able examples of my capabilities.

Once I actually get started, I’ll try to keep this blog up-to-date with what I’m doing and how I’m getting on.  Off to the drawing board I go, then!

Tagged , , ,

Voxel Engine Code Now on GitHub!

After doing some cleaning up of the code that I should’ve done before it was submitted, my voxel engine is now up on GitHub.

Just download a copy, load the provided Visual Studo 2010 solution and run it.  The repository also includes the necessary libraries, which will be needed to be added to your system path if you don’t already have them somewhere.

Tagged , ,

Honours Project Retrospective

With the final submission and the viva voce now under my belt, it’s long since time for a look back at the project and examining how it went.

As I said in the final dissertation:

“When the project was initially conceived, there was a strong personal motivation to reinforce existing C++ and OpenGL skills and knowledge. In this regard, the project has been a huge success. The knowledge gained during the development of the end product of the project has been invaluable.

There is a strong feeling that the final product could be more feature complete and more robust. The number of bugs and glitches within the final product are not in keeping with a professional programming standard, and the end product has very little resemblance with an actual game. The implementation of environmental destruction is extremely limited, with only a single block being removed when the projectile collides with the environment. While over a period of time this does illustrate the gradual deconstruction of a previously pristine environment, it lacks the “destructive” aspect that games focus on.

The most difficult aspect of the project has been time management and self-motivation. Determining a timescale and plan for the implementation was compounded by a lack of experience and awareness of how difficult certain features would be to implement.

Research was also a difficult aspect of the project. Work on voxel rendering was prioritised over research on the technology and its history, which made latter sections of the project more problematic as the focus had to be split between development and academic work. This meant that neither side of the project got the attention it required.”

It’s not been a perfect project, and certainly not as successful as my initial ambitions of creating a “game engine” with all the bells and whistles would have wanted, but when I look at what I’ve actually produced in the time allotted, all while having to deal with two other modules per trimester, I’m actually quite happy. It works. You can navigate around a voxel environment (a very basic one, admittedly) and fire projectiles at it to destroy it. Okay, it falls over after a while, but it works.

Aside from the product, I also managed to avoid having to pull any all-nighters (which I’m taking as a sign that I successfully managed my time). I’ve seen this project from start to finish, and that’s an accomplishment in itself. Despite having to drastically scale down my ambitions, it’s hardly been a small undertaking and I’m pretty proud of how things have turned out.

Without further adeuiu, here’s a quick video of my Honours project in action:

Once I tidy up the source code, I’ll make it publicly available too.

A Long Overdue Update

I’ve finally hit a major milestone with the project; block removal is working!  A projectile is fired from the camera and when it collides with a block, that block and the projectile are removed.

Working Block Removal

The next step is to improve the projectile firing mechanism so the player actually chooses when to fire, rather than the projectile moving from the camera’s initial position the moment the program is launched.  There’s still a lot of work to do to transform this admittedly basic implementation into something more advanced than just a basic Minecraft clone, but the core functionality is all there.  From now on it’s a matter of expanding on what I have, making it more efficient, more elegant and measuring the performance.  I also have a lot of writing to do.

Tagged , ,

The New Year

My work ethic has been nonexistent over Christmas, so I’ve left myself with a lot to do in the next few months.  The first order of business is to implement block selection, and for that I need some form of collision detection.  I’m using ray-casting to check whether the “cursor” (in this case, the centre of the screen) and a block are intersecting.  So far, I’ve been able to implement basic ray/sphere collision.  While a bounding sphere isn’t as accurate as a bounding box for my blocky voxel landscape, it’s a decent-enough starting point.  There’s still a lot to do before I’ve got block selection properly working, but the ball is now rolling.

What day of the week is it…?

Time for a small progress report. My other modules have been sapping my will, energy and general health, so there’s hasn’t been a great deal of tangible progress made. Certainly no more code has been written, discounting a few ill-fated attempts to remove some unnecessary faces during mesh creation. I think I have the algorithm for that figured out, so hopefully I’ll get that implemented sometime soon.

// Check if internal
if ( x > 0 && x < CHUNK_SIZE-1 )
	// Check if neighbour is active
	IF (blocks[x][y][z].isActive())
		continue; // Do nothing
	// Create the face

The next “phase” (I’ve not really nailed down what terminology I’m using, so future posts will probably be woefully inconsistent in this regard) is to implement some sort of basic block destruction. The theory is that you’ll be able to click anywhere in the “world” and a number of blocks around where the cursor is pointing will be removed. My to-do list for that goes something like this:

  • Implement raycasting
  • Implement ray/cube collisions
  • Block removal

This is just a vague plan, most of which is in my head. Admittedly, being in my head is probably not the best place for these things, considering the three commandments of Honours projects: documentation, documentation and documentation!

Week 9

Progress this week has been somewhat glacial. I have some basic lighting implemented, although there are still things I’d like to do with it, but for now I’ve got to put aside the fun programming part of this project and focus on the documentation, namely the interim report. There’s not really much in that worth showing, so for the time being have a screenshot of a roughly illuminated voxel sphere!

Real-Time Block Switching Working

As the title suggests, I’ve updated my chunk class to rebuild the mesh when a block is switched on or off, so it’s now possible to switch between the large cube and the sphere with a single keystroke. There’s not really much to show, so I’ll save screenshots for when I’ve got some lighting implemented and you can actually tell the blocks apart. Shaders are making a little more sense than when I last tried my hand at them, but they’re still a headache and add quite a few lines of code to my main code file. I might need to see if I can shunt some bits over into a separate file… after I get lighting working.

The next step is to perhaps implement one or two more basic optimisations (avoiding rendering unseen faces would be an excellent start) and then it’s onto getting the meat of the project started, the destructible environments. There’s also a lot of documentation I need to do, including an interim report, but the paperwork is what gets me the all-important marks after all.

Vertex Buffers Working!

After hitting my head against a brick wall repeatedly until it was pointed out I’d forgotten to initialise GLEW, I’ve got my block rendering up and running using vertex buffers. The combination of this and making a point of running the engine on my laptop’s dedicated graphics card has made a welcome difference to its performance, from 25FPS to 60FPS.

The next step is to be able to switch between the full cube and the sphere in real-time.

Tagged ,