x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Additional Asset Directories not Copied to Packaged Build

My Info:

  • Windows 8.1 64-bit

  • Visual Studio 2013 Update 4

  • Unreal Engine 4.8 (binary from launcher)

  • Project was created in 4.7 and updated to 4.8

  • DefaultGame.ini

I am not able to get the Additional Asset Directories to Cook feature working in my project. Here is how I am validating this result.

Add an asset directory that I want to cook.

alt text

This asset directory contains textures that I reference in C++:

alt text

They are initialized in my constructor via a static like so (all works fine in PIE):

 struct FConstructorStatics
 {
     ConstructorHelpers::FObjectFinderOptional<UTexture2D> T_Face_Button_Left;
     ConstructorHelpers::FObjectFinderOptional<UTexture2D> T_Face_Button_Right;
     ConstructorHelpers::FObjectFinderOptional<UTexture2D> T_Face_Button_Top;
     ConstructorHelpers::FObjectFinderOptional<UTexture2D> T_Face_Button_Bottom;
     ConstructorHelpers::FObjectFinderOptional<UTexture2D> T_Left_Shoulder;
     ConstructorHelpers::FObjectFinderOptional<UTexture2D> T_Left_Trigger;
     ConstructorHelpers::FObjectFinderOptional<UTexture2D> T_Right_Shoulder;
     ConstructorHelpers::FObjectFinderOptional<UTexture2D> T_Right_Trigger;
     ConstructorHelpers::FObjectFinderOptional<UTexture2D> T_DPAD;
     ConstructorHelpers::FObjectFinderOptional<UTexture2D> T_Left_Analog;
     ConstructorHelpers::FObjectFinderOptional<UTexture2D> T_Right_Analog;
     ConstructorHelpers::FObjectFinderOptional<UTexture2D> T_Start;
     ConstructorHelpers::FObjectFinderOptional<UTexture2D> T_Special;
 
 #if IsPS4
     FConstructorStatics()
         : T_Face_Button_Left(TEXT("/Game/UI/GamepadIcons/PS4/PS4_Square")),
         T_Face_Button_Top(TEXT("/Game/UI/GamepadIcons/PS4/PS4_Triangle")),
         T_Face_Button_Right(TEXT("/Game/UI/GamepadIcons/PS4/PS4_Circle")),
         T_Face_Button_Bottom(TEXT("/Game/UI/GamepadIcons/PS4/PS4_Cross")),
         T_Left_Shoulder(TEXT("/Game/UI/GamepadIcons/PS4/PS4_L1")),
         T_Left_Trigger(TEXT("/Game/UI/GamepadIcons/PS4/PS4_L2")),
         T_Right_Shoulder(TEXT("/Game/UI/GamepadIcons/PS4/PS4_R1")),
         T_Right_Trigger(TEXT("/Game/UI/GamepadIcons/PS4/PS4_R2")),
         T_DPAD(TEXT("/Game/UI/GamepadIcons/PS4/PS4_Dpad")),
         T_Left_Analog(TEXT("/Game/UI/GamepadIcons/PS4/PS4_Left_Stick")),
         T_Right_Analog(TEXT("/Game/UI/GamepadIcons/PS4/PS4_Right_Stick")),
         T_Start(TEXT("/Game/UI/GamepadIcons/PS4/PS4_Options")),
         T_Special(TEXT("/Game/UI/GamepadIcons/PS4/PS4_Share"))
     {
     }
 #elif IsXboxOne
     FConstructorStatics()
         : T_Face_Button_Left(TEXT("/Game/UI/GamepadIcons/XboxOne/XboxOne_X")),
         T_Face_Button_Top(TEXT("/Game/UI/GamepadIcons/XboxOne/XboxOne_Y")),
         T_Face_Button_Right(TEXT("/Game/UI/GamepadIcons/XboxOne/XboxOne_B")),
         T_Face_Button_Bottom(TEXT("/Game/UI/GamepadIcons/XboxOne/XboxOne_A")),
         T_Left_Shoulder(TEXT("/Game/UI/GamepadIcons/XboxOne/XboxOne_LB")),
         T_Left_Trigger(TEXT("/Game/UI/GamepadIcons/XboxOne/XboxOne_LT")),
         T_Right_Shoulder(TEXT("/Game/UI/GamepadIcons/XboxOne/XboxOne_RB")),
         T_Right_Trigger(TEXT("/Game/UI/GamepadIcons/XboxOne/XboxOne_RT")),
         T_DPAD(TEXT("/Game/UI/GamepadIcons/XboxOne/XboxOne_Dpad")),
         T_Left_Analog(TEXT("/Game/UI/GamepadIcons/XboxOne/XboxOne_Left_Stick")),
         T_Right_Analog(TEXT("/Game/UI/GamepadIcons/XboxOne/XboxOne_Right_Stick")),
         T_Start(TEXT("/Game/UI/GamepadIcons/XboxOne/XboxOne_Menu")),
         T_Special(TEXT("/Game/UI/GamepadIcons/XboxOne/XboxOne_Windows"))
     {
     }
 #endif
 
 };

