Multimedia Files

From FreeSpace Wiki
Revision as of 16:13, 13 April 2010 by Galemp (talk | contribs) (Creating an ANI file: Total rewrite with more helpful information.)
Jump to: navigation, search

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

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.

WAV

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.

ANI

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 or rendered frames.

To create your own ANI:

  1. Create your scene in a 3D animation program or in FreeSpace. You can capture game footage using free recording software such as GameCam, a preexisting movie, or you can render your own. Volition used the expensive 3ds Max for their animations, but the free Blender is just as good, and there are plenty of tutorials available for both. Alternately, ANIs can simply have one or two static frames.
  2. Output your movie to individual 24- or 32-bit BMP frames, numbered in sequence (starting with aniname0000.) You can check your desired resolution by looking at the type of ANI you want to replace, with the exception of up to 660x300 acceptable for high-resolution command briefing animations in FreeSpace Open. If you have a movie, use a program such as Virtual DUB to convert the AVI into a series of BMP files and crop or resize them as necessary.
  3. Convert your BMP frames to PCX files with a common palette. Certain interface art (for example, briefing icons and HUD head animations) requires an exact palette, which you can import from an existing ANI using a paint program such as GIMP. But in most cases, you will want to convert them to an optimized common palette. Best results are achieved with BRIGHT. AniBuilder can attempt to do this by itself but the results are almost always very poor.
  4. Use AniBuilder to convert the PCX files to an ANI. Some animations, such as ship/weapon loadouts and main hall animations, require keyframes; refer to the existing animations for how to insert these.

A more technical definition of ani files can be found here.

EFF

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

$Type:

  • Defines the file format of the graphics file used for the EFF animation
  • Syntax: String, for example DDS

$Frames:

  • Defines the length of the number of the frames in the animation
  • Syntax; Integer

$FPS:

  • Used optionally to define the frames per second value for the animation
  • Syntax: Integer

$Keyframe:

  • Used optionally to define a keyframe for EFF used as part of the interface.
  • Syntax: Integer (The frame number, starting at index 0. Do not specify numbers greater than the number of frames)

Example

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.