23 Jan 13
dislekcia

The Layerset Editor

One of the core elements of the Desktop Dungeons metagame is the idea of building up a Kingdom over time, that the titular desktop is that of a behind-the-scenes administrator (you) on which a representation of your city grows as you play. Lurk’s initial concept art set the bar incredibly high with intricate miniature buildings in a lush green field rising magically up out of an open book. We took that as a challenge to make the rest of the Kingdom screen look as good.

Building that juicy Kingdom piece by piece has proved rather time-consuming. After all, the game has had a functionally working Kingdom since just before GDC 2011, the Kingdom works as it is – it just doesn’t look as good as we want it to. The main problem is that replacing simple buttons with multi-state artwork that changes as you make choices doesn’t make your life easy. Firstly, every single button needs custom graphics for each state it could be in: You need mouseovers for every building, selection patterns, etc. Then every single one of those images needs to play nice with the other images around it, buttons are usually graphically separate items that you can pretty much put anywhere you like over a background. On top of that, you have to allow for Kingdom states in which different parts might be at different progression levels, one player might have a lvl 2 Blacksmith and no Church at all, another player might have 3 level 1 buildings but no Blacksmith – all the paths, doodads and elements that make those buildings believable have to work no matter what the player chooses to upgrade and when. Sometimes that means even more artwork, this time with conditional rules as to when it’s displayed.

This was not something that we felt we could set up easily in Unity’s editing suite, mainly because we wanted our artists to be able to build up the Kingdom without constant programmer interference (limited Unity licenses also played a part). The success of our Tileset editing program and the neat stuff that Dorianne managed to pull off with it encouraged the building of another tool – which we promptly called the Layerset editor. Because we’re great with names like that…

A layerset’s job is to take a Kingdom state (or a map screen state) and display a series of transparent layers one over the other, building up the Kingdom screen element by element. When you mouse-over a building, the layerset updates the Kingdom state and the displayed layers change accordingly. Thankfully we were able to build the state management into the Layerset editor as well, which made adding new layers (and the corresponding states to control their visibility) much easier. To illustrate the level of complexity that this “simple menu replacement” is at: The latest Kingdom uses 91 flags to control its state and selectively displays 189 separate layers; The layers themselves are pulled from 4 sets of 1024×1024 textures using custom built meshes in the editor.

While this particular editor has proven much more complex to work on than any of the other DD-supporting tools we’ve built so far (and generated its own fair share of headaches), it has meant that we could spend programmer time on getting the game feature complete while letting Dorianne really get her teeth into making the Kingdom look great. Integrating everything into Unity is proving a lot easier than we expected and the best part is that once we’ve done it once – updating the Kingdom becomes a no-hassle process. It’s also meant that we could make some much-needed changes to the flow of the game – the tutorial dungeons are now part of the main Kingdom screen as areas the player “clears out” so that the city can grow, instead of forcing new players to navigate a largely irrelevant map before they’ve grokked what the game’s about.

It still blows my mind to see what talented artists can come up with when you give them tools instead of briefs.


One Response to “The Layerset Editor”

  1. Despayre Says:

    I can’t even begin to tell you how much I enjoy these blogs. I bought the game pretty much entirely because of the idea around kingdom building, thanks so much for the behind the scenes look at how it’s coming together!


Copyright © 2014 QCF Design
Powered by WordPress, theme based on one from Themelab.com