Summer of Code: Progress of Cutscene Editor
As described in an earlier blog post, the Cutscene Editor is a tool for creating realtime cutscenes without touching a script. This allows both veteran Unity developers and those new to the engine to easily toss together a scene without too much fuss. It works similar to modern video editing software like Final Cut Pro and Adobe Premiere, with a media browser and a preview window and a timeline. Anyone who has ever edited together a movie on their computer will find a familiar user interface which has been designed with ease-of-use in mind.
Itʼs perhaps important that I emphasize the realtime aspect. This is not a tool for preparing pre-rendered scenes, as pretty as they can be. The visual quality of the scene will depend on the player’s hardware just as the rest of the game does. There are both advantages and disadvantages to this approach, but as some famous man once said, “realtime is the only time. For real.”
How’s It Going?
With not much more than a week to go, development of the Cutscene Editor is going well. It isn’t done yet (ha, I wish!), but with a few more late nights and a bit of fairy magic it will be.
In its current state the basics of creating a cutscene are there. You can add a bunch of camera shots, toss them on the timeline, throw in a few explosion animations here and there, maybe chuck in some heavy metal background music, and it will play as expected when you call scene.PlayCutscene().
Where a lot of works needs to be done before the August 31st deadline is the ease by which the developer using the editor can modify the timing of clips on the timeline. Initially thereʼs going to be two tools: the multi-purpose trim-n-drag for moving clips around, and the razor blade for splitting clips into two. Right now these donʼt really work. Neither does the preview window, an arguably essential part of the editor. So itʼs not quite in a “gee willikers, it just works!” stage, but once these features are implemented and a bit more polish added itʼll be close to the original vision.
Golly, Do Tell Me More!
Above is a screenshot of the Cutscene Editor in its current incarnation. There are four main panes: options, media, effects, and the timeline. The editor introduces some concepts blatantly stolen from the film world.
- Shots: a cameraʼs view in a limited amount of time; an animation can be attached to replicate moves like dolly or crane shots
- Actors: animated game objects
- Audio: dialog, sound effects, background music
- Subtitles: captions that transcribe the current dialog/narrative
For clarityʼs sake, each track can only hold a particular media type. That is, you canʼt throw a camera shot onto the same track as an audio clip. The timeline can be zoomed in when precision editing is desired. Clips are added to the track by clicking the “Insert” button beside each piece of media, which will place them with their default time at the position of the playhead. Drag and drop ability was desired, but at this point it may not happen. Version 1.1 perhaps?
For the most part it should feel intuitive. I referred extensively to how the interface of Final Cut Pro works, so those coming from a video editing background should feel right at home.
Most of my time has been spent building the user interface. Anyone who has used Unityʼs GUI system knows that it’s not a drag-and-drop affair; every label and button is created in code. This works great most of the time, but creating an editor as customized as a timeline has been difficult. Creating a basic GUI is smooth sailing, don’t get me wrong, but there was no documentation on how to, say, draw a line over the timeline to appear as a playhead. It has certainly been a learning experience.
Despite the challenges, I’m blown away by how extensible the Unity editor is. It completely rocks being able to build my own tools so easily, and I plan to continue working on similar projects in the future.