This tutorial will take you through the steps of setting up a basic cinematic scene in CryENGINE.
It's recommended to create the new Track View Sequence within a Level layer. In the Layers Settings panel of the Rollup bar, you can create a new layer called Cinematic.
You can now create your Track View sequence and place the objects or entities you want to modify using Track View. All of these added to the level will automatically be added to the selected Cinematic layer.
Saving the level also saves the newly added layer. The advantage of this is the possibility of working on your cutscene separately from someone working on the same level.
This also allows you to re-import only your Track View Sequence without modifying any other objects in your level. Thus, avoiding the accidental addition of entities to the incorrect layers.
Name the sequence MyCutscene and click OK.
The Track View is stored in a container object of same name (which is always created at 0,0,0).
You can move this Sequence Object as it's transformation does not affect the sequence.
Once you have created the new scene, you need to set up the properties for this specific scene.
Click the Edit Sequence icon.
With the Sequence Properties window open, select the following check boxes:
Selecting the Disable Hud check box disables the default player's HUD. Selecting the Disable Player check box hides the player during the scene, 16:9 enables the black bar effect, and Non-Skippable means that if the player decides to skip the scene, it will continue to play.
The EndTime has also been adjusted for a scene of 15 seconds in length.
The first element that needs to be added to the scene is a Director Node. The Director node will already have a camera track, which is meant to contain viewpoint settings. Keyframes added on the camera track enable switching viewpoints at any time of the sequence.
You can also add the Director node by right-clicking on the Sequence in Track View.
However, as no camera has been added to the level, a camera cannot be selected. To add a camera, select Camera under Misc in the RollupBar and place it in the level.
Next, add the camera to the Track View so that you can animate the camera's movement.
Select the Camera and right-click on the sequence in Track View for the menu. Click on Add Selected Entity(s) to add the Camera to the Scene track in the Track View.
You can also add any entity to a Track View Sequence by selecting it and clicking the Add Selected Node icon.
The camera should now be displayed in the Track View.
Next, select the scene to use this camera. Double-click the time line at frame 0 to add a Key. Once the Key has been added, select the Key to bring up the Key Properties section. From the drop-down list, select the newly added Camera1.
Next, add an object of interest to the scene, for the camera to focus on.
In this example, you will add a human character, with a simple walk animation.
For characters in cinematics, an AnimObject is used, as opposed to an AI Entity, for performance reasons. Also, because an AnimObject doesn't have AI, the AI system won't conflict/fight with the Track View system.
Select AnimObject in the RollupBar and drag it to the Perspective view.
With the AnimObject selected, click Entity Properties in the RollupBar and replace the default rectangular object with a human character by selecting the Model field and clicking the folder icon.
The jelena.cdf model applied to the AnimObject.
The camera and the girl character together.
Select the AnimObject and add it to the Track View sequence.
With the AnimObject added, you can now add an animation track to animate the character. Right-click the entity and on the Add Track menu, click Animation.
Select an animation for the character.
Double-click at frame 0 to add a Key in the Event track, and then select the Key to bring up the Key Properties section. Then, from the drop-down list, select the animation you want to use.
You can also animate objects directly in Track View (Instead of loading exported animation on the animation track of an AnimObject).
For this tutorial, we will animate a plane flying in the background of the shot. You can use a GeometryEntity or BasicEntity (the difference is that you can activate physics on the BasicEntity anytime). You can also use an AnimObject again especially if you want to play an exported animation and yet animate it's transformation in the engine (Example - The rotation of the helicopter fans could be an exported animation while it's actual transformation is animated manually in Track View).
Let's place a BasicEntity in the scene.
Load the US Cargo Plane model.
The us_cargoplane.cgf model applied to the BasicEntity.
You can add the BasicEntity now to your Track View Sequence.
Place the BasicEntity based on where you want it to start in the beginning of the sequence. If you want to already start animating, make sure the Record button is on. If not, you can manually place keyframes at frame 0 on the position and rotation tracks of the entity.
You can now animate the plane by adding the last keyframe for the plane (Note: You can add as many keyframes as you want. For this tutorial, we make a very simple animation).
To do this, make sure that the BasicEntity has been selected and that the Track View slider is set to the last frame of the sequence. Then, click the Record button.
In the Perspective view, move the plane to the desired ending position at last frame. This will record the position and add a positional key for the character. You can repeat the same for the rotation of the entity.
If you scrub through the scene with the time slider, the plane will appear to be flying between two points.
You can adjust the f-curve of the animation by switching to curve editor (View -> Curve Editor). In this case, we want a linear motion so change the bezier splines of the curve to linear.
You can select the keys and click on Set In Tangent to Linear and Set Out Tangent to Linear .
You can animate the camera to add more life and movement to your cinematic shot.
To look through the perspective of the new camera, right-click Perspective to display a menu for the view port configuration, and then on the Camera menu, click Camera1. You will now be looking through Camera1.
You can also change to Camera View from Track View. Right-Click on Camera1 in Track View, select Set As View Camera.
At the beginning, the camera will be locked and cannot be manipulated like a standard Perspective viewport. To unlock the camera, deselect Lock Camera Movement.
You can now animate the camera. Set the time slider to frame 0 and make sure that you have the camera selected and the button selected in the Track View.
Drag the time slider in the Track View to few seconds further and position the camera as desired; continue this process for the entire timeline based on the camera animation you intend to create.
Deselect the Record button to avoid accidentally animating the camera. If you now scrub the time slider in the Track View back and forth, you will see the camera animating along the new path and the character walking along.
Next, set the camera back to the default Perspective. To do this, right-click Camera1 and select Default Camera.
You will be able to see an overview of the scene, with splines depicting the path of the camera and character.
Depth of field refers to the range of distance that appears acceptably sharp. Depth of field(DOF) can significantly change the look and feel of your shot. It can push the viewer's attention to specific subjects simply by changing the focal point. A large depth of field, often referred to as deep focus, keeps most everything in your shot clear and sharp, while shallow depth of field leaves only a small area in focus, blurring what's in front and behind the subject.
In Track View, you can add a DepthOfField node inside the Director node or you can add a Depth of Field track to any camera node. If there are both, the latter takes precedence over the first one.
Right-Click on the Camera1 and click Add Track -> Depth of Field.
You can start adding keyframes to the DOF track in Track View.
The two images illustrate the same scene without and with Depth of Field on
You can find more information on Depth of field here.
When in the game mode, the scene will not play by default. You need to first set up logic by using the Flow Graph Editor.
After opening the Flow Graph Editor, add an Entity. It is possible to contain the Flow Graph within the AnimObject character. However, having a specific entity is safer as it will generally be harder to accidentally delete. For this setup, you should usually use an AreaTrigger.
Select the AreaTrigger and drag it to the viewport. Rename it as cine_example_FG. Next, create the Flow Graph by right clicking the entity and clicking Create Flow Graph.
A window called Choose Group for the Flow Graph will be displayed. Click New...
...and call it cinematics, as this will be useful for containing all the flow graphs that are related to cinematics.
This will automatically open the Flow Graph Editor.
Make sure that you have the newly created flow graph selected, to start working on it.
For this tutorial, all that is needed is a simple scene that starts as soon as the player enters the game.
Right-click the gray area and select Add Node, and then select Misc and Start.
Next, configure the start node to trigger the sequence to play by adding an PlaySequence node.
You can also add a flow graph node by clicking on the grey area of the Flow Graph window, press q and type in the name of the node in filter term. You can use up and down arrow keys to toggle quickly among the available searches and press enter to place the node.
Next, select which sequence to play. Double-click the Animations:PlaySequence node. In the Inputs settings, click ... to display the Select Sequence window. Select the sequence that you created and click OK.
With the two nodes added, connect them to set up the logic; click and hold the blue arrow port and drag it into the green StartTrigger input port.
This is what the current flow graph should look like:
If you now enter the game, the scene will automatically play.
You can always add additional details to your Track View sequence after the initial setup is done. You can add Fade In and Fade out, Post FX, Track Events that trigger specific scripted events, etc.
For this scene, we just add a simple Fade In at the beginning and a Fade Out at the end.
Just Right-Click on the Sequence Node or the Director Node, click Add Screen Fader.
Place keyframes for the Fade In and Fade Out as shown in the picture below:
For more information regarding this node, please refer to the Screen Fader documentation.
You can use Post FX to re-create realistic effects on your scene. In this case, "Post FX Water Droplets" were used to give the illusive effect of rain drops hitting the camera screen. The timing of this was done by adding a Track Event that controls the amount of water droplets at specific times of the scene.
Here is how the Track View Sequence looks after adding the Track Event:
And the Flow Graph setup using the Track Event Node:
Finally, when your scene is ready, you definitely would like to get rid of all the display widgets and info seen when the actual cinematic is played. You can manually remove them or turn them off using console variables in a Flow Graph.
The best approach is to turn the info and hud off from the Track View itself.
The hud can be disabled by setting gfx_draw to 0.
And the Display Info can be turned off by setting r_DisplayInfo to 0.
In this tutorial, the console variables are added to the Track View sequence and their values set to 0 using keyframes.
To render an image sequence of your cutscene, you can add a Capture Track to the active Director Node.
This is how the final scene looks like in game.