Difference between revisions of "Sims 3:0x6B20C4F3"

From SimsWiki
Jump to: navigation, search
Line 4: Line 4:
 
These resources do not always hash from the animation name to the resource key.  Any age specifiers (a2p, t2o, etc) are converted to only reference adult or objects (a or o) respectively to generate the hash, and the high bit is stripped off.  This becomes the "default" animation if no age specific override is provided.  Age overrides are found by XORing an age mask with the high byte (Or the second high byte for the second actor in an animation).
 
These resources do not always hash from the animation name to the resource key.  Any age specifiers (a2p, t2o, etc) are converted to only reference adult or objects (a or o) respectively to generate the hash, and the high bit is stripped off.  This becomes the "default" animation if no age specific override is provided.  Age overrides are found by XORing an age mask with the high byte (Or the second high byte for the second actor in an animation).
  
<pre>
+
==Main Header==
--Main Header
+
Offsets in the main header are all based off the location of the offset value.  So an offset at byte 4 would point to 4 + offset.
DWORD - TID
+
DWORD - TID
DWORD offset // Offset of a linked clip - purpose unknown
+
DWORD offset // Offset of a linked clip - purpose unknown, always 0
DWORD size of _S3Clip_ Section
+
DWORD size of _S3Clip_ Section
--- Offset Table
+
  DWORD clipoffset // offset to _S3Clip_ section
5 DWORD offsets
+
DWORD slotoffset // Offset to actor/slot pair table
  index 0 - Offset to _S3Clip_
