Lost Relative Path in .pak Files

Hey Alexandr,

You are not taking into account the pak file mount point.

When creating the pak file the internal relative paths are created relative to the common root path (= mount point) of all files.

So for a list of files like this:

  • ../../../GameName/Content/Packs/Events/Event1.uasset
  • ../../../Engine/Content/GlobalShaders.ushaderbytecode (I made this one up, but I’m fairly sure with the shared code there is a shader library file in the pak that lives outside of your Content folder)

This will choose ../../../ as pak mount point and the relative paths inside the pak end up like this:

  • GameName/Content/Packs/Events/Event1.uasset
  • Engine/Content/GlobalShaders.ushaderbytecode

However, if you only have assets inside the Packs/Events folder the mount point will end up being ../../../GameName/Content/Packs/Events and the path inside the pak file will look like this:

  • Event1.uasset

In general a regular game user would not care about this, since the pak loading code takes the mount point into account and correctly loads the assets by reading the mount point from the pak file.

If you are manually extracting or loading paks with custom mount points then you need to take this into account.

May I ask what your use-case is that you need to extract those paks later on?

Usually with the default pak loading if you don’t manually specify the mount point this would all be handled automatically.

Kind Regards,

Sebastian