Streamlining Stairways for Players

July 2, 2021

Sleuthhounds: Cruise, being the biggest game I’ve ever made, is very complex and complicated. However, it should not be complex nor complicated for players to play. As a software developer, I’m always looking for ways to streamline the software I make so that it’s easier to use. One specific place this tendency is exhibited is with the stairways in the dining room. Using a stairway may seem simple, but there’s a lot going on behind the scenes to make life easier for players.

The source of stairway challenges in the dining room comes from the room being divided into an upper and lower floor. This adds a whole host of complications that “normal” single floor rooms do not have. For example, typically when in a single floor room, the farther up the screen a character moves the smaller their image is drawn. This scaling is to give the impression that they’re moving farther into the screen to match the perspective the room is drawn at.

With a two floor room, if the same scaling factor was applied on each floor, then characters on the upper floor would get really tiny because they’d be that much higher up the screen. My game engine handles this by defining two separate scaling areas, one for the upper floor and one for the lower floor. When a character moves from one floor to the other, they change scaling areas so they continue to look like they fit into their surroundings.

Now, where stairs and their usability by players comes into all this is the way in which players move their characters around single floor rooms and how their thinking expectations to be accounted for in a two story room. In a single floor room it’s easy. If the player clicks on an empty part of the room, then the game engine finds the spot that can be walked upon by the characters that is closest to the clicked point and moves the character to it. If the player clicks on an object then the game engine looks up a specific point to walk to for that object and again moves the character there.

[First, walk to the stairway entrance.]
First, walk to the stairway entrance.
Click to view larger.

The first complication that arises with a two story room, and walking around it, is what to do if the player’s character is on one floor but the player clicks on a point or object on the other floor. In this case, the room has two distinct walk areas connected by one or more stairways (there are two in the dining room).

[Then traverse the stairs.]
Then traverse the stairs.
Click to view larger.

The easiest thing to do would be to walk the character to the closest stairway, animate them using it, and then just leave them standing at the other end. Well, technically the easiest thing to do would be nothing and to force the player to have to specifically interact with the stairway to move from one floor to another and only allow interactions when on the correct floor. But that’s so patently bad we won’t even worry about it. Anyway, having moved the character to the new floor, the game engine could then require the player to click on the same spot or object they had before. However, that’s still pretty bad, having to enter the same input twice. Worse, it breaks the pattern of how the game works in single story rooms, where the player clicks once and the game engine handles everything else.

[Finally, go to the real destination.]
Finally, go to the real destination.
Click to view larger.

So, the game engine needs to remember that when it gets a character to the other end of the stairs that the character should then be sent along to the appropriate point on the new floor and to do whatever interaction the player directed. That doesn’t seem so bad but there are a couple of wrinkles to it.

First, the game can’t simply do all of that as a single action. In a one floor room, if the player clicks on an object on the other side of the room, say, the character will start moving towards it. In theory, the player could click elsewhere while the character is still walking. This needs to interrupt the original movement to send the character elsewhere and it needs to ensure that the original action doesn’t happen. For example, if the player clicked a door and then clicked a painting while the character is walking towards the door, the character should not animate to look like they’re opening a door when they reach the painting.

Interrupting the walk and current action in a single floor room is straightforward. However, in the dining room there are three phases of the walk that need to be handled. These include walking to the stairs, moving through the stairs, and then walking to the final spot. During the two walking sections, it’s business as usual. The engine can detect the new click by the player and interrupt the walk and its following action. However, when the character reaches the stairs, the game has to shift into a non-interactive cutscene to animate the character using the stairs and properly move them to the new floor. We don’t want this to be interrupted because it would look really weird if the character suddenly busted loose of the stairs to go somewhere else.

So the dining room starts to get some added complexity to it behind the scenes. To this point, even that isn’t so bad. Where the real fun begins as when we remember the game is called Sleuthounds. Plural. While the player only directs one of Jane Ampson or Pureluck Homes at a time, just the fact that there are two characters means additional functional cases exist that must be dealt with. For example, talking to suspects.

I first featured Homes and Ampson together in Sleuthhounds: The Valentine’s Vendetta. Back then I discovered that it was best that when one of those two went to talk to a character the other should tag along. This allowed for a single dialog to be conducted with the target person, which greatly simplified and reduced the coding and storytelling needed.

[Travelling to a suspect together.]
Travelling to a suspect together.
Click to view larger.

The problem should be apparent then. Supposing the Sleuthhounds are on the upper floor of the dining room and the player then clicks on a suspect on the lower floor to talk to. Now it’s not enough that the current character the player is using move from the upper floor to the lower floor, the other character has to do the same. Not only that, but the other character should stop moving if the player reconsiders talking to the suspect and chooses a different point to click on.

The basic idea is to keep the two player characters, Ampson and Homes, together on the same floor at all times. Even though both characters aren’t always required for a given action, by keeping them together it significantly reduces the wait time for the player when they are needed together if we always keep the two in close proximity.

[Working independently.]
Working independently.
Click to view larger.

The last wrinkle in this is that sometimes the Sleuthhounds aren’t travelling together. During the course of their investigation, there are several points where Homes and Ampson are operating independently. Even so, they may appear in the same location such as, I don’t know, the dining room. In this case, when one character uses the stairs we don’t want the other character to use the stairs as well.

So ultimately when the player clicks somewhere in the dining room we end up with something like this:

Is the current Sleuthhound on the same floor as the clicked item?

    Yes.

        Start the Sleuthhound walking to the item.

        If the Sleuthhounds are working together, start the second Sleuthhound walking to the item. We don’t have to worry about what floor the second Sleuthhound is on, because when they’re working together we always keep them on the same floor.

    No.

        Start the Sleuthhound walking to the entrance to the nearest staircase.

        If the Sleuthhounds are working together, start the second Sleuthhound walking towards the entrance to the staircase nearest to them.

        Once the Sleuthhound (or both Sleuthhounds if they’re working together) reach the entrance to the stairs, switch to a cutscene animating the use of the stairs, and moving to the other floor.

        Walk the Sleuthhound from the exit of the stairs to the item.

        If the Sleuthhounds are working together and the item is something they should both interact with, then walk the second Sleuthhound to the item as well.

Remember, that at any point while the character or characters are walking, but not while they’re actually moving up or down the stairs, the player could click elsewhere. That should interrupt what the characters are doing for the new action, which may or may not require them to use the stairs.

This may seem like a lot of extra work to go through for something as mundane as using stairs to switch floors. However, it’s important that a player’s experience be as consistent as possible when playing the game. Users of software, just in general, become frustrated with applications that present interactions that look like they should behave the same but then don’t. In Sleuthhounds: Cruise, players will spend most of their time in single floor rooms. When they click on something in those rooms, the expectation is set that the Sleuthhounds will intelligently move to the clicked item and interact with it. That’s the norm and that’s how more complicated rooms, like the two story dining room, need to work. Just because it’s a game doesn’t mean it’s exempt from providing a good user experience.