After packaging the build, I expect this folder to exist in the final package folder, it does not.

alt text

Am I misinterpreting the asset directory parameter? How do I get these additional assets into my packaged build?

Things I've tried:

  1. Creating a User Widget that uses these textures as images. I then create a reference to that User Widget in my main HUD but again there is no change in packaging.

  2. Copying the .uasset files manually to the packaged folder, this results in a crash in GarbageCollection.cpp. I'm unsure if the assets are problematic or something else.

  3. Creating a .uasset file in the GamepadIcons folder, thinking that perhaps an empty folder was preventing the inner XboxOne folder from being scanned.

  4. Using the Cook Everything in the project content folder option

  5. Every variant of 32/64-bit development/shipping/DebugGame

  6. Packaging in editor

  7. Packaging via UnrealFrontend

Here is the log output from packaging in editor None of these attempts resulted in any change in output. Please tell me what I'm doing wrong here, I'm sure it's something fundamental or alternatively something is fundamentally broken.

Product Version: UE 4.8
Tags:
1.jpg (12.3 kB)
2.jpg (46.8 kB)
3.jpg (37.5 kB)
log.txt (1.7 MB)
gameini.txt (1.5 kB)
more ▼

asked Jun 12 '15 at 10:50 PM in Packaging & Deployment

avatar image

hyperdr1ve
593 28 51 118

avatar image hyperdr1ve Jun 20 '15 at 02:51 AM

I've added an additional firehose worth of extra details. This issue is killing my studio.

avatar image Renderdog Jun 20 '15 at 04:28 AM

I am not sure this is related. I just tried 4.8 today. I cannot compile a default scene in 4.8 without fatal errors. When I do a build it is blowing away a folder it "appears" to be looking for. Here is the link to my thread. https://answers.unrealengine.com/questions/245398/48-build-error-on-default-scene-runuatbat-error.html

avatar image hyperdr1ve Jun 20 '15 at 05:51 AM

I don't think these are related. My issue has to do with content not being copied.

avatar image hyperdr1ve Jun 20 '15 at 06:17 AM

Another note. After packaging completes, if I look in Saved\Cooked\WindowsNoEditor, I see the missing content there. So it seems that the packaging step is where things are failing.

avatar image hyperdr1ve Jul 24 '15 at 07:12 PM

I can't seem to get traction on this bug. Here is the smallest C++ project I could make that replicates the issue.

packagingbug[1].zip (407.7 kB)
avatar image hyperdr1ve Aug 11 '15 at 05:44 PM

Manually adding missing content via copy/paste works for windows but not for mobile.

avatar image Neil.Griffiths Sep 09 '15 at 08:36 PM

I'm with you, packaging is broken in UE4. It's fine for anything that's referenced; anything else isn't included.

You can see that simply by looking at the command line the editor passes to UAT (it starts with BuildCookRun) when you start packaging your project. It won't pass along any extra directories specified in the .ini file.

The only workaround I have is to have a build script that removes content I don't want packaged and then to specify that I want it to package all content (which uses the argument -CookAll). I've looked through the parameters supported by UAT and I can't see one that would cook and/or package other content.

avatar image hyperdr1ve Sep 09 '15 at 08:58 PM

Please upvote the question if you can. I think packaging C++ projects falls into the < 1% of users bin, so I'm guessing this isn't even on the radar. Even a recommended workaround of how to make sure a texture asset is referenced would be ok with me.

Your workaround seems doable, but very heavy-handed and difficult to maintain.

avatar image Neil.Griffiths Sep 09 '15 at 09:29 PM

Oh, it's ridiculous to do it that way, I agree. In our case, though, it takes our packaged builds from 2.75GB to 1.3GB - so it's worth maintaining for now. But I wouldn't have to do that if I could specify the maps to be packaged properly using the editor.

