OpenArena
Tag: Visual edit
Line 9: Line 9:
 
* /s_musicvolume <decimal values between 0.0 and 1.0> - In case the map author placed the audio as map background music, you will need to have it >0 in order to hear the sound. Default value is 0.25.
 
* /s_musicvolume <decimal values between 0.0 and 1.0> - In case the map author placed the audio as map background music, you will need to have it >0 in order to hear the sound. Default value is 0.25.
 
* /s_volume <decimal values between 0.0 and 1.0> - It allows to control the volume of sounds. If not using ''[[OpenAL]]'', it may also affect background music volume. Default value is 0.8.
 
* /s_volume <decimal values between 0.0 and 1.0> - It allows to control the volume of sounds. If not using ''[[OpenAL]]'', it may also affect background music volume. Default value is 0.8.
  +
* /s_ambient 1 - In case the map author placed the audio as target_speaker. Needed for DeFRaG mod (or iDFe engine only).
* /s_ambient - ??????
 
 
* /cinematic <filename> - Command to manually play a roq file. Examples: <tt>/cinematic idlogo.roq</tt>, <tt>/cinematic video/mymap/myvideo.roq</tt>
 
* /cinematic <filename> - Command to manually play a roq file. Examples: <tt>/cinematic idlogo.roq</tt>, <tt>/cinematic video/mymap/myvideo.roq</tt>
   
Line 50: Line 50:
   
   
4. In NetRadiant (or the editor of your choice), create a brush and assign the shader you created ''to the face of the brush which will show the video''. Assign a classic texture or shader to the other faces of the brush (e.g. bricks texture, wood texture, common/caulk if they are not visible to players...).
+
4. In NetRadiant Custom (or the editor of your choice), create a brush and assign the shader you created ''to the face of the brush which will show the video''. Assign a classic texture or shader to the other faces of the brush (e.g. bricks texture, wood texture, common/caulk if they are not visible to players...).
   
 
5. If you want to also play sound: as said in-level videos do not play sound, so you have to workaround. You can either use a target_speaker entity (see 5a) or set a background music (see 5b). So, first prepare the audio file and place it under either "sound" or "music" depending from your choice; usually, sound should be mono and music should be stereo.
 
5. If you want to also play sound: as said in-level videos do not play sound, so you have to workaround. You can either use a target_speaker entity (see 5a) or set a background music (see 5b). So, first prepare the audio file and place it under either "sound" or "music" depending from your choice; usually, sound should be mono and music should be stereo.
Line 56: Line 56:
 
