Simple cutscenes in Unity

posted in: Dev blog | 0

Months ago, while preparing the Gamelab 2015 build of Trespassers, we were thinking about how could we tell bits of the story inside the game. But things were that we had no time to develop a full cinematic for every bit of the story we wanted to share. This was time consuming, hard, and we had not so much time left to prepare our demo build, which was of utmost importance.

But, as we love classical graphic adventure games, we were predisposed to do something with scripting languages at a higher level than C# (our language of choice for Unity). We wanted to skip all that hassle of scripting a cinematic in code, we wanted something readable, simple, in a word. We came up with a solution in no time: our own simple scripts (and parser) for the scenes. Let’s check how do they look like:

(The MS DOS formatting option seemed like the best for readibility. And it is retro, so yeah, fits the theme)

This kind of snippets have two main advantages (and a big limitation, too)

  • Simple: even without the comments above the text, you could easily understand what may happen, it is non-programmer friendly. Non-programmers can edit and generate this snippets easily, so the only lonely programmer can spend his time at other tasks.
  • Text, not code: the code is executed by the parser, the CutSceneManager (as we call it). It converts the lines to real commands that get queued and executed sequentially, till no more are left. The main advantage is that we have no need to recompile the entire project, thus it helps reducing debug time. And designers fear less dealing with it. Well, the designer is the programmer in this project, so what the …

The main limitation is that it is … well, limited. Don’t expect anything too fancy, although of course you could further develop the system to get additional features, but simple was our keyword. The results are more than enough to give a small chance to reach the audience, and help us reducing the time needed to insert halts in the frenzy action when needed.

Trespassers_Talking

We hope that it helps improving your workflow or, at least, sparks your creativity towards your custom solution.

See ya!

Leave a Reply

Your email address will not be published. Required fields are marked *