Welcome to the first in a series of dev posts on how UnderMine is made. Hopefully they will be useful to other devs not because of the things we got right, but because of the things we got horribly, horribly wrong! Learnin’ from others’ mistakes is almost always a great idea. So without further ado, I give you:
How to make a top-down 2D game. Maybe?
So a lot of the great 2D indie games to come out recently have been side-scrollers. Which is great because I love side-scrollers! Owlboy, Dead Cells, Shovel Knight, Hollow Knight, Rogue Legacy, Spelunky, Cuphead have all been awesome titles I have had a ton of fun with.
Why so many 2D side-scrollers these days?
I think there is an easy answer to this: side-scrollers let you take a lot of shortcuts. You generally only need need left/right facing assets for your characters (which are often mirrored). You can cram a lot of cool vistas and set pieces into the background and add a lot of rich perspective with parallaxing. You get a lot of “free” gameplay from the struggle against your good buddy Gravity. Jumping is pretty well-understood. Signaling to the player the difference between foreground, playable, and background elements is not too hard.
With a top-down 2D game you get…. a different set of challenges entirely. So let’s look at a few of them in some more detail!
Part 1: Wall Perspective
To start, let’s go back to this little gem of confusing perspective.
What the actual fuck am I looking at here? Link is pretty much side-view, the Octoroks are entirely bird’s-eye, as are the walls mountains except the fact that I can see the cave entrance head-on.But hey, that game had a crazy set of constraints so I don’t hold anything against them. Plus it’s like one of the most beloved games of all time.
Much nicer! Wonderfully-consistent perspective! Cliffs and doorways make complete visual sense. Link and the chickens and the fences and trees are all viewed from a ~45º angle. It’s interesting to note, however, that the upper portion of the cliff is actually the same “height” as down on the ground, but because the perspective is so good, your brain believes it. LTTP is like the greatest top-down 2D game of all time. Just calling it right now.
But now let’s look at a dungeon room:
Those walls suddenly make no sense! The props and characters are still the same ~45º, but the walls have lost their damn minds. The south, east, and west walls are all leaning like crazy. I have no idea how you’d build a series of rooms like this in real life. Especially out of stone.
But of course there’s a very practical reason for this, and that is that every door, ladder, and wall section can simply be rotated in increments of 90º to match any north, south, east, or west-facing orientation. A great short-cut that saves makes for very flexible level layouts and saves a lot on art and memory budgets.
And of course our little buddy Isaac (bless his corner-cutting soul) took the same approach. So efficient!
Now let’s look at what Gungeon did.
Less efficient, but much more consistent! All walls are viewed from the same perspective. North walls are the only walls that can really be seen. East and west can only be seen from the top and the south wall can actually obscure your character.
UnderMine takes this same consistent approach to perspective.
Wall sections are divided between the background layer (the “north half”)
and the foreground layer (the “south half”).
The interactive elements (i.e. the player, the enemies, props, items, and NPCs) exist on the midground layer so they render on top of the north half and underneath the bottom half. The north wall is the most “playable” wall and works the best for props and interactive elements.
With the addition of some various corner pieces, the result looks like:
This approach fits the close-quartered, intimate feel for UnderMine much better than the leaning-wall feel of Zelda and Isaac.
Being able to get “behind” things lends a more cozy, sometimes-claustrophobic feel to the world which has been a big goal for UnderMine from the beginning. Also it feels less cheap.
Next time we’ll get into more details about how we achieved this occlusion effect with more than just walls!