5a. In the map editor, place a target_speaker near to the brush of the video. Set its "noise" key to the audio file you wish to play -e.g. set it to "sound/mymap/sound01" (better if without specifying the extension)-. You can set LOOPED_ON spawnflag to make it play all the time. The sound will be heard while near to the entity by default, but it you prefer, it can be broadcasted to all players no matter their position, by setting the GLOBAL spawnflag. See also ''[[Mapping_manual/Triggers and movers#target_speaker]]''.
 
5a. In the map editor, place a target_speaker near to the brush of the video. Set its "noise" key to the audio file you wish to play -e.g. set it to "sound/mymap/sound01" (better if without specifying the extension)-. You can set LOOPED_ON spawnflag to make it play all the time. The sound will be heard while near to the entity by default, but it you prefer, it can be broadcasted to all players no matter their position, by setting the GLOBAL spawnflag. See also ''[[Mapping_manual/Triggers and movers#target_speaker]]''.
   
5b. In the map editor, set (music/sound ???) "music" key on ''worldspawn'' (generic entity) to choose a background music (a wav or ogg file) -e.g. set it to "music/mymapmusic" (better if without specifying the extension)-. You may prefer this approach instead of creating a target_speaker due to the last one getting desynced if map restarts. Background music will heard by all players who haven't muted music volume (''s_musicvolume'' cvar), no matter their position in the map. Players may theoreticaly override the music with one of their choice using "/music music/filename" in [[console]].
+
5b. In the map editor, set the audiofile in the "music" key on ''worldspawn'' (generic entity) to choose a background music (a wav or ogg file) -e.g. set it to "music/mymapmusic" (better if without specifying the extension)-. You may prefer this approach instead of creating a target_speaker due to the last one getting desynced if map restarts. Background music will heard by all players who haven't muted music volume (''s_musicvolume'' cvar), no matter their position in the map. Players may theoreticaly override the music with one of their choice using "/music music/filename" in [[console]].
   
 
Also good to know that when player does not look at the in-level video then ''the video will be paused'' until player looks back to it. So, the audio will end up desynced ''anyway'', as the background music or the target_speaker will not pause when the video will.
 
Also good to know that when player does not look at the in-level video then ''the video will be paused'' until player looks back to it. So, the audio will end up desynced ''anyway'', as the background music or the target_speaker will not pause when the video will.

Revision as of 15:56, 12 February 2019


RoQ is the format that the game (Quake3 and derivatives, including OpenArena) supports for video playback. This is about cinematics, they are a different thing than demos.

RoQ videos are rarely used. However they can be shown in the menus (think about the intro video and the tier presentations of Q3A) or even inside the maps.

For players: related variables and commands

  • /r_inGameVideo <0 or 1> - Allows (1) or pauses (00) the playback of in-map cinematics. Defalut value is 1.
  • /s_musicvolume <decimal values between 0.0 and 1.0> - In case the map author placed the audio as map background music, you will need to have it >0 in order to hear the sound. Default value is 0.25.
  • /s_volume <decimal values between 0.0 and 1.0> - It allows to control the volume of sounds. If not using OpenAL, it may also affect background music volume. Default value is 0.8.
  • /s_ambient 1 - In case the map author placed the audio as target_speaker. Needed for DeFRaG mod (or iDFe engine only).
  • /cinematic <filename> - Command to manually play a roq file. Examples: /cinematic idlogo.roq, /cinematic video/mymap/myvideo.roq

For mappers and mod authors: how-to

Here's an "How to create RoQ video and place it in a map" guide created starting from one written by ZaRR. Other tutorials (including usage of Quake Video Maker tool) are linked in the External links section.

Tools:

(VirtualDub not needed, but if you are good on it then try)

Must be 256*256 to be played correctly in-level by vanilla Q3/OA. If the RoQ has to be used inside menus instead of inside a map, it should be safe up to 512*512.

Input videos MUST BE 30 FRAMES PER SECOND.

If you want to play your video back in a id Tech 3 engine game, then input video dimensions MUST BE POWERS OF TWO. This means 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192, 16384, or 32768.

Audio may be 11025 Hz, 22050 Hz, or 44100 Hz, any number of bits, BUT IT WILL BE ENCODED AS 22050 HZ 16-BIT REGARDLESS OF WHAT YOU DO, so it is a good idea to make your input audio those settings.

And of course if you use ROQ video in-level for Q3/OA then you should leave only video, because sound won't play in-level. Sound should be played back correctly in menus, instead.

1. With XmediaRecode convert, for example, into mpeg without video and set 30 fps and 256x256 resolution.

2. Make a shortcut[1] for FFmpeg.exe, right mouse button click on it, select proportions and add this: -i inputname.mpeg -r 30 -s 256x256 outputname.roq
You can also use -an to remove audio.

Inside the pk3, cinematics go under "video" folder (e.g. /video/idlogo.roq or /video/mymap/myvideo.roq).

3. Create a shader including a "videomap" stage to load the roq file. Add its .shader file to your shaderlist.txt.

An example of videoshader can be seen in ZaRR's map roycovideo http://ws.q3df.org/map/roycovideo/, here it is:

textures/roycovideo/roycovideo
{
	{
		videomap video/roycovideo/royco_cup_a_soup.roq
		rgbGen identity
	}
}


4. In NetRadiant Custom (or the editor of your choice), create a brush and assign the shader you created to the face of the brush which will show the video. Assign a classic texture or shader to the other faces of the brush (e.g. bricks texture, wood texture, common/caulk if they are not visible to players...).

5. If you want to also play sound: as said in-level videos do not play sound, so you have to workaround. You can either use a target_speaker entity (see 5a) or set a background music (see 5b). So, first prepare the audio file and place it under either "sound" or "music" depending from your choice; usually, sound should be mono and music should be stereo.

5a. In the map editor, place a target_speaker near to the brush of the video. Set its "noise" key to the audio file you wish to play -e.g. set it to "sound/mymap/sound01" (better if without specifying the extension)-. You can set LOOPED_ON spawnflag to make it play all the time. The sound will be heard while near to the entity by default, but it you prefer, it can be broadcasted to all players no matter their position, by setting the GLOBAL spawnflag. See also Mapping_manual/Triggers and movers#target_speaker.

5b. In the map editor, set the audiofile in the "music" key on worldspawn (generic entity) to choose a background music (a wav or ogg file) -e.g. set it to "music/mymapmusic" (better if without specifying the extension)-. You may prefer this approach instead of creating a target_speaker due to the last one getting desynced if map restarts. Background music will heard by all players who haven't muted music volume (s_musicvolume cvar), no matter their position in the map. Players may theoreticaly override the music with one of their choice using "/music music/filename" in console.

Also good to know that when player does not look at the in-level video then the video will be paused until player looks back to it. So, the audio will end up desynced anyway, as the background music or the target_speaker will not pause when the video will.

To sum up, you may wish to do not associate a sound to the in-level video at all, or to associate a "generic" music or sound to it, which does not require to be in sync with the video.

Additional tips

  • A simple way to have a RoQ video launch when starting your own mod is to provide players a .bat file containing a command similar to ..\openarena.exe +set fs_game flagraiders2 +cinematic idlogo.roq[2] (if you want to test it with FlagRaiders mod, which includes a short roq file). Of course, .bat files work under Windows... under Linux you would use a .sh script instead.
    • Of course, that requires players to launch your mod using such scripts. And autodownload can provide them only pk3 files. If you are programming your own mod, you may be able to modify its code to automatically play a video when you wish, instead.

External links

See also

Notes

  1. If you prefer, you could use command prompt or a batch file instead of using a shortcut.
  2. The initial "..\" is assuming the .bat file is placed inside the mod folder. The same may be obtained without the "..\" at the beginning of the line, but adding a previous line containing "cd .." instead.