Saturday, 8 March 2014

My First Project: A First Person Shooter Game





I knew C language before my Engineering course. As a first year student of Computer Science, I had no idea how things are going to be in CSE.

First year didn’t help much. During my second year I started trying out things. Eager to make my own game, I made a snake game with no knowledge of any of the graphics libraries. How? With the use of char matrix as the view port, linked list for the snake, ’o’ as the snake body and ‘*’ as the fruit. 
My first application ‘A Snake Game‘ in C

Why First Person Shooter Game ?

Ever since my first year (2011), I had a master project in my mind. A wearable display (with accelerometer and gyroscope) to track rotation and tilt. And a motion controller to track hand movement (Wouldn’t it be cool if you were the protagonist in your favorite FPS game, and you could look around, and shoot your enemies by mere physical movements). It was this project that inspired me to work on most of the projects that followed.
'The Master Project'
I planned to work on this project with one of my friend (doing Electronics Eng.), I were to focus on the software part and He on the hardware. So I thought of building my own game to interact with the hardware.


Decision: Design a game or Simulate key presses

I could simulate mouse movements and key presses with signals from sensors (space = jump , left click = 
shoot etc.)(so that I could run any of the FPS games) but major flaw was that the player’s hands are fixed to the camera (there is no independent movement of head and hands). Because that was the most important thing, as we head separate sensors to track head movement and hand movement, I thought of making my own game.




Game engine, which one?

It was absurd to build my own game engine and then build a game, so I started searching for the best readymade game engine for me, which was easy and gave me enough freedom. I went through Unity, Ogre3D, Panda3D and then finally found the perfect game engine “BLENDER”. Blender is free and open source and allowed me to design characters and side by side script their logic in Python. You don’t need me, to tell you how cool python is… right?



Blender, Done! What next?

I studied blender’s documentation and followed their video tutorials. Found a nice enough character, rigged it. I couldn’t attach mouse triggers for ‘looking’ because it would be triggered by our sensors.
It took me nearly 2 months to finish my first Project-level application.
And I was happy with the output…


Download
Extract and Run 'Enemyscript.exe'

Keys:
W: move forward
I, K, J, L: look up, down, left, right
Space: reposition after looking
Shift: jump
Numpad 8, 2, 4, 6: move gun up, down, left, right
R: reload







No comments:

Post a Comment