Re: GuildWars models
Posted: Sun Jan 22, 2012 10:49 am
There are so many "if else if not then else " in the script format/script it's even hard for me to follow the code but i'll give it a shot.
Global overview of the file:

Header:
Modifiers:
Meshmodifiers:
Face-Vertex:
After that the facelist immediately starts, followed by the vertex list:
after the vertex list comes a chunk which i do not know what it does: (part 1 and 2 described above in light and dark gray)

immediately the face count + vertex count again if multiple meshes in file
Global overview of the file:

Header:
Code: Select all
4 bytes = FFNA
1 byte = constant 02 for models
4 bytes = might be the difference between a model file and an animation file but i still have to look into that
4 bytes = INT slightly smaller than filesize
1 byte = always 26, end of header
Code: Select all
7 bytes = unknown
4 bytes = has an impact on how many meshes, usually if not 0800 or 09xx it's +2 meshes and weird behavior
4 bytes = TYPEA : defines global behavior on every part of the rest of the file
-reduce meshamount
-more dwords in the vertex list
-behavior after/inbetween vertex lists
4 bytes = TYPEB : I haven't seen it influence anything (yet)
20 bytes = "modifiers" -> determine, along with the mesh modifiers( listed lower) how many bytes are in between meshmodifiers and facelist
8 bytes = double float : small range of constant floats, could be scaling values
20 bytes = unknown
1 byte = amount of "meshes"
Code: Select all
15 bytes = unknown
meshamount * 8 bytes = i think global mesh info, it's mostly the last byte (#8) that influences anything in the file; here there are 2 "meshes"
next bytes untill end of image (usually terminated by "00 00 00 00") I have no clue what they do, probably some shadow settings or whatnot, way too complicated
Code: Select all
12 Bytes = 3 * Int : amount of triangles in the facelist, they add up if the values differ from eachother
4 bytes = Int : amount of vertices
4 bytes = Int : defines the amount of dwords in 1 "vertex line","17" adds a "00 00 00 00" inbetween xyz and the normals
8 bytes = 2 * Int: add up to define part 1 after vertex list
4 bytes = Int: define part 2 after vertex list
Code: Select all
12 bytes = 3* float = x,y,z
depending what else is in there it usually is, I have seen it add up to 12*4 bytes, perhaps bones? still have to look into it
12 bytes = normals
8 bytes = UV

immediately the face count + vertex count again if multiple meshes in file