Page 1 of 8

Ripping Samus Dread (.pkg file)

Posted: Tue Oct 05, 2021 4:28 pm
by Enderfacio
Hi everyone I extracted the .NCA from the .NSP of Metroid Dread and now I'm trying to open the Samus.pkg file but I can't seem to remember how to do it (:
Anyone can help me with it?

Re: Ripping Samus Dread (.pkg file)

Posted: Tue Oct 05, 2021 7:10 pm
by kees
Enderfacio wrote: Tue Oct 05, 2021 4:28 pm Hi everyone I extracted the .NCA from the .NSP of Metroid Dread and now I'm trying to open the Samus.pkg file but I can't seem to remember how to do it (:
Anyone can help me with it?
it meight help posting a pkg file really. im uploading some stuff aswell so ill do it too

Re: Ripping Samus Dread (.pkg file)

Posted: Tue Oct 05, 2021 7:19 pm
by kees
well here is the player one. at least the pkg extracter i had didnt do squad but need to do more poking around.

**edit** removed drive link email got spammed to snot with requests

Re: Ripping Samus Dread (.pkg file)

Posted: Tue Oct 05, 2021 7:57 pm
by Enderfacio
kees wrote: Tue Oct 05, 2021 7:19 pm well here is the player one. at least the pkg extracter i had didnt do squad but need to do more poking around.

https://drive.google.com/file/d/15lKGiY ... sp=sharing
Sorry, yes, thats the file I go too. I tried many bms files for quickbms that I found on github, including metroid_sr_3ds.bmd but didin´t work either...

Re: Ripping Samus Dread (.pkg file)

Posted: Tue Oct 05, 2021 8:03 pm
by Enderfacio
I ran Quickbms from the cmd and got this error message. The script metroid_sr_3ds.bms did work for Samus Returns files but they wheren't .dat so I can't open those... I can't find a good pkg script that work with Metroid Dread

Re: Ripping Samus Dread (.pkg file)

Posted: Tue Oct 05, 2021 11:44 pm
by Spiritovod
Here is simple script for Metroid Dread pkgs, it's almost a copy of Samus Returns script with a few adjustments.

Update: Script for bctex decompression added.

Update 2: Script for bctex now extracts first mip as "raw" file. You can convert it with tools like Rawtex and provided in the filename parameters + switch swizzle. If you want to simply decompress the texture, edit first line in the script accordingly.

metroid_dread_scripts.zip

Re: Ripping Samus Dread (.pkg file)

Posted: Wed Oct 06, 2021 12:51 am
by Enderfacio
Spiritovod wrote: Tue Oct 05, 2021 11:44 pm Here is simple script for Metroid Dread pkgs, it's almost a copy of Samus Returns script with a few adjustments.


metroid_dread_pkg.zip
Thank you very much!!! It works!! I still can't open the files... but is progress :D
This is the file with the results but they are all .MSAS .MMDL .MANM .MCAN .MSUR .MPSY and some .dat that i though i can open with Noesis but nope..

https://drive.google.com/file/d/11VTehc ... sp=sharing

Re: Ripping Samus Dread (.pkg file)

Posted: Wed Oct 06, 2021 3:35 pm
by kees
Spiritovod wrote: Tue Oct 05, 2021 11:44 pm Here is simple script for Metroid Dread pkgs, it's almost a copy of Samus Returns script with a few adjustments.


metroid_dread_pkg.zip
thanks so much for that! serieusly. meight be the same as the standard filesystem for samus returns aswell? at least am hoping so since then the older tools meight be able to be ajusted too somewhat. but am fearing thats a lot harder tho

Re: Ripping Samus Dread (.pkg file)

Posted: Fri Oct 08, 2021 4:05 pm
by kees
been looking into mmdl files seeing if there has been an existing way to rip em compleetly but so far have not gone that far really. there has been some info what came to samus returns but even that it seems hasnt been researched enough or even ripped at all. furthest ive found is that someone was hinting at specific locations in hex where to find the model data. but no tools at all yet
viewtopic.php?f=16&t=17939&p=139514&hil ... ns#p139514

09williamsad found out some info pertaining to texture formats but sadly the tools didnt work. but thought should mention the info regardless view
viewtopic.php?f=16&t=24585&p=178689&hilit=mmdl#p178689

Re: Ripping Samus Dread (.pkg file)

Posted: Fri Oct 08, 2021 5:22 pm
by Enderfacio
kees wrote: Fri Oct 08, 2021 4:05 pm been looking into mmdl files seeing if there has been an existing way to rip em compleetly but so far have not gone that far really. there has been some info what came to samus returns but even that it seems hasnt been researched enough or even ripped at all. furthest ive found is that someone was hinting at specific locations in hex where to find the model data. but no tools at all yet
viewtopic.php?f=16&t=17939&p=139514&hil ... ns#p139514

09williamsad found out some info pertaining to texture formats but sadly the tools didnt work. but thought should mention the info regardless view
viewtopic.php?f=16&t=24585&p=178689&hilit=mmdl#p178689
Yes i've seen those... I figured that since nobody was abble to extract the Samus Returns 3d models it would happen the same with Dread... I've got the same files ( I shared them above) but can't find a way to open them

Re: Ripping Samus Dread (.pkg file)

Posted: Fri Oct 08, 2021 5:48 pm
by Spiritovod
Script for bctex decompression added to my post above. I didn't bother with it much, but those are mipped textures, compressed with gzip - they're also using switch swizzling and most of them are DXT5. In decompressed textures first 0x78 bytes are base header, then there is 0xAC bytes of probably mips data, then at 0x124 there is additional header with total texture size and header size, then at 0x278 actual texture data. Probably format around the same as previous bctex, except for a few additional fields / magics.

Here is sample, converted with rawtex: https://drive.google.com/file/d/1TofvOA ... sp=sharing

Re: Ripping Samus Dread (.pkg file)

Posted: Fri Oct 08, 2021 5:51 pm
by pox911
I worked a bit on samus returns a while back but stopped when i noticed someone else had already extracted meshes from it. I poked around dread files and the system is mostly the same but with some tweaks. Their engine does so many stupid things. I've poked around it mostly for the last few days and got something mostly working but with some bugs i need to work out some.

An example of the stupid things being done: Only the vert and indice data is compressed. They have tables that point to ever vert info and face info but have a table full of mesh info that then points to the vert and indice data anyway. Have a table of bone indexes used for the mesh as reference with the the weights referencing the index of that table instead of just the bone index directly. Lastly they have some meshes that have a normal placement value and other meshes that require the being attached to the skeleton before it's placed to get junk placed. Her cannon took me so long to get right.

I planned on tweaking my code a bit more after work to fix a few things, granted i dont get distracted by playing the game itself :P

edit: If spirit or someone else doesnt beat me to it, i can try making a noesis script for the textures. I haven't fiddled with noesis's api yet but it's something i've been meaning to do for a while now so i'm not always making scripts directly for blender.

Image

Re: Ripping Samus Dread (.pkg file)

Posted: Fri Oct 08, 2021 7:10 pm
by Joschka
Here's a Noesis script to load the mmdl/bcmdl files, supports mesh names, uvs, normals, skeleton with joint names and skinning. Many thanks to M-1 for the help with his samus returns research. Dread's format is basically an "upgrade" of that one, with a bunch of changes in the layout and some buffers being compressed.

It should work on environmental and skeleton meshes, at least all the samples I checked work fine.

https://github.com/Joschuka/fmt_mmdl

Update 1 : More semantics added, preliminary texture support

Update 2 : Material auto assigning (kind of...)

Update 3 : The script now supports animations. It's recommended to extract the pkg files using the Switch Toolbox to have filenames.


Image
pox911 wrote: Fri Oct 08, 2021 5:51 pm Lastly they have some meshes that have a normal placement value and other meshes that require the being attached to the skeleton before it's placed to get junk placed. Her cannon took me so long to get right.
This part actually annoyed me a lot, I had the exact same issue. Meshes with rigid skinning needed their vertices to be transformed by their associated joint.
Also I wasn't aware that someone else was planning to release a model plugin for this game, at least it'll help double checking the research done heh
Spiritovod wrote: Fri Oct 08, 2021 5:48 pm Script for bctex decompression added to my post above. I didn't bother with it much, but those are mipped textures, compressed with gzip - they're also using switch swizzling and most of them are DXT5. In decompressed textures first 0x78 bytes are base header, then there is 0xAC bytes of probably mips data, then at 0x124 there is additional header with total texture size and header size, then at 0x278 actual texture data. Probably format around the same as previous bctex, except for a few additional fields / magics.

Here is sample, converted with rawtex: https://drive.google.com/file/d/1-iUAAk ... sp=sharing
Neat, I don't like working on textures so that's helpful. I'll add bctex support to the plugin later if it's straighforward enough

Re: Ripping Samus Dread (.pkg file)

Posted: Fri Oct 08, 2021 7:47 pm
by Spiritovod
Joschka wrote: Fri Oct 08, 2021 7:10 pm Neat, I don't like working on textures so that's helpful. I'll add bctex support to the plugin later if it's straighforward enough
It's pretty much straightforward, if you need only the first mip. In decompressed texture:
-> 0x8 (and at 0xB8): int height, int width
-> 0xCC: int mip_count
if mip_count = 1: int mip_size
else int texture_size, int mip_offset, next_mip_offset, ... (offset is calculated starting from 0x278)

They're using padding for headers, so offsets for those values are hardcoded - at least for models textures.

Re: Ripping Samus Dread (.pkg file)

Posted: Fri Oct 08, 2021 7:50 pm
by 09williamsad
Joschka wrote: Fri Oct 08, 2021 7:10 pm Here's a Noesis script to load the mmdl files, supports mesh names, uvs, normals, skeleton with joint names and skinning. Many thanks to M-1 for the help with his samus returns research. Dread's format is basically an "upgrade" of that one, with a bunch of changes in the layout and some buffers being compressed.

It should work on environmental and skeleton meshes, at least all the samples I checked work fine.

https://github.com/Joschuka/fmt_mmdl
Thank you for the Noesis script.

I ran it in batch on all the MMDL models to see the results.
Out of 8333 models, only 182 did not convert, list attached.