Wednesday, February 26, 2014

Unity and Unity2D review

So this month I've taken on learning as much as I can about the Unity game engine, and in particular their new 2D game features in version 4.3! Even though I have actually taught a class on Unity3D before, their approach to game development was a much different workflow compared to what i'm used to in Flash, or even XNA for going about making a full game. Like many full blown game engines, instead of an environment where everything is basically on you - from controlling all the objects in your game with your own code, optimizing performance yourself, or even defining exactly how everything is rendered on a low level - Unity offers a lot out of the box. This also comes with the hangup of figuring out exactly how to customize the feel of things, because I feel it's really easy to quickly get a game off the ground which probably ends up playing exactly like something EVERYBODY else already made. All that being said, I am starting to get the hang of it, and there is certainly a lot that I like about it so far.

Things I Like

Physics, and collisions / collision detection all come right out of the box, and are surprisingly simple to implement.  Without any scripting, you can could set up a bunch of physics objects, and colliders, and watch them fall and interact with each-other just by hitting play.  With only a few lines of code, you can even script a playable character that can jump around, observe gravity, walk up hills and curves, and not go through walls!

The scripting is built on the .NET framework!  This means you have a TON of managed code features at your disposal if you choose to take advantage of them.  Its also easy to start building your own sort of extension on the game engine by extending their behavior class with your own library.  I did not completely realize all of that the first time I picked up Unity when it came out, but after working with .NET for 4 years in my career, i'm very excited to come back to Unity now and really see what you can do with it!

The 2D features!  This video says it WAY better than I can.  Check it out.  I am digging it so far.

Publishing is a piece of cake!  Its free and easy to publish your game to the web, or many flavors of desktop executables.  The licences run a bit on the expensive side, but if you have the cash, very little 'porting' is necessary to get your game up and running on 7 different platforms and counting!  What really gets me (and this is incredible) is that not only is it super easy to get your game interfacing with a joystick or gamepad, but that input also works in the web player!! That is AWESOME.

Hangups

These aren't really even that big.  Certainly not deal-breakers.  Doing 2D, I havn't run into any real-bad performance or rendering shortcomings yet.  I've just found a couple things difficult to get my head around, and maybe that's just me:

Physics, and collisions / collision detection all come right out of the box!  While there are some things you can tweak about the default physics settings, like the gravity amount, you really only get your standard falling and colliding.  If you want to take full advantage of the collisions system, I feel it could be kind of a hassle if you wanted to do any real unique things with the physics, like non-standard gravity systems, or magnetism or something.  You're basically working against what you get for free.  But then again you could probably easily handle collisions yourself using the pretty fancy collision boxes without physics.  I might need to do that.

The scripting is definitely a bit of a different approach here!  All your scripts for the game are basically behavior components that you can add to some game object.  They are kind-of like self-contained modules.  You code one behavior, and you can apply that to several kinds of objects.  Say a behavior that makes an object move around on its own if it has a velocity.  You could put that behavior on a car, or a bullet object.  This is all cool, but what i'm really struggling with so far is the lack of a reall way to have a script that manages the game itself.  Its just what i'm used to.  You can do this to some extent, but it feels hackey.  You really have to think instead about how all your game elements are going to interact in the game, and how whatever you were going to code in your 'game script' might better be expressed through the interactions of your other script components.

The coordinate system I feel right now is stuck in a really weird place as a hang-over from the 3D nature of the engine.  It can be confusing for 2D.  I'm used to units being Pixels, but like many 3D platforms, the units here are almost completely arbitrary.  Even importing 2D graphics and sprites has a really odd arbitrary way to ascribe pixels of the asset to units in the world.  This might be good if you want to draw really large assets, so that your game window can scale, and looks fine at any resolution.  It has actually been extremely frustrating for me however, since I'm trying to achieve a pixel-art look.  It is definitely possible, but it takes a good deal of effort I feel, to get it to look right.

And that's about it for now.  Maybe this was an incredibly naive review.  Not claiming to be any sort of authority on the subject.  I just hope maybe this helps somebody wanting to try unity!

No comments :

Post a Comment