Forum Announcement, Click Here to Read More From EA_Cade.

bt request: MLOD (0x01D10F34)

cmarinetticmarinetti Posts: 147 Member
edited March 5 in Nominated Threads
@SimGuruModSquad

I see there's a new version of the MLOD chunk in this resource with City Living. Any chance of a bt? Thanks.
cmarNYC on MTS.
Post edited by EA_Cade on

Comments

  • SimGuruModSquadSimGuruModSquad Posts: 597 Member
    Hi @cmarinetti,

    We actually have not updated this resource for some time, but in order to avoid patching all these resources way back on EP01 we made it such that the version of the resource is only bumped if the model uses a particular feature (which adds some extra bounding box information). By default, this resource is exported at version 0x205 but if the new feature is used the version will be 0x206 - does that match what you are seeing?

    -SGMS
  • cmarinetticmarinetti Posts: 147 Member
    @SimGuruModSquad

    Hi, yes, I'm finding a set of 12 extra floats in some meshes in MLODs with version 0x206, thanks for letting me know they're extra bounding info and only appear with that version. My issue is among different meshes in an MLOD some may have the extra data and others don't, but I noticed it only seems to happen in meshes with more than one joint reference. Anyway, I'm using the mesh length to determine whether there's extra data, so I guess I'm set. Thanks!
    cmarNYC on MTS.
  • SimGuruModSquadSimGuruModSquad Posts: 597 Member
    Hi @cmarinetti,

    Yes that is the bounding box information. Here is a quick and dirty bt for that block, I haven't tested it extensively but I think it's correct:
    
    //
    //  MLOD block
    //
    
    typedef struct 
    {
        UINT32      mState;
        UINT32      mStartIndex;
        UINT32      mMinVertexIndex;
        UINT32      mVertexCount;
        UINT32      mPrimitiveCount;
    } PrimitiveInfoForState;
    
    typedef struct 
    {
        FLOAT min[3];
        FLOAT max[3];
    } BoundingBox;
    
    typedef struct(int version)
    {
        UINT32      mMeshLength;
        local int nextBlock = FTell() + mMeshLength;
    
        UINT32      mHashedName         <format=hex>;
        UINT32      mMaterialRef        <format=hex>;
        UINT32      mVertexFormatRef    <format=hex>;
        UINT32      mVertexBufferRef    <format=hex>;
        UINT32      mIndexBufferRef     <format=hex>;
        UINT32      mPrimitiveType : 8  <format=hex>;
        UINT32      mMeshFlags     : 24 <format=hex>;
        UINT32      mStreamOffset;
        UINT32      mStartVertex;
        UINT32      mStartIndex;
        UINT32      mMinVertexIndex;
        UINT32      mVertexCount;
        UINT32      mPrimitiveCount;
        BoundingBox mBoundingBox;
        INT32       mSkinRef;
        UINT32      mBoneCount;
    
        if (mBoneCount>0)
        {
            UINT32  mBoneHash[mBoneCount];
        }
    
        UINT32 mMeshMaterial <format=hex>;
    
        UINT32 mNumPrimInfo;
        if ( mNumPrimInfo > 0 )
        {
            PrimitiveInfoForState  mPrimitiveInfoForState[mNumPrimInfo];
        }
        UINT32  mParentBone <format=hex>;
        float   mMirrorPlane[4];
        UINT32  mSortOrderHint;  
    
        if (version >= 0x206 && (mMeshFlags & 0x4000) && mBoneCount > 0)
        {
            // Bone local bounding boxes
            BoundingBox mBoundingBoxBones[mBoneCount];
        }
    
        if (FTell()!= nextBlock)
        {
            Warning("Not all data read from MLOD.");
            return -1;
        }
    
    } MeshDiskFormat;
    
    typedef struct 
    {
        BlockSignature mMLODSignature;  // MLOD
        UINT32  mVersion <format=hex>;
        UINT32  mMeshCount;
        MeshDiskFormat mMeshData(mVersion)[mMeshCount] <optimize=false>;
    } MLOD;
    
    
    -SGMS
  • cmarinetticmarinetti Posts: 147 Member
    @SimGuruModSquad
    Very very helpful! Thank you!
    cmarNYC on MTS.

Leave a Comment

BoldItalicStrikethroughOrdered listUnordered list
Emoji
Image
Align leftAlign centerAlign rightToggle HTML viewToggle full pageToggle lights
Drop image/file
Return to top