PEW File Format: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (→‎File Format: Enblocks)
(//"Base)
Line 54: Line 54:
::*This file format is principally used with Armed Assault v1.09 and later plus the ArmA Tools Suite Final release (v1.14).
::*This file format is principally used with Armed Assault v1.09 and later plus the ArmA Tools Suite Final release (v1.14).


<code><nowiki>
  POSEW59
   POSEW60
   POSEW60
   {
   {
Line 62: Line 62:
     RoadNets                RoadNets[...];
     RoadNets                RoadNets[...];
     Terrain                  Terrain[...];
     Terrain                  Terrain[...];
     ulong                    Unknown;
     ulong                    Always0;
     ulong                    NoOfObjects;
     ulong                    NoOfObjects;
     Object                  Objects[NoOfObjects];
     Object                  Objects[NoOfObjects];
Line 68: Line 68:
     Layer                    Layers[[NoOfLayers] ;
     Layer                    Layers[[NoOfLayers] ;
     ulong                    RoadNetIndices[TerrainGridSizeXY];
     ulong                    RoadNetIndices[TerrainGridSizeXY];
     ulong                   NoOfBackgrounds;
     if (POSEW60)
    Background               Backgrounds[NoOfBackgrounds] ;
    {
    ulong                   NoOfBackgrounds;
    Background             Backgrounds[NoOfBackgrounds] ;// probably
    }
    else // pose59
    {
      ulong                  Count;
      UnknownStruct2        UnknownStructs[Count];
    }
     ulong                    nBlocks;
     ulong                    nBlocks;
     EndBlock;                EndBlocks[nBlocks];
     EndBlock;                EndBlocks[nBlocks];
     ulong                   Residual[5]; // typically 00 00 00 00 00 00 00 00 00 00 00 00 04 00 00 00 00 00 00 00
     if (POSEW60)
    {
      ulong                 Count;
      UnknownStruct2        UnknownStructs[Count];
    }
    else // pose59
    {
    ulong                  NoOfBackgrounds;
    Background              Backgrounds[NoOfBackgrounds] ;// probably
    }
    ulong                    Count;
    UnknownStruct1          UnknownStructs[Count];       
    ulong                    Always0;
    ulong                    Always4;
    ulong                    Always0;
   }
   }
</nowiki></code>
</nowiki></code>
Line 116: Line 138:


     ulong                    nOfArtificialSubObjects;
     ulong                    nOfArtificialSubObjects;
    ArtificialSubObject      ArtificialSubObjects[nOfArtificialSubObjects];


    ArtificialSubObject      ArtificialSubObjects[nOfArtificialSubObjects]; // not present for POSEW59
  // ulong                    MarkerType;  //See MarkerTypeEnum
 
    ulong                    MarkerType;  //See MarkerTypeEnum


     ulong                    ObjectTypeId // ObjectTypeID is also present at offset 16 in the VariousInfo's
     LongBool                LongBool; // 0 or 1
   }
   }
</nowiki></code>
</nowiki></code>


::NB: While the 'VariousInfo' byte array is decernable at this time it essentially defines various floats, integers, transforms etc. that denote the 'default' and/or 'seed' values for a given '''''ObjectType'''''.
::NB: While the 'VariousInfo' byte array is decernable at this time it essentially defines various floats, integers, transforms etc. that denote the 'default' and/or 'seed' values for a given '''''ObjectType'''''.
 
// ObjectTypeID is also present at offset 16 in the VariousInfo's
====ArtificialSubObject====
====ArtificialSubObject====
<code><nowiki>
   ArtificialSubObject
   ArtificialSubObject
   {
   {
     String   ArtificialSubObjectName;
     String     Name;
     ulong    Something1;
     LongBool  LongBool;
     ulong   Something2;
     ulong     Always02;
     XYZTriplet StartEndPos[2];
     XYZTriplet StartEndPos[2];
   }
   }
</nowiki></code>


===RoadNets===
===RoadNets===
Line 209: Line 227:
   Object
   Object
   {
   {
       ushort IsPresent;
       ShortBool IsPresent;
       if (IsPresent)
       if (IsPresent)
       {
       {
         ushort Unknown;
         ShortBool Always0;
         ulong InstanceId;
         ulong     InstanceId;
         float TransformColumn[3][4]; // described here to solidly illustrate to reader
         float     TransformColumn[3][4]; // described here to solidly illustrate to reader
                                      // this is a standard DirectX Transform matrix
                                        // this is a standard DirectX Transform matrix
                                      // but in COLUMN format;
                                        // but in COLUMN format;
         double ObjectRelativeSize;    // decimal percentage
         double   ObjectRelativeSize;    // decimal percentage
         String InstanceName;
         String   InstanceName;         // "minimalStrelPos"
         float RelativeSurfaceElevation;
         float     RelativeSurfaceElevation;
         RGBA   OutlineColour;  
         RGBA     OutlineColour;  
         RGBA   ObjectColour;   
         RGBA     ObjectColour;   
         ulong ObjectTypeId;
         ulong     ObjectTypeId;
       };
       };
   };
   };
Line 231: Line 249:
   Layer
   Layer
   {
   {
     String LayerName1;
     String         Name1;           //"Base"
     ulong LayerSizeType;
     ulong           SizeType;         //0
     String LayerName2;
     String         Name2;           //"Base"
     ushort DefaultIndicator;
     ushort         DefaultIndicator; // 1
     ulong NoOfTerrainMaterials;
     ulong           NoOfTerrainMaterials;
     TerrainMaterial TerrainMaterials[NoOfTerrainMaterials];
     TerrainMaterial TerrainMaterials[NoOfTerrainMaterials];
     }
     }
Line 241: Line 259:


====TerrainMaterial====
====TerrainMaterial====
<code><nowiki>
   TerrainMaterial
   TerrainMaterial
   {
   {
     ulong  Unknown;
     ulong  Type;         // 1 = label, 0x40 = rvmatfile,,,,
     String MaterialName;
     String MaterialName; // "---sea---","Layers\P_000-000_L00.rvmat"
     ulong  Unknown;
     ulong  TypeID;       // 0,1,2
   }
   }
</nowiki></code>
===Background===
===Background===
<code><nowiki>
<code><nowiki>
Line 267: Line 282:
  EndBlock
  EndBlock
  {
  {
   shortBool Always1;  
   ShortBool IsPresent;  
   shortbool Always1;  
   if IsPresent
  {
  ShortBool Always1;  
   ulong    Unknown[12];  
   ulong    Unknown[12];  
             /* typical data
             /* typical data
Line 275: Line 292:
             **C6 6F C6 42 0E 01 00 00 4B 00 00 00 00 00 00 00  
             **C6 6F C6 42 0E 01 00 00 4B 00 00 00 00 00 00 00  
             */
             */
   ushort    StageID; // 1,2,3,4
   ushort    Type;     // 0,1,2,3
   String    Name1;    //"hlavni silnice\0"
   String    Name1;    //"hlavni silnice\0"
   String    Name2;    //"kr_silnice_cesta_t\0"
   String    Name2;    //"kr_silnice_cesta_t\0"
   RGBA      color;    //0xFFFFFFFF
   RGBA      color;    //0xFFFFFFFF
   shortBool Always1;  
   ShortBool Always1;  
   ulong    Count;    // 2,3
   ulong    Count;    // 2,3
   EndBlock1 EndBlock1[Count];
   EndBlock1 EndBlock1[Count];
Line 294: Line 311:
   ulong    Count;    // 2,3
   ulong    Count;    // 2,3
   EndBlock2 EndBlock2[Count];
   EndBlock2 EndBlock2[Count];
  }
  }
  }
====EndBlock1====
====EndBlock1====
  EndBlock1
  EndBlock1
  {
  {
   ulong Unknown[4];// Typically 00 00 C8 C0 00 00 C8 C0 00 00 00 00 0E 01 00 00
   ulong Unknown[4];// Typically 00 00 C8 C0 00 00 C8 C0 00 00 00 00 0E 01 00 00
   String Name;    // "silnice hlavni silnic\0"
   String Name;    // "silnice hlavni silnic\0"
  }
  }
Line 310: Line 328:
   RGBA      color;          //FFFFFFFF
   RGBA      color;          //FFFFFFFF
   RGBA      color2;          //FFFFFFFF
   RGBA      color2;          //FFFFFFFF
   ushort    ind;             //01
   ShortBool Always01;       //01
   ulong    buf2[4];        // Typically 00 00 00 00 00 00 39 40 00 00 00 00 00 00 24 40
   ulong    buf2[4];        // Typically 00 00 00 00 00 00 39 40 00 00 00 00 00 00 24 40
  }
  }
