The Unity (formerly Unity3D) game engine is quickly becoming the de-facto standard for many Flash and Indie game developers wanting to make 3D games. Now that the Unity Editor runs on Windows and has a free Indie license (both untrue last year), it is poised to become ever more popular. However, Unity is first and foremost a 3D engine, so it stands to reason that it should not support many of the facets of building a 2D game. In reality, though, it actually works really well as a 2D engine if you set up your scene and scripts properly. You can have a pixel perfect orthographic camera, collisions around your sprites, and even physics. Where it lacks 2D game engine power, however, is in the sprite animation department. There is no easy way to animate your sprites. This is where Sprite Manager 2 by Above and Beyond Software (www.anbsoft.com) comes in to save the day.
Sprite Manager 2 (SM2) is an easy-to-use middleware that works with all licenses of Unity (free, Pro, iPhone). It takes creating and animating sprites in the engine out of the hands of your programmers and into the hands of your designers and artists via a Unity Editor plugin. You simply include the SM2 package in your project, attach a script to a GameObject you wish to have a sprite animation, and use the Unity Editor’s Inspector to set up the animation frames and settings for each animation. There is a Sprite Timeline Editor that lets you drag & drop your animation frames (one per file, which is kind of annoying) into the editor and build an animation. SM2 even has a number of features to let you use frames that are all different sizes and still make the animation look smooth. All of this without a single line of code on your part!
Of course, there is an API that programmers can use to check the status of the animation and control the sprite animations (play, pause, stop, etc). Most of the heavy lifting for setting up the sprites is in the Unity Editor. As a game programmer first, game designer second, I must say that it is nice to be able to focus on making a game fun (isn’t that what we are all doing here?) and not making a game framework.
Sprite Manager 2 has some excellent features under that great interface hood as well. It takes all of the sprite animation frames you give it and automatically builds a single optimized sprite sheet for each sprite. Now, all of your sprite’s animation frames are in one file, and SM2 is smart enough to reuse frames and not duplicate them. This saves a lot of space, and if you are developing for iPhone, you know that space is limited as you try to stay under the 10MB 3G network download limit. In addition, SM2 utilizes the iPhone’s dynamic batching system which helps minimize the number of draw calls that need to be made. This feature alone is a must-have for iPhone developers doing 2D since Unity, left to it’s own devices, will make many draw calls for every sprite. You will find your 100 frames per second frame rate drops to 15fps on the iPhone quickly!
With all the positives, there are a few SM2 negatives, however. The most prominent being that each frame of the sprite animation must be saved as a separate file. This forces you to adjust your art pipeline to fit accordingly. You may need to develop some simple scripts to make this process smoother for your artists. Another minor annoyance is that once you add animations to your sprite, they are stuck in that order unless you want to do it over again. For example, one of the settings in the editor is the “number of the default animation.” So if you add your default animation as the 10th animation in the list, you need adjust your setting to equal 10, which is confusing considering it should be 0 (the first in the list). One final gripe is that the documentation provided is a little lacking. The scripting API is fully documented, and the tutorial steps you through how to setup a sprite animation (all good things, by the way). However, there is no documentation on HOW to use the API properly. This could pose a problem for beginner game programmers. It would be nice to have an example script showing how to swap between animations in a gameplay setting would be nice. Luckily, A&B has excellent tutorial videos on their site and they participate actively in the Unity community, so help should be easily obtained.
Since everyone loves concise lists, here’s a Pros/Cons list to help summarize:
- Unity Editor plugin lets you build and edit your sprite animations visually, not in code
- Automatically generates an optimized sprite sheet (great for iPhone size limitations)
- One draw call and batching sprites for great performance (great for iPhone performance)
- Sprite timeline editor lets you create animations frame by frame for excellent frame reuse and fine animation control
- No coding to get sprite animations into your game!
- Auto-resize and anchoring lets you have oddly shaped sprite frames that work together
- Each frame of an animation must be saved out as a separate file, which adds overhead for artists
- You cannot re-order the animations once they are added to the sprite’s GameObject
- The scripting API documentation could pose a problem for beginning game programmers
Sprite Manager 2 fills an empty niche in the Unity platform by providing an optimized, easy-to-use, and cost effective solution for 2D sprite animations in your game. The current price is $75 for a single seat, and $275 for an unlimited seat studio license. It is worth more than $75 considering how many man-hours it will save your team. Overall, the robust feature set heavily outweighs the minor grievances of pipeline adjustment and documentation.
If I were on some rating website, I’d give it 5/5 stars.