Rtm (Animation) File Format: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Added disclaimer.)
 
(21 intermediate revisions by 7 users not shown)
Line 1: Line 1:
{{unsupported-doc}}
{{Feature|UnsupportedDoc}}


==Animations==
== Binary Format ==


To help understand the contents of the file format, a brief idea of what animations are, is in order.
For binary rtm's see [[Rtm Binarised File Format]]
An animation takes a <u>collection</u> of p3d files (picture-3d files) and displays them all-at-once as a 'frame'.
== Conventions ==


Any given p3d consists of say, a head, an arm, a leg, a foot. Together, they make up the the total view, the 'frame'. Each of these pictures which make up the frame, contain information on how to display that picture. Eg, it's orientation. As such, the specific p3d and the specific information about that p3d is termed a <u>component</u>.
see [[Generic FileFormat Data Types]]


Components, make up a frame.
== Animations ==


Each frame (a collection of pictures, a collection of 'components') also contains a single value of how long to display that frame until moving to the next frame (if any). ALL frames contain the exact same pictures but with differing orientations.
*RTM files are applied to any P3d that has a 'skeleton'. Not ALL p3d's have them.
 
*The appropriately termed 'skeleton' consists of 'bones' such as heads, arms, legs, feet, doors.
 
*The skeleton as such, is not used by an rtm file. Part, or all, of the bones of the skeleton are.
 
*An rtm frame consists of a collection of bones. Each frame contains identical bones but each of those bones are individually displayed at differing orientations.
*The same rtm file can be applied to different p3d's on the assumption of course that the bone names in each of those p3d's are identical. This would be reasonable for a collection of soldiers eg.


And so:
And so:


===Conventions===
byte = 1 char = 8 bits
ulong = unsigned long, 4 bytes
ushort= unsigned short 2 bytes
asciiz= variable length zero terminated string.
float= 4byte (single precision)


==struct==
== RtmFile ==
RtmFile
{
  char[8] "RTM_MDAT" //optional. Must appear 1st see frame properties. These are not asciiz
  char[8] "RTM_0101"; //mandatory
};
 
== RTM_MDAT ==
Introduced at arma3
Properties
{
  char    "RTM_MDAT"
  ulong  Zeroes;
  ulong  nFrameProperties;
  Property[nFrameProperties];
};
 
=== Property ===
{
  float phase;
  lAsciiz* name;
  lAsciiz* value;
}
==== lAscii ====
{
  byte nChars  // there is no null char 'byte' might be a compressed byte (see flashpoint strings)
  char [nChars];// there is no null char
]


  struct RtmFile
== RTM_0101 ==
  RtmData
  {
  {
   byte Signature[8]; // "RTM_0101" note. This is not asciiz
   char      "RTM_0101"
   float Vertex[3];   // Total Moving XZY at 0,0,0 'soldier' runs in same spot.
   XYZTriplet Vertex;               // Total Moving XZY. At 0,0,0 'soldier' runs in same spot.
   ulong TotalFrames; // Self Explanatory?
   ulong     nFrames;               // Self Explanatory?
   ulong nPictures;   // (Number of) Pictures in any frame. All have same amount.
   ulong     nBones;               //
   Asciiz P3dNames[nPictures][32]; // Asciiz filenames of p3d picture files.
   BoneName  BoneNames[nBones];     //  
                                  // All, in fixed 32 byte records
   RtmFrame   Frames[nFrames];
                                  // The .p3d extension is default (not stored)
};
   struct Frame1
 
   (
The number of frames (and bones in each frame) extend to the end of file. There is no checksum or end of file signature.
  float FrameTime; // Values 0.0 to 1.0
 
  /* Represents a percentage of 'time' relative to the ''total'' time taken to display all frames.
=== BoneName ===
  ** The overall time is ''not'' indicated in the rtm. External sources cause the 'frames' to move 
char BoneName[32];   //fixed 32 byte record for each bone. NOT asciiz
  ** fast, or slow, or whatever. See note4 below
 
  */
=== RtmFrame ===
    struct Component1
RtmFrame
    {
(
    asciiz P3dName[32];     //Identical to the same name in the list above
  float         FrameTime; // Values 0.0 to 1.0
                            //(and in same relative order)
  BoneTransform Bone[nBones];
    float Transform[4][3]; //The orientation of the model. See note1 below.
    };
    .....
    ComonentLast{...}; // as per the nPicture value above
  };
  more Frames{...};
  FrameLast{..}        // as per the nTotalFrames value above
  };
  };