+
DWORD actoroffset // Offset to clip actor name (Null terminated string)
  index 1 - SIMoffset (Offset to #BLOCK)
+
DWORD eventoffset // Offset to clip event section
  index 2 - Offset to Object/Sim
+
DWORD // 0 or 2
  index 3 - Offset to =CE=
+
DWORD // all have been 1
  index 4 - blank or 2? // unknown
+
DWORD endoffset // Offset to 16 bytes of unknown data
// you use these offsets by fseek(filehandle, table_start_offset+(4*index)+table[index], SEEK_SET);
+
16 BYTES // blank
// the table starts at 12, SEEK_SET seeks from the start of file
+
DWORD - count  // all examples have been 1
+
DWORD - Offset to post soundEntry 16 BYTES (from beginning of this DWORD); // the same formula as above will work
+
16 BYTES blank?  // looks like a zeroes out slot for a TGI[sub]64[/sub] reference
+
  
 +
==Clip Header==
 +
The source file name is important in that jazz scripts reference it for assigning the jazz actors to the clip actors.  Frame data is format dependent.  If the time code override is used, it is at the start of the frame data chunk, with the first joint movement rule starting right after it.
 +
QWORD _S3Clip_ // Integer value, not a string, so swapped for byte order on little endian
 +
DWORD version // 2
 +
DWORD // blank
 +
FLOAT frameduration // Always seen as 1/30
 +
WORD  framecount // Not necessarily the number of frames in this clip
 +
WORD  // unknown
 +
DWORD count1 // Joint movement rules
 +
DWORD count2 // Indexed float count - floats listed at start of frame data
 +
DWORD offset1 // Offset from start of clip header to joint movement rules
 +
DWORD offset2 // Offset from start of clip header to frame data
 +
DWORD anim name offset // Offset to null terminated animation name
 +
DWORD source file offset // Offset to null terminated source file
 +
===Joint Movement Rules===
 +
DWORD frame data offset // Offset into frame data for this movement data
 +
DWORD hash // joint name
 +
FLOAT
 +
FLOAT
 +
WORD frames // Number of defined frames in the frame data
 +
WORD frame data type
 +
===Frame Data===
 +
WORD Frame Index // Can skip some or most frames
 +
WORD // Can vary within the same motion
 +
// Type dependant data
 +
The type dependant data can be one of the following.
 +
{| class="wikitable" border="1"
 +
|-
 +
! Data type
 +
! Data format
 +
! Count
 +
! Usage notes
 +
|-
 +
| 0x103
 +
| WORD
 +
| 3
 +
| Indexed float reference
 +
|-
 +
| 0x10b
 +
| ?
 +
| ?
 +
| Always with a 0 count
 +
|-
 +
| 0x112
 +
| FLOAT
 +
| 1
 +
|
 +
|-
 +
| 0x20c
 +
| ?
 +
| ?
 +
| Always with a 0 count
 +
|-
 +
| 0x211
 +
| ?
 +
| ?
 +
| Always with a 0 count
 +
|-
 +
| 0x214
 +
| WORD
 +
| 4
 +
| Range of 0...4095
 +
|}
 +
==Actor/Slot Table==
 +
Table always starts on a DWORD boundary, padded with 0x7e if needed.  All offsets are based on the start of the corresponding offset table.  It is unclear what the significance of primary entries vs secondary entries is.  The named actor may or may not be the actor for the animation.
 +
DWORD count // Primary entry count
 +
REP count
 +
    DWORD offset
 +
REP count
 +
    DWORD pad // 0x7e7e7e7e
 +
    DWORD count2 // Secondary entry count
 +
    REP count2
 +
        DWORD offset
 +
    REP count2
 +
        DWORD index // Secondary entry index
 +
        512 BYTE Actor // Name, null terminated and padded with 0x23 (#)
 +
        512 BYTE Slot // Name, null terminated and padded with 0x23 (#)
 +
==Clip Events==
 +
Offsets in this table are based on the address of the start offset.
 +
4 BYTES "=CE="
 +
DWORD version // 0x103
 +
DWORD count // Event count
 +
DWORD endoffset
 +
DWORD startoffset // 4 if count > 0, otherwise 0
 +
REP count
 +
    WORD event type
 +
    WORD 0xc1e4
 +
    DWORD id // Type dependent meaning
 +
    FLOAT timecode // When to trigger the event
 +
    FLOAT // -1.0
 +
    FLOAT // -1.0
 +
    DWORD
 +
    DWORD length // Can be 0, in which case the name still includes the null terminator and DWORD padding
 +
    STRING event name // Size is length, with added null terminated followed by 0-padding to next DWORD
 +
    // Type dependent data
  
--S1 Header
+
{| class="wikitable" border="1"
QWORD _S3Clip_
+
|-
DWORD version 2
+
! Event type
DWORD blank?
+
! Description
4 BYTES hash?
+
! Notes
4 BYTES
+
|-
DWORD S1 entry1count
+
| 1
DWORD blank?
+
| Attach object
DWORD Offset entry1entries from S1 start
+
| Attach a prop object to a specific slot
DWORD Offset entry2entries from S1 start
+
|-
DWORD Offset to anim name from S1 start
+
| 2
DWORD Offset to .ma filename from S1 start
+
| Un-parent
 
+
| Mostly used for the bath ducky
--entry1entries (20 BYTES each)
+
|-
DWORD Offset from S1 start to this entry2entry (Sanity Check this. saw it pointed at a 7E once)
+
| 3
4 BYTES hash?
+
| Play sound
FLOAT
+
|
FLOAT
+
|-
WORD entry2entry count for this entry1entry
+
| 4
2 BYTES (IF 1402, entry2entry entrysize = 12. IF 1201, entry2entry entrysize = 8. IF 0B01 and 1102, special cases - Notice the 0 counts; Keyframe markers?)
+
| SACS script event
 
+
| ID is the event ID to send to the game scripts
STRING - Anim name 00 terminated
+
|-
STRING - .ma filename 00 terminated
+
| 6
 
+
|
--entry2entries (8,12 or 16 BYTE sections) (Count determined by summing the entry1entry count values)
+
|
WORD frameIndex? (0 based. each subsequent same code entry, increase by 1. else reset to 0)
+
|-
WORD code
+
| 9
(if entrysize = 8, FLOAT)
+
| Destroy prop
(if entrysize = 12, WORD WORD WORD WORD)
+
| Destroys an object created with "Create prop" in jazz scripts
 
+
|-
--S2
+
| 10
7E padding to next DWORD
+
|
IF SIMoffset !=0 (# Block)
+
|
Else Object (STRING - Object Target 00 terminated)
+
|}
7E padding to next DWORD
+
===Event 1===
STRING =CE=
+
DWORD hash // Prop actor name
DWORD version (259)
+
  DWORD hash // Object actor name
DWORD soundEntry count
+
DWORD hash // Slot to attach to on object
DWORD OffsetToSoundEnd (from soundEntries start)
+
DWORD // Blank
DWORD 4 if count > 0 (Offset (from this location) of soundEntries) otherwise 0
+
===Event 2===
--soundEntries (variable size)
+
DWORD hash // Object actor name to unparent
12 BYTES
+
===Event 3===
FLOAT
+
On event type 3, after the string there is various data.  It can take the form of a series of floats, a series of incrementing dwords, or data that looks compressed or encrypted.  Given that the same data appears in multiple instances with varying amounts of it overwritten by the string, it seems likely that it is just random data from memory that was not cleared.
 
+
128 BYTES // Sound name null terminated
 
+
===Event 4===
#BLOCK STRUCTURE
+
// No additional data
----------------
+
===Event 5===
 
+
DWORD
--Header
+
DWORD
DWORD - block section count
+
DWORD hash // Effect name
DWORD - block section offset from end of count
+
DWORD hash // actor name
 
+
DWORD hash // to attach effect to
--Sections
+
===Event 6===
7E7E7E7E - padding
+
FLOAT
DWORD - block subsection count
+
===Event 9===
--Subsections Offsets
+
DWORD hash // Actor name of prop to destroy
DWORD - Subsection offset from beginning of first offset
+
===Event 10===
--Subsections
+
DWORD hash
DWORD - Zero based subsection index
+
DWORD // blank?
WORD
+
==End Data==
Repeating # (510 BYTES)
+
12 BYTES // Empty
STRING 00 terminated
+
FLOAT // 1.0
Repeating # ((512 - string+00 length) BYTES)
+
WORD
+
 
+
 
+
soundENTRIES
+
----------------
+
 
+
DWORD TYPE (0000-0600, 0900-0A00)
+
WORD E4C1
+
DWORD Assignment? (usually incremental for same types of pieces)
+
FLOAT
+
FLOAT
+
FLOAT
+
DWORD
+
DWORD len
+
STRING lenBytes
+
PADDING 00's to DWORD
+
--Type Dependent Data
+
 
+
 
+
soundENTRY TYPES
+
----------------
+
 
+
0000 (embedded - same structure as a full Type 0400 soundENTRY, but embedded inside a type 0300 directly after the second string and padding)
+
 
+
0100 (0 String len)
+
4x4 matrix
+
 
+
0200
+
8 BYTES
+
 
+
0400
+
end (nothing more than the STRING)
+
 
+
0500
+
20 BYTES
+
DWORD 0x00000000
+
 
+
0600 (0 String len)
+
4 BYTES
+
FLOAT
+
 
+
0900
+
4 BYTES 0x00000000
+
FLOAT
+
 
+
0A00
+
4 BYTES
+
4 BYTES 0x00000000
+
 
+
-----------------
+
Events (by Atavera)
+
 
+
Event 0500
+
DWORD
+
DWORD
+
DWORD hash //FX name
+
DWORD hash //Object(destination) name
+
DWORD hash //Slot(destination) name
+
DWORD
+
 
+
Event 0100
+
DWORD hash //Object(prop) name
+
DWORD hash //Object(destination) name
+
DWORD hash //Slot(destination) name
+
DWORD
+
16 FLOAT matrix
+
 
+
 
+
</pre>
+

Revision as of 11:00, 20 August 2009

S3Clip (NOT complete in any sense of the word - Karybdis)

These resources do not always hash from the animation name to the resource key. Any age specifiers (a2p, t2o, etc) are converted to only reference adult or objects (a or o) respectively to generate the hash, and the high bit is stripped off. This becomes the "default" animation if no age specific override is provided. Age overrides are found by XORing an age mask with the high byte (Or the second high byte for the second actor in an animation).

Contents

Main Header

Offsets in the main header are all based off the location of the offset value. So an offset at byte 4 would point to 4 + offset.

DWORD - TID
DWORD offset // Offset of a linked clip - purpose unknown, always 0
DWORD size of _S3Clip_ Section
DWORD clipoffset // offset to _S3Clip_ section
DWORD slotoffset // Offset to actor/slot pair table
DWORD actoroffset // Offset to clip actor name (Null terminated string)
DWORD eventoffset // Offset to clip event section
DWORD // 0 or 2
DWORD // all have been 1
DWORD endoffset // Offset to 16 bytes of unknown data
16 BYTES // blank

Clip Header

The source file name is important in that jazz scripts reference it for assigning the jazz actors to the clip actors. Frame data is format dependent. If the time code override is used, it is at the start of the frame data chunk, with the first joint movement rule starting right after it.

QWORD _S3Clip_ // Integer value, not a string, so swapped for byte order on little endian
DWORD version // 2
DWORD // blank
FLOAT frameduration // Always seen as 1/30
WORD  framecount // Not necessarily the number of frames in this clip
WORD  // unknown
DWORD count1 // Joint movement rules
DWORD count2 // Indexed float count - floats listed at start of frame data
DWORD offset1 // Offset from start of clip header to joint movement rules
DWORD offset2 // Offset from start of clip header to frame data
DWORD anim name offset // Offset to null terminated animation name
DWORD source file offset // Offset to null terminated source file

Joint Movement Rules

DWORD frame data offset // Offset into frame data for this movement data
DWORD hash // joint name
FLOAT
FLOAT
WORD frames // Number of defined frames in the frame data
WORD frame data type

Frame Data

WORD Frame Index // Can skip some or most frames
WORD // Can vary within the same motion
// Type dependant data

The type dependant data can be one of the following.

Data type Data format Count Usage notes
0x103 WORD 3 Indexed float reference
0x10b  ?  ? Always with a 0 count
0x112 FLOAT 1
0x20c  ?  ? Always with a 0 count
0x211  ?  ? Always with a 0 count
0x214 WORD 4 Range of 0...4095

Actor/Slot Table

Table always starts on a DWORD boundary, padded with 0x7e if needed. All offsets are based on the start of the corresponding offset table. It is unclear what the significance of primary entries vs secondary entries is. The named actor may or may not be the actor for the animation.

DWORD count // Primary entry count
REP count
    DWORD offset
REP count
    DWORD pad // 0x7e7e7e7e
    DWORD count2 // Secondary entry count
    REP count2
        DWORD offset
    REP count2
        DWORD index // Secondary entry index
        512 BYTE Actor // Name, null terminated and padded with 0x23 (#)
        512 BYTE Slot // Name, null terminated and padded with 0x23 (#)

Clip Events

Offsets in this table are based on the address of the start offset.

4 BYTES "=CE="
DWORD version // 0x103
DWORD count // Event count
DWORD endoffset
DWORD startoffset // 4 if count > 0, otherwise 0
REP count
    WORD event type
    WORD 0xc1e4
    DWORD id // Type dependent meaning
    FLOAT timecode // When to trigger the event
    FLOAT // -1.0
    FLOAT // -1.0
    DWORD
    DWORD length // Can be 0, in which case the name still includes the null terminator and DWORD padding
    STRING event name // Size is length, with added null terminated followed by 0-padding to next DWORD
    // Type dependent data
Event type Description Notes
1 Attach object Attach a prop object to a specific slot
2 Un-parent Mostly used for the bath ducky
3 Play sound
4 SACS script event ID is the event ID to send to the game scripts
6
9 Destroy prop Destroys an object created with "Create prop" in jazz scripts
10

Event 1

DWORD hash // Prop actor name
DWORD hash // Object actor name
DWORD hash // Slot to attach to on object
DWORD // Blank

Event 2

DWORD hash // Object actor name to unparent

Event 3

On event type 3, after the string there is various data. It can take the form of a series of floats, a series of incrementing dwords, or data that looks compressed or encrypted. Given that the same data appears in multiple instances with varying amounts of it overwritten by the string, it seems likely that it is just random data from memory that was not cleared.

128 BYTES // Sound name null terminated

Event 4

// No additional data

Event 5

DWORD
DWORD
DWORD hash // Effect name
DWORD hash // actor name
DWORD hash // to attach effect to

Event 6

FLOAT

Event 9

DWORD hash // Actor name of prop to destroy

Event 10

DWORD hash
DWORD // blank?

End Data

12 BYTES // Empty
FLOAT // 1.0
Personal tools
Namespaces

Variants
Actions
Navigation
game select
Toolbox