I purchased unity licenses with the intention of making an iPhone game, but with some further exploration of the game concept, it occurs to me that it would likely benefit from being released on all four platforms: iPhone, Mac, PC, Browser.
My partner says the idea is terrible- as once we add windows to the mix we’ll drown in support requests. I’m under the impression that Unity has solved this problem for us- if the game works in the unity editor, it will work on all four platforms.
Has anyone done this? Willing to give an idea of the relative support load for each platform? Is the support burden about an equal percentage of sales / use on each platform?
I understand that the graphics capabilities of the iPhone and a desktop are very different, but due to the nature of the game, this isn’t likely to be an issue because its not very graphics intensive. This game is rather straight forward, and won’t likely even be using any of the more recent features of unity. It will be multi-player and I will likely be writing some custom client-server code, but I’m capable of dealing with this on each platform (if necessary, I believe I can do it all in javascript using the Unity networking APIs anyway.) I’m just concerned that this might be like the Java promise that turned out to be “write once, incompatible everywhere.”
So, is this a stroke of genius or flirting with disaster?
With the exception of deploying to the iphone, it is write once deploy anywhere. With the iPhone, you’ll need to make a few changes to handle input, texture compression, and a few other things. However, I think you probably may want to make additional changes because there is a difference between having a 480x320 screen and a full desktop supported resolution. I’d imagine that you’d have a slightly different UI, since it’s probably going to look odd on one of the devices.
As far as having additional support issues, I don’t think that would be much of a concern. In general unity games should handle similarly on both systems. Even if you encounter issues related to the windows platform, I don’t think it would be so many to the point where it’s not worth deploying it to the platform entirely.
But due to the nature of unity development, you really don’t need to have any special regard for keeping compatibility between the two platforms (windows/osx). You just do all your development on whatever platform, and it will naturally work on the other one. There are no special work arounds for having something work on windows as apposed to osx. If issues on one platform and not the other, it is most likely a bug in Unity.
Ah, good point. I forgot to mention that I was prepared for the nature of the different input modes between the iPhone and desktops- already do this, actually, since I use the keyboard and mouse while testing within unity. The different resolutions of the displays is something I’d spaced out on, and there will need to be some changes to the UIs and some of the other art. I think this will not be a dealbreaker, but will be some additional work.
But am I right in perceiving that no matter what graphics card / motherboard / whatever combination on PCs, unity should be able to run my game? (assuming it meets the system requirements unity gives for the browser plugin.)
I’d think that modifying the interface for each port wouldn’t be trivial. Interface, UI, the feel of the controls etc… is very important to me. But if you’ve got that nailed down, I say go for the multi port.
Let me rephrase-- has anyone done this? Written a Unity game and distributed it on multiple platforms? OSX Windows would be fine. I know the intention of Unity is that this should work fine, and that if it doesn’t, its probably a bug. I just am looking to hear from people who have done it.
I know control issues and screen resolution will be different, particularly between a desktop and iPhone. For some games this is probably a big issue, but for ours, due to the nature of it, it shouldn’t be a big one.
But, my concerns are along the lines of platform limitations. For instance, a client running on the desktop can use the Unity networking code to connect to a server. Is this true when running within a web browser? Is the Unity Browser Plugin sandboxed, or will it be able to connect to our servers the same way a desktop app would?
That’s the kind of issue I’m looking for. I’d love to hear from someone who has done this successfully.
You’d be hard pressed to find someone here who hasn’t ported their Unity games to multiple platforms.
It works just like it should. You select the platform to distribute to and hit the build button. Once the client is built you can do whatever you want with it, such as putting it in an installer system.
with this - do we have target defines?
such as #ifdef _TARGET_IPHONE or #ifdef _TARGET_WIN32
…I could see these as being very important. Input handling as just one example(iPhone vs Mouse/Keyboard)
If they don’t exist, is this something planned for Unity?
A large, serious project delivering to multiple platforms may have very different layout and control schemes (there’s the possibility of Wii as well) so how are people currently managing different code routines? The simplest being, the code needed to register a mouseclick or a iphone touch?
At work we deploy titles to PS3/XBox360/PC… and often it’s the one project that has been slated for release on these multiple SKU’s… so in the code, it really is as simple as an #ifdef… this also becomes important for shaders as well!
There are defines available for iPhone. It is difficult to maintain a single project, though, because Unity iPhone is forked from Unity 2.1. There will be some manual syncing involved in updating scripts in two places with the way things are now.
The API for Mac/Windows is not different, so defines are not required. You can branch on Application.platform if you want to do anything differently.
There are defines available for shaders for OpenGL/DirectX specific splits.
In practice we do very little for Windows/Mac/web build differences. Obviously there is more to do with an iPhone port.