Updating the Safe

Janaury 31, 2020

In the latest phase of production on Sleuthhounds: Cruise I finally get to go through and work on finished assets for the game. Obviously, the most apparent place is the graphics. However, there’s more to it than just making things look better. It’s also an opportunity to go back through and fix up various coding issues. One good example of this is the combination safe, which makes an appearance in several suspects’ cabins.

[A comparison of the old and new safe.]
A comparison of the old and new safe.
Click to view larger.

When I first put the safe into the game, as with a lot of other things, the mentality was to just get something working. The initial safe, which I’ve lived with for the better part of two years, was really rough around the edges. So much so that even I, the developer, had difficulty opening it at times. With the polished version I took some time to go back in and refine how the safe works. Specifically:

  • I made the dial bigger. When grabbed near the edge the mouse now needs to be moved farther to achieve the same amount of turn as previously. This is useful as in the old version with its tiny dial it was pretty easy to overshoot a particular digit in the combination being dialed in.
  • I evenly spaced the tick marks on the dial. With the rough version I quickly sketched the tick marks in by eye, meaning where the marks were didn’t always match exactly where they should have been mathematically. Obviously it was tricky dialing in a given digit if its mark wasn’t actually where it should have been.
  • I made the dial move by whole tick marks. There are 40 marks on the dial, which means it now turns in 9 degree increments. Previously it freely turned at any angle, which made it harder to line up on a specific tick mark.
  • I added in coding to account for jitters in the movement of the dial. In the dev version if the dial was being turned clockwise, for example, any move in a counterclockwise direction would cause it to think it was now being turned the other way. With the jitter protection, a player can now move the dial in the opposite direction by a couple of tick marks before the safe thinks that’s the desired direction of rotation. This is particularly helpful when slowing down right near a given digit being dialed in.
  • I increased the slop area for digits being entered. It’s not necessary to land exactly on the correct tick mark. If the player is within a tick either side of the desired one it will still register as the correct position. Essentially a given digit is now represented by three tick marks on the dial instead of one.

All of these changes to how the dial functions were specifically done to make the process of entering a given combination into the safe easier and more reliable. Since I’ve been living with the rough draft safe for such a long time, it’s a real kick to now have a safe that operates so much better when I’m testing. That’s the great part of where I’m at in building the game. The past two years I’ve been living with this really bumpy and cracked road full of potholes. Now I get to go back and smooth that road out.