PEW File Format: Difference between revisions
mNo edit summary |
(part one edit) |
||
Line 29: | Line 29: | ||
|} | |} | ||
===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; | |||
---- | ---- | ||
Line 43: | Line 57: | ||
POSEW60 | POSEW60 | ||
{ | { | ||
PoseHeader Header; | |||
ulong nObjectTypes; | |||
ObjectType ObjectTypes[nObjectTypes]; | |||
RoadNets RoadNets[...]; | |||
XYPair TerrainGridSize; | |||
float TerrainGridHeights[TerrainGridSize]; | |||
float BlueEdgeTerrainHeights[NoOfBlueFloats] ; //Always zero values. | |||
// NoOfBlueFloats = (TerrainGrid_X / 16) * TerrainGrid_X; | |||
float[ | |||
float[NoOfBlueFloats] | |||
ulong Unknown; | |||
ulong NoOfObjects; | |||
Object Objects[NoOfObjects]; | |||
ulong NoOfLayers; | |||
Layer Layers[[NoOfLayers] ; | |||
RoadNetworks; // Sort of defined, needs more work... | |||
ulong NoOfBackgrounds; | |||
Background Backgrounds[NoOfBackgrounds] ; | |||
EndBlocks; // Sort of defined, needs more work... | |||
} | } | ||
</nowiki></code> | </nowiki></code> | ||
===PoseHeader=== | |||
Header | |||
{ | |||
=== | char Signature[7]; "POSEW59" or "POSEW60" note not null terminated | ||
bytes Unknown[37]; | |||
} | |||
===ObjectType=== | |||
<code><nowiki> | <code><nowiki> | ||
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) | switch (ObjectClassId) | ||
Line 171: | Line 114: | ||
} | } | ||
ulong nOfArtificialSubObjects; | |||
ArtificialSubObject ArtificialSubObjects[nOfArtificialSubObjects]; | |||
ulong MarkerType; //See MarkerTypeEnum | |||
ulong ObjectTypeId // VariousInfo.Offset(16).[4].ToInt; // The 4-bytes at offset 16 in the VariousInfo is the ObjectTypeId. | |||
} | } | ||
</nowiki></code> | </nowiki></code> | ||
Line 187: | Line 127: | ||
:: The most important data is the ''ObjectTypeId'' found at the 16th byte and is an 4-byte int. | :: The most important data is the ''ObjectTypeId'' found at the 16th byte and is an 4-byte int. | ||
=== | ====ArtificialSubObject==== | ||
<code><nowiki> | <code><nowiki> | ||
ArtificialSubObject | |||
{ | { | ||
String ArtificialSubObjectName; | |||
ulong Something1; | |||
ulong Something2; | |||
XYZTriplet StartEndPos[2]; | |||
} | } | ||
</nowiki></code> | </nowiki></code> | ||
===RoadNets=== | |||
=== | RoadNets | ||
{ | |||
ushort IgnoreNets; | |||
if(IgnoreNets== 0) | |||
{ | |||
ulong nRoads; | |||
Road RoadTypes[nRoads]; | |||
ulong nXRoads; | |||
XRoad XRoads[nXRoads]; | |||
} | |||
} | |||
====Road==== | |||
<code><nowiki> | <code><nowiki> | ||
Road | |||
{ | { | ||
String NetworkTypeName; | |||
RGBA KeyPartsColour; // 0xFF:FF:FF:FF means 'default' | |||
RGBA NormalPartsColour; // ditto | |||
ushort FilledLine; // 0x0000=No, 0x0100=Yes | |||
double MaxAngle; // degrees | |||
double | double MaxBankAngle; // degrees | ||
double | ulong nStraights; | ||
RoadPart Straights[nStraights] ; | |||
ulong nCurves; | |||
RoadPart Curves[nCurves]; | |||
ulong nSpecials; | |||
RoadPart Specials[nSpecials]; | |||
ulong nTerminators; | |||
RoadPart Terminators[nTerminators]; | |||
} | } | ||
} | } | ||
</nowiki></code> | </nowiki></code> | ||
=== | =====RoadPart===== | ||
RoadPart | |||
{ | { | ||
String Name; | |||
ulong ObjectId; | |||
ushort Type; | |||
ushort CanChangeBankAngle; // not present for Curves | |||
} | } | ||
===Object=== | |||
=== | |||
<code><nowiki> | <code><nowiki> | ||
Object | |||
{ | { | ||
ushort IsPresent; | |||
if (IsPresent) | |||
{ | |||
ushort Unknown; | |||
} | 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; | |||
float RelativeSurfaceElevation; | |||
RGBA OutlineColour; | |||
RGBA ObjectColour; | |||
ulong ObjectTypeId; | |||
}; | |||
}; | |||
</nowiki></code> | </nowiki></code> | ||
===Layer=== | |||
Layer | |||
{ | { | ||
String LayerName1; | |||
ulong LayerSizeType; | |||
String LayerName2; | |||
ushort DefaultIndicator; | |||
ulong NoOfTerrainMaterials; | |||
TerrainMaterial TerrainMaterials[NoOfTerrainMaterials]; | |||
} | |||
} | } | ||
=== | ====TerrainMaterial==== | ||
<code><nowiki> | <code><nowiki> | ||
TerrainMaterial | |||
{ | { | ||
ulong Unknown; | |||
String MaterialName; | |||
ulong Unknown; | |||
} | } | ||
</nowiki></code> | </nowiki></code> | ||
===Background=== | |||
=== | |||
<code><nowiki> | <code><nowiki> | ||
Background | |||
{ | { | ||
String BackgroundFilename; | |||
String BackgroundName; | |||
float OffsetX; | |||
float OffsetY; | |||
float | float SizeX; | ||
float | float SizeY; | ||
float | ulong Transparency; | ||
float | ulong Visible; | ||
} | } | ||
</nowiki></code> | </nowiki></code> | ||
== Enums == | == Enums == |
Revision as of 15:43, 9 February 2009
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).
POSEW60
{
PoseHeader Header;
ulong nObjectTypes;
ObjectType ObjectTypes[nObjectTypes];
RoadNets RoadNets[...];
XYPair TerrainGridSize;
float TerrainGridHeights[TerrainGridSize];
float BlueEdgeTerrainHeights[NoOfBlueFloats] ; //Always zero values.
// NoOfBlueFloats = (TerrainGrid_X / 16) * TerrainGrid_X;
ulong Unknown;
ulong NoOfObjects;
Object Objects[NoOfObjects];
ulong NoOfLayers;
Layer Layers[[NoOfLayers] ;
RoadNetworks; // Sort of defined, needs more work...
ulong NoOfBackgrounds;
Background Backgrounds[NoOfBackgrounds] ;
EndBlocks; // Sort of defined, needs more work...
}
PoseHeader
Header { char Signature[7]; "POSEW59" or "POSEW60" note not null terminated bytes Unknown[37]; }
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
{
byte[118] VariousInfo;
}
case ObjectClassEnum.Artificial // 2
{
byte[118] VariousInfo;
}
case ObjectClassEnum.ArtificialAndDefinedInRoad // 5
{
byte[118] VariousInfo;
}
case ObjectClassEnum.Road // 3
{
byte[214] VariousInfo;
}
}
ulong nOfArtificialSubObjects;
ArtificialSubObject ArtificialSubObjects[nOfArtificialSubObjects];
ulong MarkerType; //See MarkerTypeEnum
ulong ObjectTypeId // VariousInfo.Offset(16).[4].ToInt; // The 4-bytes at offset 16 in the VariousInfo is the ObjectTypeId.
}
- 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.
- The most important data is the ObjectTypeId found at the 16th byte and is an 4-byte int.
ArtificialSubObject
ArtificialSubObject
{
String ArtificialSubObjectName;
ulong Something1;
ulong Something2;
XYZTriplet StartEndPos[2];
}
RoadNets
RoadNets { ushort IgnoreNets; if(IgnoreNets== 0) { ulong nRoads; Road RoadTypes[nRoads]; ulong nXRoads; XRoad XRoads[nXRoads]; } }
Road
Road
{
String NetworkTypeName;
RGBA KeyPartsColour; // 0xFF:FF:FF:FF means 'default'
RGBA NormalPartsColour; // ditto
ushort FilledLine; // 0x0000=No, 0x0100=Yes
double MaxAngle; // degrees
double MaxBankAngle; // 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; ulong ObjectId; ushort Type; ushort CanChangeBankAngle; // not present for Curves }
Object
Object
{
ushort IsPresent;
if (IsPresent)
{
ushort Unknown;
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;
float RelativeSurfaceElevation;
RGBA OutlineColour;
RGBA ObjectColour;
ulong ObjectTypeId;
};
};
Layer
Layer { String LayerName1; ulong LayerSizeType; String LayerName2; ushort DefaultIndicator; ulong NoOfTerrainMaterials; TerrainMaterial TerrainMaterials[NoOfTerrainMaterials]; } }
TerrainMaterial
TerrainMaterial
{
ulong Unknown;
String MaterialName;
ulong Unknown;
}
Background
Background
{
String BackgroundFilename;
String BackgroundName;
float OffsetX;
float OffsetY;
float SizeX;
float SizeY;
ulong Transparency;
ulong Visible;
}
Enums
ObjectClassEnum
enum ObjectClassEnum
{
Natural = 1,
Artificial = 2,
ArtificialAndDefinedInRoad = 5,
Road = 3
}
MarkerTypeEnum
enum MarkerTypeEnum
{
Rectangular = 0,
Elliptical = 1
}