HOB format: remaining unknown fields
Starting a thread for findings on the remaining unknown fields in the HOB format.
dbg/dbg_HOB is very useful since it is a small file with only 3 simple objects. (https://github.com/dpethes/rerogue/pull/9 brings it into the model_viewer)
With reference to https://github.com/dpethes/rerogue/blob/master/doc/file_hob_spec.txt
Object [116B]
{
16B array of char : name
4B int : facegroups offset
4B int : object parts offset
4B int : facegroup header 2 offset
12B zero
These ints seem to maybe be offsets, but to/from what?
4B int : ? 94, 0xD4
4B int : ? 98, 0x100
4B int : ? 9C, 0x104
4B float : ?
-bark_moon, cldcar: 1.0
-sky, e_cor: 0.2
-wmvwing: 1.25
12B zero
5x 4B float : ?
4B int offset before 0xFFFFFFFF header end marker
I am pretty sure these last 6 floats are bounding box corners (x_min, y_min, z_min) (x_max, y_max, z_max)
6x 4B float : ?`
}
I think the 4th byte in each vertex is just padding? Is it ever anything except 0?
[...]
Vertices
{
2B int X
2B int Y
2B int Z
2B int ?
}
I wrote a Python parser using construct as a tool to investigate the file further. It works for data/dbg/dbg_HOB but not for other files - although the headers can be successfully parsed in some cases (I hope to add more functionality to make it able to handle stuff it doesn't understand yet, rather than just stopping - maybe I need to rewrite it in a more "offset-based" way).
A nice feature of construct is that it is symmetric, so (in theory) the same data structure can be used for parsing or for writing a file. For now it is just a computer-readable version of the spec...
Using this parser (and manual work with a hex editor), some interesting things I've noticed:
object_effects: this array (based on the strings) looks like it might describe parts of the object with reflective/emissive properties, like cockpit canopy glass, engine/engine glow, and the chrome on/data2/koelsch_HOB.unknown_matrices_maybe_orientation: these structs don't seem to contain any offsets and have strings like "ab", "scnd", "zf", "zt", "zb", "zr", "zl", and "trl" (these names look similar for the player craft I looked at, but are different in e.g.data/imp_stuff/atat_HOB). I call them "matrices" but I don't know what they are for sure.imp_stuff/tieinter_HOBseems to have another header following the 0xFFFFFFFF of the first one. The offsets to the two parts of this header are right after the offsets for the "normal" header, they are the first 8B of what is normally 12B of zeros in the Object struct.