can i really deploy one game to multiple platform with a single click?

hi.
unity says that it is a make once run anywhere type of platform. But is it that simple to deploy a game to multiple platforms with a single click? Or do we need some more work to deploy a game to different platforms? Unity games are made basically in C#. But we know that the native language for android, osx, windows are Java, swift and C# respectively. If a game is built in c# and deployed in android and iphone will it run smoothly? If it does, how exactly unity achieve that?

Unity compiles C# to other native languages using what is called a compiler, by doing this it gets native speeds. Technically if you were to write code specifically for the platform you are targeting you could get better performance but not so much that it would be worth it to most people.

As far as deploying to multiple platforms it is very simple indeed, but if you want to take advantage of platform specific systems (say a gyroscope or google play services) then you would indeed need to write some platform specific code. In this case the advantage Unity is offering you is that 99% of your code is the same and you only write platform specific code in relation to the feature you want to use.

There are of course additional details, such as that when you want to deploy to iOS you need to hit the button from OSX using xcode; but it is not a big deal at the early stages to worry about.

2 Likes

Its not quite as cut and dry as 1-click, but its not far removed.

1 Like

Its about half a dozen clicks and a recompile. There are tools like cloud build that can automate a lot of this process for you.

2 Likes

Yea… But aren’t you forgetting that with html5 and a web portal, it will magically just happen. I remember hearing that somewhere…

The new beta cloud build tools are pretty cool. You can set it up to automatically build each time you make a commit to your repo. Then you can set it up to automatically deploy to WebGL.

However this would be no click building. Which still doesn’t meet the OPs requirement of one click building :stuck_out_tongue:

The click is to the repo.

To the OP… With stuff like the phrase ´one-click´… I think most people understand that is a marketing term, but in reality, it is really close to being the truth with a huge number of platforms included. There is very little under-the-hood stuff you need to do.

Sorry, I was making a sarcastic reference. :wink: (boon doggy)

OP: is multiplatform publishing, while not one-click, does work pretty well. Bear in mind that you will have platform constraints. A super high def, heavy content game won’t magically work on a mobile device for example.

In most cases your game will work, but when you start using assets from the Asset Store or using 3rd party plugins, this is where things can get tricky.

For instance implementing in-app purchases on each platform will be different.

Deploying to Windows Store Apps and Windows Phone can sometimes require a lot of work as they don’t support a lot of the .NET methods that Unity’s implementation of Mono does.

You’ll also find there are some quirks on some platforms, and not others.
I’ve seen some weird physics behaviour on Windows Phone, but not on other platforms.

So really it depends on the platform, and how many 3rd party plugins and libraries you are using.

Another thing to consider is input. Coding input for a PC game with a keyboard and mouse, is very different to mobile device input or coding input for the new Apple TV controller. These things will need to platform specific.

Luckily Unity has preprocessor directives which makes life a lot easier, so you can do…

#if UNITY_IPHONE
  // Do iOS stuff here
#elif UNITY_ANDROID
  // Do Android stuff here
#end if

But generally, Unity has done 95% of the work for you :slight_smile:

2 Likes