Difference between revisions of "*.VP"

From FreeSpace Wiki
Jump to: navigation, search
 
(9 intermediate revisions by 8 users not shown)
Line 1: Line 1:
VP files are a packaging file format, used to package multiple files into a single file, while maintaining directory structure. They do not use any sort of compression.
+
'''VP''' ('''V'''olition '''P'''ackage) files are a packaging file format, used to package multiple files into a single file, while maintaining directory structure. They do not use any sort of compression.
  
== Viewers ==
+
==Viewers==
  
On Win32, the most popular VP viewer is VPView32. However, almost all the editors can also be used to extract files from VPs.
+
On Win32, the most popular VP viewer is [[VPView32]]. However, almost all the editors can also be used to extract files from VPs.
  
== Editors ==
+
[[wxVPView]] is modeled on VPView32, but with cross platform support (Win/OSX/Linux)
 +
 
 +
==Editors==
  
 
As of this writing, there are a few different editors.
 
As of this writing, there are a few different editors.
  
=== VPCS ===
+
===VPCS===
  
 
Features an explorer-like interface, and is fairly easy to use to create or modify VPs.
 
Features an explorer-like interface, and is fairly easy to use to create or modify VPs.
  
=== [[QuickVP]] ===
+
===[[QuickVP]]===
  
 
Features a Winzip-like interface, is very easy to use to create, modify, and extract files and directories to/from VPs.
 
Features a Winzip-like interface, is very easy to use to create, modify, and extract files and directories to/from VPs.
  
=== [[VPMage]] ===
+
===[[VPMage]]===
  
 
Somewhat more difficult to use than VPCS or QuickVP, but also adds the ability to merge VP files, update files already in a VP, and edit files already in a VP.
 
Somewhat more difficult to use than VPCS or QuickVP, but also adds the ability to merge VP files, update files already in a VP, and edit files already in a VP.
  
== File structure ==
+
=== [[Maja]] ===
 +
 
 +
The latest VP editor, with the ability to both read and edit VPs. It is possible to place a batch of files anywhere in a VP directory, in contrast to VPMage, which requires you to import either a "Data" folder or another VP.
 +
 
 +
=== [[VPGUI]] ===
 +
 
 +
Based on .NET 4.5 VPGUI is a new editor with nifty features like drag-and-drop & a browser like history.
  
VP files are made up of three main components; the header, followed by the individual files, and finally the index for the entires.
+
==File structure==
  
=== The Header ===
+
VP files are made up of three main components; the header, followed by the individual files, and finally the index for the entries.
 +
 
 +
===The Header===
  
 
  char header[4]; //Always "VPVP"
 
  char header[4]; //Always "VPVP"
Line 34: Line 44:
 
=== The files ===
 
=== The files ===
  
Files are simply stored in the VP, one right after the other. No spacing or null termination is necessary
+
Files are simply stored in the VP, one right after the other. No spacing or null termination is necessary.
  
 
=== The index ===
 
=== The index ===
Line 46: Line 56:
 
Each direntry may be a directory, a file, or a backdir. A directory entry signifies the start of a directory, and has the name entry set to the name of the directory; a backdir has the name of "..", and represents the end of a directory.
 
Each direntry may be a directory, a file, or a backdir. A directory entry signifies the start of a directory, and has the name entry set to the name of the directory; a backdir has the name of "..", and represents the end of a directory.
  
