Tom here for another article on the development of Blightmare. This time, I will start introducing our custom made editor. Now, you may be asking, “Tom, you’re using Unity, and Unity is an editor, why would you write your own?” Well let’s find out!
So firstly, what do we even mean by “editor”? In the case of Blightmare, this is the tool we use to build all the levels in the game. It currently looks a little like this:
You probably have already seen it in previous posts. In the Blightmare editor, our level designers can draw in the terrain, place interactive objects, add spikes, decorations, control how things will move, etc.
So why create our own, if Unity has a built in editor? It’s mostly about consistency and ease of use. Here are some examples.
Unity allows you to draw tile maps, just like we’re doing for our terrain. But it lets you draw any tiles on any layer without really any constraints. In Blightmare, we do have certain constraints. For example, terrain lives on one layer, and spikes live on a different layer. This is both because of rendering considerations, but also to make the game play code easier. We can then generate different colliders, for example, for the terrain and the spike layers.
If we were using the Unity built in tile map editor, we couldn’t constrain these tiles to their specific layers. So it would be possible for level designers to accidentally put the wrong tiles on the wrong layers. This would look correct, usually, but would behave totally wrong while playing the level, in possibly hard to notice ways. By using our own editor and adding our own constrains, we can avoid this whole class of problems from even occurring in the first place.
Another example is level integrity. For example, Blightmare currently doesn’t allow two interactive objects to live in the same location in the level. Our editor enforces this. If it wasn’t for that, we would have to add additional code to Unity’s editor to make such constraints, which effectively means we’d be writing all sorts of these little editors anyway.
Usability is an important factor too. Since we have our own editor, our level designers don’t have to actually download Unity themselves. They don’t have to worry about checking out the latest code, running Unity, loading the right scene, making their changes, then making a git commit, possibly dealing with conflicts, and so forth. Instead, they just go on Steam, download the Blightmare Editor, and away they go creating levels.
Finally, by having our own editor, we also control our own level file format. This isn’t strictly necessary, but it allows us certain options. Specifically, it means we can work with level files completely outside of Unity. We could, for example, create a map viewer to work on the web. Or create some kind of analysis tools to verify that our levels are correct and complete. Or to make large automated changes to a bunch of levels at once. All of this would be much more difficult if we had to effectively reverse engineer Unity’s file format.
In future articles we’ll dig into what the editor does and how it works in a lot more detail. Until then, stay safe and keep your distance!