Advertisements
Posted by: jsonmez | August 5, 2012

Introduction to MonoGame

I’ve been playing around quite a bit with MonoGame lately and thought I would take some time to write a bit about it and talk about how to get started.

I’m also currently working on a Pluralsight course on cross platform development with MonoGame.

MonogameLogo100x100

What is MonoGame?

Well, if you are familiar with XNA, then you already know what MonoGame is.

If you are not familiar with XNA though, it is basically a game development framework that allows for creating games quickly without having to write all that repetitious code that all games need.

Basically it makes creating games more about the game and less about the technical details.

The only problem with XNA is that it only really works for Windows, XBox360 and Windows Phone 7.  If you want to create a game on Android and iOS, you can’t use XNA.

This is where MonoGame comes in.  MonoGame is an open source port of the XNA framework that can run on many more platforms that Microsoft’s XNA.

Great, so what does this actually mean?

Well, if you are interested in game development, especially if you are interested in game development for the most popular platforms today, MonoGame might be able to help you to write pretty close to the same exact code and have it work on Android, iOS, Windows 7, Windows 8, Windows Phone 7, MacOS, XBox 360, Linux and the new Playstation console.

That is pretty awesome!  Especially if you are trying to monetize your effort.

In my mind MonoGame helps overcome two huge barriers to getting into game development.

  1. Difficulty of monetizing the effort.  By allowing the same code to be shared on most platforms, a game developer can get paid for their effort in multiple marketplaces.
  2. Not knowing where to get started.  The XNA API is so simple to use that you can get a simple game, like a Pong clone for example, up and running in about a couple of hours.

Also, because MonoGame is basically just XNA, you can find a whole host of resources on how to develop a game using the platform.

In my upcoming Pluralsight course, I show how to create a Pong clone on Windows and then we get that game up and running on Android, iOS and Windows Phone 7, with minimal changes.

dgun-853-50-games-pr-h

Getting started

It can be a bit challenging to find good information to get started in each platform using MonoGame, but the basics are located on the Github page.

For the Windows tutorial there, you can use Visual Studio instead and use the MonoGame installer.

For each platform things area slightly different, but really not all that hard.  If you want to have your game run in Android and iOS, you’ll need Mono for Android and MonoTouch respectively.

For Android development, you can use Visual Studio as long as you have Mono for Android installed and all you really need to do is link your files from your Windows project and create a small bit of startup code in an Android Activity to start the game.

For iOS development, you will need to use MonoDevelop, which is packaged with the install of MonoTouch.  MonoTouch itself uses XCode and the iPhone SDK, so you have a bit more installing to do there, but the idea is pretty much the same.  One you have MonoTouch running on your Mac, you can link over the files from your Windows project, add a small bit of startup code, and you are up and running.  (You’ll also need to download the actual MonoGame source code to add to your project, since there isn’t an installer for Mac currently.)

Xamarin also has a seminar they did on MonoGame to help you get started.

True cross platform development, finally

At least for game developers.  For other applications in the mobile space, there are some solutions that help you share your code, but nothing that really allows you to have near 100% portability without a big sacrifice.

I was pretty amazed the first time my game just ran on my Android and iOS devices with virtually no changes.

I’d definitely encourage you to check out MonoGame and stay tuned for my Pluralsight video on the topic, where I will go through all the details of creating a game and getting it running on most of the major platforms.

Advertisements

Responses

  1. […] Introduction to MonoGame – John Somnez highlights the MonoGame project, an open source port of the XNA game development framework which allows .NET Developers to write XNA games to run across multiple platforms (Android, iOS, Windows 7, Windows 8, Windows Phone 7, MacOS, XBox 360, Linux and the new Playstation console) […]

  2. You are awesome man.I really need to learn game programming now its simple by learning this course.Great job man

  3. Excellent blog! I’ll certainly be adding you to my blog roll and reading regularly.
    I faced a real issue in cross platform development myself, and came up with a solution you might find interesting. The company I was working for had always developed applications to support their consumer electronic devices for Windows only, but with the rise of Apple wanted to move to the Mac as well. We had almost always used C++, with both Visual Studio and Borland compilers.
    Alot of the code was USB driven and would have to obviously be rewritten for different hardware but I was loathe to try and maintain a Mac branch and a Windows branch of the the program for the GUI stuff. The goal was to have the programs as similar as possible, and also maintain a native look and feel.
    We looked at QT, WxWidgets and other cross platform tool sets but none of them really filled the bill. Then I discovered the Lazarus Project. Their motto is “write once, compile anywhere”. It’s an open source clone of Delphi, which is also known as Object Pascal. It worked. Beautifully. There were less than 50 ifdef’d blocks in almost 50000 lines of GUI code, and result looked native on both Mac and Windows. As a bonus, we released versions for some of the more popular Linux distros as well, which increased our “geek cred”. Interestingly Object Pascal and C# were both essentially designed by the same person: Anders Hejlsberg.
    Be well,
    Dave H

  4. […] the details of creating a game and getting it running on most of the major platforms. Reference: Introduction to MonoGame from our NGC partner John Sonmez at the Making the Complex Simple blog. Posted by Nikos […]

  5. Good idea!

  6. Did you ever do the tutorials for getting games up and running? I am finding your blog tricky to navigate…I am particularly interested in the PS Mobile stuff


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Categories

%d bloggers like this: