Tuesday, October 25, 2011

Exchanging Ogre for XNA

Over much debating, I've decided to make Quarantine TO using C# and the game engine XNA, rather than C++ and the graphics engine Ogre3D.  Changing languages and engines while the project is in the making is not something I recommend, but in this case, I think it will be worth it.

Ogre doesn't let me attach a node to a bone, only entities.  Nodes are required for scaling, rotation, and translation.  I was planning to have the characters' items shrink down and vanish while the character puts them away and grow as they take out a new one, but since I can not attach a node to a bone, I can not have changes size or rotation.  The option left is to give each and every item two scaling animations, which is kind of rediculous.

XNA has the sound libraries built right in.  In fact, it has -all- the libraries built right in.  That means native math functions, native XML capabilities, and thankfully, native audio and graphics.  Before changing over, I was going to use OpenAL for audio.  Every bit of XNA is nicely documented, and consistent in style, as well.

XNA uses C# as its programming language.  C# is a much cleaner language than C++.  Foreach loops just feel so nice.  It has dynamic garbage collection, meaning the game will keep running smoothly for the end player, and be much less likely crash due to a missed bug.

XNA is built for developing for games on Microsoft systems, be it Windows, Xbox, Phone, or the poor dying Zune.  This means much easier access to the online stores, and therefor to the future players of QTO.

C# is closer to Java and Objective C than C++ is, so that increases the portability to Android and iOS devices.  This means easier access to every android phone, every android tablet, Sony's upcoming Vita, and RIM's new BBX platform, as well as every iPod, iPhone, and iPad.  Mobile is a huge market for games now, since almost anyone with a capable device is willing to spend a dollar to try a new game.

Microsoft Visual Studio is much nicer to work with when using C#, I've found.  There are quite a few features that C++ doesn't get, for whatever reason.  Although C++ is slowly getting replaced by higher-level languages, I don't think it's near the place where they should start killing it.  It's still a very useful language, and necessary for many things.  Moving to C# means I can spend more time programming, and less time debugging, more time working on my game, and less time linking libraries, and more time polishing my product so it will be ready to sell by the end. 

Rather than completely taking care of the graphics, lighting, and animations, like Ogre, XNA gives me access to the matrices, letting me deal with them directly.  Honestly, it's strange that a high-level language is giving me more power to do what I need.

~ John Adam

1 comment:

  1. Hi John. Nice article and right now I was setting up my Ogre enviroment to start my rpg project I already used Ogre before in university and I was confident that it will work nicely but in the process I had a few issues with the boost lib and I would have to build all from source to work on VS 2012 and its new compiler.. such a unnecessary headache... So I thought to give xna (monogame) a try! I know that with Ogre I can access the vertexbuffer directly and write any type of shaders (depending of the card board) with no problems without talking about the add-ons added by the community. So I would like to know if xna will help nicely as I know Ogre does. Thank you and forgive my English It is not my native language. =)