Wrp File Format - 1WVR

From Bohemia Interactive Community
Revision as of 19:34, 24 March 2010 by Mikero (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

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 ofp 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's 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;
 ulong      flags;            //not, an object id
 char       P3dModelName[48]; // "Data3d\Smrk.p3d (WVR4 is 76)
}

Net

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


NetHeader

NetHeader
{
 Asciiz     NetName[24]; //"LandText\Silnice.pac" null termed
 ulong      x,y;
 ulong      AlwaysX47;
 ulong      Always0;
 ulong      AlwaysX69fbb0;
 ulong      ModelIndex; // 0 based
 XYZTriplet XYZTriplet;
 ushort     Always00;
 ushort     kawa;
}

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;           //d6 40 bc 42 45 23 2d 42 
 XYZTriplet XYZTriplets[2];
}

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


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.