Packaging Your Product |
Quake2 Demo Editing Tutorial |
Written 8/99 by Overman |
When you finish a recam or movie, it's probably unlikely that you want to keep it to yourself - you want others to have an opportunity to enjoy your work too. With a little extra effort, you can "package" your demo or movie in a way that makes installation and playback a breeze, rather than a hassle. This is very important to your viewing audience, most of whom want to download your product and have it playing quickly. This tutorial will guide you in some of the ways to pull this off.
Directory Structure
First of all, it is important to understand the directory structure of Quake2, and how it handles different types of files. The Quake2 executable (.exe) is in your Quake2 directory, and all of the default deathmatch (base) files are located in the Quake2\baseq2\ subdirectory, either in .pak files or in further subdirectories.
Here is a breakdown of the relevant file subdirectories under baseq2 (or any mod directory):
Subdirectory Name | Usage |
<root> | Config files, and often the readme.txt and batch file(s). |
demos | This is where .dm2 (demo) files are placed. |
env | Environment map (sky) files are placed here. |
maps | Maps (.bsp files) are placed here. |
models | This is where models for items, monsters, etc. will appear, each under their own subdirectories. |
pics | On-screen images (.pcx) are here. |
players | Player models and skins are found here, each under their own subdirectory (ex. male, female, etc.) |
sound | Sound files (.wav files) are here, most of them under subdirectories (1 level max) |
textures | Map textures (.wal) files are found here, most of them under subdirectories (1 level max) |
Pak (.pak) files are set up with this precise directory structure. They hold files (uncompressed) in their respective directories, for easier organization. There can be a maximum of 10 pak files in one Quake2 subdirectory (pak0.pak, pak1.pak, ... , pak9.pak). Quake2 will first look for files in the actual subdirectories (demos, maps, etc.), and then it will look through the pak files (starting with pak9 and counting down).
In any case where you are distributing something other than just a demo (i.e. custom sounds, pics, maps, etc.), it is a very very good idea to create your own custom game directory for playback. The exception is if your demo requires files from a particular mod (Rocket Arena, CTF, etc.) that are not located in the baseq2 directories. For example, with Father Frags Best, I created the movie to be played back from the "zs" subdirectory. In order to make this operate consistently, I merely had to change the "Game Directory" setting under the Demo Information (in Keygrip2) for each demo to "zs".
When using a custom game directory, Quake2 searches for files in the following order: 1) the subdirectories under your custom gamedir, 2) the pak files in your custom gamedir, 3) the subdirectories under baseq2, and 4) the pak files in baseq2. What this means is that if you have a file named "sound\world\mysound.wav" under your custom gamedir, and that file also appears in "baseq2\sound\world\mysound.wav", then the first sound will be used, since Quake2 will use the first one it finds.
Pak File Maintenance and Creation
Pak Files are a big part of making your project easy to install. Use a program like Pak Explorer to assemble pak files. I strongly recommend putting all files in the pak file except for the ReadMe and Batch file, if any. If you need more detailed info about how Quake2's .pak files are set up, use Pak Explorer to browse around the baseq2 pak files.
It is very important to use a pak file number that will not conflict with something that may already be installed on a user's machine. For example, if you distribute a pak0.pak file with your demo or movie, and design it to be installed to baseq2, you will be overwriting the primary pak file that makes Q2 operate. This is not at all good. Using another number under baseq2 will likely conflict with someone's custom add-ons (there are a lot of them out there). For this reason, I recommend again that a custom game directory be used whenever possible... and pick a name that is unlikely to have already been used by another movie or mod. This helps your audience in two ways: ease of installation, and ease of removal (What, you didn't think they were going to keep it on their hard drive forever, did you? hehe). Seriously, though, many movie viewers want to download your demo, install it quickly, watch it once or twice, and remove it quickly to conserve hard drive space: why make it difficult for them to do so?
The Batch File
Now that you've got a custom directory set up, and you have all your finished product neatly assembled into a pak file, the next feature you could add is a way for users to launch your demo/movie with merely a mouse-click (or double-click). This is done by creating a DOS batch file in your game directory, which contains the necessary command line to run Quake2 with your demo/movie. Using any text editor (Notepad, e.g.), make your file as follows:
@echo off
cd ..
quake2 +set game YOURDIR +clear +demomap FIRSTDEMO.dm2
Where YOURDIR is the name of your custom game directory, and FIRSTDEMO is the name of the first demo you will be playing back. If you prefer to use an autoexec.cfg file to execute the Quake2 console commands, launch your demos, etc., then all that is needed in line 3 is:
quake2 +set game YOURDIR
Either way, save the file as "FILENAME.bat" - (use the quotes if using Notepad, or else an extra .txt will be added on). FILENAME can either be the name of your movie, or else anything else that makes it obvious that it should be clicked to start the movie. If you are more familiar with MS-DOS, you can dress up the batch file a bit, and make it execute "prettier" if you wish. Click here for a useful online reference of MS-DOS commands.
The ReadMe File
The ReadMe file is typically a text file that describes what the user is downloading, and includes credits and installation notes. It is an absolute MUST if you want to maximize your downloads. Responsible internet users are not going to download and run a file if they don't know what it is. Html is also acceptable, and is becoming a more and more popular venue for ReadMe info, but plain text files are by far the most popular method. Be sure to name it: "readme.txt" or something similar. NOTE: If you are not setting up your demo for a custom game directory, then add something unique to the readme filename (like the title of your project), so there's no chance of you accidentally overwriting another readme.txt that was there first (such as the one placed there by Id Software) and might be important.
There is not a set template for distributing demos (as there is for distributing maps). If someone would like to design one, drop it to me in an email, and I'll give you credit and get it circulated.
The information you need to be sure to include in the Readme.txt file is: project title / description, your contact info / URL, installation instructions (should be simple), and any credits that are due. If you are using skins, models, music, etc. that someone else made, it is important to fully credit them for their work (you should secure permission before using it, anyway).
Zipping it Up
The standard compression tool for distributing Q2 demos is Winzip, which is drag-and-drop friendly and very very easy to use. If Winzip is properly installed on your PC, you should be able to go to your game directory in Windows Explorer, right click, select NEW - WinZip File, and then name it.
Next, double-click on your new WinZip file. Click the Add button, and select the files related to your movie. Make sure that Compression is set to Maximum (Slowest) to make it the most efficient download size, and also make sure Save Extra Folder Info is checked, which will make installation extremely easy for other WinZip users, as your gamedir structure will automatically be preserved in the .zip file itself.
Finally...
Test your package, see if it installs smoothly for you, and then get a couple friends to try installing it, without giving them any instructions other than what is included with the .zip file. This takes very little time, and is an excellent way to troubleshoot before you go public. Take the time to do this, it can save a lot of headaches for your viewers and embarrassment for you.