Difference between revisions of "FS2 Data Structure"

From FreeSpace Wiki
Jump to: navigation, search
m
Line 251: Line 251:
 
===voice===
 
===voice===
 
*'''Contents:''' In game speech. This speech is separated in five different types. Each of them is located in its own subfolder inside voice folder.
 
*'''Contents:''' In game speech. This speech is separated in five different types. Each of them is located in its own subfolder inside voice folder.
**Campaign command briefing speeches. They are loaded from [[FS2_Data_Structure#command_briefing|command_briefing]] subfolder.
+
**Campaign command briefing speeches. They are loaded from [[FS2_Data_Structure#command_briefings|command_briefings]] subfolder.
 
**Mission briefing explanation speeches. They are loaded from [[FS2_Data_Structure#briefing|briefing]] subfolder.
 
**Mission briefing explanation speeches. They are loaded from [[FS2_Data_Structure#briefing|briefing]] subfolder.
 
**Mission debriefing speeches. They are loaded from [[FS2_Data_Structure#debriefing|debriefing]] subfolder.
 
**Mission debriefing speeches. They are loaded from [[FS2_Data_Structure#debriefing|debriefing]] subfolder.

Revision as of 16:12, 29 May 2007

WARNING: THIS PAGE IS FULLY UNDER DEVELOPMENT !!

Although some expert hand should revise all the page, where I DO HAVE more doubts is marked in blue colour.


Introduction

Through all this page, SCP fs2_open and FRED2_open additions over retail behaviour will be marked in red font.


Apart from the game engine or the mission editor, FRED, the game needs data to run; it needs missions, sounds, 3D models, textures... Freespace2 is highly moddable because nearly none of these data are embedded inside the game executable. In this way the user can always change nearly all game behaviour and appearance.

Like all your applications you'll have Freespace 2 installed in one folder in your hard disk drive. We will call this folder /freespace2, although it can have any other name (/fs2, /fspace2, or whatever). Inside this folder, Freespace 2 stores all its game data in three places (retail version just in two):

  1. Unpacked, ie. individual files, inside data folder within Freespace 2 installation folder, ie. in /freespace2/data. (data name is compulsory).
    Inside data folder, the game contents are classified and stored in several subfolders. Below, you have the full list of data subfolders with their description and contents, (remember that all their names are compulsory). The most commonly used and changed are:
    • effects contains all the textures and animations used in all explosions, weapon glows, smoke, particles and so on.
    • maps contains all the textures, (and animated textures), used over ship models.
    • missions contains all the mission (*.FS2) and campaign (*.FC2) definition files.
    • models contains all 3D models (*.POF).
    • music contains all the music files.
    • sounds contains all ingame sound effect files.
    • tables contains all table files. Tables define all the behaviour the game components have. They are the most important thing for modders to know. See Tables section for deeper info.
    • voice contains all the ingame voices.
  2. Packed in vp archives. This kind of archives just contain individual files in a similar way as "normal" archives like rar or zip do. They are placed in /freespace2 folder. Special software, like vpmage, is needed to build them.
    vp archives also follow the data structure, so, even while packed in a vp archive, your missions will be in /data/missions and your ship 3D models in /data/models. All retail data come packed in several vps. The next, and only the next, are the original game contents (when patched to v1.2):
  3. One of the most important SCP fs2_open additions: Auxiliary data folders loaded through -MOD launcher flag. Retail game only use former both places. But fs2_open, (and FRED2_open), can use any other auxiliary folder in /freespace2 as game data holder. This feature allows installing and using several different mods without having undesired cross-effects.

The most important consequence of having several available locations for game data, is that several versions of each file can exist. There's a priority order between different locations as explained in -MOD launcher flag help. Due to this order, only the highest priority version of each file will be used. This feature allows the user to quickly replace existing mission.fs2 or ShipModel.pof by new or improved versions, placing them in a higher priority place. There's no need to remove obsolete files.

The use of -MOD launcher flag implies that there will be two or more /data folder structures. Some game data, mainly model cache files (*.IBX), can be regenerated by the game itself. Unless explicitly specified, these autogenerated files will be placed in the highest priority /data folder structure.

data subfolders

cache

  • Contents: Model cache files. models folder contains raw *.POF 3D model files. But the game has to "compile" them in order to use them. So each original AnyShip.pof generates one compiled and ready to use AnyShip.ibx file.
  • Supported files: *.IBX model cache files.
  • Notes:
    • The content of this folder can be autogenerated by FS2.
    • Generating cache files takes a bit of time. If you release a pack or mod with a lot of new models, providing their cache files too is a good idea because, on the very first run afterwards, the game will seem hung while it is generating them.
    • FS2 detects model upgrades so it rebuilds cache files if they don't match. BUT sometimes corrupted cache files can cause problems. So sometimes, while debugging or trying to solve problems, deleting cache contents can be useful. (See also -noibx launcher flag help).


cbanims

  • Contents: Command and mission briefing animations. (They are assigned to missions through FRED2 editor).
  • Supported files: *.ANI animations.


config

  • Contents: ???????
  • Supported files: *.CFG files.


demos

  • Contents: ???????
  • Supported files: *.FSD files.


effects

  • Contents: Bitmaps and animations for every game effect:
    • All the explosions and weapon effects.
    • Damage smoke animation.
    • Particle animations.
    • Thruster glows and afterburner trails.
    • All the background images, sun bitmaps, sun glares and space motion debris (see Star.tbl table).
    • Warp-in / warp-out animations.
    • Anything more you can think of in this category. If you have a texture which you know it doesn't belong to maps folder, put it here. If you have doubts, put it here too.
  • Supported files:
    • Retail: *.PCX for bitmaps, (example, backgrounds) and *.ANI for animations (example: explosions).
    • SCP fs2_open: Both formats and *.DDS, *.JPG and *.TGA for bitmaps, and *.EFF for animations.
  • Notes:
    • Some effect bitmaps or animations can be assigned by table entries. But the name of many others is hardcoded, (example particlesmoke01).
    • Not all the effects support animations. Example background bitmaps.
    • *.DDS and *.EFF are the preferred formats.
    • Till version 3.6.9. (included), *.JPG and *.TGA formats require the usage of -jpgtga launcher flag. If not used they will be ignored. From this version, all the supported formats are always used.
    • See Texturing section for important info about this aspect of the game. It is more important for maps folder contents, (ie. ship textures), but it also applies here.


fonts

  • Contents: ???????
  • Supported files: *.vf files.


force feedback

  • Contents: ???????
  • Supported files: ???????


freddocs

  • Contents: ???????
  • Supported files: ???????


hud

  • Contents: All HUD building bricks. Anything you see on your HUD while flying is defined through this folder contents.
  • Supported files: *.PCX and *.ANI
  • Notes:
    • Most of this folder contents have a hardcoded name.
    • Most of this folder contents are "false" animations. It means that the *.ANI file is only used to pack several related bitmaps. Example: every ship shield graphic uses five bitmaps, (the ship bitmap and then, front, right, back and left shield quadrants) packed in one *.ANI.


intelanims

  • Contents: Intelligence animations used in Technical Database > Intelligence section. They are used through Species.tbl table.
  • Supported files: *.ANI animations.


interface

  • Contents:
    • All the game screens and optional mission loading screens.
    • All the button, mouse and icon bitmaps.
    • Map ship icons in Briefing screen.
    • Ship and weapon animations in Ship selection and Weapon loadout screens. These weapon animations are also used in Technical Database > Weapons section.
  • Supported files:
    • Retail: *.ANI animations and *.PCX bitmaps.
    • SCP fs2_open: The former ones and *.DDS and *.TGA formats.Is jpg supported here? Are dds, jpg and tga fully supported for everything?
  • Notes:
    • Most people use -ship_choice_3d launcher flag. With this flag, only primary weapon animations are needed in Weapon loadout screen. There's no need for ship or secondary weapon animations. Even, some mods need a compulsory use of this flag.
    • As an exception, fs2_open doesn't require the usage of -jpgtga launcher flag for intro splash screen. But the rest of *.TGA format usage needs it (until version 3.6.9.).


maps

  • Contents: All the textures used by 3D *.POF models. *.POF models use textures to "paint" their surfaces and to simulate glow points. *.POF files only have links to the names of their used textures, they don't have embedded textures. All their used textures are read from this folder.
  • Supported files:
    • Retail: *.PCX bitmaps.
    • SCP fs2_open: The former one and *.DDS, *.JPG and *.TGA formats. Some of the textures, (example: glow maps), support animated textures so *.EFF and *.ANI are also supported.
  • Notes:
    • See Texturing section for important info about this aspect of the game.
    • *.DDS and *.EFF are the preferred formats.
    • Till version 3.6.9. (included), *.JPG and *.TGA formats require the usage of -jpgtga launcher flag. If not used they will be ignored. From this version, all the supported formats are always used.


missions

  • Contents: All the mission and campaign files.
  • Supported files: Each mission is one *.FS2 file and each campaign is one *.FC2 file.
  • Notes:
    • In Mission Simulator screen, Single Missions are just available *.FS2 mission files which are not pointed by any of the available *.FC2 campaign files. This is the only way to play this kind of missions.


models

  • Contents: All the 3D models used by ships, asteroid and debris fields, missiles, subspace model, 3D shockwaves, 3D warp-in/warp-out effects and background star-holding model.
  • Supported files: *.POF model files.
  • Notes:


movies

  • Contents: Game cutscenes.
  • Supported files: *.MVE, *.OGG, *.AVI and *.MPG clip files.
  • Notes:
    • This folder is a fully SCP addition. Retail game reads *.MVE cutscenes from game CDs.
    • *.AVI and *.MPG formats are decoded through system player. It's support is not guaranteed in future fs2_open versions.
    • Retail uncompressed *.MVE and Theora compressed *.OGG formats are the preferred ones. fs2_open has built-in support for them both.
    • All the movies can have custom names, (their loading trigger is defined in FRED), but start-up movie. This movie must be called Intro.


multidata

  • Contents: ???????
  • Supported files: *.PCX and *.FS2 files. ???????


music

  • Contents: Music files used through Music.tbl table.
  • Supported files:
    • Retail: PCM *.WAV sound clips up to 16bit - 22kHz - 2 channels.
    • SCP fs2_open adds support for compressed *.OGG Vorbis sound clips.


players

  • Contents: All game player data.
    • It has 4 subfolders, each one has a deeper explanation below:
      • images: Selectable appearances of the player in Barracks screen.
      • multi: Game data of multiplayer pilots
      • single: Game data of single player pilots
      • squads: Selectable squad insignias of the player in Barracks screen.
    • The main players folder just contains HUD appearance presets, (*.HCF files), which can be loaded, edited and saved in Options screen > HUD Config screen. From this screen they can be also applied to player's HUD settings.
  • Supported files: *.HCF HUD configuration files.
  • Notes:
    • Only /freespace2/data/players main folder is used despite the -MOD launcher flag settings. Only images and squads subfolders are read from any other locations (vp archives or other /mod/data/players folders).
    • Of course, *.HCF files can be generated by the game itself.

images

  • Contents: Selectable appearances of the player in Barracks screen, ie. the player's photograph.
  • Supported files: *.PCX bitmaps.

multi

  • Contents: Game data of multiplayer pilots.
  • Supported files: *.PLR files.
  • Notes:
    • Only /freespace2/data/players/multi folder is used despite the -MOD launcher flag settings.
    • Of course, multi player data is generated and updated by the game itself.

single

  • Contents: Game data of single player pilots.
  • Supported files:
    • Each pilot consists of several files:
      • One *.PL2 file, (let's call it MyPilot.pl2), which contains main pilot data.
      • Several *.CS2 files. Each of these files is generated for each played campaign. They have the form MyPilot.Campaign name.cs2.
    • *.PLR, *.CSG and *.CSS files ??????.
  • Notes:
    • Only /freespace2/data/players/single folder is used despite the -MOD launcher flag settings.
    • Of course, single player data is generated and updated by the game itself.
    • Do not use pilot names longer than XXXXXX. The game has problems with them, ie. use short pilot names.

squads

  • Contents: Selectable squadron insignias of the player in Barracks screen.
  • Supported files: *.PCX bitmaps.


scripts

  • Contents: This has something to do with LUA scripting SCP addition, but I know NOTHING about it. Please some expert fill it.
  • Supported files: *.LUA and *.LC files. ???????.


sounds

  • Contents: All the game sound effects. Music tracks or ingame speech which have their own subfolders.
    • It has two folders, 8b22k and 16b11k to classify the sounds depending on their quality. But using them is not needed, all the sounds can go in the main folder.
  • Supported files:
    • Retail: PCM *.WAV sound clips up to 16bit - 22kHz - 2 channels.
    • SCP fs2_open adds support for compressed *.OGG Vorbis sound clips.
  • Notes:
    • In game sounds are used through Sounds.tbl table.
    • Normally, game sounds only have one channel. Depending on the sound source location, the game will generate different right and left channel volumes.

8b22k

  • Contents: Low quality sounds, but just use the main sounds folder.

16b11k

  • Contents: High quality sounds, but just use the main sounds folder.


tables

  • Contents: Data tables which set the whole game behaviour.
  • Supported files:
  • Notes:
    • Tables are just the most important thing for modders to know.
    • There is a lot of useful info about them in Tables section of the Wiki.


voice

  • Contents: In game speech. This speech is separated in five different types. Each of them is located in its own subfolder inside voice folder.
    • Campaign command briefing speeches. They are loaded from command_briefings subfolder.
    • Mission briefing explanation speeches. They are loaded from briefing subfolder.
    • Mission debriefing speeches. They are loaded from debriefing subfolder.
    • Mission scripted speech. The voice files are loaded from special subfolder.
    • Random speech generated by flying mates or enemies. The voice files are loaded from personas subfolder.
  • Supported files: All the speech kinds support these formats:
    • Retail: PCM *.WAV sound clips up to 16bit - 22kHz - 2 channels.
    • SCP fs2_open adds support for compressed *.OGG Vorbis sound clips.

briefing

  • Contents: Mission briefing explanation speeches. They are set through FRED editor in each *.FS2 mission file.

command_briefings

  • Contents: General command briefing speeches you can see before some missions. As example, the first mission usually have command brienfing. They are set through FRED editor. They are attached to the next mission file.

debriefing

  • Contents: Mission debriefing explanation speeches. They are set through FRED editor in each *.FS2 mission file.

personas

  • Contents: Random speech generated by flying ships or your command, for example to warn the player about "Bandit on your tail" or to praise him with "Good shoot!!" . This feature is used through Messages.tbl table.

special

  • Contents: Scripted speech files in every mission. This speech is set through FRED SEXPs (mainly send-message-list).


Loading order