Our last blog was about the Lumini, the most important creatures in our game. If you’ve missed it, you can find it here. This week’s blog is written by Niels and its topic is the transfer to the new Unity 5 engine. It’s an important topic, because you, like us, might have had some issues, or because you’re thinking about diving into Unity 5, but are unsure about what problems might arise.
Before scaring people too much, let’s talk about why we decided to upgrade from Unity 4 to 5.
In Lumini we’ve used Unity 4 for a long time and it worked very well for us. However, the big problem was that we needed unity pro for some of the most important features such as shadows, the profiler or loading your scenes additive async. All editor features are now free to use without the need of a pro license, which is absolutely amazing!
The other big reason for us to try Unity 5 was the new lighting system. Our impression after the switch was ‘The world of Lumini feels reborn’! The colors are even more vibrant and lifelike, bringing the atmosphere in Lumini to the next level.
But we had to do a lot of work to get it to this level. When we first opened our scenes in the new editor, everything seemed a lot brighter. In fact, the lights were literally blinding our eyes.
The values for the different lights had to be tuned down for it to look nice. Also, a lot of shaders had to be changed, because they reacted much more strongly to the lights. Some weird effects occurred, while others were simply overexposed.
The fog in our second world in the game, for example, looked like the above image, but with some changes it went back to normal, as seen below.
The physics were another area where we’ve seen a lot of small changes that had a noticeable impact on our game. Firstly, the spring joints needed to be tuned down a lot. Before Unity 5, we had to put in enormous values, sometimes in the millions, to get them to work the way we wanted. Such high values are no longer needed, so you can imagine the hilarious situations when we first saw the new spring joints’ behavior. After tuning them down they looked just fine.
The biggest change in physics was the fact that shape casting functions in code, like CapsuleCastAll, now register triggers. Because our Lumini are set to avoid certain objects they find in their way, all of a sudden they were trying to avoid all the triggers in our game as well. After we changed our layers and masks a bit, our code worked like a charm once more.
Those were the biggest changes, so we got away with it nicely. Most of the work went to changing our shaders and lighting, that took a few weeks to get right (but it was definitely worth it).
We didn’t have to do much code changes. They only thing we have to remind ourselves of, is the fact that you can’t talk to your renderer and collider components directly anymore; you have to use GetComponent for those.
If you’re making a 3D game in Unity and are thinking about switching, you can read the Unity 5 Upgrade Guide on the Unity website. It has a few more examples of things you might see changed in your projects. The switch isn’t very difficult and it was definitely worth it for us.
Lastly, if you’d like to see what Lumini looks like under the light of Unity 5, check our new teaser trailer on high quality.