The Grand Tour |
Quake 2 Demo Editing Tutorial |
12/98 by Overman |
In the first tutorial, we examined the basic structure of a .dm2 demo file, and noted the many different types of information stored in such a file. Now we're going to see how Keygrip2 organizes that material in a very efficient way. If you don't have the demo from the first tutorial, download it by clicking here.
Begin by opening Keygrip2. The higher the screen resolution, the more workspace you will have... the more the better. Setting your desktop to at least 1024x768 is highly recommended.
NOTE: It is strongly advised that you do not run Keygrip2 in a maximized window for performance reasons. Instead, resize the window so it takes up approximately the top half of your screen.
Next, open the zstut.dm2 demo from tutorial #1 by selecting File - Open, and navigating to it's location (probably your quake2\baseq2\demos\ directory). You should see the Message Log window open up. Note that the message in red says "Demo from later version of Quake 2." This is normal, and we will cover what to do about it shortly. For now, go ahead and close the Message Log window.
Click the "i" icon on the toolbar to open up the Demo Information window.
Notice the list of Configstrings in the scrolling text box. Remember the "precache list" from Tutorial #1? All of the data from the initial demo blocks is represented in this Demo Information window. If you scroll down through the Configstrings, you will see every item, light type, and piece of map information needed by Quake 2 to replay this demo. Now you see why we called the "precache list" the Demo Information.
The Server Data is just information about the status of the server at the time the demo was recorded. The Baselines list holds all the initial entity information (location, etc.).
For now, we are only going to change two things here. First, use the arrows by the Server Version box to change it from 33 to 34. This takes care of the "later version" message we got when we loaded the demo. This should be your first step for every demo you load into Keygrip2, every time you load it. Secondly, change the Player Number from 0 to -1. This will make the player who recorded the demo visible for our camera to see. Click OK to close the Demo Information.
Now that we know where the precache block data is located, let's look at the regular blocks. These are stored in the Block Tree, which can be viewed by clicking the button just to the left of the "i" button, or by selecting View - Block Tree. Do this now.
Click the "+" to the left of the demo filename to expand the list of blocks. Then expand Block 0 in the same way.
Look familiar? That's right, Keygrip2 displays the block information in the same structure as the LMPC text file we examined in Tutorial #1. Click on the Playerinfo under Block 0, and you will see how Keygrip2 has all the data organized. Any of these data fields in any of these blocks can be edited here in the Block Tree, though it should be noted that "tinkering" with this data can have unpredictable results if you are not careful. If and when you choose to do so, be sure to save your work before you try anything.
Now is also a good time to note the buttons on the left side of the Block Tree window. You can use the arrows to navigate between different demos and different blocks. Additionally, you may use the eyeglasses button to jump to a position in the block tree that you have selected on the filmstrip (we'll cover the filmstrip shortly).
When you are finished perusing the Block Tree, close it. Under the View drop-down menu, there are several other extremely helpful lists available to view. Selecting View - Sound List shows all the .wav sounds used in this demo. You can even play them from this list. Notice that numbers 11 through 27 have a wildcard (*) symbol, and cannot be played. This is because these sounds are model-specific; the particular player sounds used by the demo depend on the which model the player is wearing at the time. You can also add more sounds to the list, either from the Q2 pak file, or your own sounds. We'll cover exactly how to do this in a later tutorial.
Feel free to examine the Model List (all used models) and the Image List (statusbar images). Keygrip2 also has a pak file viewer built in, which is an extremely useful tool. You will also notice that you can reopen the Message Log.
Next, let's look at the filmstrip. Notice that there are no pictures on the filmstrip by default, which saves valuable RAM and disk space. Each numbered frame in the filmstrip represents a block in the demo. The default block increment on the filmstrip is 16, meaning that every 16th block is shown. You can increase or decrease the increment by using the Zoom In or Zoom Out buttons on the toolbar (the magnifying glasses with the + or - signs). For precision editing, I prefer to zoom all the way in, so that every block is displayed. To do this, click the Zoom In button then click on the filmstrip until it shows A0.bmp, A1.bmp, A2.bmp, etc.
Now click on the Selection Tool on the toolbar (the red arrow). You can left-click on a block in the filmstrip to select it. Try left-clicking on block 0 (A0.bmp), then right-click on block 4 (A4.bmp). Notice that this is how you can select a range of blocks for editing; left-click sets the "in" point, right click sets the "out" point. Double-clicking on the filmstrip will select all the blocks in the demo.
Before we do more with the filmstrip, let's look at the Demo Server, which is the most important feature of Keygrip2. Open the Demo Server window by clicking it's button on the toolbar or selecting View - Demo Server, and look over the layout of this mini-studio.
Before we get into it's features, click the Connect button to open the 3D Preview window. Quake2 will launch in a small window and you will see the first block of the demo visually.
Now it becomes clear why the larger the desktop, the better. You may find that depending on what stage of editing you are in, you will want to reorganize the various windows you need. To see how I organize my desktop, click here.
To see actual screenshots on the filmstrip, we can use the Playback Tools. Take note of the six buttons available here. The first button will take screenshots for the entire filmstrip, which would consume a large portion of hard drive space. Instead, let's click the second button to take screenshots for the visible frames on the filmstrip.
Now on to the Demo Server.
Notice the top row of buttons in the Demo Server window: these are the playback controls. When the Demo Server is first launched, the demo will be paused. These same controls are available from within the 3D Preview window as well, represented by the keys R through P, with U being the "pause" function. To try out these bindings, click on the 3D Preview window to make it the active window. Then try pressing "I" to advance the demo forward at normal speed. "U" will pause, and "Y" will move in reverse at normal speed. Often in editing, you will want to locate a specific block in the demo. For these purposes, the "O" and "T" keys will move forward one block and backward one block, respectively. Finally, you may move to the last block in the demo by pressing "P", or to the first block in the demo by pressing "R". Experiment around with these controls until you feel comfortable, and finish up by pressing "R" to return to the beginning.
Next, let's free up the camera. Notice that in the Demo Server window, "Fix View" and "Fix Position" are checked. By unchecking these two boxes, we are "detaching" the camera from the angle and position values associated with the player who recorded the demo; instead, we can move the camera where we like.
These boxes can also be checked/unchecked from within the 3D Preview window by using the "K" key for Fix View and the "L" key for Fix Position. Once these are free, you should be able to move the camera around the map in a "noclip" kind of mode (i.e. through walls, etc.). Move the camera forward a little bit, and turn around: you should see the female player holding her blaster.
Now, keeping the demo paused, let's move the camera up the hallway and around to where the boss monster is located. What's this?? The monster is nowhere to be found! No problem, it's supposed to be this way. If you recall from Tutorial #1, Quake 2 only renders what is either visible or almost visible to the player, and since our player is still back down the hallway and around several corners, the monster is not yet being drawn. While staying up near the "invisible" monster, press "I" to play the demo. You should hear the player's footsteps approaching and then POOF! the monster appears.
Using the playback controls, see if you can stop the demo on the exact block where the monster first appears. I found it to be Block 92. Once you have the demo paused on this block, move the camera until you find our player. She should be almost up the lift, chaingun in hand. Notice that from the player's point of view, the monster is still just out of view, but is within the player's "radius" of visibility, which we discussed in Tutorial #1.
This limitation does not exist in a serverrecord demo, which captures all entities at all times, but the limitation is very important for any client-side demo that you are going to recam. Technically, you CAN go anywhere in the map at any time in a client-side demo, but you will often find entities disappearing and reappearing, which is very distracting for the viewer. A professional-quality recam works within the limits prescribed by its source material, and does so in a way that makes the viewer virtually unaware that such limits even existed. If nothing else, that is what these tutorials hope to show you how to do.
It is also important to note that sometimes entities will appear and disappear while watching from Keygrip2 at times where it seems illogical that they would do so. This is sometimes due to the fact that Keygrip2 edits blocks while they are in their uncompressed form, and sometimes the resulting blocks are truncated because Quake 2 has a limit on the block size it can handle. This is not a problem, because when your finished product is saved as a .dm2 file again, the blocks are returned to their compressed form once again. However, if you notice entities disappearing, and you're not sure if they are "really" disappearing or just being truncated, you can check the "Delta Compress" box on the Demo Server window, and the 3D Preview window will compress as it plays. For the most part, however, this feature should remain unchecked for performance reasons.
For your own enjoyment, you may want to press "I" and watch the rest of the demo from your "free-cam" perspective. Move around as you like, keeping in mind that you should keep relatively close to the player if you want to see relevant entities, especially near the end when she runs underground.
You may notice that as a demo plays, it is difficult to follow the player accurately without at some point intersecting with a wall or floor. That's what is great about recamming with Keygrip2: the difficulties that exist for a live human cameraperson can be overcome, since the camera placement and movement can be set to exactly what the situation needs. If a mistake is made, there's no need to re-record the demo. Instead, you can go back and make minor adjustments to camera positions.
In Tutorial #3, we will do just that. For now, save the demo as an uncompressed .kg2 file (zstut1.kg2), which is always a good idea until you are completely finished recamming. By the end of Tutorial #3, you will have a completely recammed version of this demo, ready for playback in Quake 2.