The FreeSpace 2 Open engine is able to use several different multimedia file formats for audio, animation and video playback. Retail FreeSpace 2 used the WAV and ANI file formats, but the currently the FreeSpace 2 Open supports several Ogg container files as well. Support for the MP3 file format was removed in favor of Ogg. The game engine also supports special .EFF animations.
Ogg is a file format for compressed multimedia files. Unlike MP3, Ogg is an open-source, open-standard container format with a permissive license, both of which allow it to be incorporated into the FS2_Open source code. Also unlike MP3, Ogg is a container format, meaning that it can contain video data (via the Theora codec ) in addition to audio data (via the Vorbis codec).
Since Ogg delivers significantly smaller file sizes than WAV, while retaining substantially the same level of audio quality, it is becoming more and more frequently used in FSO-targeted mods. Ogg Vorbis is not, however, a lossless format -- i.e., it is not possible to exactly reconstruct the original data from an Ogg Vorbis file because some is "lost" in the conversion process. This is not usually a problem, however, because a high-quality Ogg Vorbis file is usually indistinguishable from the source. The lossless counterpart to Ogg Vorbis is FLAC, which can be contained in Ogg also.
Vorbis uses a quality parameter between -1 and 10 as a measure of quality. 5 is the default, giving around 160kbps. The higher the number, the higher the quality, but anything over 5 is probably pointless.
Audacity and Goldwave are two popular programs that allow WAV files to be converted to Ogg Vorbis audio. Audacity is Free Software, while Goldwave is shareware that ceases to function after a period of time.
Please note that this is a fso feature and is not supported by the original retail FreeSpace 2.
The most common sound file format. WAVs are uncompressed and take up a larger amount of space than almost any other sound file type, so consider converting them to the Ogg Vorbis format (supported only by SCP) before including them in your campaign. Audacity and Goldwave are two examples of programs that can make this conversion. oggdropXPd is an useful drag-and-drop encoder.
FreeSpace uses the ANI format for animation effects. It can be used either for an effect (explosions, etc.), an interface animation, or as a ship texture.
Creating an ANI file
Using AniBuilder, one can create new ANI files from AVI movies.
To create your own ANI:
- Set up a scene in a 3D animation program or in FreeSpace. Volition used 3ds Max (an expensive modeling program) for their animations.
- Using a free recording software such as for example GameCam to record the scene.
- Use for example Bink to convert the AVI into a series of 16-bit (or less) PCX files, as AniBuilder will not accept non-PCX images, or images of more than 16 bit color depth.
- Use AniBuilder to convert the PCX files to an ANI.
Note about head animations:
The game requires that ANI files used for head animations have a very specific kind of palette or they won't display correctly in-game. Firstly, the PCX files used in building the ANI should have a 256-colour palette, but only the first 16 colours should actually be used: any pixels with a colour beyond the first 16 colours in the palette seem not to be drawn correctly. Secondly, each PCX file used for building the ANI should have the exact same colour palette.
FreeSpace 2 uses the EFF ASCII format text files to store information about animated effects. These animated effects can be used for various effects such as in game animations and animated textures. Please note that this is a fso feature and is not supported by the original retail FreeSpace 2.
Creation of EFF animation
- For EFF animation all the individual frames of the animation have to be present in one of the graphic file formats supported by the game engine.
- All files related to the EFF animation have to named so that the name of actual .EFF animation forms the basic structure of the filename.
- Graphic files add the 4 digit number - that identifies the frame where the file is used - after the animation name, starting from 0 (example_0000.dds, example_0001.dds etc.)
- ASCII file contains the information of the animation (example.eff)
Contents of a EFF file
- Defines the file format of the graphics file used for the EFF animation
- Syntax: String, for example DDS
- Defines the length of the number of the frames in the animation
- Syntax; Integer
- Used optionally to define the frames per second value for the animation
- Syntax: Integer
Let's say you have three dds (TGA and pcx are also acceptable) files (named 1_000, 1_0001, and 1_0002) you want to make into an animation, but you don't want to use anibuild and therefore compromise quality.
Your EFF file would be like this:
Filename (the filename, not information to be entered. This must match up with characters before _xxxx in frames): 1.eff
$Type: DDS $Frames: 3 $FPS: 5
This EFF effect file would display one frame after another at 5 frames a second, skipping back to the beginning at the end. Please note that EFF cannot be used for streaming files (head animations, icons, mainhall, cbanis, ect.) and is meant ONLY for weapon/explosion effects and animated textures.