Migrating to Unity 5.6: A longest week of my life

A rant about how I spent the last week.

I have spent last week trying to migrate my latest title EMULATED: Pylons VR to Unity 5.6 and it has been a very rough week for me.

It’s one of the worst feelings that you get as a developer not only if you make games but software as well. When you have a huge list of bugfixes and improvements of your product but you first have to migrate to a new version of the platform and it gives you hard time.

The 5.6 update promised great things so it was a no brainer, I had to migrate to get advantage of awesome VR to non-VR mode switching, better lighting and many more advantages. Once I figured out how to switch between modes by having the ordered list of supported devices and calling VRSettings.LoadDeviceByName. This is a great premise but as I found out the hard way it wasn’t stable. I have several test devices and one of them is ASUS Zenfone 2. When I tried to run the 5.6 built app with the switch to “cardboard” it failed. After some digging through the logs from adb logcat, I found out that “gvr” was missing from the build.

It seems that native GOOGLE VR is not actually supported by all phones?

How can I release the game that is not going to work on at least one of the test devices that I have? How many devices are going to have the same problem?

In latest Unity versions a new compile time #define was introduced called UNITY_HAS_GOOGLEVR which tells google vr unity plugin scripts (that rely on it heavily) that your unity supports native GVR. Theoretically if you could remove that #define from your unity it will fallback to using GVR provided by google unity plugin (non-native) and should still work but removing that flag proved to be more complex than I thought as it’s not clear where it is being set. Another option that worked was to downgrade to gvr-unity-plugin 0.9.0 which is the last version before the UNITY_HAS_GOOGLEVR was introduced.

This worked but I ended up with old version of gvr unity plugin which wasn’t working very well, when I switched between the scenes it was showing bright huge pixels. That’s not very good experience…

The only option for me was to downgrade to Unity 5.5.2.

When I did that the build time increased dramatically and crashed the Unity after the build leaving several “Unity” processes running in the Task Manager. Also the produced .apk file was 130 mb which is 50mb increase from building the same project in 5.4.

I was desperate. Going with Unity 5.4 was still an option as I had to make a lot of changes that will benefit the users and I had to get it out as soon as possible. That felt really sore.

While I was struggling with the migration to 5.6 a new patch of Unity 5.5 came out. This improved the build dramatically and after optimizing the project I managed to get the .apk file size to 80mb. This was a success and I published the new release with a lot of good improvements but this was a really hard week.