A .roq file is a compressed video file that the engine can read and decode, thus allowing video to play both in the menu and in the game.
A .roq file plays back at 30 fps and can have sound depending on where it is used. Thus, the input files must be presented at 30 fps to appear correct in the .roq. Recording at 15 fps for instance will make everything appear to play twice as fast in the .roq. Sound will play back in the cinematics (the intro outside the menu, Raven logo, id logo, etc.), and in the menus but not in the game.
A roq file is made up of individual .tgas that are processed to make the movie. For a cinematic video or a menu video the source tgas must be 512x512, 256x256, or 512x256. Inside the game, they must be 256x256 or 128x128. No other sizes will work.
A set of files must share the same file name and be numbered sequentially. For instance, if you want thirty seconds of video for an intro logo, you’ll have 900 .tgas named something like “logo001.tga, logo002.tga… logo900.tga.”
Next, create a .param file. It’s basically a text file that the roq compliler uses to create the file. Here’s the syntax:
INPUT_DIR – This is the directory where all of your .tga files are stored.
FILENAME – This is what you want to call the .roq file and where to store it.
SOUND – This is where the .wav file is stored that will be incorporated into the .roq. Remember that only the cinematic and menu .roqs can have sound. Also, make sure the sound is the same time as the video.
INPUT – This is the actual name of the .tga files. If the files are all named sequentially, you can use a wildcard (*) and then list the numbers in brackets after.
END_INPUT – This tells the program to end compiling.
Example
of INPUT and END_INPUT:
INPUT
END_INPUT
You can also hold on a particular frame by listing it multiple times.
Example:
INPUT
Shot0001.tga
Shot0001.tga
Shot0001.tga
Shot0001.tga
Shot0001.tga
Shot0001.tga
Shot0001.tga
Shot0001.tga
Shot0001.tga
Shot0001.tga
Shot*.tga
[0001-0023]
END_INPUT
What this does is hold the first frame for 1/3 of a second. It’s played ten times at 30fps.
That’s almost all for the creation. Next actually make the .roq file. From a command line, go the video directory (For SoF2, it’s in s:\base\video, this is where you should store your .param files.)
Type “roq filename.param”. It takes a while to process it all, but once it’s done, you’ll have a .roq file named whatever you called it in the FILENAME section of the .param file.
Example
from command line:
roq intro.param
When finished, you’ll get a file called intro.roq stored in s:\base\video as specified in the FILENAME parameter.
You need to make a shader for the designer to put a .roq into the game.
So here’s a step by step:
The designer now treats it like a normal texture when applying it.
VERY IMPORTANT!!!
There can only be one .roq in view at a time. Only one! One! Is that clear?! (If more than one is visible at a time, they will both sit on the first frame, and not animate.)
Step by step:
Example:
itemDef
{
name ctf
group grphelptext
style
5
cinematic "roqtest_new.RoQ"
rect 10 154 256 192
border
1
bordercolor .5 .5 .5 1
visible
0
decoration
}
Step by step: