Skip to content
Jocelyn Beedie edited this page Nov 27, 2020 · 7 revisions

Since this structure has a lot of optional structures, here is a special structure that will be used to simplify the structure:

struct Optional<T> {
    bool exists; // 1 byte
    // if exists == 1:
        T data;
    // end if
}

If Option.exists is 0, then sizeof(Optional<T>) == 1. if Option.exists is 1, then sizeof(Optional<T>) == 1 + sizeof(T).

struct Lod {
    TransformationHeader transform;
    Optional<float[4]> unk1;
    Optional<float[4]> unk2;
    Optional<float[9]> unk3; // unk3.data[7] is junk
    Optional<LodTransform> unk4;
    Optional<float[4]> unk5;
    Optional<?> unk6; // Always empty
    Optional<LodTransform> unk7;
    Optional<float[4]> unk8;
    Optional<?> unk9; // Always empty
    Optional<LodTransform> unk10;
    Optional<float[4]> unk11;
    Optional<?> unk12; // Always empty
    Optional<?> unk13; // Always empty
    Optional<float[4]> unk14;
    Optional<LodUnkStruct> unk15;
    Optional<float[4]> unk16;
    Optional<float[4]> unk17;
    float unk18[2];
    uint16_t unk19; // Either 0 or 128
    uint32_t num_skins; // Always 1
    int32_t skin_ids[num_skins]; // SKIN or MESH ids
    uint32_t num_anims;
    LodAnimEntry anims[num_anims];
    // if Lod.transform.subtype == 2:
        uint32_t num_sounds;
        LodSoundEntry sounds[num_sounds];
    // end if
}

unk6, unk9, unk12, and unk13 are always empty. unk16 always exists. unk2, unk11, and unk17 only exist if Lod.transform.subtype is 2. unk7 and unk10 only exist if Lod.transform.subtype is 0.

struct LodTransform {
    Mat4x4 transform;
    char[16] junk;
}
struct LodUnkStruct {
    float unk1[4];
    uint32_t unk2;
}

If Lod.transform.subtype is 0, then LodUnkStruct.unk2 is always 0xFFFFFFFF. If Lod.transform.subtype is 2, then LodUnkStruct.unk2 is always either 0 or 7.

struct LodAnimEntry {
    uint32_t anim_symbol_enum;
    int32_t animation_id; // ANIMATION ID
}
struct LodSoundEntry {
    uint32_t sound_symbol_enum;
    int32_t sound_id; // SOUND ID
}

For more information on LodAnimEntry.anim_symbol_enum, see the Animation Symbol Enum page.

Clone this wiki locally