Difference between revisions of "FB00791E"

From SimsWiki
Jump to: navigation, search
m
 
(13 intermediate revisions by 3 users not shown)
Line 10: Line 10:
 
=== ANIM header ===
 
=== ANIM header ===
 
   
 
   
7BITSTR "cAnimResourceConst"
+
7BITSTR "cAnimResourceConst"
Standard [[RCOL|Scenegraph]] followed by custom Animation header.
+
;Standard [[RCOL|Scenegraph]] followed by custom Animation header.
 
  DWORD Block ID (0xFB00791E)
 
  DWORD Block ID (0xFB00791E)
 
  DWORD version (6)
 
  DWORD version (6)
  -- insert cSGResource
+
  ;-- insert cSGResource
 
+
;Custom Animation Header  
Custom Animation Header:
+
 
  DWORD data length
 
  DWORD data length
 
  WORD Total Length of Animation (probably in Milliseconds or Frames)
 
  WORD Total Length of Animation (probably in Milliseconds or Frames)
 
  WORD count1  count to a list of object modifiers
 
  WORD count1  count to a list of object modifiers
 
  WORD count2  Count for part 7
 
  WORD count2  Count for part 7
  BYTE ""ObjectModifierLength"" (this is the count for the 2nd string below is non null)
+
  BYTE [0] ""ObjectModifierLength"" (this is the count for the 2nd string below if is non null)
  '''BYTE 6'''
+
  BYTE [1] Version (Base game+EP1 version 6, EP2-SP2 version 7)
  BYTE Animation Type(4 Object Overlay Animations, 5 Object Animation, 6 Body Overlay Animations, 7 Body Animation)
+
  BYTE [2] Animation Type(4 Object Overlay Animations, 5 Object Animation, 6 Body Overlay Animations, 7 Body Animation)
  '''BYTE 0,2,3,5'''
+
  '''BYTE [3]''' UNKNOWN
  BYTE Locomotion type index (values 0 none, 1 pose, 6 turnAndGo, 7 turnAndStop, 8 turnInPlace, 9 step , 10 stepInPlace, 11-19 walktypes, 30-38 blends for the types in 11-19)
+
  BYTE [4] Locomotion type index (values 0 none, 1 pose, 6 turnAndGo, 7 turnAndStop, 8 turnInPlace, 9 step , 10 stepInPlace, 11-19 walktypes, 30-38 blends for the types in 11-19)
  BYTE ""ObjectNameLength""
+
  BYTE [5] ""ObjectNameLength""
 
  16 BYTES - FILLER (from old version) (0X11BA05F0)
 
  16 BYTES - FILLER (from old version) (0X11BA05F0)
  FLOAT Direction(in radians)
+
  FLOAT [0] Initial Direction(in radians)
  '''FlOAT UNKNOWN'''
+
  '''FlOAT [1] UNKNOWN(non-zero in locomotion animations where it seems to correlate with the magnitude of the step)'''
  '''FlOAT UNKNOWN'''
+
  '''FlOAT [2] UNKNOWN(non-zero in locomotion animations values vary with skeleton size and step)'''
  '''FlOAT UNKNOWN'''
+
  '''FlOAT [3] UNKNOWN(usually 0 or 0.5)'''
  '''FlOAT UNKNOWN'''
+
  '''FlOAT [4] UNKNOWN(non-zero in locomotion animations values usually in thousandths, correlate closely to next float)'''
  '''FlOAT UNKNOWN'''
+
  '''FlOAT [5] UNKNOWN(non-zero in locomotion animations values usually in thousandths, correlate closely to previous float)'''
  '''FlOAT UNKNOWN'''
+
  FlOAT [6] Final Direction(in radians)
  '''FlOAT UNKNOWN'''
+
  FlOAT [7] Skeleton Scale
  '''FLOAT Height?(in standing animations, correlates very closely to height of the root_trans of the skeleton, otherwise 0 or -1)'''
+
  '''FLOAT [8] Height?(in standing animations, correlates very closely to height of the root_trans of the skeleton, otherwise 0 or -1)'''
 
  ZDSTR Object Name (first object name)
 
  ZDSTR Object Name (first object name)
 
  '''ZDSTR Object Modifier string (looks like code to add to a output file always starts out "\nuser_data=")'''
 
  '''ZDSTR Object Modifier string (looks like code to add to a output file always starts out "\nuser_data=")'''
