Interactive Cutscenes: Adding Depth and Responsiveness

June 3, 2016

In developing the prototype for my new Robyn HUD game, I’ve had to develop several technical systems to handle different aspects of the game. One that’s caused a fair deal of head scratching has had to do with running interactive cutscenes in the game. Note the keyword interactive there.

A traditional game cutscene essentially plays out like a movie. Control is taken away from the player who has to sit and watch while two or more characters converse or some special action sequence plays out that the player isn’t supposed to have control over. I’ve used that kind of cutscene quite extensively in my Sleuthhounds games. That kind of cutscene is easy.

Robyn HUD doesn’t use that kind of cutscene.

With Robyn HUD, I wanted to introduce interactive cutscenes. Cutscenes where, while they’re running, the player or other characters in the game can be doing other things. Such cutscenes might even be interrupted by the arrival of another character. A guard coming across two conversing thieves, for example.

In Robyn HUD, Robyn infiltrates places for a bit of burglary (proactive redistribution of wealth). Meanwhile, HUD is the “eye in the sky”. HUD (the player) keeps track of Robyn and guides her through the use of a computer display that taps into the security cameras in the places where the pair are performing their heists.

I wanted Robyn and HUD to be fairly chatty so, as the player guides Robyn trough the level, Robyn and HUD will exchange comments. However, I didn’t want to bring the gameplay to a halt every time the two started talking to one another. Just imagine if a guard showed up and the player couldn’t guide Robyn away because she was talking.

So the cutscene system first had to allow for if a character was only talking (as opposed to doing some physical action) then that character should also be able to walk elsewhere to do some task unrelated to what she’s talking about. In my prototype level, Robyn and HUD are sneaking into a high-rise penthouse. When Robyn firsts gets inside, she exchanges some comments with HUD. During this time, the player can also direct Robyn towards several pieces of artwork to steal. The interactive cutscene system needed to allow Robyn to keep talking about the penthouse even while she’s stealing paintings.

The interesting thing about stealing paintings is that if Robyn and HUD aren’t talking at the time that happens, then they might start a small conversation on the artistic merits of the painting their stealing. So the cutscene system had to be smart enough to recognize that if Robyn and HUD were already talking then, in this case, they should finish that current conversation instead of jumping into a different one.

One could easily jump to the conclusion that if a cutscene is already playing then any further cutscenes should be blocked. However, we’re dealing with a pair of thieves here. If a security guard comes along should he have to wait for the thieves to stop talking before he can chase or capture Robyn? Of course not. He should be able to interrupt the current conversation and start chasing the thief.

So right here we have two requirements that are at odds with one another when characters are already conversing. In one situation we have a second cutscene that comes along that we don’t want to allow to play. In the other situation we have a second cutscene that we do want to have interrupt the first and start playing.

The cutscene system also had to allow for multiple separate cutscenes to run at the same time. If Robyn and HUD are talking on one side of a level, there should be nothing to prevent two guards from meeting on the other side of the level and having their own conversation. Not as daunting a task as having a character interrupt an already playing cutscene but still something to consider.

So breaking it down, my requirements for interactive cutscenes were as follows:

  • A given character should be able to be in a dialog cutscene and a separate, non-related action cutscene at the same time.
  • A less important cutscene should not be able to interrupt a currently running cutscene.
  • A more important cutscene should be able to interrupt a currently running cutscene.
  • Cutscenes involving non-overlapping groups of characters should be able to run at the same time.

After a lot of thought and a bit of work, I’ve landed on a system that works well for my needs. I start by tracking the cutscene “state” of each character. A given character can be in one of three states:

  • Free – The character is not currently being used by any cutscene and so is free to be used by any new cutscene that comes along.
  • Busy – The character is currently being used in a cutscene.
  • Needed – The character is currently being used in a cutscene, but another cutscene that is trying to start wants to get hold of the character.

