I have been adding cutscene support to my engine over the past couple of days and it has raised a couple of interesting and related questions:
Do SCUMM and the Thimbleweed Park engine support nested cutscenes? Meaning starting a cutscene from within a cutscene. It looks like (the excellently succinct) SCUMM-8 by @Liquidream maintains a stack of cutscenes to support this, which makes me think that the original SCUMM engines might have too? I’ve been trying to think of situations in TWP or classic Lucasarts games that may have required nested cutscenes but I can’t think of any…
Second question: how should the engine manage local (room-scope) threads with cutscenes? Should they be killed when starting a cutscene or preserved for afterwards?
For example, say the camera is in a kitchen room and there are two local threads running: a dripping tap thread that was started in the kitchen’s enter() function, and a microwave thread that was started when the player used the microwave. Now for some reason cutscene starts.
Let’s say that the engine is set up to destroy the local threads when a cutscene starts, so the tap and microwave threads are deleted. The camera cuts to a mansion room containing a clock. The mansion room enter() function is called which starts a clock ticking thread.
When the cutscene finishes the camera returns to the kitchen, the local threads, including the clock thread, are destroyed and the kitchen enter() function is called which starts a new tap dripping thread. But the microwave has now stopped. Bug!
So perhaps the engine should not destroy the local threads when starting a cutscene. It could just keep hold of the existing list of room threads, but not update them while in a cutscene. The cutscene “context” could have its own list of local threads to add to and update over its lifetime.
Using this technique, when the cutscene starts the tap and microwave threads are stored suspended to be restarted again later. The clock thread is added to a separate list inside the cutscene. When the cutscene ends, the cutscene threads are killed and the dormant list containing tap and microwave threads are awoken. However when the camera returns to the kitchen, its enter() is called which starts up a second dripping tap thread! Not good.
This is making me think that killing all local threads when entering a cutscene is the simpler thing to do. Until we consider a case where a cutscene starts that takes place in the same room. In this situation we don’t want to kill all the room threads or the player will notice the tap and microwave suddenly stop when a brief in-room cutscene starts.
I’m sure there is an elegant solution to this problem, with minimal special-case code, but I can’t figure it out. It would be great if @RonGilbert or @David could provide some insight into how they handle this tricky problem.