In this tutorial I am going to explain the basics of the camera mod and how to set up a camera path.

 

 

 

      I.      Installation

a.       Get the newest version (v7) of the camera mod here

b.      Unpack the camera folder into your Quake 4 folder c:\quake 4\camera (not in baseq4 because camera is a mod!)

c.       Camera includes following files:

demos                         : you have to put your demos in this folder; includes an example demo (campath.netdemo)

avinetdemo.scriptcfg    : script for avinetdemo settings (going to explain it later)

cam_commands.txt      : includes all featured commands of the current camera mod version

camedit.cfg                  : config with settings and binds for creating a camera path

campath1/2/3.dat         : includes the data for a camera path (going to explain it later)

startmod.bat                : starts the camera mod

 

(the rest are the same as in baseq4 or/and contains only things for developers)

 

 

   II.      Spawning Server

 

Start the startmod.bat to start Quake 4 + camera mod.

Start a LAN server:

Multiplayer > Create Server > dedicated: NO

or

console: spawnserver mp/mapname (if you know the exact mapname, e.g.: phrantic – swq4dm1)

 

Type exec camedit.cfg in the console to execute the config for camera path editing.


 

 

 

III.      Camera Path

 

Modify example path:

 

Spawn a server (spawnserver mp/q4dm1) and type exec camedit.cfg & camLoadPath campath1.dat .

That’s what you should see now:

 

 

 

Camera Objects:

camera path (green line)           : its like track on which the camera moves along

frames (white arrows)              : defines the frames/speed of the camera movement

waypoint                                 : point on a track that defines the position and viewpoint of the camera

controlpoint                             : point to define the path (straight, curvy, etc)

target                                       : the target is a static point where the camera looks at (if a waypoint is set on a target)

 

 

 

To get an idea how the system works, press UPARROW (camEmulatePath). That gives you a preview of the current path (emulating path).

 

Okay, lets start: as a spectator you can move through the hole map. To edit a waypoint move as spectator to a waypoint and press PGUP (camEditWaypoint). Now you’re on the waypoint’s focus and change the position with your controlkeys (forward, backward, right, left, up, down) and change the viewangle with your mouse. With RIGHTARROW and LEFTARROW you can roll the waypoint.

360° spin (don’t set smoothing! Explained later):

waypoint:         A                                 B                                 C

roll:                                                  180°                            359.9°

Apply the changes with END (camFinishEdit) or if you want to discard the changes, press HOME (camCancelEdit). The camera at the waypoint will now look at the same direction as you did. Move near a controlpoint and press PGDN (camEditControlpoint). I think the easiest way to understand how controlpoints work is either testing or imagine the following:

A cord is fixed to two points (A and B). Grab the cord on the center and move it to all directions, watch how the cord changes its direction. You can also grab it near Point A, move it around and look how it affects.

It’s the same way how the controlpoints work. The fixed points are waypoints, your grabbing finger is the controlpoint and the cord is the track/path.

Editing a controlpoint is the same as editing a waypoint, except the viewangle doesn’t matter.

NOTE: when editing a camera object, the object closest to your current gets edited. Don’t forget to press END when you want to apply the changes!

 

Test to modify the example path to get a feeling for the whole thing. Preview it by pressing UPARROW.

If you want to save a path, toggle console and type camSavePath filename.dat .

 

You can also add a waypoint on an existing path. Just edit a controlpoint and press INS to add a waypoint. To delete a waypoint, edit the waypoint and press DEL (camRemoveWaypoint).

 

Creating own path:

 

After getting to know how to edit camera objects and got an idea of the camera mod’s possibilities, this is the fun part. By creating paths you can be creative and make your own crazy camera movements.

 

Spawn a server and execute the camedit config. Move to a point on the map where you want to have your startpoint and press INS (camAddWaypoint). Look for a second point where you want your camera to go by and add another waypoint – a path is drawn. Add waypoints wherever you want to change the position or view of the camera. Edit the controlpoints how you want to affect the track and define the camera’s movement.

 

You will notice, that between waypoints with bigger distance, the camera moves faster than between waypoints who are close together. When going into editing modus of a waypoint (camEditWaypoint) and type camGetSpeed in console and compare it to another waypoint’s speed, you’ll see that the speed isn’t the same which makes it look not constant. You can achieve constant or custom speed by setting either for every waypoint or get the same speed for all waypoints of your path.

Customspeed: Edit a Waypoint and type camGetSpeed . you see the current speed of the waypoint. To change it, type camSetSpeed <value> .

Commonspeed: To set the same speed for all waypoints type camSetCommonSpeed <value> .

The speed isn’t a real value because it calculates the frames between waypoints. To set frames manually, edit waypoint and type camSetFrames <value>. To get the current frames, type camGetFrames.

 

Preview your result. In 99% you will notice that when the camera arrives at a waypoint it looks like a little stop and not very smooth, that’s because the different viewangles between the waypoints. Solution:

Edit the Waypoint and type camSetVaSmoothing <percent> . By setting 100 percent you’ll get a total smooth transition between the waypoints and the viewer wont even notice that there is a waypoint in between. To smooth the viewangle of all waypoints type camSetCommonVaSmoothing <percent> .

 

Additional info for ViewangleSmoothing:

