Homes and Ampson Together and Apart

April 13, 2018

After creating five previous Sleuthhounds adventure games (six if you count the Amelia Deerhart game jam game) you’d think the underlying technology for these types of games would be quite robust and mature. That’s exactly what I thought too. However, as I’ve started implementation on the new Sleuthhounds: Cruise game I found this was both true and false.

To be sure, the technology that I use to build the Sleuthhounds games gives me a lot out of the box at this point. I don’t have to worry about making characters walk through scenes, talk to one another, pick up objects, or any one of a dozen other things common to adventure games. However, the story and the size of the Cruise game is such that I’ve been running into cases that I didn’t really have to consider for any of the previous games.

One of the biggest of these new cases comes out of the story for the game. Sleuthhounds: Cruise is about how Pureluck Homes and Jane Ampson first came to work together. In the story the two of them start off working individually. It’s only towards the end of the first act of the game that they even meet face to face for the first time. Later in the game, of course, they work together and need to move through the environment together. But early on, they move independent of one another.

With my first two games, The Unlocked room and The Cursed Cannon, players only had one character to play as, Homes and Ampson respectively. Without the need to swap between playable characters there were a number of assumptions I could make to simplify how the one playable character moved through the game environment and how the player controlled said character. It should be noted there was one section in The Cursed Cannon where the player could switch between Ampson and Amelia Deerhart, but that was a very limited section of the game and it all happened within one room.

After that, I began work on the three Sleuthhounds holiday games, The Valentine’s Vendetta, The Halloween Deception, and The Yuletide Tail. With these the player had access to both Homes and Ampson at the same time. That necessitated a few changes to the technology but there was still the simplifying assumption that Homes and Ampson would always be in the same room together. In fact, this posed some problems in The Yuletide Tail where there is one sequence where the two characters have to be in separate rooms. To make that sequence work I had to do a lot of special case hacks to keep things from going sproing. It was a bit painful making that work but for a single sequence involving only two rooms it was manageable for that game.

Fast forward to today where the Cruise game has over fifty rooms (and counting) and the problem becomes even more pronounced. Especially as during this game there will be times when you only play as Homes, times when you only play as Ampson, times when you play as both of them moving through the same rooms together, and times where you can switch between the two of them but they’re in separate parts of the game world.

Given the sheer number of rooms that Cruise has versus the previous games, I knew that the hacky method I used for allowing the characters to be apart in The Yuletide Tail would not work here. It was fine for two rooms but it definitely wasn’t the type of thing that would scale well. Consequently, before I could even start implementing the game’s story or any of its puzzle sequences I had to spend some time improving the tech to allow for the different cases of togetherness or apartness that Ampson and Homes could have. Given that the previous games either assumed there would only ever be one playable character or else that there would be two characters but that they’d always be together this meant that I had to revisit a fair amount of the underlying tech.

When you break it down there are a few key things that the game system needs to track and deal with:

  • It needs to know which rooms Homes and Ampson (or any character for that matter) are in so that they display when those rooms display.
  • It needs to know the position and direction within a room that Ampson and Homes are standing in.
  • It needs to know which character the player is currently controlling.
  • It needs to know if Homes and Ampson are travelling through the environment together so that when one character moves to a new room the other character moves to that same room.
  • It needs to know it the player is currently permitted to switch between Ampson and Homes as the active character.
  • It needs to know that if the player does switch characters and they’re switching to a character in a different room then that room needs to be displayed.

Ultimately, the issue of tracking where our heroes are and which one the player is currently controlling aren’t that difficult. However, since the handling of those characters was at a fairly low level in the game system code it meant a fair amount of changes and testing to get everything in order. It’s all solid and working well now and I’ve already implemented several sections of the game that switch between Ampson and Homes in separate locations and with them working independently of one another. There’ve been no problems so far and no reason to suspect any will arise in the future. Does that mean the tech is finally, fully mature? Only time and more games will tell.