Skip to content

PAK File Formats

Jordan edited this page Nov 6, 2021 · 1 revision

Types of PAKs

In regard to the TS2 Homefront Port, there are two PAK file formats to be aware of:

  • CryPak
  • tsPak (unofficial name)

CryPaks (Homefront)

Homefront: The Revolution was built using CryEngine and so it leverages CryPak, a file archiving system used in CryEngine-based games. It is similar in concept to ZIP archives, but has several features that make it more ideal for game development as well as for retail game builds. One of the main benefits of CryPak is the concept of layering. The developer can create one PAK that holds a collection of core files used by the game engine and then layer additional PAKs on top which may contain files that override files found in the core PAK. This helps with the deployment of patches, as developers can distribute PAK files that have more updated versions of game files than what are found in the original PAK files on a game disc, for example.

For a more in-depth explanation of CryPak files, read this page in CryEngine's documentation: CryPak - Technical Documentation

A convenient feature of CryEngine's CryPaks format is that if you extract the contents of a CryPak, the game will use the now-extracted files on disk (assuming that the original PAK file is no longer present). The benefit of this is that you can edit files on disk directly without needing to package up your modified files whenever testing them in-game.

The game prioritizes PAK files over files located in a folder on disk, so if the same file exists in a folder on your hard drive and inside of a PAK, the game will load the file inside of the PAK instead of the one found on disk. This means that while you are working, you should rename/remove the original PAK file you extracted or else the game will load that PAK file instead of the files you extracted.

Once you are done working, you can package your new files into a CryPak and the game will load your new PAK (along with the others) along with any files you included.

To extract CryPaks, visit this forum post on XeNTaX for more information: Homefront The Revolution - XeNTaX

To create new CryPak files, use this 7-Zip command: 7za a -tzip -r -mx0 <PakFileName> [file1 file2 file3 ...] [dir1 dir2 ...]

tsPaks (TimeSplitters)

Aside from CryPak files, TimeSplitters 2 also uses a file archive system that also uses the same file extension ".pak". These PAK files are similar to CryPak files in that they are an archive containing other files within them (again, like a ZIP archive). The PAK files are generated by Free Radical's proprietary game engine, https://freeradical.fandom.com/wiki/FRDEngine, and were used in a variety of Free Radical games, including TimeSplitters 1, 2, and Future Perfect (though using different versions of the PAK format). TimeSplitters 2 specifically uses PAK formats "P4CK" and "P8CK". These were used in the original console releases of TimeSplitters 2 as well as in the PC port of TimeSplitters 2 (contained within Homefront).

A technical description of the PAK file format used for TimeSplitters 2 files can be found in this forum post by Mr. Mouse: XeNTaX Game Research Forum

To extract tsPaks, use the ts2_pak_extract BMS script found in this forum post on XeNTaX. Copy the code from this post and save it as a ts2_pak_extract.bms. Open your new BMS script using the QuickBMS application. To make a new tsPak, follow the instructions found in QuickBMS's documentation under "Reimporting the extracted files".

Note: Homefront loads all CryPaks stored in the gamehf2 folder. It loads them using a wildcard (*.pak), so in this way it is possible to have the game load additional CryPaks that we create. Conversely, the list of tsPaks that TimeSplitters will load are hard-coded in the game's executable, so it is not possible to simply drop-in new tsPaks. We can only modify existing tsPaks. This presents a challenge in terms of distributing content, as one of TS2 Redux's goals is to not distribute files from the original game. Files included in the project for download are creations of members of the Redux Tech Team. Since we cannot distribute tsPaks, we can only distribute custom patch files and then patch the end user's original tsPaks. This is currently accomplished by using the patching program "JDiff" by Joris Heirbaut (jojodiff.sourceforge.net).

Clone this wiki locally