=== Frametime ===


===Note1 Transform[4][3]===
Represents a percentage of 'time' relative to the ''total'' time taken to display all frames.
The overall time is ''not'' indicated in the rtm. External sources cause the 'frames' to move 
fast, or slow, or whatever.


This is the transform matrix used directly by Micro$oft DirectX engines.
This is one of those parameters that are easy to understand, and difficult to explain.
 
The value represents percentage of the expiry time for the '''entire''' frameset.
 
Given ten frames, all of which you want displayed for the same amount of time. the frametime value would progress, 0,0.1,0.2,0.3 etc, not, as would be intuitive, 0.1,0.1,0.1,0.1.........
 
==== BoneTransform ====
BoneTransform
{
  BoneName  BoneName;      //Identical to that found in header above, and in same relative order
  Transform  Transform;    //The orientation of the model.
};
 
The exact same number of bonesis specified inside every Frame, as per the initial list in exactly the same order. In effect, naming again, in every component, in every frame is redundant. This has since been corrected in the binarised rtm version.
 
===== Transform =====
Transform
{
  XYZTriplet Triplet[4]; // eg float[4][3]
};
 
This is the transform matrix used directly by Microsoft DirectX engines.


In fact, the 'correct' matrix is actually 4 x 4, but the last column always represents 0,0,0,1 thus
In fact, the 'correct' matrix is actually 4 x 4, but the last column always represents 0,0,0,1 thus
Line 65: Line 111:
and so is never stored.  
and so is never stored.  


This identical matrix is used for WRP files (both formats) and RTM files.
similar Transform matrices are used for WRP and P3d files as well.


The last row (M41...) happens to be the position of the object X Z Y co-ordinates, and is often referred to separately.
The last row (M41...) happens to be the position of the object X Z Y co-ordinates, and is often referred to separately.
Line 71: Line 117:
For further information visit  
For further information visit  


