When starting a new project, the first thing to do is determine which tools to use. We decided to use XNA for our game, as it’s often used and easy to handle. It provides us with the possibility to change the source code and implement certain features in our own way. But for every game you make, certain problems always remain the same, like implementing physic simulation or particle effects. Therefore it’s a good idea to look for solutions others made and luckily for XNA many open source libraries and projects exist dealing with these problems. The advantage of using open source solutions for certain problems, instead of programming it yourself, is that generally the open source solution has been used by many others before and most of the flaws have already addressed by others. As well the documentation for that solution already exists and you can reuse it for your own documentation. A good indicator for the quality of an open source solution is, how often it has been downloaded and when the last update occurred. A solution which has been updated recently, will most likely be used and maintained by many users, which generally means that this solution is more stable and reliable. Of course there can be exceptions. For Pontification we used some very popular libraries among the XNA community. For a list of good libraries for your XNA game have a look at the XNA Survival Kit.
Farseer Physics Engine
The Farseer Physics Engine is a great physics library, based on the very popular open source library Box2D. It is a very powerful engine to simulate physics within a 2D World. Also it provides a very straightforward documentation, which quickly teaches you the basics and it ships with tons of useful example projects. The handling of the functionalities is quite straightforward and if you have some experience with Box2D, you will get your head around it very quickly. We didn’t change much of the engine itself, as it already full-fills our needs as it is. For the debug view we simply used the example project “DebugViewXNA” which ships with the engine. We only had to change a view lines regarding some methods of the math library which were outdated. If you got troubles with the debug view, this post turned out to be quite useful for us. The Engine provides our game with some really neat features:
- Realistic physical behaviour of game objects taking parameters into account like mass or friction
- Easy collision handling
- Ray casting
- Rag-doll physics
- Destructible objects
Mercury Particle Engine
Another open source library we used is the Mercury Particle Engine. This engine handles all our particle effects and it is easy to use. The documentation is very detailed and provides some useful example projects. Currently we had no need to alter the engine code and we use it as it is. Using the engine and the particle classes is quite easy and you get your head around it quickly. The library also ships with a powerful editor to create particle effects. Those are stored as human readable xml files. It also ships with some example particle effects you can build upon. Yet we haven’t used it much, as the particle effects will be added later during the development process, but the first examples already work fine.
Gleed 2D is one of the most powerful tools we use. It’s a level editor specialized to create 2D worlds. The editor produces a human readable xml file which stores all the necessary information of the level, like positions or texture data of a level asset. We altered some of the source code to fit our needs. For example we added a player start object to determine the position where the player should spawn within a level, as well as NPC starts. We extended the properties you can assign to level objects by physic properties, which are then used by the Farseer Physics Engine. We also plan to add in paths for the AI, light objects for the level illumination and particle effect generators. This is a great tool and it will massively simply the life of our artists.
The next step is to think about a general structure of the game framework. We will probably go for a similar structure as it is used by theUDK, because this is the engine I mostly used and it’s an approved concept. Also stay tuned for some video show cases of our progress.