Prototyping Week 3 – Diamond Theif

A couple of weeks ago I created a basic rope physics system anticipating my group would be working on our Diamond Theif idea. However I arrived late to find that we were working on the Glider game. This week, while most of the team worked on Sprouter, a few members broke off to work on the Diamond Theif game, making use of my rope system to power the core mechanic.

The rope was made by using Character Joints in unity to connect segments composed of capsules. The first capsule is made a kinematic to anchor the rope. Following rope sections are hooked up to the section proceeding it using the character joint.

Play Here!
Note: You’ll need the unity web player.

Use the A and D keys to avoid the traps as you are lowered down to the diamond. Try and collect coins on your way down.


Prototyping Week 3 – Sprouter

I spent this week working on a game called Sprouter. The idea is that you guide a seed from sprouting into a full-grown tree, controlling the growth of branches and roots and interacting with the surrounding environment.

One of the artists developed the following presentation introducing the game:

This slideshow requires JavaScript.

The prototype ended up quite different from the gameplay in the presentation. The problem was we (the programmers) could not work out to program the tree growth mechanic in unity in the 2 days available to us. In the end we created a system where you pressed a button on the seed or existing branch/root to create a new branch/root, you could then adjust its rotation as desired. Suffice to say this was a little forced and did not really capture the relaxed gameplay style we were after.

We discussed the idea of having a game menu based on the seeds in an existing tree. You would start a new game by clicking on one of the seeds, at which point it would fall off starting a mini game where you had to land the seed in the best possible spot for future growth. the prototype includes a short scene demoing this idea.

Click here to Play!
Note: you’ll need the unity web player.

In the first scene you can use the W and S keys to control the height of the seed. It doesn’t really matter what you do here, as soon as the seed hits the ground you’ll begin the game proper.
In the second scene you’ll need to grow roots to get water and minerials and branches to convert water to energy. Make sure you start by building at least one branch and one root.
To build a branch or root click and hold one of the tan buttons on the seed. While still holding use the Q and W keys to rotate the branch/root to the desired angle.
If you get stuck you can use the IOP keys to cheat.

Prototyping Week 2 – Glider

The second prototype we developed was based on a skydiver in a wing suite, like this:

Pretty self explanatory really.

We had some trouble developing a functional movement system for this prototype. We tired applying a constant force and directly translating the player based on user input, however this didn’t feel right and allowed the player to go anywhere. the final system in the prototype is a monstrosity involving hooking the player up to two invisible games objects moving ‘on rails’ using springs (horrible!). The result was slow and sluggish, It didn’t feel like you were skydiving at all.

Here’s some of the Concept art:

Glider - Concept Art
Glider – Concept Art

Play it Here!


The goal is to hit the big gray slab at the end of the canyon. Avoid obstacles by moving the character using the arrow keys.

Prototyping Week 1 – Flick Hazard

Flick Hazard was an idea devised by one of my group members  while stewing over some of our game ideas from the first week of this Prototyping assignment. The basic premise is that you are a baby in a runaway pram going wildly down the street. The player has no control over the pram, instead they flick potential Hazards (cars, trucks, etc.) out of the way.

The game would targeted at mobile platforms (phone/tablet) using touch for the flicks.

This slideshow requires JavaScript.


Play the Prototype!
Note: You’ll need the Unity Web Player.

Flick the cars out of the way. To start a flick hold down the left mouse button, move the cursor through the car and release to finish the flick.

Prototyping Week 0 – Brainstorming

This is the first in a series of post I’m doing on my Game Prototyping assignment at college. We started out this week by brainstorming game ideas which we could later prototype.

To be honest I thought this was going to be harder than it turned out be. Once the group got started the ideas came thick and fast. Here are a few of the highlights:

  • Blind Beware – Protect the blind character as he walks down the street by interacting with potential hazards around him.
  • Hazardous Hen – Player controls a character whose aim is to dodge incoming vehicles on a busy road causing as many accidents as possible without getting harmed.
  • One Armed Warrior – One armed warrior swings from a whip and can only shoot enemies when not swinging.
  • Diamond Theif – Thief on a cable lowering towards diamond, player controls speed and swing to avoid traps and obstructions.
  • Haunted to Death – Player controls a lonely ghost trying to haunt someone to death in order to gain a ghostly companion.
  • Pick Axe Prison Break – Use your pickaxe to break through walls and make your escape, don’t break too many walls or the roof will collapse.
  • Human Herding – Player controls a pack of zombies in order to herd humans to a desired location.
  • Coral Reef – Strategically grow your coral against other plants and grow your territory.
  • Spider Web – Play as a spider creating a web;  eat or enslave your prey, repair any damage.

