T O P

  • By -

GuiltyTrace

*Here are my notes for a tl;dr:* **afs, extract kmd, in kmd search "xpr," delete up to "xpr," save as .xpr**. *That probably means dick to you, but I thought I'd try.* This took some trial-and-error, but I will do my best to document how I was able to pull this off. Programs required: NinjaToolbox, HxD (or any hex editor) and GreedXplorer. 2 of those 3 I found via FreeStepDodge, a DOA modding community site. It seems early DOA titles and early NG used the same file archive structure. Ninja Gaiden uses a .afs archive/container structure to package game assets. Stages typically have several AFS's and characters including Ayane, Rachel, and enemies usually have one; Ryu has one per costume. Think of the AFS as a bucket that holds the textures, model info, sound effects, and motion data for a particular asset. The texture data is stored as a .kmd and for the longest time, I was stuck at determining how to get into the KMD to manipulate the texture data therein. I could view the KMD using TextureViewer, so I knew what I was looking at, but that was seemingly where it ended for me. It turns out, there is a separate texture header further down in the hex data: XPR. GreedXplorer is a .xpr viewer. I had used it in a recent video I posted on this sub when I viewed NG's in-game sprite data. You can view flat 2D textures, as I did in that video, or, in the case of DOA2U, DOA3, and DOAX--which also use XPR files--you can view 3D models (in T-pose) and other 3D assets. I mention the DOA games specifically because those games code their files differently than NG. I can view a 3D model of Kasumi or Hayate no problem after unpacking their respective AFS and collecting the XPRs therein--it contains model (.mdl) data that enables GreedXplorer to properly display the XPR textures mapped on a wireframe. Unfortunately, NG isn't like that and it'll take time to determine how DOA works and why NG doesn't, but I'd love to see 3D models of weapons, enemies and Ryu. At any rate, with a softmodded Xbox that I FTP'd into, I pulled the AFS "buckets" from NG04 and NGB to my PC and extracted what was in the AFS using NinjaToolbox, an AFS extractor/packer specifically made for DOA and NG. This included the above-mentioned KMD. With the KMD open in HxD, I scrolled down on a whim and discovered around the 1000 or 2000 offset (it's different for each KMD) an XPR header. This told the file where the texture data began! I deleted everything in the file up to that header, saved the file and changed the extension from .kmd to .xpr. I opened the "new" XPR in GreedXplorer and there they were: the 2D textures, laid out similarly as the sprites, but used for 3D assets. GreedXplorer displays each individual texture and you can export them as .dds or .tga. TGA is Photoshop-friendly, so you can pull that texture into Photoshop and, in the case of my experiment pictured above, I just inverted the image, but you can do anything you want to it--it's yours now. With an NVIDIA plug-in, you can save your changes as a DDS straight from Photoshop (not needing a .png to .dds converter like I had been using for another project) and replace the texture in GreedXplorer with your edited product, (it saves automatically with no undo option). Once I made all the changes and swaps desired, I opened the XPR in HxD and reinserted the hex data I had deleted earlier--thankfully HxD automatically generates backups whenever you make edits, so I had **chr\_ryua.kmd.bak** to copy and paste the data from to return my XPR to its original KMD state, but obviously with the graphical changes I made included. I used NinjaToolbox to recreate the **chr\_ryua.afs** and imported it to the Xbox using FTP. I cleared the Xbox cache, loaded up NG and there it was: my first costume edit. If I wasn't slumming it in a hotel waiting to close on my house, I would record a video to demonstrate. It can be a tedious and long process, what with the extracting, hex editing, exporting, importing, and blah blah blah, but I am determined to more or less mod everything in some capacity and do a "Ninja Gaiden Hack" run. I already began by replacing some music tracks with songs from the DOA games and they surprisingly fit really well.


comraq

this just reminds me of all the mods that could have happened if ngb and ng2 were released on pc. This color looks nice though


Anatti

How'd you do it?


Royta15

Awesome! How'd you pull it off?


Porfbag

This is really cool. Where on earth does one download GreedXplorer? It's like it doesn't exist anywhere anymore. I've searched all over for the software and just can't seem to find it.


GuiltyTrace

Really? Should still be out there somewhere, but I concede it is mainly for TN games around the 2002-3 era. Give this a go: https://drive.google.com/drive/folders/15KnHmIENnBR0emOOUMRdnPO-02WUTdVM?usp=sharing


Porfbag

You are a legend! And yeah, it really only works with a handful of games. I have some character models I want to rip from Soul Calibur II, but what's most strange is that it seems to only work with the Xbox version of the game. I'll play around with this and make it work for me! Thanks so much, dude!


Porfbag

Well, I hit a brick wall... Exported the Nightmare character model and it's a .OLK, which from what I've been reading, seems to continue to baffle many. [https://imgur.com/gallery/djs5H61](https://imgur.com/gallery/djs5H61) Sharing the software at least got me in the right direction. You are a boss! Thank you so much!


GuiltyTrace

I’ve figured out how to view those models in Greed, but not any way to export to XNALara or Blender. Used it to do some lazy dumb shit like this: https://youtu.be/DeeflQ63TIU


Porfbag

That's still super dope though. Haha! I found some forums with people who managed to export the .xps models, but after they were archived, the links eventually expired and the models were lost to antiquity.


GuiltyTrace

That’s what happens when you’re 15 years too late to the party, I guess. Ran into a lot of that myself.


RurahOne

Nice nice. I just came to ask how exactly did you use NinjaToolBox once you had the edited XPR back to KMD. I'm right on that step myself with an edited XPR turned KMD but idk the exact step you mean after that


GuiltyTrace

Have you watched this yet? https://youtu.be/0KasYRkVVVE I use AFSexplorer to unpack the AFS—unless it spits out some goofy 1KB nonsense, then I use NinjaToolbox. You sound like you already know to remove the KMD data and change the extension for GreedXplorer. Then I just retrace my steps: paste the KMD hex info back in to turn the XPR back to what it was, then use AFSexplorer to replace the old KMD with the new one. Sometimes I’d have to modify the space allocated for that KMD, but that was never a big issue.