Wrp File Format - 1WVR: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - " ofp " to " {{ofp}} ")
m (Text replacement - " (={2,})([^ = ])(.*)([^ = ])(={2,}) * " to " $1 $2$3$4 $5 ")
Line 1: Line 1:
{{unsupported-doc}}
{{unsupported-doc}}
==General==
== General ==


WVR type 1 was released as a cwc demo island
WVR type 1 was released as a cwc demo island
Line 7: Line 7:


See [[BIS_File_Formats#Island_File_Formats|Island File Formats]] for further info.
See [[BIS_File_Formats#Island_File_Formats|Island File Formats]] for further info.
===Conventions===
=== Conventions ===
see [[Generic FileFormat Data Types]]
see [[Generic FileFormat Data Types]]


==Structure==
== Structure ==


  WVR1
  WVR1
Line 19: Line 19:
   Net        Nets[...];
   Net        Nets[...];
  }
  }
===WVR1Header===
=== WVR1Header ===
  WVR1Header // same as WVR4 except for the signature of course
  WVR1Header // same as WVR4 except for the signature of course
  {
  {
Line 26: Line 26:
  ulong Ysize;      //(=128) cell dimension
  ulong Ysize;      //(=128) cell dimension
  }
  }
===Texture===
=== Texture ===
  Texture
  Texture
  {
  {
Line 42: Line 42:




====Elevations====
==== Elevations ====
Elevations are expressed as an integral of the gridsize.
Elevations are expressed as an integral of the gridsize.


Line 51: Line 51:
see [[Wrp File Format - 4WVR]]
see [[Wrp File Format - 4WVR]]


====TextureIndex====
==== TextureIndex ====
Each cell on the map references an texture file (pac/paa) and an elevation for that text at that cell position.
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 'sea' texture (eg), rather than have each cell list it is texture, it references a texture list via an index. In this way, THE texture which is common to many cells (at sometimes differing elevations) is only stored once.
Since there could be myriads of 'sea' texture (eg), rather than have each cell list it is texture, it references a texture list via an index. In this way, THE texture which is common to many cells (at sometimes differing elevations) is only stored once.
Line 57: Line 57:
A max of 256 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.
A max of 256 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.


===Model===
=== Model ===


  Model// 64 byte structure
  Model// 64 byte structure
Line 73: Line 73:
*Cartesian rotation is clockwise. Polar rottion is counter clock. Therefore, Polar (wrp) degrees = -Cartesian degrees.
*Cartesian rotation is clockwise. Polar rottion is counter clock. Therefore, Polar (wrp) degrees = -Cartesian degrees.


===Net===
=== Net ===


  Net//64 byte structure
  Net//64 byte structure
Line 82: Line 82:




====NetHeader====
==== NetHeader ====
  NetHeader
  NetHeader
  {
  {
Line 100: Line 100:
Endof Nets also marks end of file.
Endof Nets also marks end of file.


====Subnet====
==== Subnet ====
  SubNet
  SubNet
  {
  {
Line 117: Line 117:
*Stepping appears to incrementally increase around 5.0 to each subsequent subnet
*Stepping appears to incrementally increase around 5.0 to each subsequent subnet


==FilePaths==
== FilePaths ==


Despite the impression given (lack of a leading \) All filenames (pac/paa and p3d files) are HARD WIRED to the (virtual) pboRoot\ directory.
Despite the impression given (lack of a leading \) All filenames (pac/paa and p3d files) are HARD WIRED to the (virtual) pboRoot\ directory.

Revision as of 19:12, 31 January 2021

Template:unsupported-doc

General

WVR type 1 was released as a cwc demo island

For a general description WVR-WRP file construct, see Wrp File Format - 4WVR

See Island File Formats for further info.

Conventions

see Generic FileFormat Data Types

Structure

WVR1
{
  WVR1Header  Header;
  Texture     Textures[...];
  Model       Models[...];
  Net         Nets[...];
}

WVR1Header

WVR1Header // same as WVR4 except for the signature of course
{
char Signature[4]; //"1WVR"
ulong Xsize;       //(=128) cell dimension (wvr4 is 256)
ulong Ysize;       //(=128) cell dimension
}

Texture

Texture
{
  ushort Elevations  [Ysize][Xsize]; // in centimetres. see 4WVR documentation
  ushort TextureIndex[Ysize][Xsize]; //Each 'index' refers to a filename below. Range 0..255 4WVR is 1..511
  Asciiz TextureFilenames[256][32];  //"LandText\\mo.pac\0LandText.pi.pac.........."
}

Unlike 4WVR the table is limited to 256 (not 512) entries. Unlike 4WVR the names can be

  • replicated
  • scattered anywhere

Unlike 4WVR there is no dummy, 0 index. the first entry is used. There are 'holes' in the table (eg no strings) where that paa file was removed


Elevations

Elevations are expressed as an integral of the gridsize.

Since the gridsize for Operation Flashpoint is a fixed 50 meters, to convert the value into meters:

RealHeight = Elevations[x][y] * 0.05;

see Wrp File Format - 4WVR

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 'sea' texture (eg), rather than have each cell list it is texture, it references a texture list via an index. In this way, THE texture which is common to many cells (at sometimes differing elevations) is only stored once.

A max of 256 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.

Model

Model// 64 byte structure
{
 XYZTriplet XYZTriplet;       // in gridsize scale. eg *50.0 meters
 float      heading;          // in Cartesian degrees NOT polar radians 
 char       P3dModelName[48]; // "Data3d\Smrk.p3d (WVR4 is 76)
}
  • Unlike wvr4, wvr1 has no object id
  • Unlike wvr4, only the xyz position, and an orientation is supplied. In wvr4, these were replaced by the standard Microsoft 12 float array
  • The XYZ triplet is specified in gridsize. to get real meters, multiply by 50.
    • The Y component (the height) is a relative measurement. eg an offset from the calculated position of the model on the land surface.
    • in all other formats this value is absolute asl. not, relative.
  • Cartesian rotation is clockwise. Polar rottion is counter clock. Therefore, Polar (wrp) degrees = -Cartesian degrees.

Net

Net//64 byte structure
{
 NetHeader NetHeader;
 Subnet    SubNets[...];
}


NetHeader

NetHeader
{
 Asciiz     NetName[24]; //"LandText\Silnice.pac" null termed
 ulong      Always;     //0x00cd9100 or 0x00d4c600
 ulong      Always;     //0x00bfd400
 ulong      Always;     //0x00000047
 ulong      Always;     //0x00000000
 ulong      Always;     //0x0069fbb0;
 ulong      Type;       //0,1 or 2
 XYZTriplet XYZTriplet; //[0.152,0.15,0.1] typical
 float      Scale;      //3.5, 4.5 or 5.5
}

The last NetHeader (eg, last net) contains the NetName "EndOfNets". There are NO subnets.

Endof Nets also marks end of file.

Subnet

SubNet
{
 float      X,Y;           //* gridsize of 50
 if (X || Y)
 {
   XYZTriplet Triplet;     //very similar content to header triplet
   float      Stepping;
   ulong      Always;      //0x0046931A
   ulong      Always;      //0x00980778 or 0x733760
 }
}

A block of subnets continue for each Netheader until X==Y==0

  • Stepping appears to incrementally increase around 5.0 to each subsequent subnet

FilePaths

Despite the impression given (lack of a leading \) All filenames (pac/paa and p3d files) are HARD WIRED to the (virtual) pboRoot\ directory.

From the very beginning of ofp, this lack of relative addressing has persisted to be the total pain that it is: Making the transfer of models into other addons a frustrating nightmare.