DirectoriesToAlwaysStageAsUFS does not work

Hi,

I have the problem that ‘DirectoriesToAlwaysStageAsUFS’ just does not work.
Through the project settings I added one ‘Additional Non-Asset Directories to Package’, the path was selected through the three dots (directory picker)
The defaultGame.ini shows that the value was correctly set.

+DirectoriesToAlwaysStageAsUFS=(Path="CG_Consoles/Icon")

But after cooking the directory does not appear under /Saved/Cooked/, as if unreal is straight of ignoring this setting. In the packaged game the path can therefore not be found.
There are no warnings or errors while cooking.
In another project the same setting worked as intended.

Are there maybe any other project settings which could prevent this cooking feature to work?

Best regards

Hi,
I could resolve this question myself.

The problem lies within Epic not documenting how specific settings actualy behave.

In my case the directory ‘CG_Consoles/Icon’ holds no uasset’s, only, for example, png files.
So this directory will never be cooked and staged, that is why I used ‘DirectoriesToAlwaysStageAsUFS’ to get this directory and the containing files included in the packaged game.
But because the directory will never be cooked the staging process cannot include this directory by itself, which means that ‘DirectoriesToAlwaysStageAsUFS’ does not work in this situation.

If I would add a uasset inside CG_Consoles and reference it inside the game, the directory will be staged correctly with all files inside.
Without such a, referenced, uasset the following setting must be included ‘Additional Asset Directories to Cook’ or inside the defaultGame.ini ‘DirectoriesToAlwaysCook’.
With these lines inside the defaultGame.ini everything works as intented (even if the directory is never found inside the /Saved/Cooked/ directory, as it is only staged inside the pak)

[/Script/UnrealEd.ProjectPackagingSettings]
+DirectoriesToAlwaysCook=(Path="/Game/CG_Consoles/Icon")
+DirectoriesToAlwaysStageAsUFS=(Path="CG_Consoles/Icon")

If those informations were documented, it would have been far easier and faster to get this working without hours auf trail and error.

(The last project were it worked as intented had referenced uasset inside, so it just coincidentally worked)

Best regards

1 Like