Difference between revisions of "Sims 3:0x02D5DF13"

From SimsWiki
Jump to: navigation, search
(S_St - State Definition: Added discoveries from studying code in the Sims3.CSHost.State.Export(Sims3.Pipeline.BinarySerializer) function.)
 
(52 intermediate revisions by 6 users not shown)
Line 1: Line 1:
 +
{{TS3AdvancedModdingHeader}}
 +
{{TS3Resource
 +
|name=Jazz
 +
|typeid=0x02D5DF13
 +
|expansion=The Sims 3
 +
}}
 +
<br clear="all">
 +
 
==Overview==
 
==Overview==
Coordinates animations(and sounds?).
+
This page documents the format of jazz data in packages.  For information on creating/using jazz scripts, see [[Sims_3:Jazz]].
 +
 
 +
Jazz data is a graph representing a [http://en.wikipedia.org/wiki/Finite_state_machine Finite State Machine], which is processed by the SACS engine in The Sims 3 to handle animation events.  A glimpse at a visual representation of the jazz data can be seen in [http://www.youtube.com/watch?v=3_GoaADx2_4 The Sims 3 - Behind the Scenes] ([http://www.youtube.com/watch?v=ouH0G6-wK9g Hi-Def 720p]) video.  At 2:08, a Sim is seen performing the actions associated with the "deathreactions" state machine, traversing from the Enter state through the "Shocked" state into the "Evil" state.  At 3:44 a toddler Sim is seen playing with a teddy bear as controlled by the "stuffedAnimal" state machine.
 +
 
 
==Format==
 
==Format==
Follows the [[RCOL]] format, with its own custom chunks.  These chunks have a lot of filler data(0xDEADBEEF), so it will likely expand in later versions.
+
Follows the [[Sims_3:RCOL|RCOL]] format, with its own custom chunks.  All data is aligned on DWORD boundries.  These chunks have a lot of filler data(0xDEADBEEF) which is a "serialization sentinel" according to enum definitions.  There are two types of chunks, definition chunks and decision graph node chunks.  The definition chunks form a simple structure with data about the state machine.  Decision graph nodes form a recursive data structure.  References to decision graph node indexes can validly refer to any decision graph node.
===S_SM===
+
 
State machine definition
+
Many (all?) of the "hash" values here can be looked up in the [[Sims_3:0x0166038C|_KEY]] resource for the package.
<pre>
+
===Definition Chunks===
DWORD S_SM
+
====S_SM - State Machine Definition====
DWORD Name //hashed filename(basename without .jazz extension)
+
DWORD 'S_SM'
DWORD count1
+
DWORD Version    // 0x202
--repeat
+
DWORD Name       // Hashed state machine name (Typically same as filename w/o path or extension)
  DWORD S_AD index
+
DWORD count1     // Actor definitions
DWORD count2
+
REP count1
--repeat
+
  DWORD [S_AD index]
  DWORD S_PD index
+
DWORD count2     // Property definitions
DWORD count3
+
REP count2
--repeat
+
  DWORD [S_PD index]
  DWORD S_St index
+
DWORD count3     // States
DWORD count4
+
REP count3
--repeat
+
  DWORD [S_St index]
  DWORD //grouping?
+
REP count4
  DWORD //hashed object name
+
  DWORD filename //Hash of a source filename with extension
  DWORD //hashed object name
+
  DWORD actor1  //hash of actor name in animations with above extension
DWORD 0xDEADBEEF
+
  DWORD actor2  //hash of actor name in jazz script
DWORD
+
DWORD 0xDEADBEEF
DWORD
+
DWORD Properties // State machine properties
DWORD
+
DWORD Priority  // Automation priority
DWORD
+
DWORD Overlay    // ThoughtBubble, OverlayFace, OverlayHead, OverlayBothArms, OverlayUpperbody, OverlayNone, Unset (0-6, unset is rarely used)
DWORD
+
DWORD Empty
DWORD
+
DWORD Empty
DWORD
+
DWORD Empty
</pre>
+
DWORD Empty
===S_St===
+
 
State definition
+
====S_St - State Definition====
<pre>
+
DWORD 'S_St'
DWORD S_St
+
DWORD version       // 0x101
DWORD version
+
DWORD Name          // Hashed state name
DWORD //hashed interaction name
+
DWORD Flags          // State Flags
4 BYTES
+
DWORD [S_DG index]  // State decision graph
4 BYTES S_DG index
+
DWORD count         // State transitions
DWORD count
+
REP count
--repeat(count)
+
  DWORD [S_St index] // Valid transitions out
  DWORD S_St index
+
DWORD Overlay        // Awareness Overlay override: ThoughtBubble, OverlayFace, OverlayHead, OverlayBothArms, OverlayUpperbody, OverlayNone, Unset (0-6)
DWORD
+
 
</pre>
+
====S_PD - Parameter Definition====
===S_PD===
+
DWORD 'S_PD'
Parameter definition
+
DWORD version // 0x100
<pre>
+
DWORD hash   // Hashed parameter name
DWORD S_PD
+
DWORD hash   // Default value
DWORD version
+
 
DWORD hash
+
====S_AD - Actor Definition====
DWORD hash
+
DWORD 'S_AD'
</pre>
+
DWORD version // 0x100
===S_DG===
+
DWORD Name    //hashed actor parameter name
Decision graph
+
DWORD Empty  //null in all JazzData.package cases
<pre>
+
 
DWORD - S_DG
+
====S_DG - Decision Graph====
DWORD version
+
DWORD 'S_DG'
DWORD blank (SO FAR!)
+
DWORD version         // 0x101
DWORD count1
+
DWORD blank           // In all cases in JazzData.package
--Reps (Count1)
+
DWORD count1
          DWORD index
+
REP count1
DWORD count2
+
    DWORD [DGN index] // List of all decision graph nodes descendant from this S_DG
--Reps (Count2)
+
DWORD count2
          DWORD index
+
REP count2
4 BYTES (DEADBEEF filler)
+
    DWORD [DGN index] // Root of the decision graph
</pre>
+
DWORD (DEADBEEF filler)
===S_AD===
+
 
Actor definition
+
===Decision Graph Node Chunks===
<pre>
+
====SoPn - Select on Parameter Node====
DWORD - S_AD
+
DWORD 'SoPn'
DWORD version
+
DWORD version             // 0x101
DWORD //hashed object name
+
DWORD index               // Parameter to select on
DWORD
+
DWORD count               // Possible cases to select
</pre>
+
REP count
===SoPn===
+
    DWORD Value          //hashed value to compare
Select on Parameter node
+
    DWORD indexcount
<pre>
+
    REP indexcount
DWORD 'SoPn'
+
        DWORD [DGN index] // Action to take on match
DWORD version
+
4BYTE filler(DEADBEEF)
DWORD index
+
DWORD '/DGN'
DWORD count
+
 
--repetition
+
====SNSN - Next State Node====
    DWORD //hash(values seen are "Yes","No","Normal")
+
DWORD 'SNSN'
    DWORD indexcount
+
DWORD version             // 0x101
    index[indexcount]
+
DWORD S_St index         // Next state
4BYTE filler(DEADBEEF)
+
DWORD '/DGN' (end entry)
DWORD
+
 
</pre>
+
====Rand - Random Node====
===SNSN===
+
DWORD 'Rand'
Next State Node
+
DWORD version             // 0x101
<pre>
+
DWORD count               // Possible outcomes
DWORD - SNSN
+
REP count
DWORD version
+
    FLOAT                 // Random weight
DWORD index
+
    DWORD subcount
DWORD /DGN (end entry)
+
    REP subcount
</pre>
+
        DWORD [DGN index] // Action on selection
===Rand===
+
DWORD - DEADBEEF
Random node
+
DWORD flags              // Random node flags
<pre>
+
DWORD '/DGN'
DWORD Rand
+
 
DWORD version
+
====Play - Play Animation Node====
DWORD count
+
If the string value below is defined, it a UTF-16 value null terminated, padded to the next DWORD boundry after the null termination.  If the string length is 0, there is no data at all for the string, including no null termination.
--Reps (Count times)
+
 
        FLOAT
+
When the animation name string is set, the CLIP and TkMk resource references are set to 00000000:00000000:6b20c4f302d5df12 and the string is hashed to get the animation ID after parameter substitution.  Parameters are the named parameters defined by S_PD, and a substitution inside the string is indicated by enclosing a parameter name between curly braces ("{" and "}").
        DWORD subcount
+
 
        --Reps (subcount times)
+
DWORD 'Play'
                DWORD index
+
DWORD version     // 0x105
DWORD - DEADBEEF
+
I64 T G (CLIP)
DWORD count2
+
I64 T G (TkMk)
--Reps (count2 times)
+
DWORD count1
        DWORD index
+
3 DWORDS blank    // Blank in all existing jazzdata.package entries
DWORD /DGN
+
REP count1
</pre>
+
  DWORD Empty      // 0 in all 1 entry this count is non-zero in
===Play===
+
  DWORD Empty      // 0 in all 1 entry this count is non-zero in
Play animation node
+
  DWORD Actor      // Hashed actor parameter name
<pre>
+
  DWORD Slot      // Hashed slot name (Only one instance of this in jazzdata.package)
DWORD 'Play'
+
DWORD count2
DWORD version
+
REP count2
TGI64 (CLIP)
+
  DWORD actor      // Hashed actor name
TGI64 (TkMk)
+
  DWORD suffix    // Hashed parameter name for IkSuffix
DWORD count1
+
DWORD filler(DEADBEEF)
DWORD
+
I64 T G (CLIP)    // Additive Clip Key (unused in external sacs scripts)
DWORD
+
DWORD len          // Length of the following string - a value of 0 indicates no data
DWORD
+
WSTRING animation  // Animation name to play.  See above notes on this value.
--rep(count1)
+
VAR WCHAR (0) pad  // As needed for string (If len > 0) - see above note on string padding
  DWORD
+
DWORD len         // Length of the following string - a value of 0 indicates no data
  DWORD
+
WSTRING additive  // Name of the additive animation to play on top of the main one.  See above notes on this value.
  DWORD
+
VAR WCHAR (0) pad  // As needed for string (If len > 0) - see above note on string padding
  DWORD
+
DWORD filler(DEADBEEF)
DWORD count2
+
DWORD Flags        // Animation node flags
--rep(count2)
+
DWORD Priority    // Animation Priroity
  DWORD
+
FLOAT              // Always 0
  DWORD
+
FLOAT Duration    // Animation blend-in duration, in seconds (Assuming normal speed)
4byte filler(DEADBEEF)
+
FLOAT             // Animation blend-out duration
DWORD
+
FLOAT             // Always 0
DWORD
+
FLOAT Speed        // 1.0 = normal speed
DWORD
+
DWORD [S_AD Index] // Actor to animate
DWORD
+
DWORD Priority    // Animation Priroity
DWORD len
+
DWORD             // Always 16
STRING char16[len]
+
5 DWORDS Empty
if (len > 0){BYTE[4-((2*len)%4)]} '00'
+
DWORD filler(DEADBEEF)
DWORD
+
=====MulticastDecisionGraphNode Footer=====
4byte filler(DEADBEEF)
+
DWORD count
DWORD
+
REP count
DWORD
+
  DWORD [DGN Index] // Additional actions (On animation complete?)
DWORD
+
DWORD '/DGN'
FLOAT
+
 
FLOAT
+
====Prop - Create Prop Node====
FLOAT
+
The catalog resource ID references type 0x139f7591 (CatalogObjectResourceID) which does not exist in any packages. Internally, the type is changed to 0x2dc343f before instantiation
FLOAT
+
 
DWORD S_AD Index
+
''Current speculation is that the blank values may be object create parameters, since the prop is created with no script intervention.  However, none of the values are set in existing jazz data.''
DWORD
+
''As of the Showtime version of the CSHostWrap.dll that comes with The Create A World Tool, these four blank values are unused and always zero.''
DWORD
+
DWORD 'Prop'
DWORD
+
DWORD version       // 0x100
DWORD
+
DWORD [S_Ad Index]  // Prop actor to create
DWORD
+
DWORD [S_Pd Index]  // Prop Parameter
DWORD
+
// Catalog reference of prop to create, group is always 0
DWORD
+
QWORD instance
4byte filler(DEADBEEF)
+
DWORD type
DWORD count3
+
DWORD group
--rep(count3)
+
4 DWORDS blank // Currently unused
  DWORD Index
+
=====MulticastDecisionGraphNode Footer=====
DWORD '/DGN'
+
DWORD count
</pre>
+
REP count
===Prop===
+
  DWORD [DGN index]
Create prop node
+
DWORD '/DGN'
<pre>
+
 
DWORD Prop  
+
====AcOp - Actor Operation Node====
DWORD version
+
DWORD 'AcOp'  // Signature
DWORD index
+
DWORD 0x100  // Version
4 BYTES blank?
+
DWORD Target  // Index of actor to operate on
4 BYTES
+
DWORD 0 or 1  // Actor Operation (0 = None; 1 = SetMirror) Note that it would generally be a moot point for the operation to be zero
4 BYTES blank?
+
DWORD 0 or 1  // Operand to the operation (for a SetMirror operation, this is a boolean variable that sets the Mirror attribute to true or false)
4 BYTES
+
3 DWORDS blank
20 BYTES blank?
+
=====MulticastDecisionGraphNode Footer=====
DWORD count
+
DWORD count
--Rep (count times)
+
REP count
          DWORD index  
+
  DWORD [DGN index]
DWORD /DGN
+
DWORD '/DGN'
</pre>
+
 
===AcOp===
+
====Stop - Stop Animation Node====
Actor Operation node
+
The fields in a Stop node are structurally identical to the end part of a Play node.
<pre>
+
DWORD 'Stop'
DWORD AcOp  
+
DWORD version     // 0x104
DWORD version
+
DWORD Flags        // Animation node flags
DWORD index
+
DWORD Priority    // Animation Priroity
DWORD (0x01)
+
FLOAT              // Always 0
DWORD (0x00, or 0x01 [not a count])
+
FLOAT Duration    // Animation blend-in duration, in seconds (Assuming normal speed)
12 BYTES blank?
+
FLOAT             // Animation blend-out duration
DWORD count
+
FLOAT              // Always 0
--Rep (count times)
+
FLOAT Speed        // 1.0 = normal speed
          DWORD index
+
DWORD [S_AD Index] // Actor to animate
DWORD /DGN
+
DWORD Priority    // Animation Priroity
</pre>
+
DWORD             // Always 16
===Stop===
+
5 DWORDS Empty
Stop animatio node
+
DWORD filler(DEADBEEF)
<pre>
+
=====MulticastDecisionGraphNode Footer=====
DWORD 'Stop'
+
DWORD count
DWORD version
+
REP count
DWORD
+
  DWORD [DGN index]
DWORD
+
DWORD '/DGN'
DWORD
+
 
DWORD
+
{{TS3AdvancedModdingHeader}}
FLOAT
+
DWORD
+
FLOAT
+
DWORD S_AD index
+
DWORD
+
DWORD
+
DWORD
+
DWORD
+
DWORD
+
DWORD
+
DWORD
+
DWORD 0xDEADBEEF
+
DWORD count
+
--repeat(count)
+
  DWORD index
+
DWORD '/DGN'
+
</pre>
+

Latest revision as of 22:21, 3 May 2012

Modding Reference by Category

Sims 3 :DBPF | File Types | RCOL(Scene) | Catalog Resource | String Table | Key Table | TS3 Programmer's Reference 

Jazz
TypeID:0x02D5DF13
Game Version:The Sims 3



Contents

[edit] Overview

This page documents the format of jazz data in packages. For information on creating/using jazz scripts, see Sims_3:Jazz.

Jazz data is a graph representing a Finite State Machine, which is processed by the SACS engine in The Sims 3 to handle animation events. A glimpse at a visual representation of the jazz data can be seen in The Sims 3 - Behind the Scenes (Hi-Def 720p) video. At 2:08, a Sim is seen performing the actions associated with the "deathreactions" state machine, traversing from the Enter state through the "Shocked" state into the "Evil" state. At 3:44 a toddler Sim is seen playing with a teddy bear as controlled by the "stuffedAnimal" state machine.

[edit] Format

Follows the RCOL format, with its own custom chunks. All data is aligned on DWORD boundries. These chunks have a lot of filler data(0xDEADBEEF) which is a "serialization sentinel" according to enum definitions. There are two types of chunks, definition chunks and decision graph node chunks. The definition chunks form a simple structure with data about the state machine. Decision graph nodes form a recursive data structure. References to decision graph node indexes can validly refer to any decision graph node.

Many (all?) of the "hash" values here can be looked up in the _KEY resource for the package.

[edit] Definition Chunks

[edit] S_SM - State Machine Definition

DWORD 'S_SM'
DWORD Version    // 0x202
DWORD Name       // Hashed state machine name (Typically same as filename w/o path or extension)
DWORD count1     // Actor definitions
REP count1
  DWORD [S_AD index]
DWORD count2     // Property definitions
REP count2
  DWORD [S_PD index]
DWORD count3     // States
REP count3
  DWORD [S_St index]
REP count4
  DWORD filename //Hash of a source filename with extension
  DWORD actor1   //hash of actor name in animations with above extension
  DWORD actor2   //hash of actor name in jazz script
DWORD 0xDEADBEEF
DWORD Properties // State machine properties
DWORD Priority   // Automation priority
DWORD Overlay    // ThoughtBubble, OverlayFace, OverlayHead, OverlayBothArms, OverlayUpperbody, OverlayNone, Unset (0-6, unset is rarely used)
DWORD Empty
DWORD Empty
DWORD Empty
DWORD Empty

[edit] S_St - State Definition

DWORD 'S_St'
DWORD version        // 0x101
DWORD Name           // Hashed state name
DWORD Flags          // State Flags
DWORD [S_DG index]   // State decision graph
DWORD count          // State transitions
REP count
  DWORD [S_St index] // Valid transitions out
DWORD Overlay        // Awareness Overlay override: ThoughtBubble, OverlayFace, OverlayHead, OverlayBothArms, OverlayUpperbody, OverlayNone, Unset (0-6)

[edit] S_PD - Parameter Definition

DWORD 'S_PD'
DWORD version // 0x100
DWORD hash    // Hashed parameter name
DWORD hash    // Default value

[edit] S_AD - Actor Definition

DWORD 'S_AD'
DWORD version // 0x100
DWORD Name    //hashed actor parameter name
DWORD Empty   //null in all JazzData.package cases

[edit] S_DG - Decision Graph

DWORD 'S_DG'
DWORD version         // 0x101
DWORD blank           // In all cases in JazzData.package
DWORD count1
REP count1
    DWORD [DGN index] // List of all decision graph nodes descendant from this S_DG
DWORD count2
REP count2
    DWORD [DGN index] // Root of the decision graph
DWORD (DEADBEEF filler)

[edit] Decision Graph Node Chunks

[edit] SoPn - Select on Parameter Node

DWORD 'SoPn'
DWORD version             // 0x101
DWORD index               // Parameter to select on
DWORD count               // Possible cases to select
REP count
    DWORD Value           //hashed value to compare
    DWORD indexcount
    REP indexcount
        DWORD [DGN index] // Action to take on match
4BYTE filler(DEADBEEF)
DWORD '/DGN'

[edit] SNSN - Next State Node

DWORD 'SNSN'
DWORD version             // 0x101
DWORD S_St index          // Next state
DWORD '/DGN' (end entry)

[edit] Rand - Random Node

DWORD 'Rand'
DWORD version             // 0x101
DWORD count               // Possible outcomes
REP count
    FLOAT                 // Random weight
    DWORD subcount
    REP subcount
        DWORD [DGN index] // Action on selection
DWORD - DEADBEEF
DWORD flags               // Random node flags
DWORD '/DGN'

[edit] Play - Play Animation Node

If the string value below is defined, it a UTF-16 value null terminated, padded to the next DWORD boundry after the null termination. If the string length is 0, there is no data at all for the string, including no null termination.

When the animation name string is set, the CLIP and TkMk resource references are set to 00000000:00000000:6b20c4f302d5df12 and the string is hashed to get the animation ID after parameter substitution. Parameters are the named parameters defined by S_PD, and a substitution inside the string is indicated by enclosing a parameter name between curly braces ("{" and "}").

DWORD 'Play'
DWORD version     // 0x105
I64 T G (CLIP)
I64 T G (TkMk)
DWORD count1
3 DWORDS blank     // Blank in all existing jazzdata.package entries
REP count1
  DWORD Empty      // 0 in all 1 entry this count is non-zero in
  DWORD Empty      // 0 in all 1 entry this count is non-zero in
  DWORD Actor      // Hashed actor parameter name
  DWORD Slot       // Hashed slot name (Only one instance of this in jazzdata.package)
DWORD count2
REP count2
  DWORD actor      // Hashed actor name
  DWORD suffix     // Hashed parameter name for IkSuffix
DWORD filler(DEADBEEF)
I64 T G (CLIP)     // Additive Clip Key (unused in external sacs scripts)
DWORD len          // Length of the following string - a value of 0 indicates no data
WSTRING animation  // Animation name to play.  See above notes on this value.
VAR WCHAR (0) pad  // As needed for string (If len > 0) - see above note on string padding
DWORD len          // Length of the following string - a value of 0 indicates no data
WSTRING additive   // Name of the additive animation to play on top of the main one.  See above notes on this value.
VAR WCHAR (0) pad  // As needed for string (If len > 0) - see above note on string padding
DWORD filler(DEADBEEF)
DWORD Flags        // Animation node flags
DWORD Priority     // Animation Priroity
FLOAT              // Always 0
FLOAT Duration     // Animation blend-in duration, in seconds (Assuming normal speed)
FLOAT              // Animation blend-out duration
FLOAT              // Always 0
FLOAT Speed        // 1.0 = normal speed
DWORD [S_AD Index] // Actor to animate
DWORD Priority     // Animation Priroity
DWORD              // Always 16
5 DWORDS Empty
DWORD filler(DEADBEEF)
[edit] MulticastDecisionGraphNode Footer
DWORD count
REP count
  DWORD [DGN Index] // Additional actions (On animation complete?)
DWORD '/DGN'

[edit] Prop - Create Prop Node

The catalog resource ID references type 0x139f7591 (CatalogObjectResourceID) which does not exist in any packages. Internally, the type is changed to 0x2dc343f before instantiation

Current speculation is that the blank values may be object create parameters, since the prop is created with no script intervention. However, none of the values are set in existing jazz data. As of the Showtime version of the CSHostWrap.dll that comes with The Create A World Tool, these four blank values are unused and always zero.

DWORD 'Prop' 
DWORD version       // 0x100
DWORD [S_Ad Index]  // Prop actor to create
DWORD [S_Pd Index]  // Prop Parameter
// Catalog reference of prop to create, group is always 0
QWORD instance
DWORD type
DWORD group
4 DWORDS blank // Currently unused
[edit] MulticastDecisionGraphNode Footer
DWORD count
REP count
  DWORD [DGN index]
DWORD '/DGN'

[edit] AcOp - Actor Operation Node

DWORD 'AcOp'  // Signature
DWORD 0x100   // Version
DWORD Target  // Index of actor to operate on
DWORD 0 or 1  // Actor Operation (0 = None; 1 = SetMirror) Note that it would generally be a moot point for the operation to be zero
DWORD 0 or 1  // Operand to the operation (for a SetMirror operation, this is a boolean variable that sets the Mirror attribute to true or false)
3 DWORDS blank
[edit] MulticastDecisionGraphNode Footer
DWORD count
REP count
  DWORD [DGN index]
DWORD '/DGN'

[edit] Stop - Stop Animation Node

The fields in a Stop node are structurally identical to the end part of a Play node.

DWORD 'Stop'
DWORD version      // 0x104
DWORD Flags        // Animation node flags
DWORD Priority     // Animation Priroity
FLOAT              // Always 0
FLOAT Duration     // Animation blend-in duration, in seconds (Assuming normal speed)
FLOAT              // Animation blend-out duration
FLOAT              // Always 0
FLOAT Speed        // 1.0 = normal speed
DWORD [S_AD Index] // Actor to animate
DWORD Priority     // Animation Priroity
DWORD              // Always 16
5 DWORDS Empty
DWORD filler(DEADBEEF)
[edit] MulticastDecisionGraphNode Footer
DWORD count
REP count
  DWORD [DGN index]
DWORD '/DGN'
Modding Reference by Category

Sims 3 :DBPF | File Types | RCOL(Scene) | Catalog Resource | String Table | Key Table | TS3 Programmer's Reference 

Personal tools
Namespaces

Variants
Actions
Navigation
game select
Toolbox