7

I am creating a 2D game which I wish to run cross platform (on platforms such as Windows, Mac, iOS and Android as the main targets) and the engine I use needs to be open source. The main goal is to have the most code portability (possibly through scripting).

I would prefer to do this in C# but using another language is not a massive issue if I have to.

I have considered MonoGame and flash using the Flex SDK as they both claim to be cross platform and open source.

Which one of these would be a better choice considering my criteria? Or would another game engine/library be more suitable?

Liam Flaherty
  • 337
  • 1
  • 7
  • 19
  • 1
    If you want to use Mono/MonoGame for iOS and Android, you have to get Xamarin.iOS and Xamarin.Android, which both are not open source. – Kai Hartmann Aug 14 '13 at 12:04
  • Is there a workaround using Objective-C/Java to load it? Or is a different engine a better choice? – Liam Flaherty Aug 14 '13 at 12:07
  • 1
    'Torque' by Garage Games might work for your needs... you can code in their scripting language, which is very C-like, and publish to almost all relevant platforms. –  Aug 20 '13 at 16:52

4 Answers4

7

I would suggest Unity3D. It is a 3D platform. But if you only use 2 dimensions you're good to go. In Unity3D you can write your game in C#, Javascript or Boo.

Unity is free and can export to Windows Phone, Windows 8 App, Windows, Mac, Linux, Android, Blackberry, iOs, Xbox360, Wii and PS3 but for those last 3 you need a developer license from Microsoft/Sony/Nintendo. But the possibility is there.

UPDATE

You had to pay for the ios and android addons earlier. Now they are free:

Today, we’re taking another step on this long road: as of right now, independent Unity developers will be able to deploy their games to Android and iOS platforms completely free of charge. Update Unity and you will find Android and iOS build options (previously basic add-ons) ready and waiting for you to use.

Source: http://blogs.unity3d.com/

In the meanwhile, support for other platforms has come out (including windows phone, winrt & blackberry). Those are all free. If you want pro features you need a pro license. But most of the stuff you need is in the free version. To compare look at this page.

SynerCoder
  • 12,493
  • 4
  • 47
  • 78
3

The engines below allow you to reuse pretty much all your code, only thing you need to change is resolution and touch input/controls from desktop to mobile or the other way around. I would suggest you check out these engines, they are all open source:

  • libgdx - Uses Java and is almost as fast as XNA, but faster than MonoGame. "Publish your games on Windows, Mac, Linux, Android, iOS and HTML5, all with the same code base." - off their website, anything that can run java, can run your game. Big community so you shouldn't have problems asking questions when you need help and getting it.
  • Qt-Project - Qt is a cross-platform application and UI framework for developers using C++ or QML, a CSS & JavaScript like language. As of Qt 5.1 you are supposed to be able to build for Android and iOS, allowing you to build for all the platforms you requested. Big community.
  • Moai - Uses Lua and can deploy to all the platforms you requested. Only downside is the community is pretty small and the docs are a little out of date, but people on irc and forums will usually help you, but the answer won't always be immediate. You also have to build your own hosts to build for the platforms you desire, but last time I checked there were public hosts for all platforms out.

libgdx seems like a perfect fit for you. the performance is amazing, the community is big and it lets you reuse the same code for all platforms, just to name a few. Only downside being it doesn't use C#. Of course you should definitely look into them yourselves and see if they are match for what you want. I wish you the best of luck in your endeavors.

Hate Names
  • 1,596
  • 1
  • 13
  • 20
  • I have never seen any of these engines before, thanks for this! They appear to suit my needs well. – Liam Flaherty Aug 16 '13 at 06:43
  • Is there a way to get libgdx working for iOS without using MonoDevelop and MonoTouch? – Liam Flaherty Aug 16 '13 at 06:56
  • -1 for cocos2d, take a look at cocos2d-x it is cross platform so you dont have to change language, it uses C++ for all, and libgdx uses xamarin for ios which is not the native env. as it will trade off performance and some other things and also it requires license, $79 for students $299 for indies http://libgdx.badlogicgames.com/features.html @liam, xamarin, take a look at link above – Onur A. Aug 16 '13 at 07:32
  • I believe you can use Eclipse as well for Mac, check out http://hrugames.com/installing-libgdx-in-eclipse-tutorial/. I will also take edit my post, Onur is right, Cocos2D with C++ can build for the platforms you want now. When I looked into it a while ago it did not have that option, sorry for the confusion. You will not have to worry about the performance on iOS with libgdx, trust me. I personally use Moai because I am a fan of Lua, but the smaller community and crappy docs make it harder to catch onto. – Hate Names Aug 16 '13 at 07:44
  • I still believe libgdx is one of the best options since Java is quite heavily documented, make sure you check out more recent tutorials when you search though. Also don't be afraid to ask for help on the forums or even gamedev.net, as there are always tons of people willing to help you. You can use gamedev no matter what engine you use. I hope you find the engine that best suites your desires. – Hate Names Aug 16 '13 at 07:46
  • Also as a final remark, I strongly believe that your best choice is the one that feels most natural to you. It's definitely worth testing out the different engines a couple of days because you will be spending months afterwards creating your game in it. They are all great solutions. Look up sample codes for games using the engines and find something you like and prefer coding in, it will also help you stick with it more. – Hate Names Aug 16 '13 at 08:01
  • he can use libgdx for mac using Java but not for iOS. Building for iOS requires Xamarin which is .NET based, and it will trade off performance since building with .NET to iOS is not native. – Onur A. Aug 16 '13 at 11:16
  • I think I will go for libgdx as I know Java and not C++. Also, I believe there is a Java to Objective-C converter – Liam Flaherty Aug 16 '13 at 15:42
  • 1
    And I've heard of codename one which can run Java on iOS – Liam Flaherty Aug 16 '13 at 21:56
  • 1
    Codename One looks very interesting, nice find. You will not be having performance issues on iOS cuz .NET is not native, trust me. Unless you plan on creating some kind of tower defense where the person can have 50 towers on the map and then there are another 100 monsters on the map all getting shot at at once, then you don't really have nothing to worry about. I've never had any performance issues and I've used much slower options. – Hate Names Aug 16 '13 at 22:19
2

There are a couple of options based on your preferences; I will list a couple of ones I recently come across.

  1. Cocos2d series seem very popular these days. If you think C++ isn't a problem for you then Cocos2d-X would be an option as it offers a lot of platforms. Other Cocos2d series might get your attention as well. I guess there are a couple of versions like HTML5, Javascript, Python. etc but i think only cocos2d-x is cross platform.
  2. Unity3D(C#, Javascript, Boo) seems as an option but it's not open source, as well as UDK(UnrealScript) also same, but if you think to buy a license they offer source code I guess
  3. Flash also can be a good option, as you mentioned. It uses AS3 which is an OOP language and can be very useful if you are a beginner.
  4. And ImpactJS offers a lot of platforms also, it uses HTML5, you can check here http://impactjs.com/

The list can be longer and longer, and depends on your needs. You should specify your needs clearly like; how much deep you wanna go, which platforms are most important for you? etc.

Good Luck

Onur A.
  • 3,007
  • 3
  • 22
  • 37
1

You can try this: http://www.appgamekit.com/ (AGK) Code in c++, but working perfectly. A very simple engine.