@All
Been looking at the header/footers and think I've found a plausible
breaking scheme. Let me do a normal unit first, this is
feudal_knights_lod0
Code:
22 serialization::archive
3 4 4 4 8 1 0 0
meshtypeint = 256
Regular mesh, reading 4 bytes
0 0 0 0
0 1 0 0 0 0 0 4 0 1 3 1 0 0 0 0 0 7 0 1 0 2 0 0 0 0 0
number of bytes from tell() 69
number of bytes from bytecount 69
num_groups = 34
0 0
11 0 1 3
3 0 0 0 Arms arms_Lmail_01 210 (tris:) 0 0 0 0
0 0 0 0 0 10 0 1 0
4 0 0 0 11 0 3 0 0 0
11 0 5 0 0 0 Legs legs_01 244 (tris:) 0 0 0 0 0 10 0 6 0 0 0 11 0 5 0 0 0
11 0 7 0 0 0 Hands hands_01 202 (tris:) 0 0 0 0 0 10 0 8 0 0 0 11 0 7 0 0 0
11 0 9 0 0 0 Legs legs_02 244 (tris:) 0 0 0 0 0 10 0 10 0 0 0 11 0 9 0 0 0
11 0 11 0 0 0 Arms arms_Lmail_02 210 (tris:) 0 0 0 0 0 10 0 12 0 0 0 11 0 11 0 0 0
11 0 13 0 0 0 Arms arms_Lmail_03 210 (tris:) 0 0 0 0 0 10 0 14 0 0 0 11 0 13 0 0 0
11 0 15 0 0 0 Legs legs_03 244 (tris:) 0 0 0 0 0 10 0 16 0 0 0 11 0 15 0 0 0
11 0 17 0 0 0 Legs legs_04 244 (tris:) 0 0 0 0 0 10 0 18 0 0 0 11 0 17 0 0 0
11 0 19 0 0 0 Arms arms_Lmail_04 210 (tris:) 0 0 0 0 0 10 0 20 0 0 0 11 0 19 0 0 0
11 0 21 0 0 0 Body H_mail_body_01 270 (tris:) 0 0 0 0 0 10 0 22 0 0 0 11 0 21 0 0 0
11 0 23 0 0 0 Head Barrel_Helmet_03 192 (tris:) 0 0 0 0 0 10 0 24 0 0 0 11 0 23 0 0 0
11 0 25 0 0 0 Head Barrel_Helmet_01 176 (tris:) 0 0 0 0 0 10 0 26 0 0 0 11 0 25 0 0 0
11 0 27 0 0 0 Body H_mail_body_02 270 (tris:) 0 0 0 0 0 10 0 28 0 0 0 11 0 27 0 0 0
11 0 29 0 0 0 Body H_mail_body_03 270 (tris:) 0 0 0 0 0 10 0 30 0 0 0 11 0 29 0 0 0
11 0 31 0 0 0 Head Barrel_Helmet_02 186 (tris:) 0 0 0 0 0 10 0 32 0 0 0 11 0 31 0 0 0
11 0 33 0 0 0 Arms arms_Hmail_01 210 (tris:) 0 0 0 0 0 10 0 34 0 0 0 11 0 33 0 0 0
11 0 35 0 0 0 Attachments3 teeth 24 (tris:) 0 0 0 0 0 10 0 36 0 0 0 11 0 35 0 0 0
11 0 37 0 0 0 primaryactive0 light lance_0 78 (tris:) 0 0 0 0 0 10 0 38 0 0 0 11 0 37 0 0 0
11 0 39 0 0 0 secondaryactive0 sword secondary_25 64 (tris:) 0 0 0 0 0 10 0 40 0 0 0 11 0 39 0 0 0
11 0 41 0 0 0 secondaryactive0 sword secondary_26 64 (tris:) 0 0 0 0 0 10 0 42 0 0 0 11 0 41 0 0 0
11 0 43 0 0 0 secondaryactive0 sword secondary_27 64 (tris:) 0 0 0 0 0 10 0 44 0 0 0 11 0 43 0 0 0
11 0 45 0 0 0 secondaryactive1 sword secondary_31 108 (tris:) 0 0 0 0 0 10 0 46 0 0 0 11 0 45 0 0 0
11 0 47 0 0 0 secondaryactive1 sword secondary_32 108 (tris:) 0 0 0 0 0 10 0 48 0 0 0 11 0 47 0 0 0
11 0 49 0 0 0 secondaryactive1 sword secondary_33 108 (tris:) 0 0 0 0 0 10 0 50 0 0 0 11 0 49 0 0 0
11 0 51 0 0 0 shield0 heater pattern_79 70 (tris:) 0 0 0 0 0 10 0 52 0 0 0 11 0 51 0 0 0
11 0 53 0 0 0 shield0 heater pattern_80 70 (tris:) 0 0 0 0 0 10 0 54 0 0 0 11 0 53 0 0 0
11 0 55 0 0 0 shield0 heater pattern_81 70 (tris:) 0 0 0 0 0 10 0 56 0 0 0 11 0 55 0 0 0
11 0 57 0 0 0 shield0 heater pattern_82 70 (tris:) 0 0 0 0 0 10 0 58 0 0 0 11 0 57 0 0 0
11 0 59 0 0 0 shield0 heater pattern_83 70 (tris:) 0 0 0 0 0 10 0 60 0 0 0 11 0 59 0 0 0
11 0 61 0 0 0 shield0 heater pattern_84 70 (tris:) 0 0 0 0 0 10 0 62 0 0 0 11 0 61 0 0 0
11 0 63 0 0 0 shield0 heater pattern_85 70 (tris:) 0 0 0 0 0 10 0 64 0 0 0 11 0 63 0 0 0
11 0 65 0 0 0 shield0 heater pattern_86 70 (tris:) 0 0 0 0 0 10 0 66 0 0 0 11 0 65 0 0 0
11 0 67 0 0 0 shield0 heater pattern_87 70 (tris:) 0 0 0 0 0 10 0 68 0 0 0 11 0 67 0 0 0
11 0 69 0 0 0 shield0 heater pattern_88 70 (tris:) 0 0 0 0 0 10 0 70 0 0 0 11 0 69 0 0 0
6 0 1 0 71 0 0 0 7 0 2 0 0 0 142 17 0 0 0 0 2 0 0 0 0 0
18 0 1 0
72 0 0 0 4 0 0 0 0 0 4494 (uv coords: float pairs) 0 0 0 0 17 0 1 0
73 0 0 0 18 0 72 0 0 0
18 0 74 0 0 0 1 0 0 0 4494 (vert. wts: float pairs) 0 0 0 0 17 0 75 0 0 0 18 0 74 0 0 0 0 0 1 0 0 0 0 0
23 0 1 0
76 0 0 0 0 0 0 0 0 0 4494 (vert. vecs: float triple) 0 0 0 0 22 0 1 0
77 0 0 0 23 0 76 0 0 0 0 0 4 0 0 0 0 0
28 0 1 0
78 0 0 0 2 0 0 0 0 0 4494 (vert. bones: byte quads) 0 0 0 0 27 0 1 0
79 0 0 0 28 0 78 0 0 0
28 0 80 0 0 0 3 0 0 0 4494 (mystery strm: byte quads) 0 0 0 0 27 0 81 0 0 0 28 0 80 0 0 0
28 0 82 0 0 0 10 0 0 0 4494 (mystery strm: byte quads) 0 0 0 0 27 0 83 0 0 0 28 0 82 0 0 0
28 0 84 0 0 0 11 0 0 0 4494 (mystery strm: byte quads) 0 0 0 0 27 0 85 0 0 0 28 0 84 0 0 0
0 0 0 0 0 0 0 0 0 0
Bounding sphere data: 4 floats
0.00446363957599 0.432539612055 0.793390989304 1.68704903126
0 0 0 0
Processing bone strings, number = 26
11 bone_pelvis 0
11 bone_rthigh 1
14 bone_rlowerleg 2
10 bone_rfoot 3
8 bone_abs 4
10 bone_torso 5
9 bone_head 6
8 bone_jaw 7
12 bone_eyebrow 8
14 bone_rclavical 9
14 bone_rupperarm 10
11 bone_relbow 11
10 bone_rhand 12
14 bone_lclavical 13
14 bone_lupperarm 14
11 bone_lelbow 15
10 bone_lhand 16
11 bone_lthigh 17
14 bone_llowerleg 18
10 bone_lfoot 19
13 bone_weapon01 20
11 bone_weapon 20
13 bone_weapon02 21
13 bone_weapon03 22
13 bone_shield01 22
11 bone_shield 22
3 0 1 0 86 0 0 0 4 0 1 0 0 0 0 0 1 0 0 0 0 0 39 0 1 4 87 0 0 0
number of chars 13
characterlod0
17 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 4 0 0 0 1 0 0 0 3 0 0 0
18 192 63 0 4 0 0 0 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 9 0 0 0
0 0 0 64 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 8 0 0 0 2 0 0 0 0 0 0 0 128 63 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 128 63 0 0 0 0 0 0 0 0 2 0 0 0 0 0
128 63 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 128 63 0 0 0 0 0 0
0 0 2 0 0 0 0 0 128 63 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
128 63 0 0 0 0 0 0 0 0 2 0 0 0 0 0 128 63 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 128 63 0 0 0 0 0 0 0 0 2 0 0 0 0 0 128 63 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 128 63 0 0 0 0 0 0 0 0 2 0
0 0 0 0 128 63 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 128 63 0 0
0 0 0 0 0 0 2 0 0 0 0 0 128 63 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 128 63 0 0 0 0 0 0 0 0 2 0 0 0 0 0 128 63 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 128 63 0 0 0 0 0 0 0 0 38 0 1 0 88 0
0 0 39 0 87 0 0 0
0.00446363957599 0.432539612055 0.793390989304 1.68704903126
Bytecount is now 230546
Ignore the green highlighted stuff for the moment. It looks like you can
make up some "rules":
11 0 is the code for short triples (triangle data)
18 0 is the code for float pairs (uv coords and vertex weights)
23 0 is the code for float triples (vertex vectors and variant mystery streams, seen below in an aztec variant)
28 0 is the code for byte quads (regular mystery data and vertex bone assignments)
whenever you see these codes in the data header, they are repeated
along with a "one less" code in the footer. I.e. an 11 code section
has a 10 and 11 in its footer. This was pretty much my rationale
for breaking them up this way, that is, grouping what seemed to be
related data. The header and footers have running counts
which we've seen before.
There's also this "rule": After a two-byte code, if you get two more
bytes that start with a 1 (these are the red highlighted parts above)
like a 1 3 for the triangles or 1 0 in the vertex part, then you get
an extra two bytes in the footer with 1 0. In the case of the very
first triangle group you also get an extra 0 0 0 0 block as well.
Edit: always forget something in long posts, in the vertex parts when
you have a 1 0 following the code, you also get two extra zero bytes, 0 0,
in the header.
Let's repeat for the aztec variant:
Code:
22 serialization::archive
3 4 4 4 8 1 0 0
meshtypeint = 0
Variant mesh, NOT reading 4 bytes
0 1 0 0 0 0 0 4 0 1 3 0 0 0 0 0 0 7 0 1 0 1 0 0 0 0 0
number of bytes from tell() 65
number of bytes from bytecount 65
num_groups = 15
0 0
11 0 1 3
2 0 0 0 Body aztec 876 (tris:) 0 0 0 0
0 0 0 0 0 10 0 1 0
3 0 0 0 11 0 2 0 0 0
11 0 4 0 0 0 Attachments lip 2 (tris:) 1 0 0 0 0 10 0 5 0 0 0 11 0 4 0 0 0
11 0 6 0 0 0 Attachments nose 2 (tris:) 1 0 0 0 0 10 0 7 0 0 0 11 0 6 0 0 0
11 0 8 0 0 0 Hands Hands 190 (tris:) 0 0 0 0 0 10 0 9 0 0 0 11 0 8 0 0 0
11 0 10 0 0 0 Helmet Hat 116 (tris:) 0 0 0 0 0 10 0 11 0 0 0 11 0 10 0 0 0
11 0 12 0 0 0 Attachments Ear Things 40 (tris:) 1 0 0 0 0 10 0 13 0 0 0 11 0 12 0 0 0
11 0 14 0 0 0 Head Head 396 (tris:) 0 0 0 0 0 10 0 15 0 0 0 11 0 14 0 0 0
11 0 16 0 0 0 Head Head01 372 (tris:) 0 0 0 0 0 10 0 17 0 0 0 11 0 16 0 0 0
11 0 18 0 0 0 Head Head02 400 (tris:) 0 0 0 0 0 10 0 19 0 0 0 11 0 18 0 0 0
11 0 20 0 0 0 Head Head03 404 (tris:) 0 0 0 0 0 10 0 21 0 0 0 11 0 20 0 0 0
11 0 22 0 0 0 Head Head04 404 (tris:) 0 0 0 0 0 10 0 23 0 0 0 11 0 22 0 0 0
11 0 24 0 0 0 Helmet Head Dress 24 (tris:) 1 0 0 0 0 10 0 25 0 0 0 11 0 24 0 0 0
11 0 26 0 0 0 Body aztec01 876 (tris:) 0 0 0 0 0 10 0 27 0 0 0 11 0 26 0 0 0
11 0 28 0 0 0 Body aztec02 876 (tris:) 0 0 0 0 0 10 0 29 0 0 0 11 0 28 0 0 0
11 0 30 0 0 0 Body aztec03 876 (tris:) 0 0 0 0 0 10 0 31 0 0 0 11 0 30 0 0 0
6 0 1 0 32 0 0 0 7 0 1 0 0 0 224 16 0 0 0 0 2 0 0 0 0 0
18 0 1 0
33 0 0 0 4 0 0 0 0 0 4320 (uv coords: float pairs) 0 0 0 0 17 0 1 0
34 0 0 0 18 0 33 0 0 0
18 0 35 0 0 0 1 0 0 0 4320 (vert. wts: float pairs) 0 0 0 0 17 0 36 0 0 0 18 0 35 0 0 0 0 0 4 0 0 0 0 0
23 0 1 0
37 0 0 0 0 0 0 0 0 0 4320 (vert. vecs: float triple) 0 0 0 0 22 0 1 0
38 0 0 0 23 0 37 0 0 0
23 0 39 0 0 0 3 0 0 0 4320 (var myst: float triples) 0 0 0 0 22 0 40 0 0 0 23 0 39 0 0 0
23 0 41 0 0 0 10 0 0 0 4320 (var myst: float triples) 0 0 0 0 22 0 42 0 0 0 23 0 41 0 0 0
23 0 43 0 0 0 11 0 0 0 4320 (var myst: float triples) 0 0 0 0 22 0 44 0 0 0 23 0 43 0 0 0
0 0 1 0 0 0 0 0
28 0 1 0
45 0 0 0 2 0 0 0 0 0 4320 (vert. bones: byte quads) 0 0 0 0 27 0 1 0
46 0 0 0 28 0 45 0 0 0
0 0 0 0 0 0 0 0 0 0
-0.000567032024264 0.0598796904087 0.0334888845682 1.06927001476
0 0 0 0
Processing bone strings, number = 20
8 bone_abs 0
12 bone_eyebrow 1
9 bone_head 2
8 bone_jaw 3
14 bone_Lclavical 4
11 bone_Lelbow 5
10 bone_Lfoot 6
10 bone_Lhand 7
14 bone_Llowerleg 8
11 bone_LThigh 9
14 bone_Lupperarm 10
11 bone_pelvis 11
14 bone_Rclavical 12
11 bone_Relbow 13
10 bone_Rfoot 14
10 bone_Rhand 15
14 bone_Rlowerleg 16
11 bone_RThigh 17
14 bone_Rupperarm 18
10 bone_torso 19
3 0 1 0 47 0 0 0 4 0 0 0 0 0 0 0 1 0 0 0 0 0 39 0 1 4 48 0 0 0
number of chars 13
characterlod0
17 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 4 0 0 0 1 0 0 0 3 0 0 0
18 192 63 0 4 0 0 0 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 9 0 0 0
0 0 0 64 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 8 0 0 0 2 0 0 0 0 0 0 0 128 63 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 128 63 0 0 0 0 0 0 0 0 2 0 0 0 0 0
128 63 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 128 63 0 0 0 0 0 0
0 0 2 0 0 0 0 0 128 63 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
128 63 0 0 0 0 0 0 0 0 2 0 0 0 0 0 128 63 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 128 63 0 0 0 0 0 0 0 0 2 0 0 0 0 0 128 63 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 128 63 0 0 0 0 0 0 0 0 2 0
0 0 0 0 128 63 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 128 63 0 0
0 0 0 0 0 0 2 0 0 0 0 0 128 63 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 128 63 0 0 0 0 0 0 0 0 2 0 0 0 0 0 128 63 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 128 63 0 0 0 0 0 0 0 0 38 0 1 0 49 0
0 0 39 0 48 0 0 0
0.0324329286814 0.0481732748449 -0.0606130436063 1.08008432388
Bytecount is now 330874
The green highlights differences between the two.
The big header line at the top has 0 1 3 1 and 0 2 0 0 for the feudal knight
and has 0 1 3 0 and 0 1 0 0 for the variant. And as noted it has 4 bytes
less than regular units. The variant's sequence counts are even in the
headers but are odd for regular units.
After the triangle data the regular unit has a sequence 7 0 2 0 but the
variant has 7 0 1 0.
The vertex weights lines are very similar but feudal knights has the
final sequence 0 0 1 0 0 0 0 0 0 while the variant
has 0 0 4 0 0 0 0 0.
The oddest difference is on the vertex vectors line. The regular feudal
knight unit has the extra bytes 0 0 4 0 0 0 0 0 on this line and the
variant doesn't, yet the "codes" for both are identical. I was hoping
to discover local rules for codes controlling what get printed in the footers
but this case seems to rely on a global knowledge that this is a variant
type.
Note that not only does the variant have the mystery blocks before
the bones assignments, the streams aren't byte quad streams as
they are for regular units but float triples and the codes for the
mystery blocks change to reflect that.
Edit: the variant has attachments that have a 1 0 0 0 0 in the footer
(this has been noted in other's posts). However what determines
an attachment? The variant has lips, nose, and ear things as group
names and Attachments as group type as well as head dress of type
helmut that has the 1 0 0 0 0 but the feudal knight has teeth
of type Attachments3 and this just has all zeros 0 0 0 0 0. What's
the difference?
Anyway, that's all I've got for now.
Bookmarks