Jump to content
  • Advertisement
Sign in to follow this  
MikeS

Unity How to target multiple platforms?

This topic is 1978 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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. Edited by MikeS

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

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

 

cool.png

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!