Using Cameras



This tutorial was written with the DeGeneration mod in mind since it integrates the single player feature of camera cut scenes into its multiplayer game play. However keep in mind that a lot of the information in here can be used for single player mapping in RTCW.

You'll need to download the Level Designer's Kit for the files included in this tutorial.


Camera Types

Let's go over the different types of cameras. There are fixed, interpolated and spline.

Fixed
This is the simplest of the cameras. This is one fixed point. We'll get more into this later, but think of it as what you're looking at. If you walk around a room looking at something that something would be the fixed point. If you turned your head around 360 degrees then your body would be the fixed point.

Interpolated
This camera works on what I'd call a two fixed point system. It has two points, start and end and through the duration of the camera cut scene it will move from start to end. So consider that if you had two things in your room this camera would help you start focus on the first and the move your focus to the other.

Spline
This one allows you to set many points and can give a floating type look to your cut scene. This is a great camera type to use if you'd like to get a very controlled flying style view.


Planning a Cut Scene
The first thing we need is a map because otherwise we're going to be making a cut scene for nothing right? I've included a sample map that we can use called camera_tutorial_1.map. You will see that it's extremely simple and gives us one central point to focus on, a dead tree. This will be perfect for us to start.

So in this situation the tree could be anything. Maybe it's a stack of gold, a player, a vehicle or something of importance to you and your map. We're going to want to give that object center stage.

Now, keep in mind that the camera type you start off with is the primary camera and will make a big difference in how this comes out. For instance, if you start with a fixed camera then your position will be fixed. If you add a fixed target later on then your view will be fixed. Think of it this way. The initial camera is you and the target is going to be your view. Picking a spline camera with a fixed target will allow you to fly around something while focusing on an object. Picking a fixed camera with a spline target will have you standing still while your view flies around from point to point.


Camera Inspector
Let's take a look at the tool we use to create cameras. The camera inspector. In GTKRadiant 1.4.0 you'll find it under plug-ins, camera, camera inspector. Depending on your version it might be somewhere else. Bring up the camera inspector and look at it. Let's go over it quickly. See the picture below.





Let's tackle the buttons on the right side first.

New - creates a new camera
Load - loads a previously saved camera
Save - saves the currently selected camera.
Unload - unloads the current camera
Apply - applies the settings you made to the current camera
Preview - previews the current camera

Then let's start from the top.

File - this is the camera file you're working on
Name - this it the name of the camera component
Type - this is the type of the camera you have selected
Edit - this is the part of the camera you're working on
Edit points - when selected you can move camera points
Add points - when selected you can add camera points
Rename - allows you to rename the camera
Add Target - allows you to add a target
Length - this is the length in seconds of your camera
Current time - this allows you to jump to a spot in your camera
Track camera - allows you to track the camera
Events - this shows the events that you have added in your camera
Add/Del - allows you to add remove events
Close - closes the window

 

Making a Simple Cut Scene
Let's start simple. What we want to do is focus on the tree which is our center fixture. So let's start with adding an interpolated camera. Set your camera view in GTKRadiant so that it's where you want to put the camera for your cut scene. With a 2-button mouse preference setup simply hold CTRL + right mouse button to put the camera view where you want it.

1. click new
2. select interpolated
3. click ok

You'll notice you have 2 blue dots and some writing near the camera view you set. These are your start and end points for your interpolated camera. Go ahead and click your left mouse button in the 2d view all around that area. You'll notice each time you set the start and end of the camera.

NOTE: With interpolated this isn't a big deal since it only allows 2 points to be set, but with spline you want to be careful since it will keep adding points you don't want and the only way to delete those points is in a text editor.
You'll notice that if you change to your side view in GTKRadiant that the dots are way down at the bottom of the map. All points are created at the lowest point by default.

NOTE: With spline cameras it's best to add one point and then drag that point to the desired height right away before continuing. The reason is that your next point will be created at the same height as the one before it and you don't want to have to drag all those cameras.

In the camera inspector select 'edit points' and in your side view drag each point so that it's at the same level the tree is. Otherwise you won't see anything!

4. change your length to 5
5. click preview to see what you've done

Do you like it? Probably not. I'm sure it doesn't look very good at this point, but then we haven't finished. Notice that the camera doesn't focus on the tree. Remember, this part is you moving. We haven't setup your focus yet. As long as the camera isn't going into the ground or through the tree trunk then let's move on. You can adjust it later on.

6. click on 'add target'
7. select fixed
8. click ok

Now you see another blue dot at your camera view, but this time it's just one. You'll notice clicking your left mouse button around the area will place it in a different spot. Go ahead and select 'edit points', switch to your side view and move the point up a bit so it's at the same level of the tree. Now switch to your overhead view and move it right on the tree. This will make the first camera focus it's view on the tree. Hit preview now to see what happens. You should move while your view is fixated on the tree.

At this point if you want to edit your first camera simply change to it by using the drop down box for the edit field and changing it from target to position (if you used default names)

Mess with it a bit, change the timing, positioning, etc and you can do some great things with just those two simple cameras. Once you're done don't forget to save! You can also load up the camera I've included called camera_tutorial_1.camera

NOTE: You'll find that sometimes the plug-in can crash GTKRadiant if you're editing a complex camera so make sure you save often!


Making a more Complex Camera
I love the spline cameras, but I have to admit like anything else they have their place. As said earlier the spline is a series of points connected so you can give the person viewing the camera a sensation of floating or flying. This camera is great for a flyby over a map or area.

1. click new
2. select spline
3. click ok

