Page 1 of 9 123 ... LastLast
Results 1 to 10 of 81
  1. #1
    EmuTalk Member
    Join Date
    Jul 2005
    Posts
    30

    Metroid Prime .pak format?

    Is there any way to extract the files from within these .pak files? Attempting to extract files manually with a hex editor has been nothing but a pain so far.

    so far, I've noticed that the first bytes in each one is 00 03 00 05 00 00 00 00 00 00 00...
    then a byte containing the number of entries...

    Last edited by Elpenguino; September 8th, 2005 at 20:58.


    • Advertising

      advertising
      EmuTalk.net
      has no influence
      on the ads that
      are displayed
        
       

  2. #2
    EmuTalk Member thakis's Avatar
    Join Date
    Feb 2005
    Posts
    159
    Quote Originally Posted by groupz
    Hmm... thakis might be of help. He's the master of GameCube file formats.
    Who could resist these kind words... ;-)

    I've taken a look at metroids pak files. I understand the header well enough to write a program to split a pak file into several files. Maybe I'll post it in the next few days, but it's probably not of much use because the files contained in a pak are probably in some custom format as well.

  3. #3
    EmuTalk Member thakis's Avatar
    Join Date
    Feb 2005
    Posts
    159
    Texture conversion kinda works
    Attached Thumbnails Attached Thumbnails 0_1c48adea.txtr.bti.png  

  4. #4
    EmuTalk Member
    Join Date
    Jul 2005
    Posts
    30
    oooh. good work so far, thakis.

  5. #5
    EmuTalk Member thakis's Avatar
    Join Date
    Feb 2005
    Posts
    159
    I don't have the time to continue this, though, because I want to continue to work on my bmd viewer.

    If anyone wants to continue working on this, tell me...here's a list of what I've done so far:

    - A .pak extractor that splits a pak file into all the files contained in them. Some of the contained files are compressed, a decompressor is still needed.
    - A tool to convert a metroid texture file (.txtr) to a super mario sunshine texture file (.bti) (which can then be converted to a dds file with another tool).


    Interesting things left to do:
    - A metroid model viewer (.cmdl viewer)
    - A metroid level viewer (.mrea)

    Viewers for about 25 other file types.
    Last edited by thakis; September 27th, 2005 at 20:49.

  6. #6
    EmuTalk Member
    Join Date
    Jul 2005
    Posts
    30
    thakis, if you would...could you email me the source and any data you know about? You should still have my email address... Thanks in advance.

  7. #7
    EmuTalk Member thakis's Avatar
    Join Date
    Feb 2005
    Posts
    159
    I'll post everything here, if someone else wants to to take a look...

    pak file format
    -------------

    The pak file format starts with a file header and a list that stores file name entries for some of the files in the pak (not for all). After that, there's a file header for each file stored in the pak file. This header stores the type of a file (called 'tag' in the source, for some reason it's stored in the file name entries as well), a unique identifier for this file (if the file has a name in the filename table, then the name has the same id), where in the pak this file is stored and a flag that says if the file is compressed or not (I'm not completely sure on this - but it's quite likely. Files which don't have this flag set look "normal" in a hex editor, files which have this file set look "compressed").

    mpakdump takes a pak file and extracts all files found in it. Files are not decompressed, though - you can see in the filename if a file is compressed (compressed files start with 1, uncompressed files with 0). The filename table in the pak file is ignored.


    File types
    ---------

    There a several file types in a pak file. .txtr files are texture files. mtexdump takes an uncompressed txtr file and converts it to a bti file (that's the image format used by mario sunshine, it required the least amount of code to convert to this format. You can use btidump to convert bti to dds, which is supported by most image viewers).



    Here's a list of the other file types together with some notes:

    STRG - strings (unicode or japanes shift-jis)
    CMDL - model
    TXTR - texture
    CSKR
    HINT
    FRME
    ANCS
    ANIM
    AFSM
    DGRP
    EVNT
    FONT
    CINF
    MAPA uncompressed files start with 0xdeadd00d
    MAPW uncompressed files start with 0xdeadf00d
    MLVL uncompressed files start with 0xdeafbabe
    MREA - level geometry, uncompressed files start with 0xdeadbeef
    PART - particles?
    PATH
    SCAN
    SAVW
    SWHC
    WPSC
    ELSC
    DPSC
    CRSC
    DUMB
    CTWK - tweak
    CSNG - midi data


    Stuff to do:
    - write a decompressor for the compressed files
    - write viewers for the more interesting file types (mrea, followed by cmdl imo)


    EDIT (three months later ;-) ): I wrote a decompressor for the compressed files, it is attached (mdecomp20051222.zip, source included). It takes a compressed file and decompresses it (if the input file is called "1_....", the output file is called "01_....").
    Attached Files Attached Files
    Last edited by thakis; December 22nd, 2005 at 17:10.

  8. #8
    Gekko Developer ShizZy's Avatar
    Join Date
    Feb 2005
    Location
    RI, USA
    Posts
    760
    Interesting... I'll take a look when I get a spare chance, no guarentees though.
    ~ShizZy

    6Bit.net Emulation & Gaming | Forums
    Gekko GameCube Emulator

  9. #9
    EmuTalk Member
    Join Date
    Jul 2005
    Posts
    30
    here's a few formats from metroid prime 2 that may also be in metroid prime:
    CLSN
    CSPP
    PLTT
    ANMS
    MADF
    SAVA
    SPSC
    SRSC
    DCLN
    AGSC - Scan data?
    ATBL
    HMAP
    PTLA
    STLC
    EGMC
    RULE
    FSM2
    MAPU

    also...that texture converter doesn't seem to work with metroid prime 2. it keeps producing textures that are either 128 bytes or more than 10 MB in size. I do not have a metroid prime iso at the moment, so I cannot compare the formats myself.

  10. #10
    EmuTalk Member thakis's Avatar
    Join Date
    Feb 2005
    Posts
    159
    HMAP - probably a height map and similar to .ymap in sms
    FSM2 - sounds a lot like finite state machine ;-)
    MAPU - probably similar to MAPA and MAPW (what are the first 4 bytes in an uncompressed file?)

    Be sure that you only give uncompressed txtr files to mtexdump...(I don't have m2, so I can't take a look either ;-))

Page 1 of 9 123 ... LastLast

Similar Threads

  1. Dolphin beta running Resident Evil 4, Metroid Prime 2
    By Martin in forum Emulation64.com News
    Replies: 3
    Last Post: August 14th, 2008, 14:40
  2. Metroid Prime?
    By captainrad in forum Dolphin
    Replies: 3
    Last Post: July 31st, 2004, 22:43
  3. Wow Metroid Prime sales!
    By tbag in forum Gaming
    Replies: 8
    Last Post: December 1st, 2002, 03:54
  4. Metroid Prime Trailer
    By t0rek in forum Talk of the Town
    Replies: 2
    Last Post: November 8th, 2002, 02:37
  5. Metroid Prime trailer music
    By NicePics in forum Talk of the Town
    Replies: 0
    Last Post: June 13th, 2002, 15:17

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •