Wrp File Format - OPRWv17 to 24: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
No edit summary
(OPRW18)
Line 1: Line 1:
[[Category:Sandbox]]New articles:
[[Category:Sandbox]]
[[Tiberian Genesis Mod]] <br>
[[EXT]] <br>
[[CPP]] <br>
[[BIN]]


part of old WRP File Format article:
Current state of my researches on OPRW18 file format. Any additions, suggestions, etc. are appreciated.


==General==
<code><nowiki>char[4] sig //"OPWR"
The terrain as seen in game are '''wrp''' files (world maps). The 'map' generally consist of an 'island', surrounded by sea texture. All official maps are square areas 256 x 256 'cells'. Each 'cell' defines attributes of that part of the map in a fixed 50 meter square grid.  Thus a 256 square map covers 12.8 kms square.
ulong version //0x12
ulong [2] x,y //texture cell dimension.
ulong [2] x,y //elevations cell dimensions.
float gridSize //in meters


With the introduction of Resistance, the map sizes could be considerably larger. No official BI island took advantage of this. However, the OFP Community has, for  example: '''BAS Tonal''', '''PMC Rugen 25km''', '''PMC Rattler 25km''', to name only a few.


A '''wrp''' file contain indexed references to models (p3d files) and textures (pac/paa). A wrp file does '''not''' contain the models, or the textures. Instead, these models and textures are held inside a mixture of one or more pbo files. Frequently, since this is after all an island, the very same p3d models accessed in '''this''' wrp file, '''this''' island, might also be available as separate Mission Editor models. Buildings eg, grass eg, trees, eg.
//still unknown stuff here


The model and texture pbo files can be 'official' (eg O.pbo,data3d.pbo), or unofficial. Any and all pbos that contain pxx files can be referenced by the wrp file. The wrp file itself, may, or may not be, inside one of the very same pbo's that contain some of the pictures, but, that, is immaterial to the wrp.


A wrp file is accompanied with a familiar [[Config.cpp|config.cpp]], or it's raPified equivalent, [[Config.bin|config.bin]].
Peak List
{
ulong size //maybe + 1
float[size][3] XYZ //Position of the Peak(Y is heigth)
}


All references to models and textures within the config begin:
ushort[][] TextureIndices //need still some research here


filename_of_pbo\thing.pxx
ushort[gridX][gridY] unknown //packed
note there is NO leading slash.


'''pxx''' of course are p3d. pac. or paa extensions. Depending on context, one or other of these file externsions are default. But, for modellers to play safe it is better (tm) to be specific.
byte[gridX][gridY] envSounds? //packed


There are two file formats in use. Either can be used in the engine.
float[gridX][gridY] elevation //packed
 
Rvmat List
{
ulong number of rvmats + 1
ushort 0x0
 
Rvmat entry
{
asciiz rvmat name
byte 0x00
}
}
 
Model List (w/o class names)
{
ulong size //number of models
asciiz[size] model_path //e.g. ca\buildings\kostelik.p3d
}
 
Model List (w/ class names)
{
ulong size //number of models
 
Model
{
asciiz class_name //e.g. Land_Hangar
asciiz model_path
float[3] unknown
ulong unknown
}
}
 
 
//probably 2 blocks in between
 
 
 
//lot of road blocks, which are divided by blocks of 0x00
Roadblock
{
ulong size //number of roadparts
roadpart
{
ushort 0x02
float PosX_Start
float elev_Start
float PosZ_Start
float PosX_End
float elev_End
float PosZ_End
ulong || ushort[2] unknown //sorta index or ID?? or some flag thingy
asciiz model_path
float[12] matrix
}
}
 
 
//Block of 0x00
 
Object List
{
object entry
{
ulong ObjectID
ulong modelIndex
float[12] matrix
ulong 0x02 ??
}
}
 
//probably data about how objects are displayed in the editor(grey rectangles for buildings, circles for bushes and trees and so on)
unknown Block
{
block entry
{
ulong type
 
if(type in [0x18,0x1F,0x20]) type1
if(type in [0x03,0x04,0x14) type2
if(type in [0x19]) type3
if(type in [0x02, 0x0A, 0x0B, 0x16]) type4
 
//for 0x18, 0x1F, 0x20
type1
{
ulong ObjectID
float[4][2] rectangle //boundaries of object
}
 
//for 0x03, 0x04, 0x14
type2
{
ulong ObjectID
float[4][2] rectangle //boundaries of object
ulong color??
}
//for 0x19
type3
{
ulong 0xFFFFFFFF
ulong unknown
float[4] unknown
}
 
for 0x02, 0x0A, 0x0B, 0x16
type4
{
ulong ObjectID
float[2] pos
}
}
</nowiki></code>

Revision as of 19:10, 1 October 2008


Current state of my researches on OPRW18 file format. Any additions, suggestions, etc. are appreciated.

char[4] sig //"OPWR" ulong version //0x12 ulong [2] x,y //texture cell dimension. ulong [2] x,y //elevations cell dimensions. float gridSize //in meters //still unknown stuff here Peak List { ulong size //maybe + 1 float[size][3] XYZ //Position of the Peak(Y is heigth) } ushort[][] TextureIndices //need still some research here ushort[gridX][gridY] unknown //packed byte[gridX][gridY] envSounds? //packed float[gridX][gridY] elevation //packed Rvmat List { ulong number of rvmats + 1 ushort 0x0 Rvmat entry { asciiz rvmat name byte 0x00 } } Model List (w/o class names) { ulong size //number of models asciiz[size] model_path //e.g. ca\buildings\kostelik.p3d } Model List (w/ class names) { ulong size //number of models Model { asciiz class_name //e.g. Land_Hangar asciiz model_path float[3] unknown ulong unknown } } //probably 2 blocks in between //lot of road blocks, which are divided by blocks of 0x00 Roadblock { ulong size //number of roadparts roadpart { ushort 0x02 float PosX_Start float elev_Start float PosZ_Start float PosX_End float elev_End float PosZ_End ulong || ushort[2] unknown //sorta index or ID?? or some flag thingy asciiz model_path float[12] matrix } } //Block of 0x00 Object List { object entry { ulong ObjectID ulong modelIndex float[12] matrix ulong 0x02 ?? } } //probably data about how objects are displayed in the editor(grey rectangles for buildings, circles for bushes and trees and so on) unknown Block { block entry { ulong type if(type in [0x18,0x1F,0x20]) type1 if(type in [0x03,0x04,0x14) type2 if(type in [0x19]) type3 if(type in [0x02, 0x0A, 0x0B, 0x16]) type4 //for 0x18, 0x1F, 0x20 type1 { ulong ObjectID float[4][2] rectangle //boundaries of object } //for 0x03, 0x04, 0x14 type2 { ulong ObjectID float[4][2] rectangle //boundaries of object ulong color?? } //for 0x19 type3 { ulong 0xFFFFFFFF ulong unknown float[4] unknown } for 0x02, 0x0A, 0x0B, 0x16 type4 { ulong ObjectID float[2] pos } }