Fainter and Fainter

September 7, 2018

A couple of weeks ago I wrote about adding a surgery sequence to give the player something to do while receiving plot information from a character in the upcoming Sleuthhounds: Cruise game. During this sequence, Homes is pressganged into assisting Doctor Seymour with a little impromptu surgery. However, he’s a bit squeamish when it comes to seeing the insides of people and has the possibility of fainting if the player doesn’t perform the correct actions in a timely enough manner. This week, I’ve returned to this sequence to work on both audio and visual cues to indicate to the player how they’re progressing.

[Darkness creeps in from the borders as Homes grows faint.]
Darkness creeps in from the borders as Homes grows faint.

Regardless of whether the player assists the doctor correctly or not, Homes becomes fainter over time. If incorrect actions are performed, the rate at which his faintness advances increases. As this occurs, Homes develops “tunnel vision”. Visually this is expressed by darkness creeping in around the edges of the scene. The more faint Homes becomes the darker the scene gets until eventually he passes out (or the player successfully makes it through the sequence). This was quite easy to achieve in the game as I’ve used similar techniques for other sequences in earlier games.

At the same time that Homes’s vision goes, I also wanted to distort the audio. The more faint Homes becomes the more muffled voices and sounds should be. This required adding some new capabilities to the game engine. I didn’t just want to lower the volume of the audio, instead I actually wanted it distorted in some way.

The Sleuthhounds’s game engine uses OpenAL for its audio processing. Fortunately, OpenAL offers an effects extension module that allows different processing to occur on audio in real time. One of the standard effects is a low-pass filter, which is exactly what I needed to muffle the audio. It was quite straightforward to add support for the filtering to my existing audio system. Now as Homes grows faint, the amount of filtering on the audio becomes more aggressive.

To test out the audio I recorded some rough dialog to use in the sequence. Without the filtering a line may sound something like this:

Once the filtering has gotten fairly advanced, that same line sounds like this:

The fade-to-black tunnel vision combined with the filtered audio – and a few specific mentions in the dialog – nicely gives the impression of Homes becoming fainter in the game. I’m quite happy with where this particular sequence has gotten to now. Next week I’ll be dealing with the consequences of getting through the surgery successfully and with Homes passing out.