Line 323: Line 341:
           **0E 01 00 00 4D 00 00 00  
           **0E 01 00 00 4D 00 00 00  
           */
           */
   ushort  Type;              //03
   ushort  Type;              //0,1,2,3
   String  Name;              //"silnice10 100\0"
   String  Name;              //"silnice10 100\0"
   ulong    unknown[25];
   ulong    unknown[25];
Line 335: Line 353:
           **64 4A 5F B5 01 00  
           **64 4A 5F B5 01 00  
           */
           */
   shortBool ok; //1
   ShortBool ok; // 0 or 1
}
===UnknownStruct2===
UnknownStruct2
{
  ShortBool IsPresent;
  if IsPresent
  {
  ShortBool Always0;
  BisString Name1;          //"Les_new"
  ulong    Colour[3];
  ulong    nFloats;
  float    Floats[nFloats];
            /* Typical Data
            **00 00 61 45 00 78 1B 46 00 20 64 45 00 20 19 46
            **00 20 64 45 00 78 1B 46 00 40 67 45 00 58 18 46
            **00 40 67 45 00 78 1B 46 00 60 6A 45 00 58 18 46
            **00 60 6A 45 00 78 1B 46 00 80 6D 45 00 90 17 46
            **00 80 6D 45 00 B0 1A 46 00 A0 70 45 00 C8 16 46
            **00 A0 70 45 00 E8 19 46 00 C0 73 45 00 00 16 46
            */
  ulong    ID;            // 0,1,2,3,4....
  if POSEW60
  {
    LongBool  Always1;
  }
  else
  {
    BisString Name2;          //Les_new Name2==Name1
  }
  }
};
 
