informa
5 min read
article

Some Invaluable 2D Tools from the Unity Asset Store

During the development of PuckMania in Unity3D, we ran into some of the platform's limitations with 2D-based development. In this week's PuckMania dev blog, we discussed a couple of times that we went to the asset store to work around those limitations.

Last week, I gave a brief introduction to PuckMania and its development progress.  I touched briefly upon the goal of doing as much of the design and development as possible on my own - it makes the budget a lot friendlier, and provides an excellent exercise in working around constraints.

It helps to have good tools.  And to call Unity3D a "good tool" would be a ridiculous understatement.  I've been a Unity evangelist since being introduced to it a few years ago, and believe more than ever that it is a game-changer, especially for independent developers.  It is easy to learn, versatile, and powerful.  And it can do just about everything right out of the proverbial box, even in the free version.

But like everything else, it's got limitations.  And once you start working with it enough, you'll begin to encounter these limitations and have to decide how you're going to work around them.

2D in Unity3D

Despite the name, Unity3D can be used to develop projects in 2D.  Up until not too long ago, Unity had no built-in support for 2D projects - 2D games were made with 3D objects, using orthographic perspectives and quads to simulate sprites.  In Unity 4.3, native 2D tools were finally added, which gave support for Sprites, 2D physics and colliders, sorting layers, and other nifty 2D tools.

PuckMania is a 2D game, so these new tools are invaluable.  But there are times where it feels they held back a bit.  I'm going to talk about a couple of cases where a tool or functionality was missing from Unity, and I felt it would be a good investment to go to the Asset Store for a solution, rather than develop around it myself.

Vectrosity

I'm creating an obstacle in PuckMania that can add an attractive or repulsive force to a puck that comes within its area of influence.  I wanted this area to be either circular or shaped like a slice of pie, and have arced lines radiating to or from its center, like so:

A simple 2D effect
A simple 2D effect?

Now, if you're relatively new to Unity, you'd be tempted to go into the Create menu and find yourself a Vector-based primitive, such as a line, circle, or whatever...

...aaaaaand, nada.
...aaaaaand, nada.

There's nothing there but the lonely ol' sprite.  No primitives to make vector-based lines, circles, or anything of the sort.  And let me save you the trouble, there's nothing you can do in code, either.  The closest thing you'll find are editor-only commands for drawing gizmos and handles.

The only real way around this is to simulate line drawing with the tools we have:  polys, quads, sprites.  It's a real pain in the neck, and if you're hoping to throw together a 2D game without much fuss, kind of discouraging.

This is what the Asset Store is for, ladies and gentlemen.  The Unity folks knew that no matter how powerful their product is (and it's very, very powerful), there would always be something else that someone would want to do with it.  They made their workhorse very extensible, built a store for free and premium add-ons, and integrated it right into the program itself.  Even a do-it-yourself'er like me couldn't resist looking for a good line-drawing tool so that I wouldn't have to completely reinvent the wheel.

And now I'm going to sing the praises of Vectrosity, by Starscene Software:

This is not just a thrown-together add-on for unity that can draw some lines.  It is a crazy mad robust vector drawing powerhouse!  It's simple to use, had a lot of power and options under the hood, has fantastic documentation, and it only costs $30 (as of this writing).  You could conceivably use the Vectrosity library to create a complete old-school 80's vector graphics game (like Battlezone or Tempest).. actually, I think it even includes a free demo and source for such a game.

So, if need something simulating vector graphics in your game, this is the way to go.  I used it to create the circles that I needed for the effect (and it allows partial line drawing, that's how I got the arcs).

AutoTileGen and AutoTileSet

Many 2D games use tiling systems for level generation, and PuckMania is no exception.  We're using it primarily for the static wall geometry on the levels.

Now, Unity has a very nice editor for 3D world building and object placement.  But when placing repeating objects such as tiles, you're going to wish there was some sort of editor overlay to help with the automation of that.

I stumbled upon AutoTileSet quite by accident:  I was actually looking for a tile generation tool on Steam when I came across Pixelatto's AutoTileGen.  This is a very good tool that will generate a set of 47 tiles from a handful of input images such as caps, sides, background, etc.  Very fast, and simple to use.

But what's neat about AutoTileGen is that it comes with a Unity add-on called AutoTileSet.  AutoTileSet creates a grid overlay in Unity's scene view, and will automatically place tiles creates in AutoTileGen, along with colliders.  It does have some quirks with sloped tile and collider placement, but they're pretty easily worked around and well worth the trouble.  The complete source is there and fairly easy to parse, if you need to make modifications (as I did).  AutoTileGen costs $25 on Steam (sometimes cheaper with the many Steam sales), and should get a good workout with your 2D development needs.

Conclusion

The moral of the story is, as always:  Don't reinvent the wheel!  Unity is powerful, but I guarantee you, you're going to discover that something you need is missing.  Odds are, you're not the first - hit the asset store and benefit from good work of others.  You can find something free or reasonably priced that will save you time and possibly money in the long run!

Have fun, and keep making that game!

Marc

Originally Posted To:  http://www.puckmania.com/blog/some-invaluable-2d-tools-from-the-unity-asset-store/

Latest Jobs

Treyarch

Playa Vista, California
6.20.22
Audio Engineer

Digital Extremes

London, Ontario, Canada
6.20.22
Communications Director

High Moon Studios

Carlsbad, California
6.20.22
Senior Producer

Build a Rocket Boy Games

Edinburgh, Scotland
6.20.22
Lead UI Programmer
More Jobs   

CONNECT WITH US

Register for a
Subscribe to
Follow us

Game Developer Account

Game Developer Newsletter

@gamedevdotcom

Register for a

Game Developer Account

Gain full access to resources (events, white paper, webinars, reports, etc)
Single sign-on to all Informa products

Register
Subscribe to

Game Developer Newsletter

Get daily Game Developer top stories every morning straight into your inbox

Subscribe
Follow us

@gamedevdotcom

Follow us @gamedevdotcom to stay up-to-date with the latest news & insider information about events & more