Wrp File Format - 8WVR: Difference between revisions
Jump to navigation
Jump to search
m (rearranged unknown int) |
m (explanation of my previous change) |
||
Line 75: | Line 75: | ||
:*The 'Elevations' array extends from Bottom-Left to Top-Right in Visitor; | :*The 'Elevations' array extends from Bottom-Left to Top-Right in Visitor; | ||
:*The 'TextureGridMaterials' array is a mapping of .rvmat material files to TextureGrid cells/tiles. | :*The 'TextureGridMaterials' array is a mapping of .rvmat material files to TextureGrid cells/tiles. | ||
:*The 'Materials' array always contains a Material with no name (length == 0) at the first prosition. | |||
:*The 'Objects' array will always have at least 1 object. This default object spicifies the 'center' of the map and is always the last object in the array. | :*The 'Objects' array will always have at least 1 object. This default object spicifies the 'center' of the map and is always the last object in the array. | ||
:*The 'Objects' array is the last structure in the file and the 'NoOfObjects' is a variable amount and extends from the starting offset of the structure to the EndOfFile. | :*The 'Objects' array is the last structure in the file and the 'NoOfObjects' is a variable amount and extends from the starting offset of the structure to the EndOfFile. |
Revision as of 04:11, 23 December 2008
Introduction
- The 8WVR.wrp file should be viewed as an intermediate file format and of little use to the community at large. The reason being it is not editable in Visitor directly (it is the product of exporting a .pew file) and the format is in an unoptimized state for use in the Real Virtuality game engine.
File Format
- The following is a mix of pseudo-code and structure references that could be used to describe the file format of 8WVR.wrp game island.
- Any naming definitions or naming conventions used may or may not be accurate.
- This file format is principally used with Armed Assault.
Legend
Type | Description |
---|---|
byte | 8 bit (1 byte) |
short | 16 bit signed short (2 bytes) |
int | 32 bit signed integer (4 bytes) |
float | 32 bit signed single precision floating point value (4 bytes) |
asciiz | Null terminated (0x00) variable length ascii string |
ascii | fixed length ascii string |
- Although technically there should never be negetive values for many of the 16 bit & 32 bit values, it's 'safer' in programming terms to use signed datatypes as opposed to unsigned datatypes.
8WVR
{
structHeader Header
{
char[4] Filetype;
int TextureGrid_X;
int TextureGrid_Z;
int TerrainGrid_X;
int TerrainGrid_Z;
float CellSize;
}
float[TerrainGrid_Z,TerrainGrid_X] Elevations;
short[TextureGrid_Z,TextureGrid_X] TextureGridMaterials;
int NoOfMaterials - 1; //1 Based array.
structMaterial[NoOfMaterials] Materials
{
int Length;
ascii[Length] Material;
int Unknown; //always zero
}
structObject[NoOfObjects] Objects
{
float[12] TransformMatrix;
int ObjectId;
int Length;
ascii[Length] Object;
}
}
Notes
- The 'Elevations' array extends from Bottom-Left to Top-Right in Visitor;
- The 'TextureGridMaterials' array is a mapping of .rvmat material files to TextureGrid cells/tiles.
- The 'Materials' array always contains a Material with no name (length == 0) at the first prosition.
- The 'Objects' array will always have at least 1 object. This default object spicifies the 'center' of the map and is always the last object in the array.
- The 'Objects' array is the last structure in the file and the 'NoOfObjects' is a variable amount and extends from the starting offset of the structure to the EndOfFile.
- The 'TransformMatrix' for a given object is a standard 4 x 3 transform matrix which when decomposed determines the objects x,z,y position, scale & orientation (NB: Special logic must be applied to decompose the orientation from a Matrix.).