Cutscenes Part 5: Somewhere Above the City: Difference between revisions

From The DarkMod Wiki
Jump to navigationJump to search
Line 43: Line 43:
   ...
   ...
</pre>
</pre>
[[Image:C3.jpg|200px|thumb|left|FadeOut and FadeIn]]
FadeOut and FadeIn are ''trigger_fade'' entities, and VaultTeleport4 is a ''func_teleporter''.
FadeOut and FadeIn are ''trigger_fade'' entities, and VaultTeleport4 is a ''func_teleporter''.
[[Image:C3.jpg|200px|thumb|left|FadeOut and FadeIn]]
 
{{clear}}
So the screen fades out, waits 2 seconds, then fades in. When the screen is dark, you're teleported to where you can properly hear the sounds in the upcoming shot.
So the screen fades out, waits 2 seconds, then fades in. When the screen is dark, you're teleported to where you can properly hear the sounds in the upcoming shot.


Let's look at the next set of lines, where we start the bishop--who's been waiting on a ''path_waitfortrigger'', start the camera (VaultCamera3) and mover (anchor3) along their spline (spline3), and begin tracking a ''target_null'' sitting on the bishop's shoulders.
Let's look at the next set of lines, where we start the bishop--who's been waiting on a ''path_waitfortrigger'', start the camera (VaultCamera3) and mover (anchor3) along their spline (spline3), and begin tracking a ''target_null'' sitting on the bishop's shoulders.
{{clear}}
<pre>
<pre>
   ...
   ...

Revision as of 13:48, 13 September 2010

NOTE: This article is under construction until this NOTE goes away.

Somewhere Above the City

I created SATC for the 2010 Summer Vertical Contest. Since it involved traversing a very long vertical distance up, I didn't want to ask the player to climb all the way back down. Instead, once the player has satisfied all objectives, a cutscene wraps up the storyline and ends the mission.

The Scene

The scene takes place in the Builder church, with two actors: a guard and a bishop discussing the outcome of the previous night's events. Without giving too much away, let's just say that a defrocked priest named Penshawk stirred up some trouble, and the mission was to deal with it.

Download [vault.zip] and extract it into your Doom 3 folder. What you're getting is the set for the cutscene, the vocals, and a script to run everything.

Open vault.map in Dark Radiant.

The Opening

Dead or Alive?

Two Choices

There are two conversations in this cutscene. One if the player killed Penshawk, and another if the player knocked out Penshawk. SATC started the cutscene once the player had satisfied all objectives, and the decision as to which conversation to play was based on a check of Penshawk's health. Since Penshawk doesn't exist in Vault, the player decides which path to take at the start, by stepping on one of two floorpads. The one on the left plays the scene that goes with Penshawk's death. The one on the right plays the scene that goes with Penshawk's being knocked out.

Since both scenes are the same except for a few lines, we'll discuss the Dead scene. You can review the Alive scene afterward to see the differences.

Opening Shot

When you step on the leftmost floorpad, the script function playCutsceneDead() is called:

void playCutsceneDead()
{
   penshawkHealth = 0;
   playCutscene();
}

This sets a flag that says Penshawk is dead. SATC determined this at runtime using:

   penshawkHealth = $Penshawk2.getHealth(); // is Penshawk dead or unconscious?

This flag is checked later to pick the correct conversation.

playCutsceneDead() calls playCutscene(), so let's look at its first few lines:

void playCutscene()
{
   // Fade to black, then fade back in

   sys.trigger($FadeOut);
   sys.wait(2);
   $VaultTeleport4.activate($player1); // Move the player to the start of the vault cutscene
   sys.trigger($FadeIn);
   ...
FadeOut and FadeIn

FadeOut and FadeIn are trigger_fade entities, and VaultTeleport4 is a func_teleporter.

So the screen fades out, waits 2 seconds, then fades in. When the screen is dark, you're teleported to where you can properly hear the sounds in the upcoming shot.

Let's look at the next set of lines, where we start the bishop--who's been waiting on a path_waitfortrigger, start the camera (VaultCamera3) and mover (anchor3) along their spline (spline3), and begin tracking a target_null sitting on the bishop's shoulders.

   ...
   // Camera3 - priest walking down hall, away from camera

   sys.trigger($VaultBishop); // get the Bishop started
   $VaultCamera3.activate($player1); // The camera takes over the view
   $anchor3.time(7);        // How many seconds it will take to move along the spline
   $anchor3.accelTime(0.1); // How long it takes to get up to speed
   $anchor3.decelTime(0.1); // How long it takes to decelerate
   $anchor3.disableSplineAngles(); // Allow the camera to point in different directions as it follows the spline
   $anchor3.startSpline($spline3); // Start the func_mover $anchor3 moving along the spline
   thread update_camera4();  // Call the function update_camera4() as a thread so it can run in parallel
                             // to update the camera's focal point each frame. We need to start this thread
                             // here, even before camera4 is active, because the target_null it's focused on
                             // will be moving when the priest starts walking. If we don't, then there's a
                             // hitch at the start of camera4's frames when it changes focus from where
                             // the target_null spawned, and where the priest has taken it.
   sys.waitFor($anchor3);    // Wait for $anchor3 to finish its movement
   ...
VaultCamera3

This presents an opening dolly shot rising from the floor as the bishop walks by, bound ... where? The picture shows VaultCamera3, with anchor3 and spline3 below it. Right behind it is VaultTeleport4, where we place the player.

The script line thread update_camera4() starts a separate thread (discussed in Roll Camera 6 in Part 2) to track the target_null attached to the bishop. We don't need that for VaultCamera3's shot, but we'll need it in the next shot. We have to kick it off early, otherwise the camera that points at it will have an abrupt hitch at the start of its view because the bishop has traversed almost all of the hall by then.

So the bishop walks by. Light streams from the windows, indicating it's daytime, and the city has survived to see another day. Barking dogs give a hint of life beyond the windows.

Turning Into the Archway

Text.

The Staircase

Text.

The Vault

Text.

Lighting the Candles

Text.

The Conversation

Text.

Ending the Mission

Text.

Wrapup

In Part 5, we broke down the cutscene from the ending of Somewhere Above the City. Hopefully it provided a look at how to build a complex cutscene involving several cameras and a detailed conversation.

As was mentioned in the title page of this tutorial, you can leave comments and questions here.

Enjoy!