Because there is no type descriptor inherent to the format, directories and backdirs are identified by the "offset", "size", and "timestamp" entries being set to 0.
+
Because there is no type descriptor inherent to the format, directories are identified by the "size" being set to 0. See [https://github.com/scp-fs2open/fs2open.github.com/blob/c4cf9edd4140829583a287caef0b3ed81ec2b6eb/code/cfile/cfilesystem.cpp#L1012 cfilesystem.cpp].
 +
 
 +
Timestamps are not used in identifying directories.
 +
 
 +
VP files cannot contain empty files. See [https://github.com/scp-fs2open/fs2open.github.com/blob/c4cf9edd4140829583a287caef0b3ed81ec2b6eb/code/cfilearchiver/cfilearchiver.cpp#L132 cfilearchiver.cpp].
  
 
All valid VP files should start with the "data" directory as the toplevel.
 
All valid VP files should start with the "data" directory as the toplevel.
 +
 +
VP files can contain empty directory entries. For example, "sparky_hi_fs2.vp" has an empty "data/fonts/" directory entry.
  
 
Note that it isn't necessary at all to add backdirs at the end of a VP file.
 
Note that it isn't necessary at all to add backdirs at the end of a VP file.
 +
 +
==See Also:==
 +
 +
===[[FreeSpace 2 directory structure]]===
 +
===[[FS2 Data Structure]]===
  
 
== Thanks ==
 
== Thanks ==
  
To [http://www.descent-freespace.com/ddn/specs/vp/ Descent Network], for getting file structure information before anyone else.
+
To [http://www.descent-freespace.com/ddn/specs/vp/ Descent Network] ([https://web.archive.org/web/20050329054755/http://www.descent-freespace.com:80/ddn/specs/vp/ archival link)], for getting file structure information before anyone else.
 +
 
 +
[[category: File Types]]

Latest revision as of 23:22, 8 December 2022

VP (Volition Package) files are a packaging file format, used to package multiple files into a single file, while maintaining directory structure. They do not use any sort of compression.

Viewers

On Win32, the most popular VP viewer is VPView32. However, almost all the editors can also be used to extract files from VPs.

wxVPView is modeled on VPView32, but with cross platform support (Win/OSX/Linux)

Editors

As of this writing, there are a few different editors.

VPCS

Features an explorer-like interface, and is fairly easy to use to create or modify VPs.

QuickVP

Features a Winzip-like interface, is very easy to use to create, modify, and extract files and directories to/from VPs.

VPMage

Somewhat more difficult to use than VPCS or QuickVP, but also adds the ability to merge VP files, update files already in a VP, and edit files already in a VP.

Maja

The latest VP editor, with the ability to both read and edit VPs. It is possible to place a batch of files anywhere in a VP directory, in contrast to VPMage, which requires you to import either a "Data" folder or another VP.

VPGUI

Based on .NET 4.5 VPGUI is a new editor with nifty features like drag-and-drop & a browser like history.

File structure

VP files are made up of three main components; the header, followed by the individual files, and finally the index for the entries.

The Header

char header[4]; //Always "VPVP"
int version;    //As of this version, still 2.
int diroffset;  //Offset to the file index
int direntries; //Number of entries

The files

Files are simply stored in the VP, one right after the other. No spacing or null termination is necessary.

The index

The index is a series of "direntries"; each directory has the structure, as seen below.

int offset; //Offset of the file data for this entry.
int size; //Size of the file data for this entry
char name[32]; //Null-terminated filename, directory name, or ".." for backdir
int timestamp; //Time the file was last modified, in unix time.

Each direntry may be a directory, a file, or a backdir. A directory entry signifies the start of a directory, and has the name entry set to the name of the directory; a backdir has the name of "..", and represents the end of a directory.

Because there is no type descriptor inherent to the format, directories are identified by the "size" being set to 0. See cfilesystem.cpp.

Timestamps are not used in identifying directories.

VP files cannot contain empty files. See cfilearchiver.cpp.

All valid VP files should start with the "data" directory as the toplevel.

VP files can contain empty directory entries. For example, "sparky_hi_fs2.vp" has an empty "data/fonts/" directory entry.

Note that it isn't necessary at all to add backdirs at the end of a VP file.

See Also:

FreeSpace 2 directory structure

FS2 Data Structure

Thanks

To Descent Network (archival link), for getting file structure information before anyone else.