Hi there!  Thanks for stopping by for another edition of the Blightmare dev blog.  I had been hoping that today’s post could be a look back at the fairly major editor refactor that’s been ongoing for a while now, but it’s not quite ready so that will have to wait for another week.  Today I wanted to briefly show how we designed our mechanic prefabs from the start to prepare for iterations in art.

 

In case you aren’t familiar with Unity’s nomenclature, a prefab is a bit like a template for something that can be instantiated in game (or in editor).  It has a dedicated file on disk, and most editing actions need to go through a special editor that isolates the prefab.  Prefabs can then be referenced by other objects and you can instantiate them at runtime to make use of them – a bit like a stamp.

In Blightmare, all of our mechanics are built as prefabs, and then we instantiate them when a level is loaded based on where the level description says they should be.  This is a very common setup for Unity and is pretty central to how the engine works.  The thing I want to focus on today is how the individual prefabs are actually built and why thinking about it is important.

Several prefabs are used together to implement the various cocoon types

During development of any project, there are a lot of moving parts which can introduce dependencies on which bits of the game can be worked on or not.  Reducing dependencies – or at least preventing blockers – is a key goal to any development process because it allows the team to work in parallel which can be a massive speed up.  One of the most common dependencies in games is between art and code.  As an example, we will take a look at the Cocoon from Blightmare.

 

 

The cocoon was one of the very first mechanics that we implemented, and as a result, the art was not ready.  I believe we were focused on Blissa’s design and style at the time.  Getting her right is, as you might imagine, very important!  The way we tackled this problem is by making sure there was a clear distinction between art and code.  This has implications for the structure of prefabs, and if you were to go look at all the prefabs in Blightmare, you would see the same pattern in nearly all of them.

The top level game object is where we have the scripts for game logic along with logical collision.  Underneath that is the art root – often a prefab itself!  And finally, below that, is the actual art itself.  Below you can see what we have for all of these levels today:

But it wasn’t always like this.  Returning to the start of the project, we didn’t have any fancy cocoon art.  Instead we had “programmer art”:

 

 

This was enough to get the idea across without spending really any time trying to get the visuals right.  The benefit of this is that we could build all of the logic and even play a level with cocoons without needing better art.  Obviously we weren’t showing this to anyone at the time, but levels could be built and tested, code could be written and tested all while the art was being built concurrently.

As it turns out, we’ve gone through several iterations of the cocoon’s art as we tested different things and got feedback.  Keeping a clean distinction between art and code has allowed us to easily swap between visuals without affecting any other part of the game.  This is especially beneficial when we revisit mechanics that were created a long time ago.  Programmers may not remember how some of the code works anymore, other than it does work, and that’s totally fine!  Just modify the art prefab and away we go.  Sometimes the names of animations can change or other linkages can be broken that make the art “work” and even then, we only have visual anomalies instead of a fully broken game.  All of these scenarios make it easier and less risky to make changes which promotes the all important iteration.  So far, I think this structure has been very successful in the goal of keeping development happening across multiple fronts simultaneously.

 

That’s it for today, thanks for reading!  Please head over to our Steam page and wishlist Blightmare so we know you’re interested and head over to our Twitter to make sure you know about all the latest updates.  Have a great week!