AllTinker

Commodore
TREPAK is an extractor - and repacker - for TRE and PAK containers, along with (some of) the inner formats.

Note that this is still an early version, so expect bugs and shortcomings!

The goal was to achieve completely accurate repacking, to the point where the same data will produce (even with re-compression) a byte-for-byte identical package. Actually making this happen was far from trivial!

Demo

Here I've replaced some of the Privateer bartender dialogue speech with audio from SEGA CD Wing Commander:


Game Support

It supports to varying degrees:
  • Privateer
  • Strike Commander
  • Wing Commander Armada
  • Pacific Strike (very experimental)
  • Wings of Glory (very experimental)
  • Wing Commander III (missing PAKT support at the moment)
  • Wing Commander IV (ditto)
  • Wing Commander Prophecy (not byte-for-byte identical, but doesn't need to be)
Be aware that this tool is in its infancy; it's quite limited in what it directly supports, for instance:
  • It natively supports most audio (to/from WAV) for Privateer and Strike Commander, although I've mostly just tested the former.
  • In a similar manner to WCToolbox, it exports IFF files to XML for easier editing.
  • I've started adding some support for IFF internals for WC3/4 for ships/weapons, but this is just a tiny initial first-pass.
I've delayed the release enough, if I finished supporting everything I'd like it to support (and tested all that as thoroughly as I'd prefer) it'd still be a year or more away. :D

If people need specific things (or have problems obviously), let me know and I'll try to prioritise things.

Instructions

You'll want to move the files you want to work with into another directory next to TREPAK.EXE.

This is a Windows command-line program - you can type cmd into the Explorer address bar to open a command line in the current directory. Typing TREPAK on the command line will show you the available options, but here's how you'll generally use it:

TREPAK -e SPEECH.PAK Speech​
​
This will extract the package. The Speech directory will now have the extracted files - in this case it should have converted all of the speech samples to WAV format.

You don't need to keep all of the files it extracts; you can just leave the files you want to modify. TREPAK requires the original package to repack it - any files missing from the directory will be taken as-is from the original package.

TREPAK -r SPEECH.PAK Speech​

This will repack the package, producing output.PAK (or output.TRE for a TRE file) - you'll want to then move/rename this back to SPEECH.PAK to replace the original in the game.

Note that TREPAK will never remove files from a package, only modify existing ones. It can add brand new files too, but be aware that in many cases this will be pointless (and potentially cause errors).
 

Attachments

Last edited:
Awesome! This opens the door to dubbing the games and localizing them into other languages.

I managed to get the mercenary guild representative to speak Spanish. Thank you so much!

P.S. Thank goodness Shotglass survived Tiger's Claw!
 
TREPAK is an extractor - and repacker - for TRE and PAK containers, along with (some of) the inner formats.

Note that this is still an early version, so expect bugs and shortcomings!

The goal was to achieve completely accurate repacking, to the point where the same data will produce (even with re-compression) a byte-for-byte identical package. Actually making this happen was far from trivial!

Demo

Here I've replaced some of the Privateer bartender dialogue speech with audio from SEGA CD Wing Commander:


Game Support

It supports to varying degrees:
  • Privateer
  • Strike Commander
  • Wing Commander Armada
  • Pacific Strike (very experimental)
  • Wings of Glory (very experimental)
  • Wing Commander III (missing PAKT support at the moment)
  • Wing Commander IV (ditto)
  • Wing Commander Prophecy (not byte-for-byte identical, but doesn't need to be)
Be aware that this tool is in its infancy; it's quite limited in what it directly supports, for instance:
  • It natively supports most audio (to/from WAV) for Privateer and Strike Commander, although I've mostly just tested the former.
  • In a similar manner to WCToolbox, it exports IFF files to XML for easier editing.
  • I've started adding some support for IFF internals for WC3/4 for ships/weapons, but this is just a tiny initial first-pass.
I've delayed the release enough, if I finished supporting everything I'd like it to support (and tested all that as thoroughly as I'd prefer) it'd still be a year or more away. :D

If people need specific things (or have problems obviously), let me know and I'll try to prioritise things.

Instructions

You'll want to move the files you want to work with into another directory next to TREPAK.EXE.

This is a Windows command-line program - you can type cmd into the Explorer address bar to open a command line in the current directory. Typing TREPAK on the command line will show you the available options, but here's how you'll generally use it:

TREPAK -e SPEECH.PAK Speech​
​
This will extract the package. The Speech directory will now have the extracted files - in this case it should have converted all of the speech samples to WAV format.

You don't need to keep all of the files it extracts; you can just leave the files you want to modify. TREPAK requires the original package to repack it - any files missing from the directory will be taken as-is from the original package.

TREPAK -r SPEECH.PAK Speech​

This will repack the package, producing output.PAK (or output.TRE for a TRE file) - you'll want to then move/rename this back to SPEECH.PAK to replace the original in the game.

Note that TREPAK will never remove files from a package, only modify existing ones. It can add brand new files too, but be aware that in many cases this will be pointless (and potentially cause errors).
Your mods are getting so much better!