Line 43: Line 42:
 
  the logic used for this is explained below
 
  the logic used for this is explained below
  
 
+
=== P1: Object ===
=== Object ===
+
  
 
  -Repetition count1
 
  -Repetition count1
Line 60: Line 58:
 
  the logic used for this is explained below
 
  the logic used for this is explained below
  
=== Assignment ===
+
=== P2: Assignment ===
  
 
  -repetition all the count's in part 1 added together
 
  -repetition all the count's in part 1 added together
Line 75: Line 73:
 
  the logic used for this is explained below
 
  the logic used for this is explained below
  
=== Movements ===
+
=== P3: Movements ===
  
 
  -repetition (total repetitions are calculated by adding the top 3 bits of all Anim flags from part 2)
 
  -repetition (total repetitions are calculated by adding the top 3 bits of all Anim flags from part 2)
Line 82: Line 80:
 
  DWORD - FILLER (from old version)
 
  DWORD - FILLER (from old version)
  
=== Transforms ===
+
=== P4: Transforms ===
  
 
This Block represents the Transformation Data. Each "Part 4" Block contains all  
 
This Block represents the Transformation Data. Each "Part 4" Block contains all  
Line 118: Line 116:
 
  '''offset + 3 : (optional, likely OutTangents)'''
 
  '''offset + 3 : (optional, likely OutTangents)'''
  
=== Part 5 ===
+
=== P5 ===
  
 
  -repetition  (total repetitions are calculated by adding the lower 6( or less?) bits of all part5_count from part 1)
 
  -repetition  (total repetitions are calculated by adding the lower 6( or less?) bits of all part5_count from part 1)
 
  8 BYTES - FILLER (from old version)
 
  8 BYTES - FILLER (from old version)
  '''WORD unknown'''
+
  WORD - Unknown
  BYTE count
+
  BYTE - Count of P6 Items
  '''55 unknown'''
+
  BYTE  - Unknown
 +
DWORD - Unknown
 +
BYTE  - Unknown
 +
DWORD - Unknown
 +
BYTE  - Unknown
 +
DWORD - Unknown
 +
DWORD - CRC32
 +
BYTE  - Unknown
 +
DWORD - CRC32
 +
BYTE  - Unknown
 +
DWORD - CRC32
 +
BYTE  - Unknown
 +
DWORD - CRC32
 +
BYTE  - Unknown
 +
DWORD - CRC32 from P2 names
 +
BYTE  - Unknown
 +
DWORD - Unknown
 +
BYTE  - Unknown
 +
DWORD - Unknown
 +
BYTE  - Unknown
 +
DWORD - CRC32 from P2 names
 +
BYTE  - Unknown
 
  DWORD - FILLER (from old version)
 
  DWORD - FILLER (from old version)
  
=== Part 6 ===
+
=== P6 ===
  
 
  -repetition  (for each count in Part 5)
 
  -repetition  (for each count in Part 5)
 
  8 BYTES - FILLER (from old version)
 
  8 BYTES - FILLER (from old version)
  '''35 unknown'''
+
  WORD  - Unknown
 +
WORD  - Index to P5 item
 +
BYTE  - Count
 +
DWORD - CRC32 of an IK target node name
 +
BYTE  - Unknown
 +
DWORD - CRC32 of an IK target node name
 +
BYTE  - Unknown
 +
DWORD - CRC32 from P2 names
 +
BYTE  - Unknown
 +
DWORD - CRC32 from P2 names
 +
BYTE  - Unknown
 +
DWORD - CRC32 from P2 names
 +
BYTE  - Unknown
 +
DWORD - CRC32 from P2 names
 +
BYTE  - Unknown
  
=== Events ===
+
=== P7: Events ===
 
This on the end of the file if count2 in the header is non zero.
 
This on the end of the file if count2 in the header is non zero.
  
Line 139: Line 172:
 
  DWORD - FILLER (from old version)
 
  DWORD - FILLER (from old version)
 
  WORD TimeCode
 
  WORD TimeCode
  WORD Type (ex. 8=Effect, 1014=Sound, )
+
  WORD Type (ex. 8=Effect, 1014=Sound, 1005=Behavioural event)
  '''WORD unknown'''
+
  WORD Length of event assignment string
 
  DWORD - FILLER (from old version)
 
  DWORD - FILLER (from old version)
 
   
 
   
Line 159: Line 192:
 
*Also note that the odd value must not be divisible by 4 but only by 2.
 
*Also note that the odd value must not be divisible by 4 but only by 2.
 
*If length =16 then no array needs to be added as the total length is already divisible by 4.
 
*If length =16 then no array needs to be added as the total length is already divisible by 4.
*If length =17 then one byte{0} must be added to the file to bring it up to a even WORD(total length divisible by 2 but not 4). [[Category:Modding]]
+
*If length =17 then one byte{0} must be added to the file to bring it up to a even WORD(total length divisible by 2 but not 4).  
 +
 
 +
[[Category:Sims 2 Modding]]

Latest revision as of 13:06, 17 September 2012

FB00791E
Short name: ANIM
Long name: Animation


This is a type of Scenegraph block that controls animation in Objects and Sims.

Contents

[edit] File Format

[edit] ANIM header

7BITSTR "cAnimResourceConst"
;Standard Scenegraph followed by custom Animation header.
DWORD Block ID (0xFB00791E)
DWORD version (6)
;-- insert cSGResource
;Custom Animation Header 
DWORD data length
WORD Total Length of Animation (probably in Milliseconds or Frames)
WORD count1  count to a list of object modifiers
WORD count2  Count for part 7
BYTE [0] ""ObjectModifierLength"" (this is the count for the 2nd string below if is non null)
BYTE [1] Version (Base game+EP1 version 6, EP2-SP2 version 7)
BYTE [2] Animation Type(4 Object Overlay Animations, 5 Object Animation, 6 Body Overlay Animations, 7 Body Animation)
BYTE [3] UNKNOWN
BYTE [4] Locomotion type index (values 0 none, 1 pose, 6 turnAndGo, 7 turnAndStop, 8 turnInPlace, 9 step , 10 stepInPlace, 11-19 walktypes, 30-38 blends for the types in 11-19)
BYTE [5] ""ObjectNameLength""
16 BYTES - FILLER (from old version) (0X11BA05F0)
FLOAT [0] Initial Direction(in radians)
FlOAT [1] UNKNOWN(non-zero in locomotion animations where it seems to correlate with the magnitude of the step)
FlOAT [2] UNKNOWN(non-zero in locomotion animations values vary with skeleton size and step)
FlOAT [3] UNKNOWN(usually 0 or 0.5)
FlOAT [4] UNKNOWN(non-zero in locomotion animations values usually in thousandths, correlate closely to next float)
FlOAT [5] UNKNOWN(non-zero in locomotion animations values usually in thousandths, correlate closely to previous float)
FlOAT [6] Final Direction(in radians)
FlOAT [7] Skeleton Scale
FLOAT [8] Height?(in standing animations, correlates very closely to height of the root_trans of the skeleton, otherwise 0 or -1)
ZDSTR Object Name (first object name)
ZDSTR Object Modifier string (looks like code to add to a output file always starts out "\nuser_data=")

there can be between 0 and 3 bytes here (00 01 02)
the logic used for this is explained below

[edit] P1: Object

-Repetition count1
8 BYTES  - FILLER (from old version)
WORD
WORD count
WORD part5_count
WORD length of blend`s name.
12 BYTES - FILLER (from old version)

-repetition count1
ZDSTR seems to be a list of objects to blend with 1st object

there can be between 0 and 3 bytes here (00 01 02)
the logic used for this is explained below

[edit] P2: Assignment

-repetition all the count's in part 1 added together
8 BYTES - FILLER (from old version)
DWORD - CRC32 of the bone/joint/blend's name
DWORD - FILLER (from old version)
DWORD - Anim Flags (Highest 3 Bits (Bit 31-29) contain the Number of "Part 3" Items, Bits 23-16 describe the Transformation Type (0=Translation, C=Rotation).) Bits 0-15 of this are the time of the animation for this bone with the highest bit (15) set. 
DWORD - FILLER (from old version)

-repetition all the count's in part 1 added together
ZDSTR seems to be a list of transforms and rotations

there can be between 0 and 3 bytes here (00 01 02)
the logic used for this is explained below

[edit] P3: Movements

-repetition (total repetitions are calculated by adding the top 3 bits of all Anim flags from part 2)
WORD - number of frames
WORD - type of bone (bits 0 and 1) plus how many shorts per part 4 block (bits 2 and 3)
DWORD - FILLER (from old version)

[edit] P4: Transforms

This Block represents the Transformation Data. Each "Part 4" Block contains all transformations for a specific Axis, ordered by TimeCode. So you can animate the diffrent Axis independently!!

The count for this section is derived with the following code. The code is used on each Unknown1 and 2 in part 3 it uses the 1st, 2nd and 5th bits of Unknown2 then multiplying by Unknown1.

int mult=0;

switch(p3.Unk2&3)
{
  case 0:
	mult=1;
	break;
 case 1:
	mult=3;
	break;
 case 2:
	mult=4;
	break;
}

if ((p3.Unk2&16)!=0)
  mult++;

size=(p3.Unk1*mult);


-repetition See above code WORD seems to be compressed floats. The Values here are stored in Blocks (Number of values per Block = mult). The offset index for a Block can be calculated by offset=mult*blocknr. Here is what we know so far about the Block Structure:

offset + 0 : TimeCode (when should the stored Transformation happen)
offset + 1 : (optional) Transformation Value (like the translation amount, or the rotation angle)
offset + 2 : (optional, likely InTangents)
offset + 3 : (optional, likely OutTangents)

[edit] P5

-repetition  (total repetitions are calculated by adding the lower 6( or less?) bits of all part5_count from part 1)
8 BYTES - FILLER (from old version)
WORD  - Unknown
BYTE  - Count of P6 Items
BYTE  - Unknown
DWORD - Unknown 
BYTE  - Unknown
DWORD - Unknown
BYTE  - Unknown
DWORD - Unknown
DWORD - CRC32
BYTE  - Unknown
DWORD - CRC32
BYTE  - Unknown
DWORD - CRC32
BYTE  - Unknown
DWORD - CRC32
BYTE  - Unknown
DWORD - CRC32 from P2 names
BYTE  - Unknown
DWORD - Unknown
BYTE  - Unknown
DWORD - Unknown
BYTE  - Unknown
DWORD - CRC32 from P2 names
BYTE  - Unknown
DWORD - FILLER (from old version)

[edit] P6

-repetition  (for each count in Part 5)
8 BYTES - FILLER (from old version)
WORD  - Unknown
WORD  - Index to P5 item
BYTE  - Count 
DWORD - CRC32 of an IK target node name
BYTE  - Unknown 
DWORD - CRC32 of an IK target node name
BYTE  - Unknown
DWORD - CRC32 from P2 names
BYTE  - Unknown
DWORD - CRC32 from P2 names
BYTE  - Unknown
DWORD - CRC32 from P2 names
BYTE  - Unknown
DWORD - CRC32 from P2 names
BYTE  - Unknown

[edit] P7: Events

This on the end of the file if count2 in the header is non zero.

-repetition count2 from begining of file
DWORD - FILLER (from old version)
WORD TimeCode
WORD Type (ex. 8=Effect, 1014=Sound, 1005=Behavioural event)
WORD Length of event assignment string
DWORD - FILLER (from old version)

-repetition count2
ZDS - Event Assignment String

After each of the first 3 sets of text above there is generally an array of up to 3 bytes. This array is probably to bring the section to a specific word cut off. Logic is as follows:

if the length of the strings from the first letter to the end of the section is even the length must be brought up to a even DWORD if the length is odd the length must be brought up to a even WORD that is not also a DWORD

Examples:

  • If length =14 then an array of 2 bytes{0,1} must be added to bring it up to a even DWORD(total length divisible by 4).
  • If length =15 then an array of 3 bytes{0,1,2} must be added to bring it up to a even WORD(total length divisible by 2).
  • Also note that the odd value must not be divisible by 4 but only by 2.
  • If length =16 then no array needs to be added as the total length is already divisible by 4.
  • If length =17 then one byte{0} must be added to the file to bring it up to a even WORD(total length divisible by 2 but not 4).
Personal tools
Namespaces

Variants
Actions
Navigation
game select
Toolbox