Monday, July 29, 2013

XNA/Monogame - First thoughts

XNA is awesome!  It is truly a shame that Microsoft decided to stop supporting it.  After many failed attempts throughout the years at getting started with game programming, it looks like I finally found something will allow me to finish a 2D and possibly a 3D game.

To be clear, all my "XNA" learning so far has been with Monogame, which is open-sourced XNA.  In the short time that I spent, I now know how to display textures and even do basic animations.  At this point I feel confident enough to make pong.

The stuff  I liked so far is that there are plenty of resources to learn XNA/Monogame i.e. books, online tutorials, youtube lessons.  Since XNA is now "dead" some XNA books on Amazon.com can be had for really cheap.  I was able to snag "Learning XNA 4.0" for  $16!  More than 95% of what I've read from the book applies directly to Monogame.

There are only very few things I don't like about XNA/Monogame.  Everything that a game in XNA uses and it's not code is referred to as content i.e. images, sounds, etc.  The tool that compiles the content into a format that XNA/Monogame can use, has not been ported to Monogame as of this writing.  This forces you to use XNA Studio or the Windows Phone SDK.  Also, the Visual Studio templates for Monogame have some weird bugs that still need to be ironed out.  However, given that I'm only a beginner some of these issues might no be issues at all, and I'll probably run into more major things the more I use the framework.

Overall, my initial reaction from XNA and Monogame have been very positive.  The multiplatform version of Bastion, Terraria, Fez use Monogame.  If you go by those examples, it is clear the framework has a bright future since it can only get better.

Would I recommend others to learn XNA/Monogame?  Absolutely!

Tuesday, July 23, 2013

My travels in graphics programming

DirectX

Early this year I started reading a book about DirectX but quit shortly after.  I wanted to use VS2012, but couldn't get my environment configured properly.  All the issues stem from the fact that VS2012 now comes with DirectX built-in, but this version only works for Metro applications.  If you want to develop for the desktop, you have to install the "June 2010 SDK" for DirectX which is a pain for me as a beginner.  One solution to this problem is to go back to Windows 7 and use Visual Studio 2010, which is something I don't want to do.

OpenGL

About two months ago I strongly considered forgetting DirectX and instead learning OpenGL.  I have to admit that not being able to set up my machine properly has been one of the biggest reasons for the switch.  At the moment, I'm waiting for the latest version of the "OpenGL SuperBible" to be released at the beginning of next month.  This book was highly recommended by a friend who is a graphics programmer, so I have high hopes for it.

Monogame/XNA

In the last couple of weeks I gave DirectX another shot and again and I'm not seeing the progress I expected.  To calm my frustration with DX, I went and researched other alternatives and discovered Monogame which is an open-source port of XNA.  Now, XNA is dead and will no longer be supported by Microsoft, but I found Monogame very promising.  For the type of games I want to code as a beginner I believe is more than capable and satisfies all my requirements.

Yesterday I said what the hell and decided to give it a shot.  Right off the bat, I'm finding it a pain to use VS2012 in my environment again.  To get Monogame to run on Win7 with VS2012 I had to go through a labyrinth of steps:
  1. Install Visual Studio 2010
  2. Install XNA Game Studio
  3. Install Monogame
  4. Create OpenGL Monogame project and have it fail to run.
  5. Fix SDL.dll issue with the way the Monogame VS template works.
  6. Install OpenAl because Monogame didn't install this driver for some reason.
  7. Finally run basic project.
The whole process took me a couple of hours, which isn't too bad.  But I find steps 1 and 2 to be non-ideal.  Why do I need to install VS2010 to code something in VS2012?  The reason is one key part of XNA has not been ported to Monogame, the content creation pipeline.  One way to avoid having VS2010 and XNA installed is by using Windows 8 Phone SDK.  The only problem with that approach is that you can only do that on Windows 8.


Upgrading to latest Qt 5.1 broke my 5.0.2 project

So it appears that installing the newest release of Qt can potentially break your existing projects.  This, as far as I can tell, occurs when you install the wrong version of the installer, which now comes in two flavors for x64 windows.  One is for DirectX and the other for OpenGL.

So to keep your existing projects compiling properly install the OpenGL version.  However, this is just a minor issue, and I actually think installing the DirectX version on windows might be a better choice.