It includes acceleration and deceleration which means if Waypoint A has 100% VaSmoothing and B has 0%, the viewangle change accelerates all the way. When A and B are set to 100%, the va change accelerates the first half the way to B and decelerates the second way.

Although 100% make it looks very smooth, the speed can get very unconstant, so I recommend to use smaller values (around 10).

 

 

To create a target, edit a waypoint and type camSetTarget <targetname> into console. Press END to finish the waypoint editing and type camEditTarget now you can edit the target as the other camera objects. To link a waypoint with target, edit the waypoint and type camSetTarget <targetname> .

When a target doesn’t exist, it will be create with camSetTarget, if it already exists, camSetTarget will link the target with waypoint.

 

If you want the camera to stops at a certain point for some time, edit the waypoint you want to stop and type camSetWaitTime <value>.

WaitTime also includes a pause function which freezes (players stop moving etc) but the camera movement goes on. To do that, set camSetWaitTime -1.

 

 

      I.      Rendering / Capturing Screenshots:

 

Modify Scriptfile

 

To render the camera path, you need to modify the avinetdemo.scriptcfg. To do that, save your path (camSavePath <filename.dat>) and go back to the camera folder. Open the script file:

Don’t get confused by all the code – its very basic and you only need to adjust some values.

(note: you can edit the bold values)

 

sys.setPersistantArg( "avinetdemo_fps", 30 );

Captures the demo at 30 fps

 

sys.setPersistantArg( "avinetdemo_useJpeg", 1 );

0: Captures the demo with .tga images

1: Caputeres the demo with .jpeg images (I prefer jpeg because it saves space)

 

sys.setPersistantArg( "avinetdemo_saveDir", "SSDemo" );

Saves the screenshots in “SSDemo” (I recommend to set separate folders for every path otherwise screenshots from every path you render will be saved into this folder and the screenshots get overwritten)

 

sys.setPersistantArg( "avinetdemo_width", 800 );

sys.setPersistantArg( "avinetdemo_height", 600 );

Defines the resolution (width & height) of your screenshots.

Example:

800*600 = 4:3 (Fullscreen)

1280*720 = 16:9 (Widescreen)

 

sys.setcvar ("r_aspectRatio", "1");

0: 4:3               (Fullscreen)

1: 16:9             (Widescreen)

2: 16:10           (Widescreen)

 

sys.Cam_RenderCamPath("campath1.dat");

the path campath1.dat gets rendered

 

The lines with // at the beginning of the lines are disabled. If you want to enable them, simple erase the //.

Example script (fps: 30; jpeg; folder: campath1; resolution: 1280*720; fov: 110; widescreen):

 

namespace aviNetDemo {

            void Execute()

            {

                        // initialize

                        sys.setPersistantArg( "avinetdemo_fps", 30 );                                //max 62.5

                        sys.setPersistantArg( "avinetdemo_useJpeg", 1 );                          // jpeg does not work for firstperson

                        sys.setPersistantArg( "avinetdemo_saveDir", "campath1" );

 

                        // width and height of the video: does not work for firstperson

                        // change r_mode for firstperson.

                        sys.setPersistantArg( "avinetdemo_width", 1280 );

                        sys.setPersistantArg( "avinetdemo_height", 720 );

 

                        sys.setcvar ("g_fov", "110");

                        sys.setcvar ("r_aspectRatio", "1");                                                 // 16:9

 

 

                        sys.Cam_RenderCamPath("campath1.dat");

                       

            }

}

 

 

 

Avinetdemo

 

To start rendering, type avinetdemo <demoname>.netdemo . All Items, Models etc which are on the camera’s view will be shown on the final render.

Important note: only demos that were recorded in baseq4 work which means you cannot use the mod with q4max, ra4, gtr, xbm demos YET!

 

Another issue is that you can only render clientdemos. Which means, you have to join a server as a client and record a netdemo (recordnetdemo <filename>.netdemo). If you want to record a mapflythrough (no players) just record a demo as spectator (you don’t have to fly around or anything, just look at one point).

 

Recording demo on your own server:

Create a shortcut of the startmod.bat, rightclick and choose edit.

Type in the following:

 

cd ..

start Quake4 +set fs_game camera +set fs_savepath "J:\games\q4\q4 cam" +set win_allowMultipleInstances 1 +connect 127.0.0.1

 

change the “j:\games\q4\q4cam” into a folder you want to save your demo.

 

Start a dedicated server and the shortcut. You will auto-connect to your dedicated server. Now you can record a clientdemo.

(note: the recorded demo has to at least as long as you want to record your videomaterial)

Copy the demo into \quake 4\camera\demos, and record as explained above.

 

To convert the screenshots into avi, read converting screenshots to avi tutorial.

 

Additional tips:

 

• to move the camera objects more precise, set a lower pm_spectatespeed value

• if you too low fps after loading a path, set g_editwaypath 1

• when you get dark areas in the final render (no light), the areas weren’t covered in the demo -> rerecord the demo and try to cover all the areas you want to have on your camera path

 

Example videos:

campath1 Video          (by TTK-Bandit)

warforged Video          (by neRo)

 

I hope this tutorial helped you to learn the basics of the current camera mod version. Have fun creating your own path and show us your results in

#q4movie @ quakenet !

 

// neRo

 

VaSmoothing image by Bandit – applause for his great painting skills =)