ROQ Files

 

1 What is it?

 

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.

 

2 What features does it have?

 

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.

 

3 How do I make a .roq?

 

3.1 The Standards

 

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.”

 

3.2 The .param file

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.

            Example:  INPUT_DIR     c:\quake\base\screenshots

FILENAME – This is what you want to call the .roq file and where to store it. 

Example: FILENAME    s:\base\video\intro.roq

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.

            Example: SOUND   s:\base\sound\intro.wav

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

Shot*.tga  [0001-0223]

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.

 

3.3 Run the RoQ compiler

 

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.

 

4. Putting a .roq into the game

 

You need to make a shader for the designer to put a .roq into the game. 

 

So here’s a step by step:

 

  1. Create a new shader.
  2. Give it an editor image (maybe the first frame from the video).
  3. Flag it nolightmap.
  4. Create a new blending stage.
  5. Select videomap in ShaderEd2 and browse to the location of the .roq file.
  6. That’s it, there’s no second stage!

 

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.)

 

5. Putting a .roq into the menu

 

Step by step:

 

  1. Find the appropriate .menu file that you want to have the .roq in.
  2. Write up a bunch of stuff that I don’t understand. 

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

            }

  1. The important things are “cinematic” and “rect
  2. “Cinematic” is the actual file you want.
  3. Rect” has four numbers.  The first two are the “x” and “y” coordinates for the location while the third and fourth numbers are the size you want the .roq to be drawn at.

 

 

6.  Putting a .roq into the logo intro

 

Step by step:

 

  1. Make a cool new Raven logo.
  2. Call the .roqraven.roq
  3. That’s it.  The game is hard-coded to accept “raven.roq” as the logo file.