Next week we’ll have to start taking these ideas and turn them into working game prototypes.

Lambdas: What are they and When to use them!

I’ve always know that Lambdas existed and had some idea as to what they were (inline functions right?); but I never really bothered to learn how to use them (and the few times I came across them i had no idea what I was looking at). It wasn’t until recently, while reading about the new c++11 features, that I finally came to understand what they are and how to use them.  With my more recent discovery that (unlike most new c++11 features) they can be used in Visual Studio 2010 I thought I’d share my new insight.

Because it took me a while to get my head around them I’ve tried to make this explanation as simple as possible so a relative newcomer to c++ can understand them. However I will point out that if you don’t know what function pointers are and how to use them your going to struggle with the lambdas.

Continue reading Lambdas: What are they and When to use them!

Tutorial: Multiple Windows with GLFW3 and GLEW MX


I recently wrote a short demo program on how to setup a Multi-window Multi-context OpenGL demo using GLFW3. I thought I’d write a tutorial on how to setup this demo for yourself.

The tutorial is specific to MS Visual Studio 2012, however all the code and 3rd party libs are platform independent, so it shouldn’t be hard to port this to Mac/Linux.

The full source code is available here.

Update: Full source code for Visual Studio 2013 can be found here.


GLFW3, the successor to the popular GLFW2 cross-platform window management framework is nearing release. Update: GLFW3 was release some time ago now. Among it’s new features is support for multiple windows (each with a separate OpenGL context). Seeing this i decided to give it a go.

The Goal is to draw the same scene to two different windows, giving each window a separate camera so they can see the scene from different angles.  for the demo we’ll use a simple rotating quad as the “scene”.

Using multiple windows involves solving several challenges, including:

  • Tracking which OpenGL Context is active.
  • Sharing Data between the different OpenGl Contexts (and therefor Window).
  • Being able to re-size each window individually and have the correct OpenGL Context update.
  • Closing windows at any time.

Continue reading Tutorial: Multiple Windows with GLFW3 and GLEW MX

OpenGL Multi-Window, Multi-Context Demo


A demo of a small demo I created showing off multiple OpenGL windows, each with its own context. Note that the lag is because I was recording it, normally it runs just fine.

The demo was created using GLFW3, GLEW (compiled with the GLEW_MX directive) and GLM. You can see the full code here.

I tried multi-threading the demo but the frame rate dropped to around 60 fps from what is shown in the video, it also caused the Nvidia drivers to crash.

See here for some general information on using multiple OpenGL contexts.

For vs For Each

I’ve been curious for a while now about the performance of the MS for each C++ extension compared to the traditional for loop. So a couple of weeks ago I dug up and old performance testing framework I’d put together and found out for myself.

The Framework works by running a specified piece of code (using a function pointer) a specified number of times. It uses Microsoft’s Query Performance Counter (QPC) to time the code each run and reports the average time as well as some other stats. I used it to run a number of different For and For each loops on the same data/container to see which one performs best. A reset function can be specified and used to reset data between each test run. The Full framework used can be found Here. Continue reading For vs For Each

To get things started…

To get things started I thought I’d post some information I promised a friend on easy multi-threading techniques in C#/.Net.

First trick is to use the Parrallel Class. This is a new addition in .Net 4.0 that provides version of for and foreach that will automatically split up the loop to run across multiple threads, depending on how many cores the System CPU has and how much load each core is under (this can be controlled too, if need be).

The other is Background Workers. Background workers are best used for slow jobs that might cause the UI to lock up (such as long file IO operations). A Background worker runs whatever task you give it on a separate thread, preventing the UI from locking up and allowing the user to do other thing while they wait for it to complete. The background worker provides a series of events for monitoring its progress.

Hope you find these useful in your future .Net projects.