Simple FPS base framework
Posted: Sun Jun 02, 2013 4:42 pm
Here I'd like to share what used to be the base of my project before I realized I'm too inexperienced to design and build a game (almost) from the ground up using Ogre, and decided to go with a complete game engine instead.
My project was intended to be a first-person adventure game, therefore I started to implement a first person camera system (based on code from the wiki) to the Advanced Ogre Framework (which was an excellent starting point and a great piece of code). Then I threw in some physics via Bullet and BtOgre (the shining example of what a physics engine wrapper should look like), but because the character controller included with Bullet was completely useless back then (in fact, it was probably the number one reason I gave up), I also integrated the Minimal Ogre Collision library to at least prevent the player to walk through walls and objects (MOC was another great help, understanding how it works and integrating it to the existing system took me about ten minutes). Then to make the camera move smoother, I... umm... lifted some code from the SdkCameraMan system, and it turned out quite nicely. Then I made some quick test levels with Ogitor (I was eagerly waiting for the next release back then, too bad I gave up on this project shortly before a new version had been released ), and I was able to load them "out of the box" with the built-in dotScene loader of the Advanced Ogre Framework (apart from some entities, but it would have been trivial to fix it as the scene format supported by AOF was simply a bit outdated). In the end, I also implemented a config file loader I've found on the wiki.
So, here it is, I decided to share because I realized it could be useful for some absolutely beginners, and could give then the idea of how to put various code snippets together and make them work. Also, it's an example how not to do object-oriented code...
Download link, sorry for the crappy file hosting, I had no idea where to put it. Comes with a precomiled executable.
I'd like to thank everybody who made the aforementioned projects, and I'd like to thank the whole Ogre community as well. Although I'm using a different engine right now, it was fun to play around with Ogre, and I've learned more about C++ and 3D maths (especially quaternions) during this experiment than I've ever expected.