Monday, October 29, 2012

All about Snipe Hunt

Introduction:

     Snipe Hunt was the prototype made for the Mechanical Engineering department. The apparatus on which the Game was being deployed consisted of a tread-port, three giant screens and no mechanical interface between the player and the game. So, a player could just walk to play the game. Why such apparatus for playing games? This apparatus is for helping people with spinal cord injury to start walking again and regain their confidence and games are the medium by which people forget about the therapy and push themselves to succeed in the game. This is why Neuroworx asked us to make a game.

Game Idea:

     After a lot of discussion, Chris came up with the idea of a tower defense game. The player is a farmer and he needs to protect his food which he has just harvested and piled up, from the snipes. The player can set up traps or baits on the field which which trap or lure away the snipes. So, the mechanics of the game were walk to a trap spot or a bait spot to acquire a trap, stop walking to set up a trap or a bait and walk towards a snipe to manually capture a snipe. We divided the work according to different components that are present in the game and their behavior in the world.

Division of work into different parts according to components in the game  and their behavior
   
My Role in Snipe Hunt:

     My work was to manage the movement of the snipes on the field. I used the SnipePosition Vector and the FoodPosition Vector for doing it. I used the approach shown in the image below.

My approach for randomizing the movement of Snipe in the world
   Angle between the current Snipe Position and the Food Position was checked. Then within a margin angle of  'X' at a distance of 'Y', a point was selected randomly. The snipe makes its way to the selected sub-target and then finds a new sub-target. The motion between this two points was sinusoidal. The margin angle decreased after every iteration by a small amount. Hence, the snipes were directed towards the food. After the snipe is at a certain distance from the food pile, it will make its way towards the food pile without creating any sub-target.

Problems faced during this prototype (Postmortem):

One of the main problems that we faced during this prototype was merging the code that we wrote individually. This problem was caused because there was a lack of structure to the code. A proper interface between two systems was not defined and because of that merging was not possible. We ended up having two copies of the same game.

What I learned?

Defining the structure of the code before starting the code. For example, Part A of the code needs x, y, z from Part B. So Part B should be written in a way that it gives x, y, z to Part A and not something else.

Sticking to what work is assigned or what work we take up.

Take up more responsibilities if you know you are capable of doing it.

Screenshots:


Snipes in the farm

Trap Spot

Trap Acquired

Setting a trap

Snipe Captured