Doors! What are they good for?! Breaking and entering!
Everybody knows doors are the bane of every game developer's life, so I thought I'd write about how I've been handling them in Shadows. This post may contain what I would consider some mechanical spoilers; that is, a few cool things it may be fun to discover in the game without reading about them first. If that bothers you then it might be best to skip this one.
The reason doors are difficult to get right is that by default, their real-life movement can be fundamentally incompatible with slick feeling first-person movement. The prime culprit is which way they open; in real life double-swinging, doors are pretty rare outside of a western saloon. In games though, we always expect them to open away from the player, so we don't suddenly have a big wad of box collider coming towards us. If you've ever played a game where the doors open towards a player then you may have noticed just how awkward that feels. It's a pretty easy fix though, just make them always open away from the person that opened them.
On the technical side of things, the doors in Shadows also act as my 'culling portals'. As the game is procedurally generated, I had to come up with my own system for handling culling. The game has a lot going on, and there's no way we can render everything in the game at any one time. The solution to this is only to render what the player can see. To help with this, Shadows of doubt breaks everything down into rooms connected with doors (even the streets are behind the scenes treated the same as rooms). Doors act as the portal between them and allows the game to create trees or groups of rooms that should be visible to the player. To cut a very long, quite boring technical explanation short; doors in shadows help me narrow down what can be visible to the player at any one time. Useful!
The game isn't rendering a whole lot behind closed doors.
After getting the basics right it was time to move onto the fun stuff. Film noir loves doors. It loves passing notes under them, listening through them, and even peeking through their dirty keyholes. I wanted this game to celebrate the door too. Here are some cool mechanics and design decisions that I've put in the game to help achieve that:
Opening and closing are pretty simple, but when trespassing your character will automatically do it much more quietly.
You can knock on most doors, and if someone is home they should answer. Unless they're asleep of course, in which case if you keep knocking your character will automatically knock louder until you're banging on the door!
A lot of doors can be locked. If you have the key, you can interact with the handle to lock or unlock it. If you don't have the key, after trying the handle you'll get the option to lock-pick it!
Before you do that though, it's always worth checking around; there might be a hidden spare key under the welcome mat or in a nearby plant!
Lock-picking is fairly straightforward, you just need to focus on the handle to increase the progress bar. You can look away to check if anybody might see you (it's classed as an illegal activity), but the progress bar won't fill. Super cool idea to add in future; brass doorknobs featuring real-time reflections so you can see behind you while lock-picking!
Lock-picks will run out and this display shows you how many you are going to need. They are easily found, however; both paperclips and hair clips can be used as lock-picks and are easily stolen without anyone noticing.
You can peek under doors too! Luckily most doors in the world of Shadows of Doubt are poorly-fitted and have enough of a gap underneath for you to see through! Useful for seeing if someone is home. This actually started as me getting the scale of the actual door a little off, I then realised it would make a cool feature.
More importantly, though, the gap is big enough to pass notes under. What a useful trope!
Last but not least: Is a door in your way? Don't like its flimsy poorly-measured craftmanship? If you sprint towards a door you'll get the option to shoulder-barge it. It might take a few tries depending on its door strength, but it's very cool and sometimes worth it. It may alert the neighbors though, and attract all kinds of unwanted attention!
That's it! It's amazing how much cool functionality you can build around something so ubiquitous. Got any more cool ideas I can put in? Give me a shout over on the Shadows of Doubt Discord Chanel. If you haven't already, please wishlist us on Steam.
1 comment