ofp:file_formats:4wvr
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| ofp:file_formats:4wvr [2007/07/10 09:52] – external edit 127.0.0.1 | ofp:file_formats:4wvr [2024/07/31 12:36] (current) – links added. snakeman | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ====== WRP - 4WVR ====== | + | ====== |
| - | Flashpoint wrp files use two different file formats to contain the data. This document contains information on 4WVR format as used by WrpTool and Visitor 2. | + | [[https:// |
| - | This document does not discuss the alternate format, OPRW. Both file formats can be used directly by the engine, whether the file exists independently in ~\worlds, or, packed inside a pbo (addon). | + | **Operation Flashpoint |
| - | See General Wrp format for further info. | + | **WRP File Format - 4WVR** |
| - | "Binarize" | + | |
| + | ====== General ====== | ||
| + | |||
| + | Flashpoint wrp files use two different file formats to contain the data. This document contains information on 4WVR format as used by WrpTool and Visitor 2 | ||
| + | |||
| + | This document does **not** discuss the alternate format, OPRW. Both file formats can be used directly by the engine, whether the file exists independently in ~\worlds, or, packed inside a pbo (addon). | ||
| + | |||
| + | Binarize tool by BIStudio will convert 4WVR to OPRW if desired. | ||
| (some problems exist with 2 versions of binarize) | (some problems exist with 2 versions of binarize) | ||
| - | **Conventions** | + | For a general description of how simple this (or any other) wrp file construct, see 8WVR |
| - | < | ||
| - | Intel byte order, lsb first | ||
| - | byte = 1 char = 8 bits | ||
| - | ulong = unsigned long, 4 bytes | ||
| - | ushort= unsigned short 2 bytes | ||
| - | asciiz= variable length zero terminated string. | ||
| - | float= 4byte (single precision) | ||
| - | </ | ||
| ====== Structure ====== | ====== Structure ====== | ||
| - | < | + | < |
| - | struct | + | 4WVR |
| { | { | ||
| - | byte Signature[4]; | + | WRP4Header |
| - | ulong Xsize; | + | Texture |
| - | ulong Ysize; | + | Model |
| - | short Elevations[Ysize][Xsize]; // eg 2*256*256 = 131072 bytes See Note | + | } |
| - | short TextureIndex[Ysize][Xsize]; // eg 2*256*256 = 131072 bytes | + | </code> |
| - | // | + | |
| - | | + | |
| - | /* | + | ====== WRP4Header ====== |
| - | A max of 512 texture files can be listed. Each is held as an asciiz string inside a fixed 32 byte | + | |
| - | record. Eg max length of filename is 31 characters. | + | |
| - | | + | |
| - | */ | + | |
| - | struct model | + | <code cpp> |
| + | WRP4Header | ||
| { | { | ||
| - | | + | char Signature[[4]]; //& |
| - | long | + | ulong Xsize; //(=256) cell dimension |
| - | asciiz Filename[76]; | + | ulong Ysize; |
| - | | + | } |
| - | }[variable]; | + | |
| - | }; | + | |
| </ | </ | ||
| - | ====== Note1 ====== | ||
| - | TransformMatrix[4][3]; | + | ====== Texture ====== |
| - | This is the transform matrix used directly by Microsoft DirectX engines. | + | <code cpp> |
| + | Texture | ||
| + | { | ||
| + | ushort Elevations | ||
| + | ushort TextureIndex[[Ysize]][[Xsize]]; | ||
| + | Asciiz TextureFilenames[[512]][[32]]; | ||
| + | } | ||
| + | </ | ||
| + | |||
| + | |||
| + | ====== Elevations ====== | ||
| - | In fact, the ' | + | Elevations are expressed as an integral of the gridsize. |
| + | Since the gridsize for ofp is a fixed 50 meters, to convert the value into meters: | ||
| < | < | ||
| - | M11,M12 M13 (0.0) | + | RealHeight = Elevations[[x]][[y]] * 0.05; |
| - | M21,M22,M23 (0.0) | + | |
| - | M31,M32,M33 (0.0) | + | |
| - | M41,M42,M43 (1.0) | + | |
| </ | </ | ||
| - | and so is never stored. This identical matrix is used for WRP files (both formats) and RTM files. The last row (M41...) happens to be the position of the object X Z Y co-ordinates, | ||
| - | For further information visit [[http:// | + | ====== TextureIndex ====== |
| - | ====== | + | Each cell on the map references an texture file (pac/paa) and an elevation for that text at that cell position. |
| + | Since there could be myriads of ' | ||
| + | |||
| + | A max of 512 texture files can be listed. Each is held as an asciiz string inside a fixed 32 byte record. Eg max length of filename is 31 characters. | ||
| + | |||
| + | The first entry (effectively index0) is never used. Even though a filename is associated with this entry. it is never accessed. | ||
| + | |||
| + | ====== | ||
| + | |||
| + | <code cpp> | ||
| + | Model | ||
| + | { | ||
| + | float | ||
| + | long | ||
| + | asciiz P3DFilename[[76]]; | ||
| + | } | ||
| + | </ | ||
| The number of models varies from none, to end of file. Each model is 128 bytes in length. | The number of models varies from none, to end of file. Each model is 128 bytes in length. | ||
| + | |||
| + | Note that this is in marked contrast to an 8WVR file. In 8WVR, there is always a minimum of one entry. The last (or only) entry in an 8WVR has no filename associated with it. | ||
| + | |||
| + | |||
| + | ====== FilePaths ====== | ||
| + | |||
| + | Despite the impression given (lack of a leading \) All filenames (pac/paa and p3d files) are HARD WIRED to the (virtual) pboRoot\ directory. | ||
| + | |||
| + | The PboRoot\ directory is built in-situ during game load and consists of an index table of all addons from ' | ||
| + | |||
ofp/file_formats/4wvr.1184061152.txt.gz · Last modified: 2009/11/22 08:14 (external edit)