When a cutscene is about to start, it first needs to check to see if all the characters it intends to use are in the “Free” state. If they are then the cutscene marks all those characters as “Busy” and then commences playing.

If a cutscene needs characters that are not available then there are two things that can be done. If the new cutscene is not that important then it can simply not run. This covers off the case where Robyn and HUD are already talking about the penthouse and another cutscene comes along to talk about a painting they intend to steal. The painting conversation isn’t that important so it chooses not to run itself.

However, if the new cutscene is important then different steps are taken. In this case, the new cutscene marks the “Busy” characters as “Needed”. The new cutscene then sits and waits until the existing cutscene says the characters are “Free” again. This works for the case where Robyn and HUD are discussing the penthouse and a guard shows up to interrupt them. Here, when the guard arrives a cutscene starts where the guard tells Robyn to “Halt!” The guard cutscene sets Robyn’s state to “Needed” and then sits and waits. Meanwhile, the penthouse discussion cutscene periodically checks to see if either Robyn or HUD are “Needed” for another cutscene. Seeing that Robyn is “Needed”, the penthouse cutscene interrupts itself midway through and frees up Robyn to be used by the guard cutscene.

Now, the interesting thing about this cutscene system is that if a critical cutscene is running that should not be interrupted, then all it has to do is keep a hold of the characters it’s using instead of freeing them. For example, if Robyn is being chased by a guard, she has several evasive maneuvers she can use, such as rolling across a countertop to put a little more distance between her and her pursuer.

Ordinarily, if the pursuer caught up to her, a high importance cutscene would start with Robyn being caught. However, if Robyn reaches the counter just before being caught then she should enter into a cutscene that rolls her across the countertop. During the beginning of the roll animation, the guard might get close enough that he would ordinarily capture her. However, it would look really odd if Robyn suddenly snapped from her rolling pose to an arrested pose. So the capture cutscene comes along and says it needs to have the Robyn character. However, the already running roll cutscene can ignore the request for the character until the roll has finished. At that point, Robyn is freed and the capture cutscene needs to perform a final check before it starts playing to ensure that Robyn is still close enough to the guard. If she’s not, then the capture cutscene shouldn’t start.

Obviously, with some cutscenes being able to decide not to release characters when another cutscene requests them, it’s important for the requesting cutscene to have some other “out”. We don’t want to leave pending cutscenes just waiting forever because another cutscene is holding onto the characters. However, that other “out” will need to be implemented on a case by case basis. In the example above, the “out” is that the capture cutscene checks the distance to Robyn while waiting for her to be released. If she rolls past the distance in which she can be captured, then the capturing cutscene can be aborted.

One last wrinkle in all of this. I mentioned early on that when Robyn enters the penthouse she and HUD have a conversation. During that time, Robyn can be directed around to steal paintings. This seems to require that one character – Robyn – be involved in two cutscenes at once, which goes against the Free/Busy/Needed system. One cutscene is needed for her to discuss the penthouse with HUD and another is needed where she can perform an animation of cutting the painting out of its frame and taking it with her.

In this case, even though it’s the same Robyn character, the cutscenes aren’t in conflict. One cutscene only involves Robyn talking and the other only involves her doing some physical action (cutting the painting out). To handle this situation, I’ve created two separate cutscene states for Robyn. One is a “talk” state and one is an “act” state.

When the penthouse discussion starts, the game marks the Robyn Talk state as busy but it leaves the Robyn Act state alone. While the discussion is going on, the player can direct Robyn to the painting. Here the game checks the Robyn Act state and finds it to be free. So even while Robyn is talking, a second cutscene can start up of Robyn stealing the painting.

In practice, it’s a fairly simple system to use that offers a lot of flexibility in how interactive cutscenes are played and controlled. It may be the case that as I continue to develop the game beyond the prototype I encounter situations that this system can’t handle. Meanwhile, the system is up and running and working nicely.

Oh. And I am looking for a better name than interactive cutscenes. Playables maybe? We'll see.