Synide – User talk

From Bohemia Interactive Community
Jump to navigation Jump to search
No edit summary
No edit summary
Line 1: Line 1:
== ODOL v40 File Format ==


{{unsupported-doc}}
The following is temporary...
 
----
=== Introduction ===
This is my init.sqf file I use in all my missions.
 
It correctly identifies in what context the init.sqf file is being run.
The general file format of a ArmA ODOL v40 p3d model file is similar to the ODOL v7 format.
The major differences are that in ArmA models there is now included (but not always) a model.cfg and the resolutions are ordered in the file in reverse numerical order.
 
The order of resolutions denoted in the header portion of the file is <b>not</b> necessarily the numerical order of the resolutions. (often the 11,000 resolution is the last in the header array)
The header resolutions need to be sorted in descending order. The resultant sorted array of resolutions is the order in which they appear in the file.
 
 
==== Legend ====


{| border="0"
<code><nowiki>/*
!width="100"|Type
        Synide
!width="300" align="left"|Description
        11/6/2007
|-
        v1.0
|-
       
|align="middle"|byte||align="left"| 8 bit (1 byte)
Things to note...
|-
|align="middle"|ushort||align="left"| 16 bit unsigned short (2 bytes)
|-
|align="middle"|int||align="left"| 32 bit signed integer (4 bytes)
|-
|align="middle"|float||align="left"| 32 bit signed single precision floating point value (4 bytes)
|-
|align="middle"|asciiz||align="left"| Null terminated (0x00) variable length ascii string
|-
|-
|}


If you are there at mission launch from that point on your 'Context'
will always be 'MP_CLIENT' and will stay as such even when you respawn.
If you are an 'MP_CLIENT' then you 'disconnect' from a continuing mission
and select a new playable character or the same playable character you will
become a 'JIP_CLIENT'.
If you join an inprogress mission you will be a 'JIP_CLIENT' from that
point till the mission ends.
*/
//init.sqf
debug=false;


if (isServer) then
{
  if (isnull player) then {Context = "mp_server";}else{Context = "sp_server";};
}else{
  if (isnull player) then {Context = "jip_client";}else{Context = "mp_client";};
};


=== Enums ===
call compile preprocessFileLineNumbers "scripts\common\init.sqf";
call compile preprocessFileLineNumbers format["scripts\%1\init.sqf",Context];


<code><nowiki>
processInitCommands;
int enum PixelShaderId
finishMissionInit;
{
  Normal = 0x00,
  NormalMap = 0x02,
  NormalMapMacroASSpecularMap = 0x14,
  NormalMapSpecularDIMap = 0x16,
  NormalMapMacroASSpecularDIMap = 0x18,
  AlphaShadow = 0x0C,
  AlphaNoShadow = 0x0D,
  Glass = 0x38,
  Detail = 0x06,
  NormalMapSpecularMap = 0x12
}
</nowiki></code>
</nowiki></code>


<code><nowiki>
Things to note about the above for MP only.
int enum VertexShaderId
{
  Basic = 0x00,
  NormalMap = 0x01,
  NormalMapAS = 0x0F
}
</nowiki></code>


*If you are there at mission launch from that point on your 'Context' will always be 'MP_CLIENT' and will stay as such even when you respawn.
*If you are an 'MP_CLIENT' then you 'disconnect' from the continuing mission and select a new playable character you will become a 'JIP_CLIENT'.
*If you join an inprogress mission you will be a 'JIP_CLIENT' from that point till the mission ends.


=== Structures ===


==== structP3DHeader ====
<code><nowiki>
struct structP3DHeader
{
  asciiz                  Filetype; //eg. ODOL
  int                      Version;    //eg. 0x2800 0000 = 40
  int                      NoOfResolutions;
  float[NoOfResolutions]  HeaderResolutions;
}
</nowiki></code>


==== structBone ====
----
<code><nowiki>
  structBone
  {
    asciiz Bone;
    asciiz Parent;
  }
</nowiki></code>


==== structSkeleton ====
{{unsupported-doc}}
<code><nowiki>
  structSkeleton
  {
    asciiz                  SkeletonName;
    bool                    isInherited;
    int                    NoOfBones;
    structBone[NoOfBones]  Bones;
  }
</nowiki></code>


==== structAnimation ====
<code><nowiki>
  structAnimation
  {
    int        AnimTransformType;
    asciiz      AnimSelection;
    asciiz      AnimSource;
    if (AnimTransformType == 9)
      {
        float[6] Transforms;
      }
      else
      {
        float[7] Transforms;
      }
  }
</nowiki></code>


==== structProxy ====
=== LOD Stuff ===
<code><nowiki>
  structProxy
  {
    asciiz      ProxyName;
    float[12]  ModelProxyUnknown1;
    int[4]      ModelProxyUnknown2;
  }
</nowiki></code>


==== structStage ====
A typical 'character' model has approx. '''16''' LOD's.
<code><nowiki>
  structStage
  {
    asciiz  StageTexture;
    int      Stage;
    int      UVSource;
    float[3] aside;
    float[3] up;
    float[3] dir;
    float[3] pos;
  }
</nowiki></code>


==== structMaterial ====
<b>10000</b> is the 'Stencil Shadow' LOD.
<code><nowiki>
* What is LOD <b>10010</b>?
  structMaterial
  {
    asciiz        Material;
    float[4]      Emissive;
    float[4]      Ambient;
    float[4]      Diffuse;
    float[4]      forcedDiffuse;
    float[4]      Specular;
    float          SpecularPower;
    int            PixelShaderId;
    int            VertexShaderId;
    structStage[]  Stages;
  }
</nowiki></code>


==== structPolygons ====
What is the <b>11000</b> LOD, seems to have approx. 1/3 of the Poly's of a 'Stencil Shadow' LOD.
<code><nowiki>
  structPolygons
  {
    byte NoOfVertices; // 3 or 4
    ushort[NoOfVertices] VerticesIndex; // 0-based index into Vertices Arrays
  }
</nowiki></code>


What is LOD <b>11010</b>?


==== structResolution (simple) ====
<code><nowiki>
  structResolution
  {
    NoOfVertices;
    <space>
    NoOfTextures;
    Textures;
    NoOfMaterials;
    Materials;
    <space>
    NoOfPolygons;
    <space>
    Polygons;
    <space>
    NoOfComponents;
    Components;
    NoOfProperties;
    Properties;
    <space>
    NoOfVertices;
    VerticesUVSet1;
    NoOfVertices;
    VerticesUVSet2;
    NoOfVertices;
    VerticesPositions;
    NoOfVertices;
    VerticesNormals;
    NoOfVertices;
    VerticesMinMax; //Looks like Min/Max info.
    NoOfVertices;
    VerticesUnknown1; //Looks like per vertex properties
    NoOfVertices;
    VerticesUnknown2; //hmmmm...
    if(pointer<filesize)
    {
        NoOfProxies;
        Proxies;
        <space>
    }
    NoOf;
    IntermittentUnknownData; // As at article date 12-Aug-2007. This data is not in every lod
                              // it is intermittent. Currently, structure is unknown.
                              // Can be bypassed by manual intervention to start of next resolution.
                              // Most likely is Texture-2-Face/Vertex mappings.
                              //This is a 'show-stopper' for continuous processing.
  }
</nowiki></code>


==== structResolution (detailed) ====
<code><nowiki>
  structResolution
  {
    int        NoOfVertices;
    byte        byteResUnknown1;
    byte        byteResUnknown2;
    switch (byteResUnknown2)
    {
        case 0x00: { byte[40] byteArrayResUnknown1; break; }
        case 0x20: { byte[45] byteArrayResUnknown1; break; }
        case 0x30: { byte[45] byteArrayResUnknown1; break; }
        case 0xFF: { byte[45] byteArrayResUnknown1; break; }
        case 0x3F: { byte[51] byteArrayResUnknown1; break; }
    }
    int                            NoOfTextures;
    asciiz[NoOfTextures]            Textures;
    int                            NoOfMaterials;
    structMaterial[NoOfMaterials]  Materials;
   
    //Basically... A direct replication of the information in the given .rvmat file
    for (int i = 0; i < NoOfMaterials; i++)
    {
      asciiz Material;
      byte[4] byteArrayMaterialUnknown1;
      float[4] Emissive;
      float[4] Ambient;
      float[4] Diffuse;
      float[4] forcedDiffuse;
      float[4] Specular;
      float    SpecularPower;
      int      PixelShaderId; //See enumPixelShaderId
      int      VertexShaderId; //See enumVertexShaderId
      //Based on the enumPixelShaderId that matches this PixelShaderId process a variable 'NoOfStages'
      //by default one should probably process 2 stages as this seems the most common amount
      if (NoOfStages > 0)
        {
          byte[34]  byteArrayMaterialUnknown2;
          for (int i = 0; i < NoOfStages; i++)
          {
            byte[4]  byteArrayMaterialUnknown3;
            asciiz    StageTexture;
            int      StageNumber;
          }
          for (int i = 0; i < NoOfStages; i++)
          {
            int      UVSource;
            float[3] aside;
            float[3] up;
            float[3] dir;
            float[3] pos;
          }
          byte[52] byteArrayMaterialUnknown4; //Possibly default values for a stage as same struct size
        }
        else
        {
          byte[86] byteArrayMaterialUnknown5;
        }
     
    }//EndOfMaterials


    byte[8] byteArrayResUnknown2;
    int NoOfPolygons;
    byte[6] byteArrayResUnknown3;
    structPolygons[NoOfPolygons] Polygons;
   
    //The following is an Unknown structure, however this code snippet iterates over it
    int NoOf;
    for (int i = 0; i < NoOf; i++)
    {
      byte[26] byteArrayResUnknown4;
      byte byteResUnknown3;
      if (byteResUnknown3 == 0xFF)
      {
        byte[16] byteArrayResUnknown5;
      }
      else
      {
        byte[15] byteArrayResUnknown5;
      }
    }//EndOfUnknownStructure




    int NoOfComponents;
=== Model Stuff ===
   
......




next biki session... tomorrow night...
*'''OFP2_ManSkeleton''' (has 75 Bones)


**neck
***neck1
****head
*****lbrow
*****mbrow
*****rbrow
*****lmouth
*****mmouth
*****rmouth
*****eyelids (10)
*****llip
**weapon
**launcher
**camera
**spine
**spine1
**spine2
**spine3
**pelvis
**leftshoulder (20)
**leftarm
**leftarmroll
**leftforearm
**leftforearmroll
**lefthand
**lefthandring
**lefthandring1
**lefthandring2
**lefthandring3
**lefthandpinky1 (30)
**lefthandpinky2
**lefthandpinky3
**lefthandmiddle1
**lefthandmiddle2
**lefthandmiddle3
**lefthandindex1
**lefthandindex2
**lefthandindex3
**lefthandthumb1
**lefthandthumb2 (40)
**lefthandthumb3
**rightshoulder
**rightarm
**rightarmroll
**rightforearm
**rightforearmroll
**righthand
**righthandring
**righthandring1
**righthandring2 (50)
**righthandring3
**righthandpinky1
**righthandpinky2
**righthandpinky3
**righthandmiddle1
**righthandmiddle2
**righthandmiddle3
**righthandindex1
**righthandindex2
**righthandindex3 (60)
**righthandthumb1
**righthandthumb2
**righthandthumb3
**leftupleg
**leftuplegroll
**leftleg
**leftlegroll
**leftfoot
**lefttoebase
**rightupleg (70)
**rightuplegroll
**rightleg
**rightlegroll
**rightfoot
**righttoebase (75)


......
----


== M1_Abrams.p3d ==


:* Has <b>19</b> LOD's.
:* 1,2,3.5,7,10,15,20,1000,1200,10000,10010, 1.0e13 (Geometry), 1.0e15 (Memory), 2.0e15 (LandContact), 5.0e15 (Hitpoints), 6.0e15 (View Geometry), 7.0e15 (Fire Geometry),11000 and 11010.


:* <b>The first LOD in the file</b> (which ever LOD that might be...) has <b>6302</b> Poly's.
:: This first LOD has 20 Components
::: otochlaven (has 735 selected faces)
::: otocvez (has 1634 selected faces)
::: zasleh (has 1 selected face)
::: otocvelitele (has 651 selected faces)
::: poklop_commander (has 432 selected faces)
::: poklop_gunner (has 170 selected faces)
::: proxy:\ca\temp\proxies\abrams\gunner.01
::: proxy:\ca\wheeled\flag_alone.01
::: proxy:\ca\temp\proxies\abrams\commander.01
::: otochlavenvelitele (has 2668 selected faces)
::: feedtray_cover (has 85 selected faces)
::: bolt (has 6 selected faces)
::: charging_handle (has 50 selected faces)
::: \ca\weapons\m2_static.01 (has 1158 selected faces)
::: zasleh_1 (has 1 selected face)
::: telo (has 6297 selected faces)
::: damagehide (has 792 selected faces)
::: damagevez (has 317 selected faces)
::: proxy:\ca\weapons\zasleh2_proxy.001 (has 1 selected face)
::: proxy:\ca\weapons\zasleh2_proxy.002 (has 1 selected face)


:* Has 1 property. (lodnoshadow=1)


  }
</nowiki></code>


=== File Format ===
<b>M1A1Skeleton</b> (has 81 Bones)


*koll1
*koll2
*koll3
*koll4
*koll5
*koll6
*koll7
*koll8
*kolp1
*kolp2 (10)
*kolp3
*kolp4
*kolp5
*kolp6
*kolp7
*kolp8
*podkolol1
**kolol1
**podkolol1_hide
*podkolol2 (20)
**kolol2
**podkolol2_hide
*podkolol3
**kolol3
**podkolol3_hide
*podkolol4
**kolol4
**podkolol4_hide
*podkolol5
**kolol5 (30)
**podkolol5_hide
*podkolol6
**kolol6
**podkolol6_hide
*podkolol7
**kolol7
**podkolol7_hide
*podkolol8
**kolol8
**podkolol8_hide (40)
*podkolop1
**kolop1
**podkolop1_hide
*podkolop2
**kolop2
**podkolop2_hide
*podkolop3
**kolop3
**podkolop3_hide
*podkolop4 (50)
**kolop4
**podkolop4_hide
*podkolop5
**kolop5
**podkolop5_hide
*podkolop6
**kolop6
**podkolop6_hide
*podkolop7
**kolop7 (60)
**podkolop7_hide
*podkolop8
**kolop8
**podkolop8_hide
*ukaz_rychlo
*ukaz_rychlo2
*ukaz_rpm
*ukaz_radar
*hodinova
*minutova (70)
*kompas
*ukazsmer
*damagehide
*otocvez
**otochlaven
**otocvelitele
***otochlavenvelitele
***poklop_commander
**poklop_gunner
**damagevez (80)
*poklop_driver


The following is a mix of ''pseudo-code'' and structure references that could be used to discribe the file format of ODOL v40.
It may or may not be accurate but has do date been used to read ODOL v40 is some cases without manual intervention. As at the writing of this article in most cases though, manual intervention is required to complete navigation throughout the given p3d file as there is some unkonwn data that prevents continuous processing.


<b>Animation Selections</b> (61 in total)


<code><nowiki>
{| border="1"
 
! No. !! AnimSelection !! AnimSource
  ODOLv40
|-
  {
|-
    structP3DHeader Header;
|align="middle"| [0] ||align="middle"| damageHide ||align="middle"| damage
    byte[155] Unknown;
|-
    structSkeleton Skeleton;
|align="middle"| [1] ||align="middle"| HatchDriver ||align="middle"| hatchDriver
    byte unknown1;
|-
    if(unknown1 == 0x00) {byte unknown2};
|align="middle"| [2] ||align="middle"| Wheel_kolL1 ||align="middle"| wheelL
    byte[32] unknown3;
|-
    int unknown4;
|align="middle"| [3] ||align="middle"| Wheel_koloL1 ||align="middle"| wheelL
    byte unknown5;
|-
    asciiz unknown6;
|align="middle"| [4] ||align="middle"| Wheel_podkoloL1 ||align="middle"| damper
    byte[6] unknown7;
|-
    bool AnimsExist;
|align="middle"| [5] ||align="middle"| Wheel_kolP1 ||align="middle"| wheelR
    if (AnimsExist)
|-
      {
|align="middle"| [6] ||align="middle"| Wheel_koloP1  ||align="middle"| wheelR
        int NoOfAnimSelections;
|-
        structAnimation[NoOfAnimSelections] Animations;
|align="middle"| [7] ||align="middle"| Wheel_podkoloP1 ||align="middle"| damper
 
|-
        //Basically... for each bone there is a list of Animations and this array structure
|align="middle"| [8] ||align="middle"| Wheel_kolL2 ||align="middle"| wheelL
        //            is stored on a per resolution basis.
|-
        int NoOfResolutions;
|align="middle"| [9] ||align="middle"| Wheel_kolP2 ||align="middle"| wheelR
        for(int i=0; i<NoOfResolutions; i++)
|-
        {
|align="middle"| [10] || align="middle"| Wheel_koloL2  ||align="middle"| wheelL
          int NoOfBones;
|-
          for(int ii=0; ii<NoOfResolutions; ii++)
|align="middle"| [11] || align="middle"| Wheel_koloL3  ||align="middle"| wheelL
          {
|-
            int NoOfAnims;
|align="middle"| [12] || align="middle"| Wheel_koloL4  ||align="middle"| wheelL
            if (NoOfAnims > 0)
|-
              {
|align="middle"| [13] || align="middle"| Wheel_koloL5  ||align="middle"| wheelL
                for(int iii=0; iii<NoOfAnims; iii++)
|-
                {
|align="middle"| [14] || align="middle"| Wheel_koloL6  ||align="middle"| wheelL
                  int Animation;
|-
                }
|align="middle"| [15] || align="middle"| Wheel_koloL7  ||align="middle"| wheelL
              }
|-
          }
|align="middle"| [16] || align="middle"| Wheel_koloP2  ||align="middle"| wheelR
        }
|-
 
|align="middle"| [17] || align="middle"| Wheel_koloP3  ||align="middle"| wheelR
        //Unknown Anim info...
|-
        //Basically... for each Animation if the TransformType !=9 then there
|align="middle"| [18] || align="middle"| Wheel_koloP4  ||align="middle"| wheelR
        // is a 6 x float of positional info.
|-
        for(int i=0; i<NoOfResolutions; i++)
|align="middle"| [19] || align="middle"| Wheel_koloP5 ||align="middle"| wheelR
        {
|-
          int Anim;
|align="middle"| [20] || align="middle"| Wheel_koloP6  ||align="middle"| wheelR
          if (Anim != -1)
|-
            {
|align="middle"| [21] || align="middle"| Wheel_koloP7  ||align="middle"| wheelR
              if (Animations[Anim].TransformType != 9)
              {
                  float[6] UnknownAnimInfo;
              }
            }
        }
      }//AnimExist
   
    byte[Header.NoOfResolutions * 8] Unknown8;
    bool[Header.NoOfResolutions] ResolutionFaceIndicator;
 
    //Basically...For each Resolution if the LODFaceIndicator is true
    //there is a int FaceCount + 13 bytes
    //I think this 'indicator' may serve other areas but at the very least it indicates
    //the following structure
    for (int i = 0; i < Header.NoOfResolutions; i++)
    {
        if (LODFaceIndicator[i])
        {
            int HeaderFaceCount;
            byte[13] Unknown9;
        }
    }
 
    int NoOfModelProxies;
    if (NoOfModelProxies != 0)
    {
      structProxy[NoOfModelProxies] ModelProxies;
    }
 
 
    structResolution[Header.NoOfResolutions];  //Note:- Remember, the order in which lod's
                                              //      occur is descending numerical order.
                                              //      eg. Resolution 1.0 will be the last in
                                              //          the file.
 
    //EndOfFile
  }
 
</nowiki></code>
 
=== Decompression ===
 
In ODOL v40 format files some of the datastructures present in the file are compressed by using a form of LZ compression.
Unlike pbo compression, in ArmA model files, one only knows the number of items to decompress, the expected output size (in bytes) and the expected checksum.
With this information and the size of a given data item one has the necessary information to expand the data to it's original format and size.
 
 
<b>''Note:- Data structures that are identified as being compressible will only be compressed if the 'expectedSize' is greater than 1024 bytes.''</b>
 
 
<b>''The code that follows is written in C# and may or may not be optimal or correct.''</b>
 
 
 
As an example if one was expanding the array of vertices positions...
 
* A vertex is described by it's x,y,z coordinates which are floats. A float is a 32bit (4 byte) number.
* If we were processing 1968 vertices then our expected output size would be 1968 * (3 * 4) = 23,616 bytes.
 
This 'expectedSize' is the only necessary information one would need to pass to a processing sub-routine or function.
 
 
<code><nowiki>
  public bool Expand(int ExpectedSize)
  {
      byte PacketFlagsByte; //packet flags
      byte WIPByte;
      BitVector32 BV;
      msLZ = new MemoryStream(ExpectedSize);
      BinaryWriter bwLZ = new BinaryWriter(msLZ);
      byte[] Buffer = new byte[ExpectedSize + 15];
      bool[] BitFlags = new bool[8];
      int i = 0, PointerRef = 0, ndx = 0, CalculatedCRC = 0, ReadCRC = 0, rPos, rLen, CurrentPointerRef = 0, Count = 0;
      int Bit0 = BitVector32.CreateMask();
      int Bit1 = BitVector32.CreateMask(Bit0);
      int Bit2 = BitVector32.CreateMask(Bit1);
      int Bit3 = BitVector32.CreateMask(Bit2);
      int Bit4 = BitVector32.CreateMask(Bit3);
      int Bit5 = BitVector32.CreateMask(Bit4);
      int Bit6 = BitVector32.CreateMask(Bit5);
      int Bit7 = BitVector32.CreateMask(Bit6);
 
 
      PacketFlagsByte = br.ReadByte();
      do
      {
          BV = new BitVector32(PacketFlagsByte);
          BitFlags[0] = BV[Bit0];
          BitFlags[1] = BV[Bit1];
          BitFlags[2] = BV[Bit2];
          BitFlags[3] = BV[Bit3];
          BitFlags[4] = BV[Bit4];
          BitFlags[5] = BV[Bit5];
          BitFlags[6] = BV[Bit6];
          BitFlags[7] = BV[Bit7];
          i = 0;
          do
          {
              if ((int)bwLZ.BaseStream.Position >= ExpectedSize) { break; }
              if (BitFlags[i++]) //Direct Output
              {
                  WIPByte = br.ReadByte();
                  bwLZ.Write(WIPByte);
                  Buffer[PointerRef++] = WIPByte;
                  CalculatedCRC += WIPByte;
              }
              else //Get from previous 4k
              {
                  rPos = (int)(br.ReadByte());
                  rLen = (int)(br.ReadByte());
                  rPos |= (rLen & 0xF0) << 4;
                  rLen = (rLen & 0x0F) + 2;
                  CurrentPointerRef = PointerRef;
                  if ((CurrentPointerRef - (rPos + rLen)) > 0)
                  {
                      //Case of wholly within the buffer, partially within the end of the buffer or wholly outside the end of the buffer
                      for (Count = 0; Count <= rLen; Count++)
                      {
                          ndx = (CurrentPointerRef - rPos) + Count;
                              if (ndx < 0)
                              {
                                  //Beyond the start of the buffer
                                  WIPByte = 0x20;
                              }
                              else
                              {
                                  //Within the buffer
                                  WIPByte = Buffer[ndx];
                              }
                          //}
                          bwLZ.Write(WIPByte);
                          Buffer[PointerRef++] = WIPByte;
                          CalculatedCRC += WIPByte;
                      }
                  }
                  else
                  {
                      //Case of wholly or partially beyond the start of the buffer.
                      for (Count = 0; Count <= rLen; Count++)
                      {
                          ndx = (CurrentPointerRef - rPos) + Count;
                          if (ndx < 0)
                          {
                              //Beyond the start of the buffer
                              WIPByte = 0x20;
                          }
                          else
                          {
                              //Within the buffer
                              WIPByte = Buffer[ndx];
                          }
                          bwLZ.Write(WIPByte);
                          Buffer[PointerRef++] = WIPByte;
                          CalculatedCRC += WIPByte;
                      }
                  }
              }
          }
          while ((i < 8) & (bwLZ.BaseStream.Position < ExpectedSize));
          if (bwLZ.BaseStream.Position < ExpectedSize) { PacketFlagsByte = br.ReadByte(); }
      }
      while (bwLZ.BaseStream.Position < ExpectedSize);
      ReadCRC = br.ReadInt32();
      if (ReadCRC == CalculatedCRC) { return true; } else { return false; }
  }
</nowiki></code>
 
=== Reference Tables ===
 
Note: These are not part of the p3d model file but are reference tables used for processing.
 
==== Resolutions ====
 
<code><nowiki>
  refResolutions
{
  float  Resolution;
  string ResolutionName;
}
</nowiki></code>
 
{| border="0"
!width="50" align="left"|Value
!width="150" align="left"|Value
!width="300" align="left"|Description
|-
|-
|align="middle"| [22] || align="middle"| Wheel_podkoloL2 ||align="middle"| damper
|-
|-
|align="left"|1.0e3||align="left"|1,000||align="left"|View Gunner
|align="middle"| [23] || align="middle"| Wheel_podkoloL3 ||align="middle"| damper
|-
|-
|align="left"|1.1e3||align="left"|1,100||align="left"|View Pilot
|align="middle"| [24] || align="middle"| Wheel_podkoloL4 ||align="middle"| damper
|-
|-
|align="left"|1.2e3||align="left"|1,200||align="left"|View Cargo
|align="middle"| [25] || align="middle"| Wheel_podkoloL5 ||align="middle"| damper
|-
|-
|align="left"|1.0e4||align="left"|10,000||align="left"|Stencil Shadow
|align="middle"| [26] || align="middle"| Wheel_podkoloL6 ||align="middle"| damper
|-
|-
|align="left"|1.001e4||align="left"|10,010||align="left"|Stencil Shadow 2
|align="middle"| [27] || align="middle"| Wheel_podkoloL7 ||align="middle"| damper
|-
|-
|align="left"|1.1e4||align="left"|11000||align="left"|Shadow Volume
|align="middle"| [28] || align="middle"| Wheel_podkoloL8 ||align="middle"| damper
|-
|-
|align="left"|1.101e4||align="left"|11010||align="left"|Shadow Volume 2
|align="middle"| [29] || align="middle"| Wheel_podkoloP2 ||align="middle"| damper
|-
|-
|align="left"|1.0e13||align="left"|10,000,000,000,000||align="left"|Geometry
|align="middle"| [30] || align="middle"| Wheel_podkoloP3 ||align="middle"| damper
|-
|-
|align="left"|1.0e15||align="left"|1,000,000,000,000,000||align="left"|Memory
|align="middle"| [31] || align="middle"| Wheel_podkoloP4 ||align="middle"| damper
|-
|-
|align="left"|2.0e15||align="left"|2,000,000,000,000,000||align="left"|Land Contact
|align="middle"| [32] || align="middle"| Wheel_podkoloP5 ||align="middle"| damper
|-
|-
|align="left"|3.0e15||align="left"|3,000,000,000,000,000||align="left"|Roadway
|align="middle"| [33] || align="middle"| Wheel_podkoloP6 ||align="middle"| damper
|-
|-
|align="left"|4.0e15||align="left"|4,000,000,000,000,000||align="left"|Paths
|align="middle"| [34] || align="middle"| Wheel_podkoloP7 ||align="middle"| damper
|-
|-
|align="left"|5.0e15||align="left"|5,000,000,000,000,000||align="left"|HitPoints
|align="middle"| [35] || align="middle"| Wheel_podkoloP8 ||align="middle"| damper
|-
|-
|align="left"|6.0e15||align="left"|6,000,000,000,000,000||align="left"|View Geometry
|align="middle"| [36] || align="middle"| podkoloL1_hide_damage ||align="middle"| damage
|-
|-
|align="left"|7.0e15||align="left"|7,000,000,000,000,000||align="left"|Fire Geometry
|align="middle"| [37] || align="middle"| podkoloL2_hide_damage ||align="middle"| damage
|-
|-
|align="left"|8.0e15||align="left"|8,000,000,000,000,000||align="left"|View Cargo Geometry
|align="middle"| [38] || align="middle"| podkoloL3_hide_damage ||align="middle"| damage
|-
|-
|align="left"|9.0e15||align="left"|9,000,000,000,000,000||align="left"|View Cargo Fire Geometry
|align="middle"| [39] || align="middle"| podkoloL4_hide_damage ||align="middle"| damage
|-
|-
|align="left"|1.0e16||align="left"|10,000,000,000,000,000||align="left"|View Commander
|align="middle"| [40] || align="middle"| podkoloL5_hide_damage ||align="middle"| damage
|-
|-
|align="left"|1.1e16||align="left"|11,000,000,000,000,000||align="left"|View Commander Geometry
|align="middle"| [41] || align="middle"| podkoloL6_hide_damage ||align="middle"| damage
|-
|-
|align="left"|1.2e16||align="left"|12,000,000,000,000,000||align="left"|View Commander Fire Geometry
|align="middle"| [42] || align="middle"| podkoloL7_hide_damage ||align="middle"| damage
|-
|-
|align="left"|1.3e16||align="left"|13,000,000,000,000,000||align="left"|View Pilot Geometry
|align="middle"| [43] || align="middle"| podkoloL8_hide_damage ||align="middle"| damage
|-
|-
|align="left"|1.4e16||align="left"|14,000,000,000,000,000||align="left"|View Pilot Fire Geometry
|align="middle"| [44] || align="middle"| podkoloP1_hide_damage ||align="middle"| damage
|-
|-
|align="left"|1.5e16||align="left"|15,000,000,000,000,000||align="left"|View Gunner Geometry
|align="middle"| [45] || align="middle"| podkoloP2_hide_damage ||align="middle"| damage
|-
|-
|align="left"|1.6e16||align="left"|16,000,000,000,000,000||align="left"|View Gunner Fire Geometry
|align="middle"| [46] || align="middle"| podkoloP3_hide_damage ||align="middle"| damage
|-
|-
|align="middle"| [47] || align="middle"| podkoloP4_hide_damage ||align="middle"| damage
|-
|-
|}
|align="middle"| [48] || align="middle"| podkoloP5_hide_damage ||align="middle"| damage
 
 
==== Material Stages ====
 
The number of material stages is dependant on the type of Shader that is used to process the material by the ArmA game engine.
A reference table is used when processing materials where depending on the shader specified the given number of stages should be processed.
 
<code><nowiki>
refShaderStages
{
  int PixelShaderId;
  int NoOfStages;
};
</nowiki></code>
 
{| border="0"
!width="350" align="left"|PixelShaderId enum
!width="50" align="left"|NoOfStages
|-
|-
|align="middle"| [49] || align="middle"| podkoloP6_hide_damage ||align="middle"| damage
|-
|-
|align="left"|PixelShaderId.Normal||align="left"|0
|align="middle"| [50] || align="middle"| podkoloP7_hide_damage ||align="middle"| damage
|-
|-
|align="left"|PixelShaderId.NormalMapSpecularDIMap||align="left"|2
|align="middle"| [51] || align="middle"| podkoloP8_hide_damage ||align="middle"| damage
|-
|-
|align="left"|PixelShaderId.AlphaNoShadow||align="left"|0
|align="middle"| [52] || align="middle"| damageVez ||align="middle"| damage
|-
|-
|align="left"|PixelShaderId.AlphaShadow||align="left"|0
|align="middle"| [53] || align="middle"| MainTurret  ||align="middle"| mainTurret
|-
|-
|align="left"|PixelShaderId.NormalMapMacroASSpecularDIMap||align="left"|4
|align="middle"| [54] || align="middle"| MainGun ||align="middle"| mainGun
|-
|-
|align="left"|PixelShaderId.Glass||align="left"|2
|align="middle"| [55] || align="middle"| ObsTurret ||align="middle"| obsTurret
|-
|-
|align="left"|PixelShaderId.Detail||align="left"|1
|align="middle"| [56] || align="middle"| ObsGun  ||align="middle"| obsGun
|-
|-
|align="left"|PixelShaderId.NormalMap||align="left"|3
|align="middle"| [57] || align="middle"| HatchCommander  ||align="middle"| hatchCommander
|-
|-
|align="left"|PixelShaderId.NormalMapMacroASSpecularMap||align="left"|4
|align="middle"| [58] || align="middle"| OtocVelitele_damage ||align="middle"| damage
|-
|-
|align="left"|PixelShaderId.NormalMapSpecularMap||align="left"|2
|align="middle"| [59] || align="middle"| poklop_commander_damage ||align="middle"| damage
|-
|-
|align="middle"| [60] || align="middle"| poklop_driver_damage  ||align="middle"| damage
|-
|-
|}
|}


----
== UH_60MG.p3d ==
Basically a good Air Model should have about <b>8</b> LOD's + the necessary LOD's.
:* Has <b>24</b> LOD's.
:* 1,2,3,4,5,6,7,8, 1000, 1100, 1200, 10000, 10010, 1.0e13 (Geometry), 1.0e15 (Memory), 2.0e15 (LandContact), 5.0e15 (Hitpoints), 6.0e15 (View Geometry), 7.0e15 (Fire Geometry), 8.0e15 (View Cargo-Geometry), 1.3e16 (View Pilot-Geometry), 1.5e16 (View Gunner-Geometry), 11000 and 11010.
:* Has approx. <b>14768</b> Poly's in most detailed LOD.
<b>UH60MGSkeleton</b> (has 34 Bones)
*velka vrtule
*mala vrtule
*otocvez
**otochlaven
***gatling_1
*alt
*alt2
*nm_alt
*nm_alt2
*mph (10)
*mph2
*vert_speed
*vert_speed2
*rpm
*rpm2
*horizont_dive
**horizont
*horizont2_dive
**horizont2
*kompas (20)
*kompas2
*hodinova
*hodinova2
*minutova
*minutova2
*damagehide
*rotorshaft
*dampers
*damper_rear
*elevator (30)
*horizont_dive2
*otocvez_1
**otochlaven_1
***gatling_2 (34)




== Links ==
----

Revision as of 17:18, 11 August 2007

The following is temporary...


This is my init.sqf file I use in all my missions. It correctly identifies in what context the init.sqf file is being run.

/* Synide 11/6/2007 v1.0 Things to note... If you are there at mission launch from that point on your 'Context' will always be 'MP_CLIENT' and will stay as such even when you respawn. If you are an 'MP_CLIENT' then you 'disconnect' from a continuing mission and select a new playable character or the same playable character you will become a 'JIP_CLIENT'. If you join an inprogress mission you will be a 'JIP_CLIENT' from that point till the mission ends. */ //init.sqf debug=false; if (isServer) then { if (isnull player) then {Context = "mp_server";}else{Context = "sp_server";}; }else{ if (isnull player) then {Context = "jip_client";}else{Context = "mp_client";}; }; call compile preprocessFileLineNumbers "scripts\common\init.sqf"; call compile preprocessFileLineNumbers format["scripts\%1\init.sqf",Context]; processInitCommands; finishMissionInit;

Things to note about the above for MP only.

  • If you are there at mission launch from that point on your 'Context' will always be 'MP_CLIENT' and will stay as such even when you respawn.
  • If you are an 'MP_CLIENT' then you 'disconnect' from the continuing mission and select a new playable character you will become a 'JIP_CLIENT'.
  • If you join an inprogress mission you will be a 'JIP_CLIENT' from that point till the mission ends.



Template:unsupported-doc


LOD Stuff

A typical 'character' model has approx. 16 LOD's.

10000 is the 'Stencil Shadow' LOD.

  • What is LOD 10010?

What is the 11000 LOD, seems to have approx. 1/3 of the Poly's of a 'Stencil Shadow' LOD.

What is LOD 11010?



Model Stuff

  • OFP2_ManSkeleton (has 75 Bones)
    • neck
      • neck1
        • head
          • lbrow
          • mbrow
          • rbrow
          • lmouth
          • mmouth
          • rmouth
          • eyelids (10)
          • llip
    • weapon
    • launcher
    • camera
    • spine
    • spine1
    • spine2
    • spine3
    • pelvis
    • leftshoulder (20)
    • leftarm
    • leftarmroll
    • leftforearm
    • leftforearmroll
    • lefthand
    • lefthandring
    • lefthandring1
    • lefthandring2
    • lefthandring3
    • lefthandpinky1 (30)
    • lefthandpinky2
    • lefthandpinky3
    • lefthandmiddle1
    • lefthandmiddle2
    • lefthandmiddle3
    • lefthandindex1
    • lefthandindex2
    • lefthandindex3
    • lefthandthumb1
    • lefthandthumb2 (40)
    • lefthandthumb3
    • rightshoulder
    • rightarm
    • rightarmroll
    • rightforearm
    • rightforearmroll
    • righthand
    • righthandring
    • righthandring1
    • righthandring2 (50)
    • righthandring3
    • righthandpinky1
    • righthandpinky2
    • righthandpinky3
    • righthandmiddle1
    • righthandmiddle2
    • righthandmiddle3
    • righthandindex1
    • righthandindex2
    • righthandindex3 (60)
    • righthandthumb1
    • righthandthumb2
    • righthandthumb3
    • leftupleg
    • leftuplegroll
    • leftleg
    • leftlegroll
    • leftfoot
    • lefttoebase
    • rightupleg (70)
    • rightuplegroll
    • rightleg
    • rightlegroll
    • rightfoot
    • righttoebase (75)

M1_Abrams.p3d

  • Has 19 LOD's.
  • 1,2,3.5,7,10,15,20,1000,1200,10000,10010, 1.0e13 (Geometry), 1.0e15 (Memory), 2.0e15 (LandContact), 5.0e15 (Hitpoints), 6.0e15 (View Geometry), 7.0e15 (Fire Geometry),11000 and 11010.
  • The first LOD in the file (which ever LOD that might be...) has 6302 Poly's.
This first LOD has 20 Components
otochlaven (has 735 selected faces)
otocvez (has 1634 selected faces)
zasleh (has 1 selected face)
otocvelitele (has 651 selected faces)
poklop_commander (has 432 selected faces)
poklop_gunner (has 170 selected faces)
proxy:\ca\temp\proxies\abrams\gunner.01
proxy:\ca\wheeled\flag_alone.01
proxy:\ca\temp\proxies\abrams\commander.01
otochlavenvelitele (has 2668 selected faces)
feedtray_cover (has 85 selected faces)
bolt (has 6 selected faces)
charging_handle (has 50 selected faces)
\ca\weapons\m2_static.01 (has 1158 selected faces)
zasleh_1 (has 1 selected face)
telo (has 6297 selected faces)
damagehide (has 792 selected faces)
damagevez (has 317 selected faces)
proxy:\ca\weapons\zasleh2_proxy.001 (has 1 selected face)
proxy:\ca\weapons\zasleh2_proxy.002 (has 1 selected face)
  • Has 1 property. (lodnoshadow=1)


M1A1Skeleton (has 81 Bones)

  • koll1
  • koll2
  • koll3
  • koll4
  • koll5
  • koll6
  • koll7
  • koll8
  • kolp1
  • kolp2 (10)
  • kolp3
  • kolp4
  • kolp5
  • kolp6
  • kolp7
  • kolp8
  • podkolol1
    • kolol1
    • podkolol1_hide
  • podkolol2 (20)
    • kolol2
    • podkolol2_hide
  • podkolol3
    • kolol3
    • podkolol3_hide
  • podkolol4
    • kolol4
    • podkolol4_hide
  • podkolol5
    • kolol5 (30)
    • podkolol5_hide
  • podkolol6
    • kolol6
    • podkolol6_hide
  • podkolol7
    • kolol7
    • podkolol7_hide
  • podkolol8
    • kolol8
    • podkolol8_hide (40)
  • podkolop1
    • kolop1
    • podkolop1_hide
  • podkolop2
    • kolop2
    • podkolop2_hide
  • podkolop3
    • kolop3
    • podkolop3_hide
  • podkolop4 (50)
    • kolop4
    • podkolop4_hide
  • podkolop5
    • kolop5
    • podkolop5_hide
  • podkolop6
    • kolop6
    • podkolop6_hide
  • podkolop7
    • kolop7 (60)
    • podkolop7_hide
  • podkolop8
    • kolop8
    • podkolop8_hide
  • ukaz_rychlo
  • ukaz_rychlo2
  • ukaz_rpm
  • ukaz_radar
  • hodinova
  • minutova (70)
  • kompas
  • ukazsmer
  • damagehide
  • otocvez
    • otochlaven
    • otocvelitele
      • otochlavenvelitele
      • poklop_commander
    • poklop_gunner
    • damagevez (80)
  • poklop_driver


Animation Selections (61 in total)

No. AnimSelection AnimSource
[0] damageHide damage
[1] HatchDriver hatchDriver
[2] Wheel_kolL1 wheelL
[3] Wheel_koloL1 wheelL
[4] Wheel_podkoloL1 damper
[5] Wheel_kolP1 wheelR
[6] Wheel_koloP1 wheelR
[7] Wheel_podkoloP1 damper
[8] Wheel_kolL2 wheelL
[9] Wheel_kolP2 wheelR
[10] Wheel_koloL2 wheelL
[11] Wheel_koloL3 wheelL
[12] Wheel_koloL4 wheelL
[13] Wheel_koloL5 wheelL
[14] Wheel_koloL6 wheelL
[15] Wheel_koloL7 wheelL
[16] Wheel_koloP2 wheelR
[17] Wheel_koloP3 wheelR
[18] Wheel_koloP4 wheelR
[19] Wheel_koloP5 wheelR
[20] Wheel_koloP6 wheelR
[21] Wheel_koloP7 wheelR
[22] Wheel_podkoloL2 damper
[23] Wheel_podkoloL3 damper
[24] Wheel_podkoloL4 damper
[25] Wheel_podkoloL5 damper
[26] Wheel_podkoloL6 damper
[27] Wheel_podkoloL7 damper
[28] Wheel_podkoloL8 damper
[29] Wheel_podkoloP2 damper
[30] Wheel_podkoloP3 damper
[31] Wheel_podkoloP4 damper
[32] Wheel_podkoloP5 damper
[33] Wheel_podkoloP6 damper
[34] Wheel_podkoloP7 damper
[35] Wheel_podkoloP8 damper
[36] podkoloL1_hide_damage damage
[37] podkoloL2_hide_damage damage
[38] podkoloL3_hide_damage damage
[39] podkoloL4_hide_damage damage
[40] podkoloL5_hide_damage damage
[41] podkoloL6_hide_damage damage
[42] podkoloL7_hide_damage damage
[43] podkoloL8_hide_damage damage
[44] podkoloP1_hide_damage damage
[45] podkoloP2_hide_damage damage
[46] podkoloP3_hide_damage damage
[47] podkoloP4_hide_damage damage
[48] podkoloP5_hide_damage damage
[49] podkoloP6_hide_damage damage
[50] podkoloP7_hide_damage damage
[51] podkoloP8_hide_damage damage
[52] damageVez damage
[53] MainTurret mainTurret
[54] MainGun mainGun
[55] ObsTurret obsTurret
[56] ObsGun obsGun
[57] HatchCommander hatchCommander
[58] OtocVelitele_damage damage
[59] poklop_commander_damage damage
[60] poklop_driver_damage damage



UH_60MG.p3d

Basically a good Air Model should have about 8 LOD's + the necessary LOD's.

  • Has 24 LOD's.
  • 1,2,3,4,5,6,7,8, 1000, 1100, 1200, 10000, 10010, 1.0e13 (Geometry), 1.0e15 (Memory), 2.0e15 (LandContact), 5.0e15 (Hitpoints), 6.0e15 (View Geometry), 7.0e15 (Fire Geometry), 8.0e15 (View Cargo-Geometry), 1.3e16 (View Pilot-Geometry), 1.5e16 (View Gunner-Geometry), 11000 and 11010.
  • Has approx. 14768 Poly's in most detailed LOD.

UH60MGSkeleton (has 34 Bones)

  • velka vrtule
  • mala vrtule
  • otocvez
    • otochlaven
      • gatling_1
  • alt
  • alt2
  • nm_alt
  • nm_alt2
  • mph (10)
  • mph2
  • vert_speed
  • vert_speed2
  • rpm
  • rpm2
  • horizont_dive
    • horizont
  • horizont2_dive
    • horizont2
  • kompas (20)
  • kompas2
  • hodinova
  • hodinova2
  • minutova
  • minutova2
  • damagehide
  • rotorshaft
  • dampers
  • damper_rear
  • elevator (30)
  • horizont_dive2
  • otocvez_1
    • otochlaven_1
      • gatling_2 (34)