Page 1 of 5

Kingdom Hearts MDLX and Re:coded File Viewer (Request?)

Posted: Mon Nov 15, 2010 7:13 pm
by Mirrorman95
I have been using ModelViewerWXD3D9 for the longest time to view my Kingdom Hearts models, but it only can view about half of them without crashing. When I export those models to OBJs with 3D Ripper DX 1.8, they all get stretched upwards, which makes them difficult to look at and completely ruins some models like Jafar's lamp. It can't even view a.fm or adpx files. Also, there are no programs that can extract and/or view the 3D models within the p2 and z files from 358/2 and Re:coded, and no one has posted on the original topic for those models in weeks. And furthermore, the Re:COM 3D model format has not been cracked either, to the best of my knowledge. Is there a program, or a plugin for a program, or anything else that could help solve any of the above problems?

Re: Kingdom Hearts MDLX and Re:coded File Viewer (Request?)

Posted: Mon Nov 15, 2010 7:27 pm
by ultimaespio
For MDLX, there is another model view that supports animations. Can't remember it's name though.

Nobody has bothered with Re Com because all the models in there are in KH1/2. There are no Highpoly models because all the cutscenes are pre recorded. There isn't much new stuff to get from it.

Re: Kingdom Hearts MDLX and Re:coded File Viewer (Request?)

Posted: Mon Nov 15, 2010 7:34 pm
by Mirrorman95
Where can I download this other viewer?

Re: Kingdom Hearts MDLX and Re:coded File Viewer (Request?)

Posted: Mon Nov 15, 2010 7:45 pm
by ultimaespio
The contents of this post was deleted because of possible forum rules violation.

Re: Kingdom Hearts MDLX and Re:coded File Viewer (Request?)

Posted: Mon Nov 15, 2010 7:54 pm
by Mirrorman95
The 3D viewport won't show me anything. How do I see the models?

Hold on, I figured it out. Thank you.

Re: Kingdom Hearts MDLX and Re:coded File Viewer (Request?)

Posted: Mon Nov 15, 2010 11:06 pm
by Mirrorman95
Also, is it possible to make a MDLX plugin for Noesis? Or at least a way to capture them without being stretched?

Re: Kingdom Hearts MDLX and Re:coded File Viewer (Request?)

Posted: Sun Nov 21, 2010 3:29 am
by revelation
Not yet....don't know when i will get around to converting my code over to noesis.
Image

Re: Kingdom Hearts MDLX and Re:coded File Viewer (Request?)

Posted: Sun Nov 21, 2010 1:32 pm
by Mirrorman95
Well, I can sleep soundly at night knowing that there will be a MDLX plugin for Noesis eventually. Thank you, revelation.

Re: Kingdom Hearts MDLX and Re:coded File Viewer (Request?)

Posted: Mon Nov 22, 2010 4:36 am
by Zerox
I'd personally appreciate a re:coded/days (same format for the models in both games) plug in for Noesis more. Though either would be great. Mostly I'm posting to get notifications of when a reply is posted.

Re: Kingdom Hearts MDLX and Re:coded File Viewer (Request?)

Posted: Mon Nov 22, 2010 10:54 am
by valvoga
revelation you are aweeeeeesome
Even Mr.Burn say
Image

Re: Kingdom Hearts MDLX and Re:coded File Viewer (Request?)

Posted: Tue Nov 23, 2010 10:47 pm
by Mirrorman95
I have found out the next step in extracting the models from 358/2, and by extension, Re:coded. The z files in the data/mi/ch/ folder contain character models. I think 0D, 43, and 56 all are models of Xion, and 3E is the model of Ven. If you download DSDecmp, and make a bat in the same folder with the command "DSDecmp X Y", where X is the filepath of the .z file and Y is is the filepath of the folder you would like the extracted file to go, then by running that bat, a .KAPH file of the same name will appear in that folder. Within those .KAPH files are BMD0 (Models), BCA0 (Animations), and other things. I learned much of this from http://forums.qhimm.com/index.php?topic=10792.0 and http://forums.qhimm.com/index.php?topic=8521.0 .
The BMD0 files can be opened with the nsbmd tool, but they have "custom opcodes" which makes it difficult to view them properly. I'm still not sure how to extract the BMD0s from the KAPHs, and I don't know how to fix the opcode issue.
The NSBMD Tool can be found at http://pokemonhackingclub.webs.com/Programs/NSBMD.zip .
Crystal Tile 2 has AsmView, which shows the file in terms of the ARM9 NDS processor.
A tool that is also useful for this is the video game Console Tool.
And apparently, Zerox already extracted the models.