The wiki (https://wiki.unrealengine.com/How_to_package_your_game_with_commands) suggests that I can add maps under the [AllMaps] section of DefaultEditor.ini. But then why does the editor add MapsToCook under [/Script/UnrealEd.ProjectPackagingSettings]? It seems like all of the array options under the Packaging UI in the editor are just thrown away when packaging - only the binary on/off options are used.

I actually don't believe this problem is specific to C++ projects, it's specific to any project that doesn't want to package everything... or one that wants to package things that aren't directly referenced by maps!

I guess I could look into fixing it myself since I've already done a lot of investigating - the problem is finding time with deadlines looming! I'm sure Epic has the same issue too - it's just frustrating because in all other ways the packaging process is very good!

avatar image hyperdr1ve Sep 09 '15 at 09:38 PM

yep I agree, all of the array options seem to be no-ops. I'm not sure how to create unreferenced content using only blueprints, but if there were an easy repro it might help the cause.

I know what you mean about fixing it yourself. It's on my todo list to look at the packaging code, if you ever want to collaborate on this, maybe we can share notes! I haven't yet upgraded to 4.9 by the way, so unsure of changes there.

avatar image Neil.Griffiths Sep 09 '15 at 09:51 PM

I'm on 4.9 - it still doesn't work.

As for working on it together - I can tell you that we have to start with Engine\Source\Programs\AutomationTool\Scripts\BuildCookRun.Automation.cs - all the magic happens inside DoBuildCookRun(). I'll definitely get around to going further down the rabbit hole, I just don't have any time this week. :-(

avatar image Neil.Griffiths Sep 09 '15 at 09:59 PM

Actually, I went further down the rabbit hole. It looks like the problem might be inside Engine\Source\Editor\UnrealEd\Private\Commandlets\CookCommandlet.cpp. In 4.9 at least, the line in question starts at 1146.

I'll let you know what I find out!

avatar image hyperdr1ve Sep 09 '15 at 10:00 PM

I'm going to pull down master tonight and dig around.

avatar image Neil.Griffiths Sep 09 '15 at 11:51 PM

I don't have time to continue looking today but what I've found is that where the settings are being ignored starts in SetupParams() in BuildCookRun.Automation.cs. It creates a new ProjectParams object in there - that's the object that needs to contain all of the correct data.

In theory passing the "cookdir" parameter with directories delimited by the '+' character should solve your problem! So far that seems to be specified in CookCommandlet.cpp and CommandletUtils.cs - so either they're not working properly or it needs to be specified somewhere else too!

Hopefully that gives you something to start working with!

avatar image hyperdr1ve Sep 10 '15 at 05:55 PM

I spent a good 2 hours familiarizing myself with the code. I'm currently investigating the CreateStagingManifest() function in CopyBuildToStagingDirectory.Automation.cs and determining why it isn't honoring the UFS and Non-UFS parameters in the packaging settings.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

2 answers: sort voted first

Well, I finally found the issue. It wasn't a bug, just an unexpected feature of the staging system.

In CopyBuildToStagingDirectory.Automation.cs, a function is called to copy UFS and NonUFS folders to the staging folder (`SC.StageFiles(...)`):

The final argument passed to the function is a bool called bStripFilesForOtherPlatforms that is determined using:

 !Params.UsePak(SC.StageTargetPlatform)

So basically if you aren't using a pakfile, bStripFilesForOtherPlatforms will be true and you're in danger of getting the same behavior I describe.

 public bool UsePak(Platform PlatformToCheck)
 {
     return Pak || PlatformToCheck.RequiresPak(this) == Platform.PakType.Always;
 }

When this boolean is set, there's some code in DeploymentContext.cs::StageFiles that looks at the full path of the content you are including. If this content contains a folder whose name matches any platforms that you are not building for then the content gets ignored - as in not copied.

So for instance trying to include content named /Game/Content/UI/XboxOne/button.uasset when building for Win32 will get ignored because XboxOne is a platform name. If the folder name was XboxOne1 or MyXboxOne it would have been ok since the match string is "/Platform/".

I looked through the docs and couldn't find any mention of platform specific folder names as part of the packaging process! Kind of a huge deal here I think.

For future generations, strategically use platform names in your build folders: Win32 Win64 WinRT WinRT_ARM UWP Mac XboxOne PS4 IOS Android HTML5 Linux AllDesktop

In short, renaming my folder from XboxOne to Xbone fixed the problem.

more ▼

answered Sep 11 '15 at 05:45 PM

avatar image

hyperdr1ve
593 28 51 118

avatar image zerofiftyone Jun 08 '16 at 03:57 PM

I've been having this same issue for the past two months. Thank you SO MUCH for getting to the bottom of it and documenting it in this thread.

avatar image HazzaBui Jun 12 '16 at 12:12 AM

Thanks for this answer, it helped me as well! For anyone interested, this bug (anything which acts in an unexpected way, and is undocumented, is a bug in my eyes), still exists in 4.11.2

avatar image DanZaidan Mar 10 '17 at 11:54 AM

Thanks for much for this. I can`t believe this isn't talked more often.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

edit: Top editing because I found something useful.

Someone came across this. Looks like unreal doesn't like to package directories with "xbox" or "ps4" in their names. Maybe try changing the directory name and see if it packages?

end edit:

I believe all the asset directories that get cooked get compiled into an intermediate file format that lives under Your_Cooked_Project_Path\Content\Paks as .pak files and the directory structure is not preserved. If you want the directory structure and all files copied across it should go under "Additional Non-Asset Directories to Copy" or Cook depending on what you want.

The reason it probably doesn't work in the cooked build is probably because your paths in your constructor aren't asset references, which should look like this: "Texture2D'/Game/Textures/Light01.Light01'"

I think this is more that you took a really roundabout way of loading your assets that happened to work in the editor by some random quirk of the FObjectFinder. You can copy and paste the actual asset paths by right clicking the asset in the content browser and "Copy Reference" then paste that in for your strings. Try that and see what happens.

edit: Hrm. I think the first bit I said is because we have "Create compressed cooked packages" ticked. hrmrmrm. I'll poke around more, but we've had no issues using "Additional Asset Directories to Cook".

more ▼

answered Sep 11 '15 at 04:05 PM

avatar image

mrooney
703 40 32 123

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question