Twili Posted May 20, 2014 Share Posted May 20, 2014 http://www.mediafire.com/download/z0rj1kemar8bq21/ActorCommonBCHs.rar Join me in figuring out the model format for A Link Between Worlds! These were extracted from ActorCommon.szs, so they're the models used in many places, such as Link. Here's what I know so far about the format, using Link's model (055.bch) as an example: === HEADER 0x0: Magic word "BCH" (null-terminated.) 0x4: Unknown, is set to 2121E1A2 in every file. 0x8: Chunk 1 pointer. (44000000) Needs to be word-swapped. 0xC: Chunk 2 pointer. (643A0000) Needs to be word-swapped. 0x10: Chunk 3 pointer. (A03E0000) Needs to be word-swapped. 0x14: Chunk 4 pointer. (00780000) Needs to be word-swapped. 0x18: Chunk 5 pointer. (00900300) Needs to be word-swapped. 0x1C: Chunk 6 pointer. (8C250400) Needs to be word-swapped. 0x20: Chunk 1 size. (203A0000) Needs to be word-swapped. 0x24: Chunk 2 size. (30040000) Needs to be word-swapped. 0x28: Chunk 3 size. (20390000) Needs to be word-swapped. 0x2C: Unknown. (28180300) Needs to be word-swapped. 0x30: Also unknown. (A4950000) Needs to be word-swapped. You would think that these are the sizes for chunks 4 and 5, but adding them to the pointers results in them running past the start of the next chunk. 0x34: Chunk 6 size. Needs to be word-swapped. (CC0B0000) 0x38: Another unknown value (D0010000), but is as big as the half-word at 0x42 multiplied by 4. This applies to every file. Needs to be word-swapped. 0x3C: Reserved? Set to 00000000 in every file. 0x40: A half-word that needs to be byte-swapped. 0100 (0001 byte-swapped) in every file except 065.bch, where it is 0000. 0x42: The half-word that when multiplied by 4 equals the value at 0x38, and needs to be byte-swapped first of course. (7400) === Chunk 2 will be mentioned first because it's used by others. It's purely null-terminated strings that aren't aligned. Excerpt: 2@DefaultShader-s2-nl.3@DefaultShader-nl.LarmA_jnt.LarmB_jnt.Lclotch_jnt.Link_model. === Chunk 1 contains the skeleton, I assume? If you search for pointers relative to the start of Chunk 2 in your hex editor, such as 3D000000 (0000003D word-swapped) which goes to "Lclotch_jnt", you will find them. I literally don't have any more of a clue as to the format of this chunk, as it's extremely convoluted, like the others! === Chunk 3 I know for certain loads indices and points to textures. Examples... 00EC0200 27020F00 08040000 28020F00 The above is at 0x54C0 (absolute.) Again, everything needs to be word-swapped. The first word is a relative pointer into Chunk 4. The third word is the size of the indices data requested, so divide this by 2 if you wish for the amount of indices. I don't know for certain what purpose words two and four serve. 80100000 9D000F00 0D000000 9E000F00 The above is at 0x67E0 (absolute.) Word-swapping needed. I only know that the first word is a relative pointer into Chunk 4. This is for a texture. Each texture seems to be pointed to three times for some reason. That's all that I know about Chunk 3 now. No determining how the data is pointed to for specific model parts yet. === Chunk 4 contains textures and indices. That's all I've got to say. === Chunk 5 is the vertices, normals, and texture coordinates. Nothing else about it for now. === Chunk 6 I have no idea about. === I hope that somebody can make use of these notes, which are incredibly lacking. Link to comment Share on other sites More sharing options...
hannssoni Posted May 20, 2014 Share Posted May 20, 2014 i didn't know ALBW files were leaked (or ripped ) do you have map files? or just the models ... Link to comment Share on other sites More sharing options...
Twili Posted May 20, 2014 Author Share Posted May 20, 2014 Only these models. No maps. Link to comment Share on other sites More sharing options...
hannssoni Posted May 20, 2014 Share Posted May 20, 2014 ok... Link to comment Share on other sites More sharing options...
Twili Posted May 21, 2014 Author Share Posted May 21, 2014 Also, these Python scripts by smealum are supposed to convert from BCH to OBJ, but the files from ALBW don't quite follow the same format: https://gist.github.com/smealum/9394125 So it's pretty much a dead end until it can be figured out. Link to comment Share on other sites More sharing options...
Arcaith Posted May 21, 2014 Share Posted May 21, 2014 I'm wondering if the differences in the format might be due to additional transform data for the perspective trick. Unless it's an easily applied global macro, that might be what's causing the differences in the files. Link to comment Share on other sites More sharing options...
Antidote Posted May 29, 2014 Share Posted May 29, 2014 Arcaith, you would appear to be correct, there is indeed a transformation matrix right smack where the script is expecting there to be face definitions Link to comment Share on other sites More sharing options...
Twili Posted May 29, 2014 Author Share Posted May 29, 2014 Link to comment Share on other sites More sharing options...
Arcaith Posted May 29, 2014 Share Posted May 29, 2014 Awesome Progress is always cool. If my little suggestion helped, I'm glad Link to comment Share on other sites More sharing options...
Twili Posted July 16, 2014 Author Share Posted July 16, 2014 I've learned more since I made the video, and now models won't be missing any parts. Download all of the models I was able to convert here: http://www.mediafire.com/download/plcefyev2rdb827/ActorCommonOBJs.rar And here: http://www.mediafire.com/download/l6ld0ccbi9gsviv/Demo8OBJs.rar They still lack textures, because I don't understand the texture format yet. But you can give them funky custom textures if you want to use them for anything. Here's some previews of the characters only: Link model comparison (gameplay versus cutscenes): The cutscene model has two sets of hands; open and closed. Princess model comparison (Hilda versus Zelda): Ravio model comparison (hood down (most of the game) versus hood up): Irene: 1 Link to comment Share on other sites More sharing options...
Recommended Posts