Skip to content

Repak

Repak is a tool made to build .rpak and .starpak files

Note

.starpak files are just textures for streaming, while .rpak can and does contain textures most will be in .starpak files as mipmapped textures are used for streaming

Introduction

Repak is a CLI based tool which interacts with json files, which we will call a "map" to undertand these maps and make sense of how to properly structure a repak project we need to get over some things first

GUID

Assets in .rpak files get assigned a unique id, these ids are generated from the string of the assets path, the names you see in an rpak when using, for example, RSX are just stored debug names, and as such can deviate from the original asset path used to generate the asset's GUID

DLL Files

If an .rpak file contains ui assets, it must be accompanied by a matching .dll generated by tools like SERE; otherwise, the game cannot load those ui assets

Repak main map example

The following is an example for the actual map used to build an .rpak with Repak

{
  "keepDevOnly": true,
  "version": 7,
  "name": "placeholdername",
  "streamFileMandatory": "placeholdername.starpak",
  "assetsDir": "bal",
  "outputDir": "build",
  "compressLevel": 0,
  "compressWorkers": 16,
  "hasDynamicLibrary": true,
  "files": [
      ]
}

Options

keepDevOnly - bool - wether names, such as the name field in a material's json should be kept as a debug name as described in GUID

version - int - version of the rpak file to be built, for us should always be 7

name - string - the final name of the .rpak without the extension

streamFileMandatory - string - the final name of the .starpak file, needs the .starpak extension in the string

assetsDir - string - the directory, either relative or absolute of the assets that are supposed to be used to build the .rpak

outputDir - string - the directory, either relative or absolute to where the paks are supposed to be exported

hasDynamicLibrary - bool - wether the rpak should load an .dll file with the same name, used for ui assets

files - array - an array of all assets supposed to be packed into the .rpak

Adding an asset

Assets are comprised of two things, a type and a path

    {
        "_type": "matl",
        "_path": "material/models/testmodel/test_m_skn.rpak"
    },

_type should be the asset type for the given asset _path should be the path inside the assetsDir defined in the json header

See Assets for possible Asset definitions and explainations