News for hackers. Stuff that matters.

natosha_bard

The Editor needs to do all kinds of complex window management, and other stuff, and also uses all sorts of 3rd party middleware (like Enlighten, for global illumination) that wouldn't work as being part of the runtime itself.

The editor is, however, largely written in Unity (uses the same APIs, etc, in addition to a bunch of private ones).

Hi! I'm glad to see that the post is promoting constructive dialog about what does or doesn't make portable code, which is what the point actually was (in addition to shedding a bit of light about the state of porting Unity to Linux).

I'll clarify a few things:

1. Unity was originally written for Mac OS X, then later ported to Windows (not the other way around). Given that it's more than possible to have a case-sensitive HFS+ filesystems (since, I think OS X Panther released in 2003?), IMO it would have been more future proof for us to be sure to develop on a case-sensitive filesystem. Unity users over the years have tried to run Unity on a case-sensitive HFS+ filesystem and failed, so it would have been nice for all of those guys. :-)

2. Note that the point in the article was not to avoid using OS-specific defines (that's impossible), it was to make sure to do something sane (like #error) in the #else case that would make it immediately clear something need to be implemented there.

3.1. Yes, the higher-level point is indeed, "Be smart/cautious about what language features to use for the sake of portability".

3.2 & 3.3. Of course it's just a matter of opinion, but I wish that we'd considered a more platform-agnostic approach to GUI handling when the number of platforms that Unity was ported to went from 1 to 2. I (and others) are still a fan of the menu-system-written-entirely-in-Unity-GUI idea, but others (within Unity), for very good reasons, disagree. Fair enough.

Anyway, thanks for sharing your thoughts; when I write about anything I'm always looking forward to hearing a different perspective, and one of the main goals I had in writing the post was to promote constructive dialog about what it means to write "portable" code. :-)

So based on all of the feedback we've gotten, I'm going to look at making a platform-agnostic installer as well as a .deb package, for people who want to run Unity on non-Ubuntu installations.

We're probably going to still only offer "official" support for Ubuntu, since that is what we build/test on, but we'll try to fix what we can when problems are supported on other distros.

Unity only uses native UI systems for Window management, input handling, and menus/file dialogs. The rest of Unity's UI is intentionally written in Unity's own GUI.

We chose GTK over QT for Linux because Unity 5.1 ships with CEF (https://en.wikipedia.org/wiki/Chromium_Embedded_Framework) as the embedded browser and CEF already pulls in a dependency on GTK).

il2cpp has advantages other than licensing (Mono is indeed open-source, but it is LGPL so it can only be used on platforms that comply with the LGPL; Unity runs on various non-LGPL platforms). il2cpp combines ease-of-use (C#) for Unity developers with native (C++) performance. What's not to love about that? :-P
Right, it's in the category of "things I wish we would have done back then" because it would have been easy to solve: we could have simply had everyone install OS X (which is what Unity was originally written on) on a case-sensitive HFS+ filesystem, but we didn't do that. Ooops. Oh well. :-)
> I don't think the problem is having case insensitive file systems, the problem is having both on different platforms. A similar problem as with different endians. If everything were case insensitive, it wouldn't cause issues.

Indeed; if everything were case-sensitive, or case-insensitive, we definitely wouldn't have these problems. But alas, it's not, and in 2015 here we are still having problems with case sensitivity. :-P

> While as a programmer, I prefer the level of precision case sensitivity provides, I'm hard pressed to make the case that it is better for an average computer user.

I also personally prefer it ('a' and 'A' are not the same character!!!!), but I'm not sure if thats because it's inherently 'right' or because I'm used to Linux where case sensitivity is more or less a given. :-)

I can totally sympathize, and we'd like to support every distribution. :-( But the simple statistics show that we get the most bang for our buck by supporting Ubuntu because of its desktop market share.

The great thing about the Linux community is that it's full if crazy smart people who will go out of their way to make sure stuff is working on their distribution. And of course if something isn't working on your distro, it'll be just like the player -- send us a bug report or poke us on the forums, and we'll do what we can. But in order to not spread our resources too thin (especially considering that this is starting off as an experiment), we have to set some boundaries, and we need to do what will make sense for the largest number of users.

And case sensitivity problems will exist as long as we have a mixture of some platforms (Windows/OS X) using case-insensitive filesystems by default, and others (Linux) using case-sensitive filesystems by default.