Tuesday 26 May 2015

Unity 5

Unity 5

Rick Lane revisits the Unity engine, which is now capable of some stunning graphical feats, including real-time global illumination

When we last looked at Unity in 2013, it was a rapidly growing mid-tier engine. Big on flexibility and community support, it lacked the power of mainstream packages such as Unreal and CryENGINE. Two years and two major updates later, and Unity is much more powerful, more comprehensive and, for all but the biggest developers, completely free.

It’s firstly worth recapping what Unity 4 brought, especially its DirectX 11 support, which brought it in line with other mainstream proprietary engines. Unity 4 also affixed a whole new animation system called Mecanim to the program, and switched to smaller, more frequent updates, including rendering and physics support specifically for 2D games, and broader coverage of mobile devices.


With Unity 5, the team had several goals outlined. ‘One was creating a graphics powerhouse for Unity – being able to stand out with powerful graphics, but with an easy way to achieve it,’ says Carl Callewaert, Americas director for Unity. ‘That’s why we went after rich features and a highly flexible editor.’

The foundation of this graphical boost is Unity’s new real-time global illumination (GI) system, which is based on Geometrics’ Enlighten technology. Several companies have strived to achieve real-time GI for years. With Unreal Engine 4, Epic notably had to abandon its system in favour of a more traditional lighting approach. But Callewaert states that Unity 5 does have a fully real-time system available. ‘It gives artists the freedom to really set up the lights as you would in real life.’

But real-time GI is still very computationally expensive when extended across an entire game, so alongside this feature, Unity developers can still opt for the traditional method of baking lights. Sandwiched between these approaches is a middle option, which Unity calls ‘continuous baking’ – lighting data that’s baked into textures and updating automatically as the developer adjusts the lights.

‘The cool thing about that is, once the bake is done, you can dynamically change the intensity of the light, or dynamically change the rotation or colour of the light,’ says Callewaert. ‘It updates it on the fly, and doesn’t have to recalculate.’

Unity 5

In addition to real-time GI, Unity 5 also adds HDR reflection probes. These probes capture their surrounding environment in a reflection cubemap that, like lighting data, can be baked into a texture or run in real time. The final inclusion to Unity’s graphics suite is the new Standard Shader, a physically based shading model that’s used across Unity’s graphics rendering by default, aiming to ensure that objects are shaded consistently across the rendered image.

Alongside these new features, Unity 5 also sees some significant improvements to Unity 4’s Mecanim animation system. The biggest is the addition of state-machine behaviours, which was implemented because game developers were creating far more complex animations than Unity originally anticipated, and it essentially enables animators to add very specific behaviours to their animation cycles.

Callewaert offers an example. ‘Say you’re walking and you want some particles coming out of your feet – you just drag and drop the script on it, create particles with the walk animation and it works,’ he says. The animation ‘state-machine’ automatically recognises the item you want to connect with the animation – it could be particles, or it could be an audio file or a complex script command. ‘That allows you to really manage your project much better, again helping you to get your game out of the door faster,’ Callewaert adds.

The last major extension of Unity 5’s feature set is the new audio mixer. ‘It really brings the tools with which audio engineers are working directly into Unity,’ Callewaert says. Much of the audio mixer’s capabilities are fairly standard, but there is one interesting widget – snapshots.

Snapshots allow developers to save audio states, tweak their parameters and then switch between them depending on what’s happening in the game. For example, you might have a stealth game where the same audio track plays with different effects depending on whether or not you’ve been spotted by an enemy. ‘You can set all the settings, take a snapshot and then blend between different snapshots,’ Callewaert says.

The result of the updates through both Unity 4 and 5 is that the potential for game development within the engine is now much broader. Unity has been the go-to engine for small teams for a long time, but it’s now capable of tackling much larger projects. Noteworthy Unity-based games include Obsidian’s brilliant Pillars of Eternity and the upcoming Firewatch, a beautiful first-person exploration game that casts you as a reclusive park ranger spotting fires during a blazing Wyoming summer.

Unity 5

Unity also has recently expanded its already broad developmental horizons by making the engine entirely free. Callewaert is keen to point out that both Unity 3 and 4 had free versions as well, ‘but in Unity 5 we wanted remove as many of the barriers as possible, so that’s why we moved all the pro features into the free version’. This Personal Edition of Unity is also royalty free for companies earning less than $100,000 per year.

So where does Unity go from here? Well, there are a couple of major new technologies hovering on the horizon. The first is DirectX 12, which Unity intends to support in one of the updates for Unity 5. The other big potential game changer is, of course, virtual reality (VR). Callewaert points out that Unity has added free integration with the Oculus Rift in version 4.6, and states that Unity continues to be in ‘close communication’ with Oculus and other VR developers such as Samsung. Otherwise, though, Unity is tight-lipped about the specifics of dealing with VR hardware.

In fact, Unity is reluctant to discuss future updates in general, which isn’t entirely surprising given that Unity 5 was only released in March this year. But we can examine what the community most wants to see added to Unity.

By far the most demanded feature is support for Linux, a request that’s accumulated almost 20,000 votes since December 2010. Other community priorities include a default script for easy implementation of saving and loading in Unity-developed games, and a Voxel-based terrain system, which would allow more complex generation of terrain.