Tuesday, November 20, 2007

Unity 2.0



Unity 2 has been out for a month or so now, and I've gotten my head around most of the additions (everything except multiplayer, basically). It's a bit of a mixed bag (I'll probably write a more thorough review for MacApper) but the nutshell version is this:

The new UI support is at once great (in that it lets you do all the stuff you really need to do fairly easily) and disappointing (in that the architecture is pretty much a horrible kludge). In essence the UI code is all stateless procedural drawing code versus a library of widgets. There's no proper event support, widgets don't have an independent existent or retain state.

The new UI code works, is pretty, and is fairly easy to use, but it's kind of architecturally lame and the code to support a UI is unnecessarily complex and high maintenance, or you need to write your own state-ful abstraction layer. By comparison, Director offered two UI options -- a clunky looking, incomplete, but otherwise functional set of widgets for basic interaction which could be dragged onto the timeline, and a platform-native plugin that let you build "proper" windows with standard controls, but which was completely un-integrated with the rest of your app.

So, on the good side, the new UI code works, looks good, and is integrated fairly well with everything else (cosmetically) ... i.e. your UI widgets don't look 10 years out of date or live in their own Window. On the bad side, writing UI code is unnecessarily tedious and you'll end up reinventing all kinds of wheels... But it does seem like you could write a bunch of wrapper code for all this that could make it not suck (whereas there was simply no way to fix Director's UI issues).

Enough on that topic.

The terrain engine is similarly great (the terrain drawing tools are simply awesome, the results look fabulous, and it's all very easy to use) and incomplete (terrain doesn't work with blob shadows, the terrain shader is kind of limited, and the lightmapper won't take into account trees or other geometry in the scene, so while your terrain can cast shadows onto itself, it can't receive shadows from objects, such as buildings, placed on it.

Several notable deficiencies in Unity remain: undo is still unreliable at best; UnityScript is still not JavaScript (which would be OK if the differences from JavaScript were properly documented, but they're not); and there's still no set-breakpoint-and-step-style debugger.