Now remember, if you click the left mouse button it will add a point. With spline you can add as many points as you want so make sure you mean it. I usually select 'edit points' when working with splines until I'm sure I want to add a new point. I'll show you how to remove points via a text editor later on.

Another tip to remember is that it seems with splines that the first couple of points added act like lead ins. They don't show up in your camera's play. Instead it will usually start at the 3rd one. Keep that in mind when you start out so that you can provide that buffer of space. For now don't give it two thoughts. Let's move on.

4. with 'add points' selected left click to create a point
5. change length to 5
6. change to 'edit points'
7. change to side view and drag the newly created point above ground level

The next point you add will be at the same height as your previous.

Go ahead and select 'add points' again and left click in a few points. Make them go around the tree. As you get to the fourth point notice how the line begins to show. When you're finished select 'edit points' so we don't add more than we want to.

Click on preview to see how your camera acts, but remember this is one half of it. This is just your movement and not your focus.

8. click on 'add target' and select fixed
9. select 'edit points'
10. change to side view and move the fixed point above ground level

Now preview it. It's a lot better now that it's focused on something.

At this point change your edit field back to position and select 'edit points' if not already selected. Let's play with the movement a bit. Change the heights on your spline points. Maybe start low and have it end high or have it wavy. Whatever you like, but mix it up a bit. You can take a look at mine. It's camera_tutorial_2.camera. It's not very good, but you get the idea. You can follow these same steps and incorporate interpolated targets with splines too.


Fixing Mistakes with Cameras
Two things that I find annoying is that you can't (or I don't know how) to remove targets and points from a spline through the camera inspector. However there is one way.

Find your camera file (usually in the cameras folder) or my camera_tutorial_2.camera file and open it in Wordpad or your favorite text editor. This is what you'll see.

cameraPathDef
{
        time 5.000000
        camera_Spline
{
        time 5000
        type 2
        name position
        baseVelocity 249.530518
        target
  
         {
                granularity 0.025000
                ( 256.000000 -128.000000 16.000000 )
                ( 192.000000 -160.000000 16.000000 )
                ( 128.000000 -192.000000 40.000000 )
                ( 72.000000 -192.000000 48.000000 )
                ( -56.000000 -192.000000 104.000000 )
                ( -120.000000 -168.000000 80.000000 )
                ( -192.000000 -128.000000 72.000000 )
                ( -296.000000 -64.000000 88.000000 )
                ( -296.000000 32.000000 48.000000 )
                ( -184.000000 96.000000 40.000000 )
                ( -128.000000 160.000000 48.000000 )
                ( -64.000000 192.000000 56.000000 )
                ( 8.000000 192.000000 152.000000 )
                ( 64.000000 192.000000 176.000000 )
                ( 128.000000 128.000000 208.000000 )
                ( 192.000000 64.000000 224.000000 )
                ( 256.000000 0.000000 256.000000 )
            }
}

        target_Fixed
        {
                time 5000
                type 0
                name target1
                baseVelocity 0.000000
                pos ( 0.000000 0.000000 64.000000 )
        }

        event
        {
                type 4
                param "target1"
                time 0
        }

        fov
        {
                fov 90.000000
                startFOV 90.000000
                endFOV 90.000000
                time 0
        }
}

 

Notice the spline entries like this one:

( 256.000000 -128.000000 16.000000 )

If you remove lines from the top you remove points from the start and if you remove lines from the bottom of that section you remove points from the end.

If you want to remove a target from your camera look further down in the script to the section that starts with the word target like below:

target_Fixed
{
        time 5000
        type 0
        name target1
        baseVelocity 0.000000
        pos ( 0.000000 0.000000 64.000000 )
}

Removing this whole part will remove your target.


Advanced Features
You'll notice in the last section of the camera file that you can change your FOV or field of view as well as other settings. In camera inspector click on the add button near the events section and you'll see you can do a lot more.

I'm not going to get much into those settings in this tutorial though. This is just for the basic stuff. Keep in mind you can also write the camera files in a text editor of course. The plug-in just helps make it easier.


DeGeneration Scripting of Cameras
We've only used the cameras to show the generator destruction with a bit of objective completion, but nothing is stopping you from using it in other places if you want to experiment.

You're going to want to familiarize yourself with two new scripting commands available in DeGeneration. Startcam and Stopcam. These are self explanatory. One starts the camera and the other stops it. Stopcam is good to use to finish off your sequence, but consider that if you start a new camera while one is going then it will switch to the one started second, third, etc.

How would you trigger the camera? The same way you'd trigger anything else. For instance in the death sequence of the generator like below:

death
{
        // run the camera showing the allied generator dying
        startcam dg_shipment_camera1a
        wait 1500
        startcam dg_shipment_camera1b
        wait 1500
        startcam dg_shipment_camera1c
        wait 1500
        stopcam
        trigger game_manager objective1_destroyed
}

You'll see the above is a simplified version of the generator death script, but you get the picture.

Notice that it uses three cameras and there are waits between them. If you don't put waits in there it will just move onto the next line and start a new camera. Make sure you time it all out based on the time you set for each camera. 1500 is 1.5 seconds so if you have a 10 second camera you will want to set the wait times accordingly.


End Notes
With the addition of this feature into DeGeneration you can really get creative with ending objectives or even objectives during the game.

Imagine the beach map cutting to the wall exploding when the dynamite explodes! Imagine an objective where one team must get parts to fix a rocket that takes off at the end and the whole server will see it happen! Imagine showing an overview of your map when the docs are returned!

Have fun with this and drop by the TRAM Design forums if you need help!

Copyright © Tram design - All Rights Reserved Legal Notices