Picking Some Middleware

The Requirements

Before getting started, I spent some time evaluating a few different middleware options.  Here are some things I am looking for:

Cross-platform

I want to be able to develop and publish at the very least on PC and iOS.  The Apple appstore seems relatively easy to get into, and even if it gets lost in all the other games out there, at least I can direct my friends to it and have something to show.  Distribution on the PC is a little tougher since most people just buy through Steam, and you need to apply to get in.  Also all my friends who are willing to help have PCs, and nobody else actually has the Macbook you need to even develop for iOS.  If the code can be released on Android or Mac, that would be a nice bonus, though I’m not sure I’d want to handle the support for all the different Android devices out there.

Relatively cheap

I’m willing to spend the 99 dollars to join Apple’s developer program, but I’m not willing to spend hundreds more on middleware.  This is just a hobby so I don’t know if things will pan out.  Besides, it’s time to start saving for Connor’s college fund!  This cuts out things like Unity, which can get pretty expensive.

Decent tools

The last time around on XNA, I wrote a basic level/object editor and physics engine.  I spent most of my time developing those basic framework things, and not as much time working on gameplay mechanics.  This time I don’t want to worry too much about all the low level stuff anymore, so integration with a physics engine like Box2D would be nice.

Coding language

I do have a computer science background, so I don’t need to be working with anything too basic.  I still want the flexibility of a decent programming language, not just using a game maker type application.  I’m either looking to use something I’m familiar with (C++/C#) or something that would be interesting to learn.

Proven track record

There are a lot of tools out there, and I want to choose one that has actually been used successfully.  This means a game that looks decent, and is released on the Appstore or Steam.

The Options

So here are the options I looked at:

XNA

This is a free framework that Microsoft put out a few years ago.  It was meant to get people interested in developing games for the Xbox, which has a separate indie store.  You write everything in C# and use Visual Studio.
+  This is what I used last time, so I’m comfortable with C#, .NET, WPF and the XNA library.
+  I have all the tools and libraries I wrote before that I can reuse.
+  It is free – you can do everything you need with Visual Studio Express too.
–  As far as I can tell, Microsoft has dropped support for XNA, so there will be no more updates.
–  The target platforms here would only really be PC.  XNA probably won’t work on any next-gen consoles, and nobody actually has a windows phone.

Monogame

This is an implementation of the XNA interface that is cross platform, using Mono (the open source implementation of the .NET framework on different platforms).  I tried installing it, which was pretty straight forward, and it appeared that it would be pretty easy to just move all my old XNA codebase over.  Games like Bastion and Skulls of the Shogun use this.
+  Supports PC, Mac, iOS and Android at least
+  I can reuse most of the code from my XNA project, since it is still all in C#
–  To actually deploy on iOS or Android, you need to pay a separate company which maintains a use-able version of Mono.  The price is really steep here, around 400 dollars per platform, per developer.  If anyone ever wants to help be program, the price will go up really fast.
–  Since Monogame is an open source project with no real company behind it, it is missing some pieces, like the content pipeline part of XNA.  I read about some weird workflows like having to install XNA first, use that to convert assets into .xnb files, and then putting those into your Monogame project.

Cocos2d-x

This is a C++ port of  the Cocos2d framework, which is an Objective-C based library for iOS.  The Objective-C version seems to be very commonly used.  +  Supports PC, Mac, iOS and Android
+  I can use C++, and also for the iOS specific code, learn some Objective-C.
+  Box2D is built in and should be easy to use.
–  I couldn’t find many examples of real commercial games put out using this on PC.  Does that mean this is too new, or is nobody picking it?
–  I lose all the work I had done before in C#, so I’d have to rewrite a lot of stuff in C++.
–  I’m pretty spoiled by the .NET framework, and I can’t really imagine going through and figuring out the C++ libraries that will do all the stuff .NET does for you for free.
–  I am comfortable writing linux style C++, but I’ve never gotten the hang of Windows style C++.  All the weird macros and data types!

Moai

I read about Moai in the comments of another blog I found while comparing the other frameworks.  Moai uses the Lua scripting language to let you write your game code once, and then has a separate host executable compiled under each platform to run it.  There are released iOS games that use this like Crimson: Steam Pirates, which is published by Bungie.  I actually have it on my iPad since it was on sale one day, though I never really played it because it didn’t have retina support.  Doublefine also chose Moai for their big Kickstarter project, and used it for the Middle Manager of Justice game.  That game wasn’t great, but the technical parts of it seemed fine.
+  Supports PC, Mac, iOS, Android as the others do.
+  Easier to develop on different platforms.  Since you are just editing scripts, any text editor will do.  No need for everyone to install Visual Studio or X Code and support libraries.
+  Free to use for all platforms, though you need to display their banner in your program.
+ Box2D is built in.
–  Lua isn’t something I’ve used before, and it isn’t something I’ve been wanting to learn.  However, the source code is all available on Github and you can also download and extend the C++ side of things to add additional features.
–  No Visual Studio or X Code means you don’t get all those nice features an IDE offers.

The Verdict

After installing these on my PC and compiling the basic sample projects, I had to decide which one I wanted to stick with.  XNA was out because it wasn’t cross platform and support is discontinued, and Monogame was eliminated once I realized the costs of getting it running on iOS and Android.  I ended up deciding between Cocos2d-x and Moai, which would be pretty different experiences because it’d either be programming in C++ or Lua scripting language.  I ended up going with Moai because of how easy it is to work on different platforms.  With just a host executable, some Lua files and a simple text editor, I can do pretty much anything I need to.  I can have the code on my PC or my Macbook and still be able to develop the same way.  An extra bonus is easily running the code on my Macbook as a OSX program without running the iOS simulator every time to test.  Since I’m pretty much working on my project in the spare minutes I have while the baby is sleeping, every moment counts!

In the next blog posts, I’ll write about my experience downloading the SDK and setting up a simple project.  I’ll also go over which text editor I found to be the most useful.

Leave a Reply