As part of my personal inquiry module at University, I decided I wanted to make a game that specifically used the Microsoft Kinect. Having recently read (at the time) that the Kinect had been “hacked” (the usb driver) so that it could be connected via a PC, this sparked my interest to create a Kinect game. Upon doing some research I discovered the company PrimeSense (which developed the Kinect’s software with Microsoft) had released their own framework and middleware (OpenNI and NITE, respectively). So after reading through the API documentation a few times, I had got the jist of how the framework worked, and how to develop for it. It was at this point that I made another discovery, PrimeSense had also released a wrapper of OpenNI for Unity (a game engine/creation software, which I used and loved for years).
With OpenNI and NITE in one hand, and Unity in the other, I decided to go to work. The time scale for the project (the deadline I was working to) was 3 weeks, including having other on-going assignments. So I decided on a simple game, which was both enjoyable to play and could be realistically created within 3 weeks (including documentation). The game I came up with was “Gunslingers”, a wild west dueling game. The player would play against the computer, by standing in front the screen, and drawing when prompted. The fastest to draw would shoot the other, deducting a life. The first player to 0 lives would lose the game. The game is coded entirely in C#.
The most difficult parts of development were really getting to grips with how OpenNI and NITE worked with Unity (especially when bumping into a barrage of bugs, i.e. if you rotated the player’s rig in the editor, the rig would simply break). After getting to grips with OpenNI and NITE, I soon learned several tips and tricks, which sped my workflow exponentially. This allowed more time to be spent on the games’ mechanics and the computers AI.
The computer’s AI was developed to act exactly the same as a human player (as mostly all game AI’s are). Thus, the AI was required to follow the same rules as the player in order to win. The computer would draw at differing speeds dependant on the difficulty the player selected. The computers rig was also animated, when drawing and holstering their gun.
The game also featured a large GUI options menu, where the player could select pre-set difficultly options or individually set the entire function set of the game (i.e. number of lives – for player and computer, draw speed, timer speed etc). Thus, the player could effectively set a handicap, or make the game as difficult, as they wanted.
I felt the project was very successful, considering the time frame. It wasn’t as polished as I would have liked to be, but given the fact that I had to learn an the OpenNI framework and NITE API, and then create an entire working game from scratch within 3 weeks, I was very happy. The demonstration of the game at a University poster session, also provided me with a lot of positive feedback from my peers.
I thought about extending this project, however instead I carried the lessons I’d learnt from the project, over to my masters project, which pushed the idea of using the Kinect with Unity a lot further. Therefore, I shall simply leave this project at this point, as it served it’s purpose and was ultimately surpassed by my masters project (but will always be remembered as the originator) 🙂
Note: A side-by-side version (footage of me using the Kinect, and the game) of this video will be uploaded in the near future. However, as my video camera has broken, it may be a few weeks before I’m able to record and upload the new video.