Subscribe to GameFromScratch on YouTube Support GameFromScratch on Patreon

14. June 2015


Welcome to a brand new series on covering the MonoGame open source game framework.  Over the next several chapters we will cover almost every factor of using MonoGame for game development.  First we are going to start with a bit of a history lesson and introduction to MonoGame; we’ll talk about where it came from and why you should care.  Don’t worry, we will get to the code and the technical bits very soon!


For the more visually inclined there is also an HD video version covering mostly the same material we will discuss here.


So what exactly is MonoGame?  The simple answer is, it’s a cross platform, open source implementation of the XNA game libraries.   XNA in turn was Microsoft’s indie focused 2D/3D game library.  A more complex answer than that requires a bit of a history lesson.


A Brief History of XNA


XNA stands for XNA’s Not Acronymed, a recursive algorithm and very much on vogue at the time (think GNU or WINE).  Although the more likely reason for the name is X’s were really just quite cool at the time, XBox, X Games, XXX the Movie…  XNA was announced at the Game Developer Conference (GDC) in 2004 as a great and accessible way to bring game development to the masses.  At the time however, we instead got (what eventually became) MS Build and they open sourced the source code and all assets for the game MechCommander 2.  However two years later XNA Game Studio was finally released.


So what exactly was XNA Game Studio?  First off, it was a special version of Visual Studio for C# with an integrated pipeline for importing game assets.  On top of that, it was a collection of .NET libraries aimed at making games, covering facets like input handling, graphics, audio and networking.  Finally it was a special .NET runtime capable of running on PC, (eventually) Windows Phone and perhaps most importantly, XBox 360.  That was the big selling point…  XNA enabled basically anybody to make games for a game console.  Outside of the very limited edition ( and much more expensive ) Net Yaroze ( a special version of the PlayStation 1), nobody had ever done this.  You could argue that XNA more than any other single release, gave rise to the burgeoning indie development scene we have today.


What makes XNA even more impressive is realizing the world it was released in.  Game engines certainly existed, Unreal was AAA only and several million dollars per title, Unity was I believe still a Mac only product and several hundred dollars per seat.  Several of the prominent open source libraries of today simply didn’t exist back then.  Plus the IDE XNA itself was based on, Visual Studio,  cost a few thousand dollars.  XNA really did bring console game development to the masses and many of the “big” indie games, titles like Fez, Braid and Terraria were create using XNA.


It wasn’t all roses though, and even though Microsoft basically invented the indie developer market, it quickly pissed it away too.  XNA titles, without a publisher agreement, were confined to Xbox Indie Games channel as well as Windows Phone stores.  The Xbox IG channel quickly became a dumping ground, discovery became a huge factor and very few developers made money.  With the release of XBox One, it seems Sony stole Microsoft’s crown as the place for indie developers to shine.


Worse, and this is a story that could fill a book on it’s own, there was a shake up at Microsoft and several technologies ended up having their plug pulled.  XNA was one of them.  Sadly, in Oct 2011, with XNA Game Studio 4.0 refresh, XNA saw it’s final release. 


So then, a dead and unsupported technology… why the heck should we care?  Simple… XNA was… is good.  Very good.  Plus “unsupported” isn’t exactly the right word to used.  Enter…


A Brief History of MonoGame


So XNA became very popular very quickly.  There was a large and growing community, several books available on the subject and new versions being released.  Hands down the biggest limitation were the supported platforms, XNA was very much tied to Microsoft platforms and a limited subset at that.  This lead to twoimage different projects, SilverSprite and XNA Touch.  The first was an attempt to make a code compatible version of XNA (at least, the 2D bits) that could be run in the browser using Silverlight.  The other was a port of XNA to run on an OpenGL back end on mobile devices.  XNA Touch ended up using the 2D code from Silver Sprite and the two eventually emerged as MonoGame.


