Difference between revisions of "Sims 3:0x8EAF13DE"

From SimsWiki
Jump to: navigation, search
 
(29 intermediate revisions by 5 users not shown)
Line 1: Line 1:
RIG
+
{{TS3AdvancedModdingHeader}}
 +
{{TS3Resource
 +
|name=Rig Resource - _RIG
 +
|typeid= 0x8EAF13DE
 +
|expansion=The Sims 3
 +
}}
 +
<br clear="all">
  
<pre>
+
==Overview==
By Karybdis and Atavera
+
The RIG file has gone through some changes over the years.  There was once the proprietary GR2 format, but it has since been replaced with EA's own format that is much easier to deal with.  At this point, the olde format should never be used.  It has been deprecated by patches and expansions, and new versions of the base game rig files can be found in DeltaBuild0.package.  Pets in their own EP were made using the new format as well.
  
  
--Int2 Offset Header (optional)
+
There were previously three formats of the RIG file.
DWORD DE13AF8E
+
* The basic file content is a [http://www.radgametools.com/granny.html Granny 2] data file.
DWORD 0
+
** Apart from the official tools, there are some user-contributed tools for manipulating the data.
DWORD Offset to Int2 (from beginning of main header - offset 52. IE this is offset+52 from beginning of file)
+
** Get "Granny Viewer" from the [http://gr2decode.altervista.org/download.html altervista downloads] page and you can load the data (export it as 'somefile.gr2')
DWORD Offset to end of Int2 offset header (from beginning of this DWORD)
+
** Also related is [http://forum.xentax.com/viewtopic.php?f=16&t=1805&start=30&st=0&sk=t&sd=a this thread] on Xentax.
9x DWORD - Offset to beginning of this Int2 section from the beginning of this DWORD (only 5 used)
+
* A second format exists, where the Granny data is wrapped with [[#Optional wrapper|some additional fields]].
 +
* Starting with the Create A Pet Demo, there is a new third format that is [[#Unencrypted Rig Data|unencrypted]].
  
--Header (For all further offsets, treat this as Offset 0 (as if the Int2 Offset header didn't exist)) (This is Granny2 data)
 
16 BYTES B867B0CAF86DB10F84728C7E5E19001E
 
DWORD - Header Size
 
12 BYTES
 
DWORD - 6
 
DWORD - Size of main file not including Int2/Int2Header data
 
DWORD - Guid?
 
DWORD
 
40 BYTES
 
DWORD - 2
 
DWORD - Offset of the scripty bit from beginning of file
 
DWORD - Size of the scripty bit
 
DWORD
 
DWORD
 
DWORD
 
DWORD
 
DWORD - offset Int1
 
DWORD - count Int1
 
DWORD - offset end Int1
 
DWORD
 
  
--Int1 Section
+
==Olde Format==
DWORD
+
===Optional wrapper===
DWORD
+
There is an optional wrapper to the Granny data.  This can be identified by the first DWORD in the file being 0x8EAF13DE (i.e. the resource type).  The format is:
DWORD
+
  
--Scripty
+
====Format====
 
+
//Examples of this being used?  What does "Int2" block or "Int2" Chunk mean here?  Is it the data from Count1? [[User:Pljones|Pljones]] 15:28, 17 October 2011 (EDT)
--Padding 00's to next even DWORD (end of granny2 data)
+
DWORD 0x8EAF13DE
 
+
DWORD 0
--Int2 section
+
DWORD offset1 // To "Int2" block from start of Granny data
-1st offset
+
DWORD offset2 // To start of Granny data (from start of this DWORD)
DWORD Offset Count
+
DWORD IKChainsOffset // To start first of "Int2" Chunk (from start of this DWORD)
DWORD offset (from end of offset count)
+
DWORD IKTargetSlotsOffset //(from start of this DWORD)
REPS
+
DWORD IKInfoNodeOffset //(from start of this DWORD)
QWORD (if 00000000 03000000, X=144 BYTES) (if 01000000 01000000, X=176 BYTES)
+
DWORD CompressNodeOffset //(from start of this DWORD)
X
+
DWORD FullBoneListOffset //(from start of this DWORD)
-2nd-5th offsets
+
DWORD // unused offset?
DWORD count
+
DWORD // unused offset?
DWORD  
+
DWORD // unused offset?
 +
DWORD // unused offset?
 +
 +
--insert Granny2 data
 +
--Padding 00's to next even DWORD
 +
 
 +
DWORD Count1
 +
--repetition Count1:
 +
DWORD offset to IK Chain entry (from start of this DWORD)
 +
--repetition Count1:
 +
//IK Chain entry
 +
DWORD
 +
DWORD ChainLength
 +
BYTE[32] //00
 +
DWORD IK pole //Bone index from granny2 data
 +
DWORD Chain start //Bone index from granny2 data
 +
 +
DWORD SlotInfoNode //Bone index from granny2 data
 +
DWORD SlotInfoRootNode //Bone index from granny2 data
 +
 +
DWORD SlotOffsetNode //Bone index from granny2 data
 +
DWORD SlotOffsetRootNode //Bone index from granny2 data
 +
 +
DWORD InfoNodeFlags //(bits 0-10 means that node is enabled)
 +
 +
DWORD InfoNode0  //Bone index from granny2 data
 +
DWORD InfoNode1  //Bone index from granny2 data
 +
DWORD InfoNode2  //Bone index from granny2 data
 +
DWORD InfoNode3  //Bone index from granny2 data
 +
DWORD InfoNode4  //Bone index from granny2 data
 +
DWORD InfoNode5  //Bone index from granny2 data
 +
DWORD InfoNode6  //Bone index from granny2 data
 +
DWORD InfoNode7  //Bone index from granny2 data
 +
DWORD InfoNode8  //Bone index from granny2 data
 +
DWORD InfoNode9  //Bone index from granny2 data
 +
DWORD InfoNode10 //Bone index from granny2 data
 +
 +
--repetition(ChainLength)
 +
DWORD
 +
 +
DWORD //0
 +
 +
//Chain links
 +
--repetition(ChainLength)
 +
DWORD EndBone //Bone index from granny2 data
 +
DWORD StartBone  //Bone index from granny2 data
 +
//IK Target Slots
 +
DWORD count
 +
--repetition count
 +
DWORD //Bone index from granny2 data
 +
 +
BYTE[56] //00
 +
 +
//Info Nodes
 +
DWORD count
 +
--repetition count
 +
DWORD //Bone index from granny2 data
 +
 +
//Compress Nodes(i.e. "b__R_Calf__Compress__")
 +
DWORD count
 +
--repetition count
 +
DWORD //Bone index from granny2 data
 +
 +
//Full bone list(contains every bone from granny2 data)
 +
DWORD count
 +
--repetition count
 +
DWORD //Bone index from granny2 data
  
 +
====Granny2 Data====
 +
All offsets in this section start from the start of the Granny2 Data.
 +
BYTE[16] // See Rick's note below
 +
DWORD Header Size // ?
 +
DWORD Header Format
 +
DWORD Reserved
 +
DWORD Reserved
 +
DWORD Version // 6
 +
DWORD DataSize
 +
DWORD CRC
 +
DWORD SectionOffset
 +
DWORD SectionCount // 1
 +
DWORD RootObjectTypeIndex
 +
DWORD RootObjectTypeOffset
 +
DWORD RootObjectIndex
 +
DWORD RootObjectOffset
 +
DWORD Tag // 0x8000001C
 +
DWORD StringDb CRC
 +
DWORD[3] Unused
 +
//Sections
 +
--repeat(SectionCount)
 +
DWORD CompressionFormat // 2
 +
DWORD DataOffset
 +
DWORD DataSize
 +
DWORD DecompressedSize
 +
DWORD Alignment
 +
DWORD
 +
DWORD
 +
DWORD Int1Offset
 +
DWORD Int1Count // ?
 +
DWORD Int1EndOffset // to start of byte after Int1 section
 +
DWORD
 +
 +
//Int1 Section // does this repeat or what?
 +
DWORD
 +
DWORD
 +
DWORD
 +
 +
// Data
 +
BYTE[DataSize]
  
 
Rick adds:
 
Rick adds:
The blobs that start with B867B0CAF86DB10F84728C7E5E19001E
 
 
(as well as)
 
 
29DE6CC0BAA4532B25F5B7A5F666E2EE
 
0E1195B56AA5B54BEB2828502578B304
 
E59B495E6F631F141E13EBA990BEEDC4
 
3195D4E320DC4F62CC36D03AB182FF89
 
 
Are Granny 2 file data,
 
 
http://gr2decode.altervista.org/
 
  
Get "Granny Viewer" from the downloads page & you can load that blob of data (copy it out and save it as 'somefile.gr2').
+
The blobs that start with the following sequences are Granny2 data blocks:
 +
B867B0CAF86DB10F84728C7E5E19001E
 +
29DE6CC0BAA4532B25F5B7A5F666E2EE
 +
0E1195B56AA5B54BEB2828502578B304
 +
E59B495E6F631F141E13EBA990BEEDC4
 +
3195D4E320DC4F62CC36D03AB182FF89
  
Also related is this thread on Xentax:
+
==New Format==
 +
Starting with the Create A Pet Demo, there is a new third format of RIG files that is unencrypted. Version 3 contains no IK data, and zero-length skeleton name.
  
http://forum.xentax.com/viewtopic.php?f=16&t=1805&start=30&st=0&sk=t&sd=a
+
===Format===
 +
DWORD Major Version? //3-4
 +
DWORD Minor Version? //1-2
 +
DWORD Bone Count
 +
--repeat(Bone Count)
 +
    FLOAT[3] Position
 +
    FLOAT[4] Orientation //Quaternion
 +
    FLOAT[3] Scaling?
 +
    DWORD Bone Name Length
 +
    STRING (Bone Name Length ASCII characters)
 +
    DWORD ??? // Something to do with mirrored bones.  It will be the same as the bone's index except in the case of Left/Right mirrored bones it is the index of it's opposite
 +
    DWORD Parent Index
 +
    DWORD Bone Name Hash (FNV 32)
 +
    DWORD Flags? //Usually 0x23, except with mirrored bones, then one will be 0x3F
 +
DWORD Skeleton Name Length
 +
STRING (Skeleton Name Length ASCII characters)
 +
--if(Version >= 4)
 +
    DWORD IK Chain Count
 +
    --repeat(IK Chain Count)
 +
        DWORD Length
 +
        --repeat(Length) 
 +
            DWORD BoneIndex //bone index 
 +
        DWORD InfoNode[11] //bone index
 +
        DWORD PoleVector //bone index
 +
        DWORD SlotInfo //bone index
 +
        DWORD SlotOffset //bone index
 +
        DWORD Root //bone index
  
</pre>
+
{{TS3AdvancedModdingHeader}}

Latest revision as of 09:09, 14 October 2012

Modding Reference by Category

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

Rig Resource - _RIG
TypeID:0x8EAF13DE
Game Version:The Sims 3



Contents

[edit] Overview

The RIG file has gone through some changes over the years. There was once the proprietary GR2 format, but it has since been replaced with EA's own format that is much easier to deal with. At this point, the olde format should never be used. It has been deprecated by patches and expansions, and new versions of the base game rig files can be found in DeltaBuild0.package. Pets in their own EP were made using the new format as well.


There were previously three formats of the RIG file.

  • The basic file content is a Granny 2 data file.
    • Apart from the official tools, there are some user-contributed tools for manipulating the data.
    • Get "Granny Viewer" from the altervista downloads page and you can load the data (export it as 'somefile.gr2').
    • Also related is this thread on Xentax.
  • A second format exists, where the Granny data is wrapped with some additional fields.
  • Starting with the Create A Pet Demo, there is a new third format that is unencrypted.


[edit] Olde Format

[edit] Optional wrapper

There is an optional wrapper to the Granny data. This can be identified by the first DWORD in the file being 0x8EAF13DE (i.e. the resource type). The format is:

[edit] Format

//Examples of this being used? What does "Int2" block or "Int2" Chunk mean here? Is it the data from Count1? Pljones 15:28, 17 October 2011 (EDT)

DWORD 0x8EAF13DE
DWORD 0
DWORD offset1			// To "Int2" block from start of Granny data
DWORD offset2			// To start of Granny data (from start of this DWORD)
DWORD IKChainsOffset		// To start first of "Int2" Chunk (from start of this DWORD)
DWORD IKTargetSlotsOffset	//(from start of this DWORD)
DWORD IKInfoNodeOffset		//(from start of this DWORD)
DWORD CompressNodeOffset	//(from start of this DWORD)
DWORD FullBoneListOffset	//(from start of this DWORD)
DWORD // unused offset?
DWORD // unused offset?
DWORD // unused offset?
DWORD // unused offset?

--insert Granny2 data
--Padding 00's to next even DWORD
 
DWORD Count1
--repetition Count1:
	DWORD offset to IK Chain entry (from start of this DWORD)
--repetition Count1:
	//IK Chain entry
	DWORD
	DWORD ChainLength
	BYTE[32] //00
	DWORD IK pole //Bone index from granny2 data
	DWORD Chain start //Bone index from granny2 data

	DWORD SlotInfoNode //Bone index from granny2 data
	DWORD SlotInfoRootNode //Bone index from granny2 data

	DWORD SlotOffsetNode //Bone index from granny2 data
	DWORD SlotOffsetRootNode //Bone index from granny2 data

	DWORD InfoNodeFlags //(bits 0-10 means that node is enabled)

	DWORD InfoNode0  //Bone index from granny2 data
	DWORD InfoNode1  //Bone index from granny2 data
	DWORD InfoNode2  //Bone index from granny2 data
	DWORD InfoNode3  //Bone index from granny2 data
	DWORD InfoNode4  //Bone index from granny2 data
	DWORD InfoNode5  //Bone index from granny2 data
	DWORD InfoNode6  //Bone index from granny2 data
	DWORD InfoNode7  //Bone index from granny2 data
	DWORD InfoNode8  //Bone index from granny2 data
	DWORD InfoNode9  //Bone index from granny2 data 
	DWORD InfoNode10 //Bone index from granny2 data

	--repetition(ChainLength)
		DWORD

	DWORD //0
	
	//Chain links 
	--repetition(ChainLength) 		
	 	DWORD EndBone //Bone index from granny2 data
	 	DWORD StartBone   //Bone index from granny2 data
//IK Target Slots
DWORD count
--repetition count
	DWORD //Bone index from granny2 data

BYTE[56] //00

//Info Nodes
DWORD count
--repetition count
	DWORD //Bone index from granny2 data

//Compress Nodes(i.e. "b__R_Calf__Compress__")
DWORD count
--repetition count
	DWORD //Bone index from granny2 data

//Full bone list(contains every bone from granny2 data)
DWORD count
--repetition count
	DWORD //Bone index from granny2 data

[edit] Granny2 Data

All offsets in this section start from the start of the Granny2 Data.

BYTE[16]		// See Rick's note below
DWORD Header Size	// ?
DWORD Header Format
DWORD Reserved
DWORD Reserved
DWORD Version		// 6
DWORD DataSize
DWORD CRC
DWORD SectionOffset
DWORD SectionCount	// 1
DWORD RootObjectTypeIndex
DWORD RootObjectTypeOffset
DWORD RootObjectIndex
DWORD RootObjectOffset
DWORD Tag		// 0x8000001C
DWORD StringDb CRC
DWORD[3] Unused
//Sections
--repeat(SectionCount)
	DWORD CompressionFormat	// 2 
	DWORD DataOffset
	DWORD DataSize
	DWORD DecompressedSize
	DWORD Alignment
	DWORD 
	DWORD 
	DWORD Int1Offset
	DWORD Int1Count 	// ?
	DWORD Int1EndOffset	// to start of byte after 	Int1 section
	DWORD

//Int1 Section		// does this repeat or what?
DWORD
DWORD
DWORD

// Data
BYTE[DataSize]

Rick adds:

The blobs that start with the following sequences are Granny2 data blocks:

B867B0CAF86DB10F84728C7E5E19001E
29DE6CC0BAA4532B25F5B7A5F666E2EE
0E1195B56AA5B54BEB2828502578B304
E59B495E6F631F141E13EBA990BEEDC4
3195D4E320DC4F62CC36D03AB182FF89

[edit] New Format

Starting with the Create A Pet Demo, there is a new third format of RIG files that is unencrypted. Version 3 contains no IK data, and zero-length skeleton name.

[edit] Format

DWORD Major Version? //3-4
DWORD Minor Version? //1-2
DWORD Bone Count
--repeat(Bone Count)
    FLOAT[3] Position
    FLOAT[4] Orientation //Quaternion 
    FLOAT[3] Scaling?
    DWORD Bone Name Length
    STRING (Bone Name Length ASCII characters)
    DWORD ??? // Something to do with mirrored bones.  It will be the same as the bone's index except in the case of Left/Right mirrored bones it is the index of it's opposite
    DWORD Parent Index
    DWORD Bone Name Hash (FNV 32)
    DWORD Flags? //Usually 0x23, except with mirrored bones, then one will be 0x3F
DWORD Skeleton Name Length
STRING (Skeleton Name Length ASCII characters)
--if(Version >= 4)
    DWORD IK Chain Count
    --repeat(IK Chain Count)
        DWORD Length
        --repeat(Length)  
            DWORD BoneIndex //bone index  
        DWORD InfoNode[11] //bone index 
        DWORD PoleVector //bone index 
        DWORD SlotInfo //bone index 
        DWORD SlotOffset //bone index 
        DWORD Root //bone index 
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