Sims 3:0x01D10F34

From SimsWiki
Revision as of 20:36, 27 August 2009 by ChaosMageX (Talk | contribs)

Jump to: navigation, search

Sims 3:Main Page -> Sims 3:PackedFileTypes
Sims 3:Main Page -> Sims 3:RCOL


Object Model LOD

This is a Sims_3:RCOL chunk. LOD means Level of detail. This chunk is found in both .lod and .model files, and it is the key that maps each mesh group to the appropriate parts of VRTF, VBUF, IBUF, SKIN and MATD chunks. It is the one ring to rule them all.

DWORD   // 'MLOD'
DWORD   // type
DWORD   // group_count

repeat group_count times:

   DWORD    // subset_bytes  number of bytes after here in this repetition
   DWORD    // unknown purpose
   DWORD    // (MATD relative index) | 0x10000000
   DWORD    // (VRTF relative index) | 0x10000000
   DWORD    // (VBUF relative index) | 0x10000000
   DWORD    // (IBUF relative index) | 0x10000000
   DWORD    // VBUF type
   QWORD    // VBUF offset   in bytes
   QWORD    // IBUF offset   in facepoints (three per polygon)
   DWORD    // VBUF count    vertex count
   DWORD    // IBUF count    face count (one per polygon)
   FLOAT[6] // BoundingBox   MinX/MinY/MinZ/MaxX/MaxY/MaxZ for this group

Appears in MLOD for musicalInstrumentGuitar and possibly other objects:

   DWORD    // unknown
   DWORD    // unknown

Appears in all MLODs:

   DWORD    // (SKIN relative index) | 0x10000000
   DWORD    // bone_count

repeat bone_count times:

   DWORD    // bone hash name

The data that follows depends on the type value

This was the original format posted:

   DWORD    // (MATD relative index) | 0x10000000
   FLOAT[6]
   ....     // depending on type value, additional data may be present, purpose undetermined

This is format observed (so far) in MLODs having multiple "geometry states", hereafter abbreviated as GEO_ST:

   DWORD    // (GEO_ST relative index) | 0x10000000
   DWORD    // geo_st_count

repeat geo_st_count times:

   DWORD    // geo_st name hash
   DWORD    // (IBUF starting index) * 3    index of the first vertex of the geo_st
   DWORD    // VBUF starting index          index of the first polygon face of the geo_st
   DWORD    // VBUF count                   number of vertices in the geo_st
   DWORD    // IBUF count                   number of polygon faces in the geo_st

Finally, the MLOD block is ended with:

   FLOAT[6] // unknown purpose; so far, only value encountered is (0.0, 0.0, 0.0, 1.0, 0.0)




The purpose of geometry states is to sub-divide the mesh of a given group, allowing the model to be dynamically changed by the game through the function:

   ScriptCore.World.ObjectSetGeometryVisibilityState(ObjectGuid objId, string geometryVisibilityState);

For most objects with geometry states, this function is commonly accessed through this function:

   Sims3.Gameplay.Abstracts.GameObject.SetGeometryState(string state);

For some objects, the string argument is fnv32 hashed and matched to the corresponding geo_st name hash. However, in some cases, such as for the musicalInstrumentGuitar, it is unknown how some geometry states are located for the game. In the case of the guitar, two geometry states are given in the MLOD block:

   0x4A9A1FD1 "guitarOnly"
   0x019C3651 "standOnly"

However, the guitar's code uses the string "guitarAndStand" to combine the two states and get the complete mesh. How this is done is still unknown.


Sims 3:Main Page -> Sims 3:PackedFileTypes
Sims 3:Main Page -> Sims 3:RCOL

Based on contributions from karybdis and atavera and ChaosMageX

Personal tools
Namespaces

Variants
Actions
Navigation
game select
Toolbox