How to target multiple platforms?

Started by
3 comments, last by wodinoneeye 10 years, 9 months ago
Hello GameDev Community,

I am currently developing a game framework for the Android system using Java. I have a small runtime scripting language that users can utilize to create models, move them around, and do various things.

However, I would now like to start targeting iOS applications.

So as a case study, how is an engine like Unity3D implemented? They have various scripting languages(Javascript, C#, etc.), and they can target multiple platforms.

Do they implement the same codebase on multiple platforms? For example: They have a Java codebase that implements all of the functionality needed to create android apps, and then they duplicate that codebase to implement all of the functionality they need for iOS apps, etc.

How do they deploy to multiple platforms? Are they simply translating source from a target language(C#, Javascript, etc.) and then generating Java code for Android from there Java codebase, Objective-C code for iOS from their separate Obj-C codebase, etc?

The overall theme of my question is how do I structure my codebase so that I am not duplicating a lot of work to support multiple platforms. Should I build my own VM that is deployed to each of these systems(I'm aware this will be a cost in performance)?

Thanks for your insight.
Advertisement

They have a Java codebase

generating Java code for Android

Objective-C code for iOS

They don't use Java or Objective C. They use C++. Let me clarify that. They use the bare minimum that is needed to interact with the device. The engine is written in C++ and the C#, Javascript are just scripting languages.

You may want to check out a few open source games engines to see how this works. Try Cocos2d-x or gameplay3d. You will notice that in these engines there tends to be only a single file that provides a layer to the bare platform and everything else is cross platform code.

Thank you for your response. I will take a look at the gameplay3d source code and then come back with more questions. :)

cool.png

Marmalade is another development environment that targets all the mobile platforms. http://www.madewithmarmalade.com/

You can write your code in lua which gets translated to C++, or you can write it in C++ directly. Then when you pick which platform you want to deploy on, it will generate the appropriate binary that you can load onto Android, iPhone, Windows or BlackBerry phones.

Ive been investigating console/smartphones for secondary game operations for a MMORPG and one definite concern is what display and input methods/capabilities are available (and what might be common across an adaquate spectrum of all the available hardware models)

You will hope to not have to re-code/re-test/re-debug the same code on lots of platforms - so looking for commonality between then (and unfortunately a 'least common denominator' requirement). Common library compatibility will be a key thing to consider.

--------------------------------------------[size="1"]Ratings are Opinion, not Fact

This topic is closed to new replies.

Advertisement