===UnknownStruct1===
UnknownStruct1
{
  ShortBool LongInd; // always 0 or 1
  String    Name1;  //"Noe_Lany"
  RGBA      Colour[3];
  ShortBool Always1;
  float    Offset[2];
  float    Size[2]; // 250 x 250.0 eg
  ulong    ID;      // 0,1,2,3,4,5,6
  BisString Name2;  //"Lipany"
  BisString Name3;  //"NameCity"
  BisString Name4;  // always null
  }
  }



Revision as of 18:43, 12 February 2009

Template:unsupported-doc

Introduction

To do...

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)
double 64 bit signed single precision floating point value (8 bytes)
asciiz Null terminated (0x00) variable length ascii string
ascii fixed length ascii string(UTF-8)

XYPair

XYPair
{
 ulong x,y;
}

RGBAColor

RGBAColor
{
 byte r,g,b,a;
}

String

String
{
 ulong  Length;
 Asciiz Characters;// null terminated regardless. Actual len = len+1;

File Format

The following is a mix of pseudo-code and structure references that could be used to describe the file format of POSEW60.pew project design file.
Any naming definitions or naming conventions used may or may not be accurate.
  • This file format is principally used with Armed Assault v1.09 and later plus the ArmA Tools Suite Final release (v1.14).
 POSEW59
 POSEW60
 {
   PoseHeader               Header;
   ulong                    nObjectTypes;
   ObjectType               ObjectTypes[nObjectTypes];
   RoadNets                 RoadNets[...];
   Terrain                  Terrain[...];
   ulong                    Always0;
   ulong                    NoOfObjects;
   Object                   Objects[NoOfObjects];
   ulong                    NoOfLayers;
   Layer                    Layers[[NoOfLayers] ;
   ulong                    RoadNetIndices[TerrainGridSizeXY];
   if (POSEW60)
   {
    ulong                   NoOfBackgrounds;
    Background              Backgrounds[NoOfBackgrounds] ;// probably
   }
   else // pose59
   {
     ulong                  Count;
     UnknownStruct2         UnknownStructs[Count];
   }
   ulong                    nBlocks;
   EndBlock;                EndBlocks[nBlocks];
   if (POSEW60)
   {
     ulong                  Count;
     UnknownStruct2         UnknownStructs[Count];
   }
   else // pose59
   {
    ulong                   NoOfBackgrounds;
    Background              Backgrounds[NoOfBackgrounds] ;// probably
   }
   ulong                    Count;
   UnknownStruct1           UnknownStructs[Count];         
   ulong                    Always0;
   ulong                    Always4;
   ulong                    Always0;
 }

</nowiki>

PoseHeader

Header
{
 char   Signature[7]; "POSEW59" or "POSEW60" note not null terminated

 ulong    UnknownLong0;
 ulong    UnknownLong1;  // typically 0
 String   UnknownString1;//"cwr\cwr_islands\cwr_cain\data\0"
 String   UnknownString2;//""
 float	   GridSize;      //50.0
 float	   UnknownFloat3; //400.0
 String   UnknownString3;//""
 ulong	   UnknownLong2;  // typically 0
};

ObjectType

ObjectType { String ModelFilename; //"SomePrefixRoot\data\SomeFile.p3d\0" String ObjectTypeName;//"SomePrefixRoot\data\SomeFile\0" ulong ObjectClassId; RGBAColor OutlineColour; // 0xFF:FF:FF:FF means 'default' RGBAColor ObjectColour; // ditto switch (ObjectClassId) { case ObjectClassEnum.Natural // 1 case ObjectClassEnum.Artificial // 2 case ObjectClassEnum.ArtificialAndDefinedInRoad // 5 { byte[118] VariousInfo; // 114 for POSEW59 } case ObjectClassEnum.Road // 3 { byte[214] VariousInfo; // 210 for POSEW59 } } ulong nOfArtificialSubObjects; ArtificialSubObject ArtificialSubObjects[nOfArtificialSubObjects]; // ulong MarkerType; //See MarkerTypeEnum LongBool LongBool; // 0 or 1 }

NB: While the 'VariousInfo' byte array is decernable at this time it essentially defines various floats, integers, transforms etc. that denote the 'default' and/or 'seed' values for a given ObjectType.

// ObjectTypeID is also present at offset 16 in the VariousInfo's

ArtificialSubObject

 ArtificialSubObject
 {
    String     Name;
    LongBool   LongBool;
    ulong      Always02;
    XYZTriplet StartEndPos[2];
 }

RoadNets

RoadNets
{
   shortBool RoadInd;
   if(RoadInd)
   {
      ulong nNets
      {
      ulong nRoads;
      Road  RoadTypes[nRoads];
      ulong nXRoads;
      XRoad XRoads[nXRoads];
     }[nNets];
   }
}

Road

Road { String NetworkTypeName; // "cesta\0" RGBA KeyPartsColour; // 0xFF:FF:FF:FF means 'default' RGBA NormalPartsColour; // ditto shortBool FilledLine; // 0 or 1 double MaxAngle; // 25.0 degrees double MaxBankAngle; // 5.0 degrees ulong nStraights; RoadPart Straights[nStraights] ; ulong nCurves; RoadPart Curves[nCurves]; ulong nSpecials; RoadPart Specials[nSpecials]; ulong nTerminators; RoadPart Terminators[nTerminators]; } }

RoadPart
 RoadPart     
 {
      String      Name;               // "cesta25" generallly "" on 1st entry
      ulong       ObjectId;
      ushort      Type;               // not present for Terminators
      shortBool   CanChangeBankAngle; // not present for Terminators or Curves
 }

XRoad

XRoad
{
 String    Name;	      //kr_asfaltka_asfaltka_t.
 ushort    Type              //1 or 3
 RGBA      color;	      //FF FF FF FF 
 shortBool CanChangeBankAngle; //0 or 1
 ulong     ObjectID;
 String    ChildName1;	     //asfaltka
 String    ChildName2;	     //hlavni silnice
 String    ChildName3;	     //cesta
 String    ChildName4;	     //Type=1"" Type=3 "cesta"
}

Terrain

Terrain
{
   XYPair   TerrainGridSize; // 256 x 256 eg
   float    TerrainGridHeights[TerrainGridSize];
   float    BlueEdgeTerrainHeights[NoOfBlueFloats]  ; //Always zero values // NoOfBlueFloats = (TerrainGrid_Y * TerrainGrid_X)/16;
}

Object

Object { ShortBool IsPresent; if (IsPresent) { ShortBool Always0; ulong InstanceId; float TransformColumn[3][4]; // described here to solidly illustrate to reader // this is a standard DirectX Transform matrix // but in COLUMN format; double ObjectRelativeSize; // decimal percentage String InstanceName; // "minimalStrelPos" float RelativeSurfaceElevation; RGBA OutlineColour; RGBA ObjectColour; ulong ObjectTypeId; }; };

Layer

 Layer
 {
   String          Name1;            //"Base"
   ulong           SizeType;         //0
   String          Name2;            //"Base"
   ushort          DefaultIndicator; // 1
   ulong           NoOfTerrainMaterials;
   TerrainMaterial TerrainMaterials[NoOfTerrainMaterials];
   }
 }

TerrainMaterial

 TerrainMaterial
 {
    ulong  Type;         // 1 = label, 0x40 = rvmatfile,,,,
    String MaterialName; // "---sea---","Layers\P_000-000_L00.rvmat"
    ulong  TypeID;       // 0,1,2
 }

Background

Background { String BackgroundFilename; String BackgroundName; float OffsetX; float OffsetY; float SizeX; float SizeY; ulong Transparency; ulong Visible; }

EndBlock

EndBlock
{
 ShortBool IsPresent; 
 if IsPresent
 {
 ShortBool Always1; 
 ulong     Unknown[12]; 
           /* typical data
           **00 00 00 00 00 00 00 F0 2C 46 00 98 23 46 C6 6F 
           **C6 42 0E 01 00 00 01 00 00 F0 2C 46 00 98 23 46 
           **C6 6F C6 42 0E 01 00 00 4B 00 00 00 00 00 00 00 
           */
 ushort    Type;     // 0,1,2,3
 String    Name1;    //"hlavni silnice\0"
 String    Name2;    //"kr_silnice_cesta_t\0"
 RGBA      color;    //0xFFFFFFFF
 ShortBool Always1; 
 ulong     Count;    // 2,3
 EndBlock1 EndBlock1[Count];
 ulong     Unknown[27];
           /* typical data
           **FA D4 30 BF 94 58 08 3D 00 00 C8 C0 00 00 60 C0 
           **00 00 00 00 00 00 48 C1 00 00 60 40 00 00 00 00 
           **00 00 48 C1 00 00 60 C0 00 00 00 00 00 00 00 00 
           **00 00 60 40 00 00 00 00 00 00 00 00 00 00 C8 C0 
           **00 00 00 00 00 00 30 C0 00 00 C8 C0 00 00 00 00 
           **00 00 1C C1 04 01 00 00 00 00 00 00 00 00 00 00 
           **09 00 00 00 0B 80 00 00 04 00 00 00 
           */
 ulong     Count;    // 2,3
 EndBlock2 EndBlock2[Count];
 }
}

EndBlock1

EndBlock1
{
  ulong  Unknown[4];// Typically 00 00 C8 C0 00 00 C8 C0 00 00 00 00 0E 01 00 00
  String Name;     // "silnice hlavni silnic\0"
}

EndBlock2

EndBlock2
{
 ulong     Count;           //15 eg
 EndBlock3 EndBlock3[Count];
 String    Name;            //"silnice hlavni silnic\0"
 ulong     Unknown[4];      //Typically 00 00 C8 C0 00 00 C8 C0 00 00 00 00 0E 01 00 00
 RGBA      color;           //FFFFFFFF
 RGBA      color2;          //FFFFFFFF
 ShortBool Always01;        //01
 ulong     buf2[4];         // Typically 00 00 00 00 00 00 39 40 00 00 00 00 00 00 24 40
}
EndBlock3
EndBlock3
{
 ulong    unknown[6];
          /* typical data
          **01 00 01 00 00 86 2D 46 
          **00 98 23 46 65 6C C5 42 
          **0E 01 00 00 4D 00 00 00 
          */
 ushort   Type;               //0,1,2,3
 String   Name;               //"silnice10 100\0"
 ulong    unknown[25];
          /*typical data
          **00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
          **C4 76 C2 3F 0E EB 8A C1 00 00 00 00 BE 00 00 00 
          **CC ED 26 BE CA 0F 12 40 56 30 28 3F 00 00 00 00 
          **18 CA 04 C1 48 8B 3D C0 00 00 00 00 2D 3D 91 C1 
          **06 01 C0 40 00 00 00 00 EE 98 84 C1 99 99 91 C0 
          **00 00 00 00 64 4A 5F 35 99 99 91 40 00 00 00 00 
          **64 4A 5F B5 01 00 
          */
 ShortBool ok; // 0 or 1
}

UnknownStruct2

UnknownStruct2
{
 ShortBool IsPresent;
 if IsPresent
 {
  ShortBool Always0;
  BisString Name1;          //"Les_new"
  ulong     Colour[3];
  ulong     nFloats;
  float     Floats[nFloats];
            /* Typical Data
            **00 00 61 45 00 78 1B 46 00 20 64 45 00 20 19 46 
            **00 20 64 45 00 78 1B 46 00 40 67 45 00 58 18 46 
            **00 40 67 45 00 78 1B 46 00 60 6A 45 00 58 18 46 
            **00 60 6A 45 00 78 1B 46 00 80 6D 45 00 90 17 46 
            **00 80 6D 45 00 B0 1A 46 00 A0 70 45 00 C8 16 46 
            **00 A0 70 45 00 E8 19 46 00 C0 73 45 00 00 16 46 
            */
  ulong     ID;             // 0,1,2,3,4....
  if POSEW60
  {
   LongBool  Always1;
  }
  else
  {
   BisString Name2;          //Les_new Name2==Name1
  }
 }
};

UnknownStruct1

UnknownStruct1
{
 ShortBool LongInd; // always 0 or 1
 String    Name1;   //"Noe_Lany"
 RGBA      Colour[3];
 ShortBool Always1; 
 float     Offset[2];
 float     Size[2]; // 250 x 250.0 eg
 ulong     ID;      // 0,1,2,3,4,5,6
 BisString Name2;   //"Lipany"
 BisString Name3;   //"NameCity"
 BisString Name4;   // always null
}

Enums

ObjectClassEnum

enum ObjectClassEnum { Natural = 1, Artificial = 2, ArtificialAndDefinedInRoad = 5, Road = 3 }

MarkerTypeEnum

enum MarkerTypeEnum { Rectangular = 0, Elliptical = 1 }