-
-
Notifications
You must be signed in to change notification settings - Fork 5
[Help]: .unit format discovery thread #1
Comments
This mesh should have animation data: 0x990B45D5D75FFF3A, 28. File contains errors #4, #6 and #3. The values in 0x7, 0x1f suggest it is indeed (type_2b_wide)[4], but the order is not exactly described. It looks like it'd be half, though it is unclear what the 4th value is for. Most of the time, it is 0, but rarely it is non-zero in the "exact" amount that's missing from [nX, nY, nZ]. |
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as resolved.
This comment was marked as resolved.
We've had the mesh structure all wrong, and didn't notice it until now.
This is big. It means that several meshes were incomplete by default, since we assumed there was only one set of vertex/index information. I'm not sure why the vertex_offset and vertex_count repeat as well, but they haven't changed yet. |
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
Hashes appear to be MurmurHash(2) 64bit version. Not quite sure how to implement it, but I'll focus on proper exports for now. |
This comment was marked as resolved.
This comment was marked as resolved.
The matrices and vectors in __unk1 seem to be related to something. There's some kind of relationship tree happening there, but I don't quite understand how it works yet. |
Similarly, __unk6 seems to belong to the same type of relationship. |
The end of __unk1 overlaps with __unk5 if __unk5 is present. |
No apparent relation between bones file and __unk1. Number of bones doesn't ever match up with the number stored in there. |
I'm probably approaching this from the wrong angle. I'm assuming that the game engine uses a model format, but this is clearly multiple models in one. It could very well have merged all the meshes into one cluster. It doesn't quite explain where animation and bone data goes though. As far as I can tell, each of these .unit files is usually accompanied by .bones, .state_machine, .physics and .dfde6a8797b4c0ea. For units without a .bones file, the ones that are present are .physics and .dfde6a8797b4c0ea. For units with a .bones files, the .dfde6a8797b4c0ea is replaced with .state_machine often. |
We also see .336bdb8766bd591d accompanying the same file - possibly another part of the .unit file. |
Also of note is that several of the files are very clearly Havok Physics, and they all seem to be related to the bones in the model. |
May have found some sort of LoD or similar? __unk0.__unk_data[].__unk_data[].data[] is always lower than the maximum amount of meshes. Seems to cluster together around meshes. |
__unk5 appears to also limit itself to the number of meshes in the unit file. |
Unfortunately my theory about type 7 and 6 not fitting in the vertex stride was destroyed by another file having a vertex stride where they fit again. |
Format 24 might be "Bone Indices" and Format 25 is "Bone Weights". These both appear to be u8vec4_t |
Format 24, 25 and 26 are still unknown. 25 is definitely not bone indices, as either there are 65535 possible bones, or most models refer to bone 255 and assign a weight of 0 to it - assuming 24 is bone weights. |
Formats:
Types:
|
content/objectives/obj_common/gneeric_intel/generic_intel.unit
|
content/fac_helldivers/vehicles/lav/lav.unit
|
content/fac_helldives/vehicles/combat_walker/combat_walker.unit
|
Tough nut to crack, but I've finally made progress. Turns out it wasn't two 4x4 matrices, but instead one structure containing the data to make the matrix, and an actual list of precalculated matrices. This could have been used to offset the abysmal performance of the AMD Bulldozer CPUs/APUs that were in use around the time the engine was alive and maintained.
We now have a reasonably deep understanding to reproduce a mesh tree in glTF format. |
All of this will aid in the correct conversion of the mesh in the end.
Everything about the
.unit
file structure.Known Information
Related links:
The text was updated successfully, but these errors were encountered: