PAK blacklist file deprecated in favor of DefaultPakFileRules.ini

Hello,

I have been using PakBlacklist-Shipping.txt file for excluding folders during cooking, for some time.

Today, I have noticed the following message during cooking. (Using Unreal Editor v4.25.4)


Applying PAK blacklist file [Project]\Build\Win64\PakBlacklist-Shipping.txt. This is deprecated in favor of DefaultPakFileRules.ini

I am afraid, there seems to be no official documentation for **DefaultPakFileRules.ini **file.

What is the proper way of including/excluding folders during cooking using this method? Is there any information about DefaultPakFileRules.ini file format and how to use it?

Hi,

I suppose this is too late for you to help, but maybe this will help others.

There is a documentation about “DefaultPakFileRules.ini” inside “BasePakFileRules.ini” file.

“BasePakFileRules.ini” is located inside your UE4 Engine folder (“Engine\Config\BasePakFileRules.ini”).

It contains a basic explanation on how to use it.

In order to use it in your project you need to do several steps:

  • Create the “DefaultPakFileRules.ini” config file in you project Config folder (you can just copy and rename “BasePakFileRules.ini”)

  • Keep the [ExcludeContentForMobile] section (I do not know about any other section names for this config file, I suppose you will need to dig into the source code, maybe CopyBuildToStagingDirectory.cs will help you)

  • Specify the “Platforms” key (even “Win64” have worked so far)

  • Specify the “Targets” key (Shipping, Debug, Development, etc)

  • I suppose you should keep “bExcludeFromPaks=true” (it depends on your setup. The “Pak” containter is the one you specify in the package settings)

  • Add +Files to exclude files. It’s using Regex, so for example :

    • +Files=“…/Content/Blueprints/Debug/*” will exclude all files with “<anything>/Content/Blueprints/Debug/<anything>” in their filepath (… and * means any symbol)

7 Likes

Hi @Araxnid,

Thank you very much for pointing out the “BasePakFileRules.ini” file inside the engine folder. I’ll certainly check that out.

@Araxnid @matahari
hi, can you please have a look at my application and see if i’m doing this correctly?
When I use this, it comes with the message of
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)): Excluding config file [drive]:\[folder]\[folder]\Unreal\[project]\Config\DefaultPakFileRules.ini and UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)): Staging with more than one target, PakFileRules may apply too many rules!

Also, should i be doing something like

[ExcludeContentForMobile]
; Exclude specific large textures on mobile platforms, this was moved from CopyBuildToStagingDirectory.cs
; This can be added to in a game's DefaultPakFileRules.ini by using the same sections, and new sections can be added
; To remove this rule, use !Files to clear the list of file paths
Platforms="Android,iOS,tvOS"
Targets="Shipping,Debug,Development"
bExcludeFromPaks=true
bOverrideChunkManifest=true
:[LIST=1]
+Files=".../Engine/Content/EngineMaterials/DefaultBloomKernel.*"
+Files=".../Engine/Content/Fonts/*"
+Files=".../Engine/Content/Common/*"
[/LIST]

OR

[ExcludeContentForMobile]
; Exclude specific large textures on mobile platforms, this was moved from CopyBuildToStagingDirectory.cs
; This can be added to in a game's DefaultPakFileRules.ini by using the same sections, and new sections can be added
; To remove this rule, use !Files to clear the list of file paths
Platforms="Android,iOS,tvOS"
Targets="Shipping,Debug,Development"
bExcludeFromPaks=true
bOverrideChunkManifest=true
+Files=".../Engine/Content/EngineMaterials/DefaultBloomKernel.*"
+Files=".../Engine/Content/Fonts/*"
+Files=".../Engine/Content/Common/*"

If you could please reply, that would help me out of this problem with which I’ve been stuck for almost 2 weeks now.

Thanks!

Thanks for the information. After first trying the PakBlacklist rules without realizing they are deprecated and ignored during packaging, and then after a couple more hours of trial and error, I finally managed to get the exclusion list working.

Results: Saved about 3MB in final shipping package size, mostly from the excluded Slate image files. Not too significant, but at least it works.

How to get it to work:

  1. Create the file DefaultPakFileRules.ini in your [Project]/Config directory.

  2. Paste the following contents into the file (customize as necessary):

; These rules are applied in order, the first rule that applies per file is taken and no others are evaluated
; [SectionName]
; bOverrideChunkManifest=false 		; If true this allows overriding assignments from the cooker
; bExcludeFromPaks=false 			; If true this removes entirely, cannot coexist with overridepaks
; OverridePaks="pakchunk1" 			; If set this will override pak list, comma separated
; Platforms="iOS,Android"			; If set this rule will only apply to these platforms
; Targets="Shipping,Test"			; If set this rule will only apply to these configurations
; bOnlyChunkedBuilds=true			; If set this rule will only apply to chunked builds
; bOnlyNonChunkedBuilds=true		; If set this rule will only apply to non-chunked builds
; +Files=".../*FileMask*.*"			; List of file masks to apply to, using the C# FileFilter class

[ExcludeDefault]
;Platforms="Windows,Win64" ; Note: Win64 doesn't seem to be recognized in UE5.1.1
;Platforms="Windows"
;For now commenting out above Platform designation so that exclusion rules apply to all platforms
Targets="Shipping,Development,Debug"
bExcludeFromPaks=true
bOverrideChunkManifest=true
+Files=".../Engine/Content/ArtTools/*"
+Files=".../Engine/Content/EditorLandscapeResources/*"
+Files=".../Engine/Content/EditorMeshes/ColorCalibrator/*"
+Files=".../Engine/Content/EngineSounds/*"
+Files=".../Engine/Content/Maps/*"
+Files=".../Engine/Content/MobileResources/*"
+Files=".../Engine/Content/Slate/Automation/*"
+Files=".../Engine/Content/Slate/Common/*"
+Files=".../Engine/Content/Slate/CrashTracker/*"
+Files=".../Engine/Content/Slate/Docking/*"
+Files=".../Engine/Content/Slate/Fonts/DroidSansFallback.ttf"
+Files=".../Engine/Content/Slate/Icons/*"
+Files=".../Engine/Content/Slate/MessageLog/*"
+Files=".../Engine/Content/Slate/Old/*"
+Files=".../Engine/Content/Slate/Testing/*"
+Files=".../Engine/Content/Slate/Tutorials/*"
;+Files=".../Engine/Content/Slate/Checkerboard.png" ; don't exclude - used in the default slate brush. excluding this turned one of my UI transition screens white instead of black in packaged version
+Files=".../Engine/Content/Tutorial/*"
+Files=".../Engine/Content/VREditor/*"
+Files=".../Engine/Content/EditorMeshes/Camera/SM_CraneRig_Arm.*"
+Files=".../Engine/Content/EditorMeshes/Camera/SM_CraneRig_Base.*"
+Files=".../Engine/Content/EditorMeshes/Camera/SM_CraneRig_Body.*"
+Files=".../Engine/Content/EditorMeshes/Camera/SM_CraneRig_Mount.*"
+Files=".../Engine/Content/EditorMeshes/Camera/SM_RailRig_Mount.*"
+Files=".../Engine/Content/EditorMeshes/Camera/SM_RailRig_Track.*"
+Files=".../Engine/Content/EditorMaterials/MAT_Groups_Toggle.*"
+Files=".../Engine/Content/EditorMaterials/MAT_Groups_Visibility.*"
+Files=".../Engine/Content/EditorMaterials/PreviewShadowIndicator.*"
+Files=".../Engine/Content/EditorMaterials/PreviewShadowIndicatorMaterial.*"
+Files=".../Engine/Content/EditorMaterials/MatineeGroups/MAT_ColorTrack.*"
+Files=".../Engine/Content/EditorMaterials/MatineeGroups/MAT_Groups_Anim.*"
+Files=".../Engine/Content/EditorMaterials/MatineeGroups/MAT_Groups_AudioMaster.*"
+Files=".../Engine/Content/EditorMaterials/MatineeGroups/MAT_Groups_Director.*"
+Files=".../Engine/Content/EditorMaterials/MatineeGroups/MAT_Groups_Event.*"
+Files=".../Engine/Content/EditorMaterials/MatineeGroups/MAT_Groups_Fade.*"
+Files=".../Engine/Content/EditorMaterials/MatineeGroups/MAT_Groups_Float.*"
+Files=".../Engine/Content/EditorMaterials/MatineeGroups/MAT_Groups_Move.*"
+Files=".../Engine/Content/EditorMaterials/MatineeGroups/MAT_Groups_Slomo.*"
+Files=".../Engine/Content/EditorMaterials/MatineeGroups/MAT_Groups_Sound.*"
+Files=".../Engine/Content/EditorMaterials/MatineeGroups/MAT_Groups_Vector.*"
+Files=".../Engine/Content/EditorMaterials/ParticleSystems/PSysThumbnail_NoImage.*"
+Files=".../Engine/Content/EditorMaterials/ParticleSystems/PSysThumbnail_OOD.*"
+Files=".../Engine/Content/EditorMaterials/Camera/CineMat.*"
+Files=".../Engine/Content/EditorMaterials/Camera/MI_CineMat_Rig.*"
  1. Package your project and it should apply. A lot of rows of “UATHelper: Packaging (Windows): Excluding …(file)…” should appear in your Output Log window if it was successful.

Other Notes:

  • The Platform identifier “Win64” doesn’t seem to work in UE5.1.1, but “Windows” works. I commented out the Platforms row so that the exclusion rules will apply to all platforms.
  • The Section name (ExcludeDefault above) is arbitrary and can be changed to anything.
4 Likes

DefaultPakFileRules.ini actually very poor replacement. It is non-exhaustive. For example, you cannot blacklist/remove packaging of /Game/Plugins/* path, but you can with PakDenylist-*.txt