{"name":"Wrp File Format - 4WVR","title":"Wrp File Format - 4WVR","type":"topic","url":"https://community.bistudio.com/wiki/Wrp_File_Format_-_4WVR","revid":373402,"updated":"2025-05-08T11:27:10Z","aliases":[],"markdown":"> **Disclaimer: This page describes internal undocumented structures of Bohemia Interactive software.**\n>\n> This page contains unofficial information.\n>\n> Some usage of this information may constitute a violation of the rights of Bohemia Interactive and is in no way endorsed or recommended by Bohemia Interactive.\n> Bohemia Interactive is not willing to tolerate use of such tools if it contravenes any general licenses granted to end users of this community wiki or BI products.\n\n### General\n\n*Flashpoint wrp files use two different file formats to contain the data. This document contains information on unbinarised 4WVR format as used by WrpTool and Visitor 2.*\n\nThis document does **not** discuss the **binary** 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).\n\nSee Island File Formats for further info.\n\n\"Binarize\" tool by BIStudio will convert 4WVR to OPRW if desired.\n\n(some problems exist with 2 versions of binarize)\n\nFor a general description of how simple this (or any other) wrp file construct, see 8WVR format\n\n#### Conventions\n\nsee Generic FileFormat Data Types\n\n### Structure\n\n```\n4WVR\n{\n  WRP4Header          Header\n  CompressedFloats    Elevations  [Ysize][Xsize]; // in centimetres. See below\n  ushort              TextureIndex[Ysize][Xsize]; //Each 'index' refers to a filename below. Range 1..511\n  char                TextureFilenames[512][32];  //\"data\\pi.paa\\0|data\\pi1.paa\\0\".....\n  Model               Models[...];\n}\n```\n\n#### WRP4Header\n\n```\nWRP4Header\n{\nchar Signature[4]; //\"4WVR\"\nulong Xsize;       //(=256) cell dimension\nulong Ysize;       //(=256) cell dimension\n}\n```\n\n##### Elevations\n\nElevations are expressed as an integral of the gridsize.\n\nSince the gridsize for Operation Flashpoint is a fixed 50 meters, to convert the value into meters:\n\n```\nRealHeight = Elevations[x][y] * 0.05;\n```\n\nNote that (probably WrpTool) can set a default index of -1 (0xFFFF). The meaning is unclear.\n\nsee Talk\n\n##### TextureIndex\n\nEach cell on the map references an texture file (pac/paa) and an elevation for that text at that cell position.\nSince 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.\n\nA fixed (and therefore max) table size of 512 texture filenames can be listed. Each is held as an asciiz string inside a fixed 32 byte record. Eg max length of filename is 31 characters. Each 32 byte record can contain garbage after the Asciiz. The first null entry is considered the end of the usable list.\n\nThe first entry (effectively index0) is never used. Even though a filename is associated with this entry. it is never accessed.\n\n#### Model\n\n```\nModel\n{\n float  TransformMatrix[4][3]; // see Generic FileFormat Data Types\n long   ObjectID;              // unique for every entry\n asciiz P3DFilename[76];       // \"data3d\\kasna.p3d\"\n}\n```\n\nThe number of models varies from none, to end of file. Each model is 128 bytes in length.\n\nNote 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.\n\n### FilePaths\n\nDespite the impression given (lack of a leading \\) All filenames (pac/paa and p3d files) are HARD WIRED to the (virtual) pboRoot\\ directory.\n\nThe PboRoot\\ directory is built in-situ during game load and consists of an index table of all addons from 'anywhere' in the game structure. Eg, the official Addon Directories (plural), the bin\\folder, plus any oem addons stated in the command line.","sections":[{"heading":null,"level":1,"markdown":"> **Disclaimer: This page describes internal undocumented structures of Bohemia Interactive software.**\n>\n> This page contains unofficial information.\n>\n> Some usage of this information may constitute a violation of the rights of Bohemia Interactive and is in no way endorsed or recommended by Bohemia Interactive.\n> Bohemia Interactive is not willing to tolerate use of such tools if it contravenes any general licenses granted to end users of this community wiki or BI products."},{"heading":"General","level":3,"markdown":"*Flashpoint wrp files use two different file formats to contain the data. This document contains information on unbinarised 4WVR format as used by WrpTool and Visitor 2.*\n\nThis document does **not** discuss the **binary** 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).\n\nSee Island File Formats for further info.\n\n\"Binarize\" tool by BIStudio will convert 4WVR to OPRW if desired.\n\n(some problems exist with 2 versions of binarize)\n\nFor a general description of how simple this (or any other) wrp file construct, see 8WVR format"},{"heading":"Conventions","level":4,"markdown":"see Generic FileFormat Data Types"},{"heading":"Structure","level":3,"markdown":"```\n4WVR\n{\n  WRP4Header          Header\n  CompressedFloats    Elevations  [Ysize][Xsize]; // in centimetres. See below\n  ushort              TextureIndex[Ysize][Xsize]; //Each 'index' refers to a filename below. Range 1..511\n  char                TextureFilenames[512][32];  //\"data\\pi.paa\\0|data\\pi1.paa\\0\".....\n  Model               Models[...];\n}\n```"},{"heading":"WRP4Header","level":4,"markdown":"```\nWRP4Header\n{\nchar Signature[4]; //\"4WVR\"\nulong Xsize;       //(=256) cell dimension\nulong Ysize;       //(=256) cell dimension\n}\n```"},{"heading":"Elevations","level":5,"markdown":"Elevations are expressed as an integral of the gridsize.\n\nSince the gridsize for Operation Flashpoint is a fixed 50 meters, to convert the value into meters:\n\n```\nRealHeight = Elevations[x][y] * 0.05;\n```\n\nNote that (probably WrpTool) can set a default index of -1 (0xFFFF). The meaning is unclear.\n\nsee Talk"},{"heading":"TextureIndex","level":5,"markdown":"Each cell on the map references an texture file (pac/paa) and an elevation for that text at that cell position.\nSince 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.\n\nA fixed (and therefore max) table size of 512 texture filenames can be listed. Each is held as an asciiz string inside a fixed 32 byte record. Eg max length of filename is 31 characters. Each 32 byte record can contain garbage after the Asciiz. The first null entry is considered the end of the usable list.\n\nThe first entry (effectively index0) is never used. Even though a filename is associated with this entry. it is never accessed."},{"heading":"Model","level":4,"markdown":"```\nModel\n{\n float  TransformMatrix[4][3]; // see Generic FileFormat Data Types\n long   ObjectID;              // unique for every entry\n asciiz P3DFilename[76];       // \"data3d\\kasna.p3d\"\n}\n```\n\nThe number of models varies from none, to end of file. Each model is 128 bytes in length.\n\nNote 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."},{"heading":"FilePaths","level":3,"markdown":"Despite the impression given (lack of a leading \\) All filenames (pac/paa and p3d files) are HARD WIRED to the (virtual) pboRoot\\ directory.\n\nThe PboRoot\\ directory is built in-situ during game load and consists of an index table of all addons from 'anywhere' in the game structure. Eg, the official Addon Directories (plural), the bin\\folder, plus any oem addons stated in the command line."}],"categories":["Operation Flashpoint: Modelling","Real Virtuality File Formats"],"groups":["Tools and File Formats"]}