[http://msdn.microsoft.com/library/default.asp?url=/library/en-us/directx9_c/directx/graphics/programmingguide/fixedfunction/transforms/transforms.asp Microsoft]
{{Link|https://msdn.microsoft.com/en-us/library/windows/desktop/bb206269.aspx|Microsoft Transforms (Direct3D 9)}}


===Note2===
== Examples ==
The exact same number of Components is specified inside every Frame, as per the initial p3d list in exactly the same order. In effect, naming the p3d file again, in every component, in every frame is redundant.


Bonenames apply to p3d models that have skeleton structure. This, chiefly, to class man objects (soldiers, civilians, etc). They are internal to the engines.


===Note3===
There are 25 bone names in ofp, and 65 in arma1.
The number of frames (and components in each frame) extend to the end of file. There is no checksum or end of file signature.


===Note4 Frametime===
=== Ofp ===
This is one of those paramaters that are easy to understand, and difficult to explain.
            hlava(Head)
 
            krk(Neck)
The value represents percentage of the expiry time for the '''entire''' frameset.
            zebra(Spine) //ribs
 
            hrudnik(Spine1 2 or 3) //chest
Given ten frames, all of which you want displayed for the same amount of time. the frametime value would progress, 0,0.1,0.2,0.3 etc, not, as would be intuitive, 0.1,0.1,0.1,0.1.........
            bricho(Pelvis) //abdomen
lrameno(LeftShoulder) prameno(RightShoulder)
lbiceps(LeftArm)      pbiceps(RightArm)
lloket(LeftForeArm)  ploket(RightForeArm)
lruka(LeftHand)      pruka(RightHand) //right fist
lprsty(LeftHand)      pprsty(RightHand) //left right fingers
lstehno(LeftUpLeg)    pstehno(RightUpLeg)
lholen(LeftLeg)      pholen(RightLeg) // lower legs
lchodidlo(LeftFoot)  pchodidlo(RightFoot)
lzadek                pzadek          // right buttock
            zbran(weapon)  //primary weapon proxy
            roura(launcher) //secondary weapon proxy


[[category:Operation Flashpoint: Addons]]
=== Arma ===
          Head
          Neck
          Neck1
          Spine
          Spine1
          Spine2
          Spine3
          Pelvis
LeftShoulder  RightShoulder
LeftArm      RightArm
LeftArmRoll  RightArmRoll
LeftForeArm  RightForeArm
LeftForeArmRoll RightForeArmRoll
LeftHand      RightHand
LeftHandThumb1  RightHandThumb1
LeftHandThumb2  RightHandThumb2
LeftHandThumb3  RightHandThumb3
LeftHandIndex1  RightHandIndex1
LeftHandIndex2  RightHandIndex2
LeftHandIndex3  RightHandIndex3
LeftHandMiddle1 RightHandMiddle1
LeftHandMiddle2 RightHandMiddle2
LeftHandMiddle3 RightHandMiddle3
LeftHandRing    RightHandRing
LeftHandRing1  RightHandRing1
LeftHandRing2  RightHandRing2
LeftHandRing3  RightHandRing3
LeftHandPinky1  RightHandPinky1
LeftHandPinky2  RightHandPinky2
LeftHandPinky3  RightHandPinky3
LeftUpLeg              RightUpLeg
LeftUpLegRoll          RightUpLegRoll
LeftLeg                RightLeg
LeftLegRoll            RightLegRoll
LeftFoot(pchodidlo)    RightFoot
LeftToeBase            RightToeBase
            weapon
            launcher
            camera


[[category:Operation Flashpoint: Modelling]]
{{GameCategory|ofp|Modelling}}
[[Category:BIS_File_Formats]]

Latest revision as of 06:38, 20 January 2024

bi symbol white.png
Disclaimer: This page describes internal undocumented structures of Bohemia Interactive software.

This page contains unofficial information.

Some usage of this information may constitute a violation of the rights of Bohemia Interactive and is in no way endorsed or recommended by Bohemia Interactive.
Bohemia Interactive is not willing to tolerate use of such tools if it contravenes any general licenses granted to end users of this community wiki or BI products.

Binary Format

For binary rtm's see Rtm Binarised File Format

Conventions

see Generic FileFormat Data Types

Animations

  • RTM files are applied to any P3d that has a 'skeleton'. Not ALL p3d's have them.
  • The appropriately termed 'skeleton' consists of 'bones' such as heads, arms, legs, feet, doors.
  • The skeleton as such, is not used by an rtm file. Part, or all, of the bones of the skeleton are.
  • An rtm frame consists of a collection of bones. Each frame contains identical bones but each of those bones are individually displayed at differing orientations.
  • The same rtm file can be applied to different p3d's on the assumption of course that the bone names in each of those p3d's are identical. This would be reasonable for a collection of soldiers eg.

And so:


RtmFile

RtmFile 
{
 char[8] "RTM_MDAT"	//optional. Must appear 1st see frame properties. These are not asciiz
 char[8] "RTM_0101"; //mandatory 
};

RTM_MDAT

Introduced at arma3

Properties
{
 char    "RTM_MDAT"
 ulong   Zeroes;
 ulong   nFrameProperties;
 Property[nFrameProperties];
};

Property

{
 float		phase;
 lAsciiz*	name;
 lAsciiz*	value;
}

lAscii

{
  byte nChars   // there is no null char 'byte' might be a compressed byte (see flashpoint strings)
  char [nChars];// there is no null char
]

RTM_0101

RtmData 
{
 char       "RTM_0101"
 XYZTriplet Vertex;                // Total Moving XZY. At 0,0,0 'soldier' runs in same spot.
 ulong      nFrames;               // Self Explanatory?
 ulong      nBones;                //
 BoneName   BoneNames[nBones];     // 
 RtmFrame   Frames[nFrames];
};

The number of frames (and bones in each frame) extend to the end of file. There is no checksum or end of file signature.

BoneName

char BoneName[32];   //fixed 32 byte record for each bone. NOT asciiz

RtmFrame

RtmFrame
(
  float          FrameTime; // Values 0.0 to 1.0
  BoneTransform  Bone[nBones];
};

Frametime

Represents a percentage of 'time' relative to the total time taken to display all frames. The overall time is not indicated in the rtm. External sources cause the 'frames' to move fast, or slow, or whatever.

This is one of those parameters that are easy to understand, and difficult to explain.

The value represents percentage of the expiry time for the entire frameset.

Given ten frames, all of which you want displayed for the same amount of time. the frametime value would progress, 0,0.1,0.2,0.3 etc, not, as would be intuitive, 0.1,0.1,0.1,0.1.........

BoneTransform

BoneTransform
{
  BoneName   BoneName;      //Identical to that found in header above, and in same relative order
  Transform  Transform;     //The orientation of the model.
};

The exact same number of bonesis specified inside every Frame, as per the initial list in exactly the same order. In effect, naming again, in every component, in every frame is redundant. This has since been corrected in the binarised rtm version.

Transform
Transform
{
  XYZTriplet Triplet[4]; // eg float[4][3]
};

This is the transform matrix used directly by Microsoft DirectX engines.

In fact, the 'correct' matrix is actually 4 x 4, but the last column always represents 0,0,0,1 thus

M11,M12 M13 (0.0)
M21,M22,M23 (0.0)
M31,M32,M33 (0.0)
M41,M42,M43 (1.0)

and so is never stored.

similar Transform matrices are used for WRP and P3d files as well.

The last row (M41...) happens to be the position of the object X Z Y co-ordinates, and is often referred to separately.

For further information visit

Microsoft Transforms (Direct3D 9)

Examples

Bonenames apply to p3d models that have skeleton structure. This, chiefly, to class man objects (soldiers, civilians, etc). They are internal to the engines.

There are 25 bone names in ofp, and 65 in arma1.

Ofp

           hlava(Head)
           krk(Neck)
           zebra(Spine) //ribs
           hrudnik(Spine1 2 or 3) //chest
            bricho(Pelvis) //abdomen
lrameno(LeftShoulder) prameno(RightShoulder)
lbiceps(LeftArm)      pbiceps(RightArm)
lloket(LeftForeArm)   ploket(RightForeArm)
lruka(LeftHand)       pruka(RightHand) //right fist
lprsty(LeftHand)      pprsty(RightHand) //left right fingers
lstehno(LeftUpLeg)    pstehno(RightUpLeg)
lholen(LeftLeg)       pholen(RightLeg) // lower legs
lchodidlo(LeftFoot)   pchodidlo(RightFoot)
lzadek                pzadek          // right buttock
           zbran(weapon)   //primary weapon proxy
           roura(launcher) //secondary weapon proxy

Arma

          Head
          Neck
          Neck1
          Spine
          Spine1
          Spine2
          Spine3
          Pelvis
LeftShoulder  RightShoulder
LeftArm       RightArm
LeftArmRoll   RightArmRoll
LeftForeArm   RightForeArm
LeftForeArmRoll RightForeArmRoll
LeftHand      RightHand
LeftHandThumb1  RightHandThumb1
LeftHandThumb2  RightHandThumb2
LeftHandThumb3  RightHandThumb3
LeftHandIndex1  RightHandIndex1
LeftHandIndex2  RightHandIndex2
LeftHandIndex3  RightHandIndex3
LeftHandMiddle1 RightHandMiddle1
LeftHandMiddle2 RightHandMiddle2
LeftHandMiddle3 RightHandMiddle3
LeftHandRing    RightHandRing
LeftHandRing1   RightHandRing1
LeftHandRing2   RightHandRing2
LeftHandRing3   RightHandRing3
LeftHandPinky1  RightHandPinky1
LeftHandPinky2  RightHandPinky2
LeftHandPinky3  RightHandPinky3
LeftUpLeg              RightUpLeg
LeftUpLegRoll          RightUpLegRoll 
LeftLeg                RightLeg
LeftLegRoll            RightLegRoll
LeftFoot(pchodidlo)    RightFoot
LeftToeBase            RightToeBase
           weapon
           launcher
           camera