When should we buy and when should we write our own tools for Unity?

Everyone who’s following our team knows that we work with the Unity game engine. Since we started working with Unity it has grown greatly and became one of the favorite engines of the indie developers. Of course, like everything else, Unity has it’s pros and cons. In order to come to the point of this post I’m going to talk about some Unity cons.

A major con is that Unity does not have geometry editing tools out of the box while Unreal for example has it’s BSP brushes which can be used to build the foundations of each level. This lack in Unity is really bothering me as a game designer because it slows down the prototyping.

Another thing that Unity doesn’t have out of the box is splines. I don’t know if I’m way too much into splines but I constantly use them in every CG 2D or 3D package I work with.

So there are two problems I was trying to solve a while back – I needed this functionality and Unity just didn’t provide it for me. Unity, however, has something very clever up it’s sleeve. I’m talking about the so-called editor extensions. When a certain functionality is needed that Unity doesn’t have it can be added to the Unity editor via code. This is called Editor Scripting and it enables developers to add new menus, buttons, panels, windows and all sorts of other UI elements to the existing editor interface. So what I’m trying to say is that everyone can fill the functionality holes yourself.  Well, everyone who can program that is…which judging by the people I know is almost nobody… BUT DON’T WORRY!

The Asset Store

A few years ago Unity launched the Asset Store which is an online platform for selling Unity assets. Developers upload their creations there, set prices for them, other developers come and buy their stuff, Unity receives a 30% commission and everyone’s happy. The Asset Store gives developers who don’t have the skills or the time to make a certain asset the opportunity to purchase such an asset and save their troubles. So basically my studio can purchase some geometry creation and spline plugins and we’ll all be set!

Yeah but not exactly. See, we are a small studio and each spent or earned dollar makes a significant difference for us. We can’t afford spending money on everything especially on code when we have a perfectly functioning programmer (me). The only problem is that there’s only one of me and a lot of games to work on and if I had to write unity extensions for everything, I wouldn’t have time to nurture some of the basic needs of my own personal body.

In search of the right balance

So what do we do when we don’t have money but we also don’t have time to work on our own editor extensions? Well the answer’s pretty obvious – cgpeers.com. No, I’m kidding of course. We need to stay balanced and not spend too much money on extensions while not wasting too much time on writing them ourselves. Basically, we need to stay cost-effective.

 - Oh, so that’s it? That’s easy! Thank you, Mitko, how didn’t I think of that first *sarcasm*

Well, to stay cost-effective we need a little bit more than just the right mindset (although that’s a good start). We need to know exactly what we need and why we need it and also be able to estimate how much time it’s going to take to make it versus how much money we would spend on buying an external solution.

Don't go giving money right away

Every developer has/has had a long term relationship with at least one software. In the beginning we learn to use the basic functionality of the software, then we gain confidence become „experts“ and then all of the sudden we learn that that’s not exactly true and our professional degree in this software spans to a mere 10% of it’s functionality and so we start learning again with a slower and steadier phase. Mastering a software package takes years or at least one and throughout this time we develop certain habits and skills which help us work better, faster (stronger) and work around the quirks of the application.

My advice if you’re new to Unity is: don’t  just go ahead and write/buy extensions for it. You still don’t know it’s limitations and what it actually lacks. Instead, look around, you might find out that this feature already exists.

If you’re totally sure that the feature you’re looking for doesn’t exist, look around the Unity community first before resorting to the Asset Store. Sometimes you can find useful editor scripts in the Unity Wiki or in the forums.

If after all you decide to buy an editor tool from the Asset Store after all, look for other tools that have similar functionality. You want to get sure that you get the most out of your money. That doesn’t mean purchasing the most complex piece of code there is. In some cases you might be after a single simple functionality, in this case don’t buy huge editor packages that offer the functionality + a lot more stuff + a Swiss army knife + a full year Playboy magazine subscription. Take the time to find the package that suits your needs the best in comparison to the price.

When writing our own code...

So far I told you to use the asset store as a last resort and be super-picky about what you purchase. And you’re maybe thinking that you could be better off writing the code all by yourself. So now I’m going to tell you what you need to consider before doing that.

Each game project has different requirements and different needs. Therefore you can’t use your new, shiny, complex voxel terrain system for that 2D bouncing ball game you’re going to be developing for mobile phones. You would however need to make 2D levels in this case but making content by hand sometimes can be hard and may take up too much of your time. So now we know that we need to write a fancy editor tool that would help us with the level design.

Save work time, don't increase it

When starting a new project it’s important to estimate what types of tasks you will need to do in the editor during the development process. If you manage to visualize the development process, you might just be able to pinpoint repetitive operations that would slow you down or maybe tasks that take wa-a-a-y too much time to accomplish before you have started work. You need to plan your extension scripting accordingly and tackle these problems with your custom extension. You need to make sure that your extension really saves you time instead of doing the opposite.

I’ll give you a simple example for that. In a low budget mobile airplane game, we were asked by our client to make lots of levels where the player has to pilot their plane through various checkpoints. To do that we had to make a checkpoint prefab which was basically a circular gate through which the plane had to fly. We then had to clone this prefab multiple times, position and orient each checkpoint instance and then link the checkpoints to tell them which checkpoint is the next one. This may not sound like a lot of work but do that 150 times and test and I promise you, you will want to die. So in our case I wrote a simple editor extension which allowed me to place and orient checkpoints very easily and the extension linked the checkpoints automatically + it provided functionality to easily re-link checkpoints. This sped up the level design (if you can call placing checkpoints that) proves greatly and the project was more lucrative for us because while we didn’t get more money for doing so, we spent a lot less time and effort working on it.

Research

Another really important thing when making a custom Unity extension is research. If you want your tool to save you time, you need to make sure that the workflow it provides is smooth and intuitive. To do so, open up videos of similar extensions and see how they’ve done it. Don’t go reinventing the wheel. Nobody’s going to criticize you for borrowing ideas, Ğ°fter all, you’re writing this tool for yourself. Also, try to visualize how you personally are going to work with the tool and what would be most intuitive to you. Try to get the best of both worlds.

Drawing the line


So in the end, it’s important to carefully plan the usage of extensions. This is something that aids your work process or maybe even makes it possible in first place and it’s not to be taken lightly. If you are serious about making games with Unity you’re certainly going to need editor tools and extensions and the right ones can make all the difference.

Oh, and about my dilemma with the splines and the mesh geometry features? I wrote a special Spline system for our company which we have been using for a while and it helps us a lot. As for the geometry generation – we decided to purchase a package that wasn’t too expensive and provided all the functionality our studio needed.