DOCUMENTATION

Modding Packaged Games

Mod a cooked, packaged game with MifBridge: inspect its pak files, plan the extract, patch, repack and deploy steps, build and cook your own content, and read the mod loader log afterward. Read this if you make mods for a game you own and play offline.

A packaged game ships its content as cooked assets inside .pak or .utoc/.ucas containers, with the editor-only data stripped. Cooked Projects explains what that removes and which MifBridge calls still work on such content. This page covers the modding workflow around it and does not repeat that page.

What MifBridge does and does not do here

MifBridge reads and plans. It does not unpack a game into your project, and it does not run a game for you.

  • It lists what a container holds and compares two containers.
  • It writes down the exact command sequence for a cook-and-deploy, with your paths filled in. It executes none of it.
  • It builds and cooks your own mod content in a matching editor, through the same calls as any other project.
  • It reads the mod loader's log back so a failed load says why.

It takes no encryption key anywhere. A container that is encrypted is reported as encrypted by inspect_pak, and nothing in MifBridge decrypts it. Everything on this page is for single-player use on your own copy of a game.

Installing a mod loader such as UE4SS, or the helper programs the plan uses, is something you do yourself. MifBridge does not bundle or download them.

Step 1: look inside the game

inspect_pak lists what a .pak or a .utoc holds on disk.

inspect_pak {file: "<GameDir>/Content/Paks/pakchunk0-Windows.pak", top: 20}
Parameter Meaning
file A .pak, or a .utoc whose .ucas sits beside it
filter Only entries whose path contains this text
top How many of the largest entries to list (default 20)
diff A second container: reports added, removed and resized entries

The reply gives mountPoint, the file count, compressed and uncompressed bytes, whether it is encrypted, the compression methods and the largest entries. A .pak is read inside the editor process. A .utoc is listed by the engine's UnrealPak in a child process. A file that is not a container is refused.

Use diff between two versions of a game to see which files a patch changed.

For a specific package inside a project that mounts the content, describe_package lists the objects a /Game/ package contains and whether it is cooked, and describe_chunks says which chunks a package cooks into and why.

Step 2: build your mod

Build the mod's assets in an editor of the same engine version as the game. That is an ordinary MifBridge project: the same endpoints you use for any content. Two calls are specific to checking a cook:

  • cook_check cooks just the packages you name, with no references, in a child editor process, and lists every error and warning. run false returns the plan; run true starts it. The editor you are driving is not touched. Unsaved packages are cooked as saved on disk.
  • cooked_size_report gives cooked size by package, folder, class and chunk from a cooked build's asset registry, and diff compares two.

To package your own project into paks, package_project builds the UAT BuildCookRun line (with run false) or starts it (with run true), including the pak, iostore and compress options. It requires an archiveDir outside the project. The cook reads the files on disk, so settings come from Config/DefaultGame.ini and Config/DefaultEngine.ini, not from the editor's memory. See Safety and Write Modes for what a package_project run is allowed to do.

If a mod needs to change a cooked Blueprint, the graphs are gone. See the section on create_editable_child in Cooked Projects.

Step 3: plan the cook and deploy

plan_cook returns the command sequence for patching an asset inside a game's paks and deploying the result, with every path pinned. It executes nothing. trigger_cook is an accepted alias and answers the same.

plan_cook {mod: "MyMod", asset: "DT_Items"}

mod is substituted into the deploy paths and asset into the extract step's filter. Both only fill placeholders (the defaults are <ModName> and <AssetName>). The reply has executed: false, a note, plan, paths and caveats.

The plan is one command per line:

  1. Extract the asset with retoc to-legacy from the Paks directory.
  2. Apply a same-size byte patch to the .uexp.
  3. Repack with retoc to-zen.
  4. Check parity with retoc list.
  5. Deploy to Content/Paks/Mods.
  6. Read the runtime log.

The paths object names the retoc executable, the game root, the Paks directory, the deploy folders (deployMods and deployLogicMods) and the UE4SS log. Every path derives from the game root, so the plan is refused until one is configured. Set MIF_GAME_ROOT in the environment, or GameRoot under [MifBridge] in the configuration file.

You run the commands yourself, in a shell. retoc is a separate command-line tool for converting between IoStore and legacy packages.

Step 4: read the mod loader log

When a mod is loaded by UE4SS, print() output from Lua mods and Blueprint PrintToModLoader output land in UE4SS.log. read_modloader_log tails it.

read_modloader_log {lines: 80, filter: "MyMod"}
Parameter Meaning
path The log file to read. The default is UE4SS.log under the configured game root, Binaries/Win64/ue4ss/
lines Tail size, 1 to 5000, default 80
filter A plain substring (not a regex) a line must contain, applied before the tail is taken

Only the last 64 MB of the file is read, and the reply says when it truncated. The reply gives path, found, matched, returned and lines. It refuses when no path and no game root are configured, and answers found: false when the log file is not there.

UE4SS installs vary: the log sits beside the game executable in some layouts. If the default path finds nothing, pass path with the real location.

When something fails

Symptom Likely cause
inspect_pak refuses The file is not a container
inspect_pak reports encrypted The container is encrypted. MifBridge has no key and cannot read it
plan_cook refuses No game root is configured
read_modloader_log says found: false The log is at a different path, or the game has not run with the loader since it was installed
A mod pak loads but does nothing Read the log first, with filter set to the mod's name
An asset will not cook cook_check on just that package lists every error and warning

Where to go from here