Looking for help decoding .AMD model files
Posted: Sun Feb 02, 2014 10:25 am
I've been trying my hand at ripping models (and hopefully animations as well) from an old Atlus game on GCN called Go! Go! Hypergrind. I've had some experience hacking games and deciphering file formats in the past, and I've made some progress already: I can figure out the file offsets in the main .amd model files, for the most part, and I've written up a little Python program that can read verts, or what look very much like verts - I'll admit I'm not 100% sure I'm looking at the right data.
I've been using sunglass.amd as a test bed for my format-reading capabilities, and while I get something that does look like sunglasses by reading the (big-endian) floats that start at the offset given at 0x30 (unsigned int, big-endian), the outline I'm getting doesn't quite match the model I've seen in screenshots. Reading the other sets of vertices (offset at 0x34) usually gives me these odd geometric patterns, like spheres or ring shapes: I was assuming they were something like collision shapes, or perhaps normals, but given what I thought were verts aren't quite matching up, I have to reexamine my assumptions. Even more confusing, the data starting from the offset given at 0x2C appears to be face data, but the vertex indices go up to 0x1E when my first set of vertices has only 0x10, and even if I use only the indices that are under 0x10 to construct triangles, I get random junk. However, the second set of vertices has 0x1F, and using them to make triangles gives me nice geometric shapes - not at all the ones I'm expecting, but it certainly suggests these are the real model verts...somehow.
At any rate, my own research into the subject of GCN 3D models has run into a dead end: all the documentation I've been able to find on the subject is either incomplete or irrelevant. I'm hoping someone with more experience and sharper eyes for this kind of stuff could outline what I'm getting wrong and put me back on the right track. I've attached a sample .zip containing some files: two simple meshes, the aforementioned sunglass.amd and castanets.amd, and some additional files which go with them. I know .tpl is a texture format (and some of my successful Google delving suggests they're S3TC-encoded - hopefully I can find some more information on the format), but I'm not sure what to do with the .ld or .skn files. I'm assuming .skn is "skin"; perhaps UV data of some kind? But I don't know what to make of .ld apart from the "LNK" magic ID at the start - and the main model has one that's over 2 megabytes in size, so I have a feeling it's important. I'm not looking for hand-holding or people to do the hard work for me; I've had experience with this kind of stuff before (though never in relation to 3D files, I'll admit) and I can write my own tools, but I just don't have the experience or the context to solve this puzzle on my own.
I just hope I've done a good enough job explaining what I've worked out so far that I don't sound like some newbie crying for help. ^_^;
EDIT: It might also help if someone could point me to info on any documented GCN model/animation formats. They might not be compatible, but they'd give me a point of reference to work from.
I've been using sunglass.amd as a test bed for my format-reading capabilities, and while I get something that does look like sunglasses by reading the (big-endian) floats that start at the offset given at 0x30 (unsigned int, big-endian), the outline I'm getting doesn't quite match the model I've seen in screenshots. Reading the other sets of vertices (offset at 0x34) usually gives me these odd geometric patterns, like spheres or ring shapes: I was assuming they were something like collision shapes, or perhaps normals, but given what I thought were verts aren't quite matching up, I have to reexamine my assumptions. Even more confusing, the data starting from the offset given at 0x2C appears to be face data, but the vertex indices go up to 0x1E when my first set of vertices has only 0x10, and even if I use only the indices that are under 0x10 to construct triangles, I get random junk. However, the second set of vertices has 0x1F, and using them to make triangles gives me nice geometric shapes - not at all the ones I'm expecting, but it certainly suggests these are the real model verts...somehow.
At any rate, my own research into the subject of GCN 3D models has run into a dead end: all the documentation I've been able to find on the subject is either incomplete or irrelevant. I'm hoping someone with more experience and sharper eyes for this kind of stuff could outline what I'm getting wrong and put me back on the right track. I've attached a sample .zip containing some files: two simple meshes, the aforementioned sunglass.amd and castanets.amd, and some additional files which go with them. I know .tpl is a texture format (and some of my successful Google delving suggests they're S3TC-encoded - hopefully I can find some more information on the format), but I'm not sure what to do with the .ld or .skn files. I'm assuming .skn is "skin"; perhaps UV data of some kind? But I don't know what to make of .ld apart from the "LNK" magic ID at the start - and the main model has one that's over 2 megabytes in size, so I have a feeling it's important. I'm not looking for hand-holding or people to do the hard work for me; I've had experience with this kind of stuff before (though never in relation to 3D files, I'll admit) and I can write my own tools, but I just don't have the experience or the context to solve this puzzle on my own.
I just hope I've done a good enough job explaining what I've worked out so far that I don't sound like some newbie crying for help. ^_^;
EDIT: It might also help if someone could point me to info on any documented GCN model/animation formats. They might not be compatible, but they'd give me a point of reference to work from.