This was several years ago and since then MonoGame has grown into a nearly 100% complete implementation of XNA 4 that can be run on several platforms ( Windows DirectX, Windows OpenGL, Mac, Linux, Android, iOS, PlayStation Vita, PlayStation 4, OUYA and more ).  The biggest hanging point has always been the content pipeline.  Until recently you’ve needed to keep an old version ( and a PC ) Game Studio around to convert your assets into the binary XNB format.  However, near the end of 2014 the MonoGame team provided that final missing piece with the release of their own cross platform content pipeline tool.    It will be interesting to see what the future holds now that the MonoGame team have basically implemented 100% of XNA.  The future of XNA is now theirs to determine.



Why should I use MonoGame?


So, that was a bit of XNA history for you.  The biggest question you may have now is… “So what?  Why should I use XNA/MonoGame today?”


Sometimes it is often easier to start with why you shouldn’t use something.  The following are the biggest reasons I can think of not to use MonoGame.

  • You want a WYSIWYG environment or integrated game editor
  • You don’t like C#
  • You want a higher level programming experience
  • There is a price tag attached to support iOS and Android


Those are probably the biggest drawbacks of using XNA.  There is no world editor.  In fact, there are very few tools at all, except content importers.   Even the libraries themselves are fairly low level, leaving you to roll your own sprite and animation classes for example.  XNA is also not the easiest library to learn, especially compared to many scripting languages or all in one solutions like GameMaker or Construct.  That coding is done in C# ( or other Mono supported languages like F#, but 99% of examples are in C# ), so if you aren’t a fan of that language, you wont like MonoGame.  Finally, and perhaps worst, targeting iOS or Android requires a Xamarin license, and that costs money.


So that’s why you shouldn’t use MonoGame, now why you should.


First off, because XNA was and is just a great library!  It was well designed, very clean and works well.  Simply put, if you like working in C# ( and I do, very much ), working in XNA is just a very pleasant coding experience.  You work at a lower level of abstraction than many of todays game engines, but after being around for about a decade, there are a huge amount of code samples and libraries to fill those pieces.  The core though, those pieces every game needs, they are all provided.  If you are the type of person that likes to have maximum control, to dig in deep and get your finger nails dirty, you’ll feel right at home!


Also, MonoGame provides access to pretty much every single platform you’d want to target today.  One of the scary things about working with some open source game project is, you never know how well they will work in the real world.  Fortunately, MonoGame has an pretty impressive resume of shipped titles, such as:

  • Bastion
  • Fez
  • Infinite Flight
  • Skulls of the Shogun
  • Transistor

Some of the biggest selling indie game, from both the past and the present, prove that MonoGame is capable. 


So basically MonoGame is a battle proven cross platform indie friendly code focused C# based game engine built on the bones of Microsoft’s XNA.  Now, let’s jump into the technical aspects and you can see why I am such a big fan of the XNA libraries in the first place.  Along the way we will cover the way MonoGame does things differently, and look at some of the unique concerns that cross platform development bring.  Next however, let’s look at getting MonoGame up and running on your platform of choice.


The Book


While I am compiling this tutorial series on, I am also compiling the entire series for an e-book release.   In the end the tutorial series and the book will contain virtually identical content.  I will be compiling new WIP releases of the book as I go and those will be made available to Patreon backers as a thank you reward.  So if you enjoy this series but would prefer it offline or printed in a PDF or Kindle/Kobo friendly format, or if you simply wish to help support GameFromScratch (or both!), your support is certainly appreciated.  Once the series is “complete”, I will do a formal compilation with proper forward, index and table of contents and make this book available on popular book stores for purchase.  Basically I am publishing a book in the open, while I develop it.  Just instead of the traditional model, this one is available completely free and has a video tutorial series to go along with it!


As always, your feedback is appreciated.  If you have any requests, comments or suggestions, please let me know and I will see what I can do!


The Video

Programming , , ,

blog comments powered by Disqus

Month List

Popular Comments