Re: Kingdom Hearts MDLX and Re:coded File Viewer (Request?)

Posted: Wed Nov 24, 2010 1:19 am
by Zerox
If you guys want I could post what I used to extract the BMD0 and BMT (texture files) from the compressed files. Because if we can just figure out the already decompressed models that'd be good enough for me.

Re: Kingdom Hearts MDLX and Re:coded File Viewer (Request?)

Posted: Wed Nov 24, 2010 4:17 am
by Mirrorman95
The contents of this post was deleted because of possible forum rules violation.

Re: Kingdom Hearts MDLX and Re:coded File Viewer (Request?)

Posted: Wed Dec 01, 2010 4:28 am
by Zerox
Mirror man they're the same as 358/2 days models. So to decrypt them you could use the programs Barubary made. Here's those and info on the format:

I have more progress on the files of Days and Re:coded thanks to Barubary. I'll post quotes of what he told me about it. I hope this can help you guys figure out this format even further.
Barubary wrote: - .z files are LZ-compressed files
- .p2 files have the following format:

Code: Select all

char[2] magicHeader; // 'P2'
WORD nFiles; // maybe longer/shorter. MSB flags filenames
QWORD padding;
DWORD dataStart;
WORD offsets[nFiles]; // to get real offset: << 9 + dataStart
WORD padding; // only if nFiles % 2 = 1
DWORD sizesAndFlags[nFiles]; // MSB flags compression
char filenames[8][nFiles]; // length 0 if nFiles & 0x8000 != 0
byte* data; // possibly preceded by padding, so that start matches dataStart
- .pak files have the following format:

Code: Select all

char[4] magicHeader; // 'KAPH'
DWORD padding; // ?
// if any of the offsets below are FFFFFFFF, it is not present
DWORD BCAdataOffset;
DWORD BVAdataOffset;
DWORD BMAdataOffset;
DWORD BTPdataOffset;
DWORD BTAdataOffset;
DWORD unknownOffset1;
DWORD unknownOffset2;
DWORD BMDdataOffset;

each offsets points to data formatted as such:
DWORD one; // always 1? (maybe number of files with this format? never seen something else though)
DWORD fileStart;
DWORD fileLength;
- .p2d / .pobj files have the following format:

Code: Select all

char[4] magicHeader; // 'D2KP'
DWORD padding;
DWORD* FATFolderEntryOffsets; // continues up to first offset. some offsets may be 0xFFFFFFFF

// each FAT Folder entry is formatted as follows:
DWORD numFiles;
DWORD[numFiles] offsets;
DWORD[numFiles] sizes;

// the data follows, possibly preceded by padding.
And how he actually decompressed them with his tools:
Barubary wrote:For 358/2 Days (and for my R:c rips) I used an unpacker that could only decompress one specific file or folder at a time, and thus quite unusable for anybody who didn't create the program in the first place. I've now ported it to my more generic unpacker, NinUnpack, which should now be able to unpack all packages in both KH DS games. Drag a folder or a (set of) files on the executable (or use the command line) to unpack the given files. (providing a folder will only unpack the files directly in that folder; it is not recursive)
The game has three pack formats: P2, PK2D an HPAK. The first is just a generic archive file, like NARC but without folders. It has extension .p2 (or sometimes .p2f), but sometimes there is no extension at all for these files. PK2D (extension .D2KP, possibly others as well) only packs 2D graphic files. HPAK (extension .KAPH or .pak) only packs 3D graphic files.

Note that some files are compressed as well (in the normal filesystem, in packs, and I believe also in packs in packs). DSDecmp (or any other decompressor for DS formats) should work on those files (they usually have a .z extension, but sometimes none).
Edit: You also say it's possible to convert them by extracting the MDL0 via hex editor and then using that converter but my attempt at such has failed. Have you had any luck in actually converting a model through this method?

Re: Kingdom Hearts MDLX and Re:coded File Viewer (Request?)

Posted: Wed Dec 01, 2010 5:16 am
by Mirrorman95
I've had as much success as I've already shown, but as far as I've checked the two decryptors make the HEX method almost obsolete. Now, I've been trying to dump W_EX010_20_TR.mdlx from my KH2 disk for a while now, but what it all boils down to is that the file is there somewhere but the KH2 Dumper can't or won't find it. It's in the objentry file, but none of the blades, staffs, or shields customized for Tron or any other keyblade-changing world just aren't dumping. Does anyone have the texture for the Paranoids Oblivion?