Skip to content
Jocelyn Beedie edited this page Jul 23, 2020 · 18 revisions

A lot of data within the Node structure is dependent on the resource_id.

struct Node {
    int32_t parent_node_id;
    int32_t unknown_node_ids[3];
    int32_t resource_id; // Depends on what this node is for; lighting nodes tend to use LIGHT files, particle nodes tend to use PARTICLE files, etc.
    int32_t datatype_id; // Data type (see table below)
    // if datatype_id != 0:
        NodeDataUnion node_data; // Structure depends on datatype_id; has variable size
    //
    int32_t light_id; // LIGHT file, may be 0
    int32_t hfog_id; // HFOG file, may be 0
    uint32_t userdefine_id; // USERDEFINE file, may be 0
    float floatv1[9]; // Unknown usage, related to transforms somehow
    float floatv2[9]; // Unknown usage, related to transforms somehow
    Mat4x4 local_transform;
    Vector3 local_translation;
    char junk[4];
    Quaternion local_rotation;
    Vector3 local_scale;
    char junk2[4];
    float unk1[2];
    uint32_t unk2[8];
    float unk3[4];
    Mat4x4 global_transform;
    Mat4x4 global_transform_inverse;
}

NodeDataUnion

union NodeDataUnion {
    NodeDataLod lod;             // variable size
    NodeDataSkin skin;           // variable size
    NodeDataSurface surface;     // 40B
    NodeDataRotshape rotshape;   // 62B
    NodeDataMesh mesh;           // 28B
    NodeDataParticles particles; // 30B
}
struct NodeDataLod {
    int32_t path_id;
    int32_t subtype_id;
    // ...
}
struct NodeDataSkin {
    int32_t path_id;
    int32_t subtype_id;
    // ...
}
struct NodeDataSurface {
    int32_t data_id;
    int32_t subtype_id;
    float data[8]; // Always {0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0}
}
struct NodeDataRotshape {
    int32_t data_id;
    int32_t subtype_id;
    // ...
}
struct NodeDataMesh {
    int32_t data_id;
    int32_t subtype_id;
    float data[5]; // Always {0.0, 0.0, 0.0, 0.0, 1.0}
}
struct NodeDataParticles {
    int32_t data_id;
    int32_t subtype_id;
    // ...
}

General substructure info

data_id is often the hash of the string that subtype_id hashes, but with "_DATA" concatenated to the end; for example, if subtype_id is the hash of "GOOBUBBLEPOP", then data_id is the hash of "GOOBUBBLEPOP_DATA".

Resource Type datatype_id (hash of)
SURFACE SURFACEDATA
SKIN SKEL
ROTSHAPE ROTSHAPEDATA
LOD LODDATA
MESH MESHDATA
PARTICLES PARTICLESDATA
Clone this wiki locally