Unity3D fully lives up to its reputation
In recent weeks I have spent a bit of time with Unity3D, the middleware package that gets a lot of acclaim — and deservedly so, I must say. Those of you who have followed me for some time, or know me, are aware that I am always very outspoken about issues I see in the things I do or work with. Whether it’s been my criticism of Qualcomm’s operations during the BREW era, whether it’s been Hollywood studios’ approach to DVD and Blu-Ray, or things such as the Kindle. When I see problems, I address them and offer up constructive criticism, because oftentimes I do have workable solutions to offer. The fact that on various occasions my comments have lead to actual change, shows me that my attempts not to be unreasonable have been successful. I usually just point out things where I have the distinct feeling that someone simply didn’t think things through.
The truly curious thing about my working with Unity3D so far is that I have not a single complaint. This is by far the most complete, reliable and comprehensive middleware package I have ever seen and I have yet to find an area where the package is weak or has true shortcomings. Sure, it is inevitable that the package won’t do exactly what I want all the time, but that is the nature of the beast. On the whole, however, you can tell that Unity3D has been put together who understand the subject matter, knew what they were doing and what developers need. There don’t seem to be a whole lot of useless because-we-can features and all the areas I have touched upon so far in my tests have all been thoroughly thought out with interfaces that are precise and complete. As a software developer one really can’t ask for more. And to think that the basic version of Unity3D is actually free… it truly boggles the mind.
When I started playing around with Unity3D one of the first things I had to decide was whether I wanted to program in JavaScript or C#. I’ve been working with JavaScript over the years, porting countless J2ME games to BREW, but somehow it never really clicked with me. I had never worked in C#, though I had heard some good things about it. Looking over it briefly it seemed very similar to C++, the language I’ve been using most for the past 20 years or so. It was that similarity that made me decided to use C# in the end.
Ironic, I know. Me, using a programming language developed by Microsoft… ah well, the world is full of surprises. But in all honesty, so far C# has been pretty good to work with. There are few things that I do not particularly like, instances like the lack of static array initialization, where the language has taken a few steps backwards as opposed to forward, but on the whole, it’s been cool and fun to work in C#. The main problem I have with it – and that’s really just a minor gripe – is that I think it is too user friendly. The language makes it possible to implement certain things in a very quick and easy manner, making it seem super-cool, but if you look under the hood, you realize that a tremendous code overhead has to be generated to make that functionality possible. Therefore a single two-line code snippet may result in brutal code bloat and a serious performance sink without the programmer ever suspecting it at first.
This is not C# problem, though. It is a trend that most modern programming languages have been following – including Java and JavaSCript – and while it seems great at first, to me as a down-to-the-wire programmer who used to count CPU cycles for a living in assembly coding, it is really the wrong way to approach programming. Most of today’s software is clearly evidence of that. Just look at the resource hogs that simple applications like word processors have become. It is not because they have so many more really cool features, but because their implementation is just totally shoddy.
But I digress…
So, I’ve been doing some work in Unity using C#. I’ve never been big on 3D programming. It’s never been something I was particularly interested in, but imagine my surprise when it took my no more than a few minutes to actually script a simple 3D application in Unity. A few hours later I was able to actually have a scene with some user control. This is hard core. There was virtually no learning curve to that point and what really took me the longest was looking up the C# syntax for what I wanted to do, because as it turned out, in the details, C# is quite a bit different than C++.
There is a learning curve, of course. No middleware could be without. It is the nature of the beast, but the fact hat it took me virtually no time to jump in and do things in Unity showed me that this was very well thought-through, because the API made sense from the get-go, and Unity’s naming convention is clear and to the point. No guesswork involved.
As I expanded my tests and began to do a little more specific programming, I had to spend some more time reading the documentation, but it was always a very clear process and I never had the sense of being overwhelmed – despite the fact that Unity3D has such a wealth of functionality that it could make your head explode.
Over the past week or so I ran into a small problem. I was doing some GUI programming and had planned to do some fancy visual effects with texture blending, only to ind out that Unity’s GUI class is somewhat limited — a lot actually. Some of the functionality I was looking for is simply not there. I tried to dig deeper but everywhere I looked the tenor was that Unity couldn’t do it, so I decided to look at NGUI, one of the third-party packages that is available. But just as I was playing around with it, a work-around for my problem came to my mind. so I switched back to my original project and tried it out, and indeed, I had found a working fix to draw GUI elements, using different shaders. This was a relief because I would not have to rewrite what I had done so far and could simply continue down the path I was going.
Even though this immediate problem has been solved, I now run into the problem that I would like to render a 3D object in front of the GUI, and Unity does not immediately allow me to do that. So, it’s time to figure out another work-around for this.
As you can see, there are still a few things I need to figure out and get to work, but I am hopeful. Perhaps, I will decide to use NGUI, after all, when everything is said and done, if only because it might allow me to get certain tasks done in an easier fashion. I haven’t decided yet, and that is what makes Unity so great and so much fun to play around with.
I like Unity 3.5 but after upgrading to 4.0 I had nothing but trouble, the license server would crash and when I went to get help from the company they kept trying to get the license files for 4.x but when it installed there were “none”. Apparently, Unity 4.0 doesn’t like Vista SP2 or Windows Server 2008 installations. After I tried to uninstall 4.0 I tried to go back to 3.5 and that hosed my installation up really bad, had to wipe out all the registry keys and files associated with both installations and start over.
Unity 3D is a great package, don’t get me wrong but there is a lot that needs to be worked on. The other thing is that the frame rate is artificially slow in both the Unity 3D browser plug-in and executable, it seems to make certain people sick to their stomach when they play games based on Unity 3D even while set on “Fastest” for best frame rates. Note: Some of these people have very high end consumer grade enthusiast graphics cards and computers so that’s not the issue.
By default the Unity 3D demo (Free version) and the Pro are exactly the same except the Pro you get more tools included and a lot better support. The manipulation of graphics on their own, assuming you don’t “extend” Unity 3D via C# and C/C++ you will run into that exact problem you are faced with.
By the way, if you are trying to create industry standard, high end graphics for interfaces you should look for the plug-in called, Scaleform. Granted, there is a stand alone Scaleform package and I suggest you get it but I will say this, it’s an Autodesk application and the stand alone Scaleform is uber expensive with all the bells and whistles active. :))
Scaleform can do all the GUI you need on the front end and help you create some animations, however there is packages on Autodesk’s site that do exactly what you are looking for and do a better job at it.
Here’s Autodesk’s Gameware website URL:
http://gameware.autodesk.com/
P.S. I hope you get your GIT and SourceTree problem resolved quickly.
A few days after making this blog post I decided to go with NGUI and I have been exceedingly happy with it. I am new to Unity’s approach of game development – I am coming from a hardcore down to the wire assembly background originally – and thinking in terms of developing so much visually took me a bit to get used to. But now that I do, I am fascinated by the possibilities.
I know what you mean, counting cycles and no assembler to tell you if you’ve made a coding error or not. The assembler assuming you know what you’re doing. 🙂 Yes, NGUI is an interesting package on the Asset Store for Unity3D, there is a couple of things I would change in the coding so it works immediately the stage upon importing the library, so you don’t need to do manual patching so your code works with the 2D NGUI in 3D space. Unless he changed this release on the newest version, it was a pain to get it to work correctly unless you were doing only 2D demos or games. The problem was the camera angle and it was a visible reflection even when the windows you were creating weren’t “visible” and you’d try to turn off the reflection from the 3D camera and it wouldn’t do it no matter what.
But, they may have figured out what the problem was and fixed it by now.
Yes, it may be fixed because I did not notice that, and my UI is entirely in 3D. I started with 2D sprites but eventually we decided to replace all the objects with 3D objects and it was as simply as could be.