Sims 3:0x01D10F34

From SimsWiki
Revision as of 15:50, 25 November 2010 by Pljones (Talk | contribs)

Jump to: navigation, search
Modding Reference by Category

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

Object Model - MLOD
TypeID:0x01D10F34
Game Version:The Sims 3



Contents

Overview

This is an RCOL chunk. LOD means Level of detail. This chunk is found in both MLOD and MODL 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.

Format

DWORD   // 'MLOD'
DWORD   // type
DWORD   // group_count
repeat group_count times:
	DWORD    // subset_bytes  number of bytes after here in this repetition
	DWORD    // FNV32 of the group name
	DWORD    // MATD or MTST Private index
	DWORD    // VRTF Private index
	DWORD    // VBUF Private index
	DWORD    // IBUF Private index
	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
	DWORD    // SKIN Private index
	DWORD    // bone_count
	repeat bone_count times:
		DWORD    // bone hash name
    	DWORD    // MATD Private index
    	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
	if(version > 0x00000201)
		FLOAT	// unknown purpose; 0.0
		FLOAT	// unknown purpose; 0.0
		FLOAT	// unknown purpose; 0.0
		FLOAT	// unknown purpose; 1.0
		FLOAT	// unknown purpose; 0.0

Geometry States

Geometry states are basically a way to make part of an object's mesh visible while the rest of it becomes invisible. The polygons and vertices that are visible in the geometry state are determined by the state's poly and vertex offsets and counts.

The purpose of geometry states is to sub-divide the mesh of a given group, allowing the model's visibility 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.

UPDATE:

  • The current theory is that when the hash of a geometry state name does not explicitly match any of the geometry states in the mesh's model, the entire model becomes visible.
  • Also, the geometry state only effects the group that it is in. All other groups remain completely visible despite the current geometry state of one of the group.
  • By creating what can be called a "zero" geometry state, with offset and count values all equal to zero, the group that the geometry state is an can be hidden in the game when that state is entered.
  • An example is the garden sprinkler, which has two groups, one of which contains the sprinkler and the "dome" that you see in build/buy mode, and the other containing only the dome itself.
  • The group that contains only the dome has a single geometry state, "domeOff", which is a zero geometry state. When this state is entered, the dome disappears, and the scripts enter it whenever Live Mode is entered.
  • When Build or Buy Mode is entered, the scripts enter the "domeOn" geometry state. Since this state is not explicitly defined in the model, entering this state causes the entire model, including the dome, to become visible.
  • Based on contributions from karybdis, atavera and ChaosMageX
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