How do I keep EngineDebugMaterials from being included in a shipping build?

As the title states, when I package a (no pak) shipping build for Win64(at least), a search of the output shows that the Engine/Content/EngineDebugMaterials folder is taking up 90+ MB in the packaged game.

In a shipping build, with the console disabled and the debugging symbols and instructions removed(and a significantly smaller executable size), I would think the contents of the EngineDebugMaterials folder would not need to be packaged. Considering that after all, they are debug materials.

I have tested this on both a project I am working on, and a totally new C++ blank project.

So. What do I do now? Ideally, I want to keep them from being packaged, as I need to deploy mobile versions of my project, and I would like as much room as possible for content, not debug materials in a non-debug package.

EDIT: This appears to be a bug with the ‘Use Pak file’ option. See my answer for more details.

Hey Axtel,

Have you attempted to go into your ‘Project Settings’ and within the ‘Packaging’ section edit the options for what is or is not included?

Let me know if these options help resolve your issue.

Cheers,

I forgot to clarify, the folder is in the Engine Content section. In addition, I have looked and do not see an ‘Exclude [files/folders/…]’ field or anything similar. Running 4.8.3.

Be sure the ‘Include Debug Files’ is unchecked and you are using the ‘Shipping’ build configuration.

Let me know if you are still having troubles.

I just packaged with the settings as recommended, still includes EngineDebugMaterials. Seems like all engine content is being cooked into the packaged game, is there a way to modify that behavior?

Hey Axtel Sturnclaw,

In order to accurately reproduce the issue you are reporting, would you provide me with some simple steps to follow so I can get to the same end point?

The important part of the steps, are the settings you have chosen for your packaged build. Would you provide me with a screenshot for this part of the steps so I can take a look at the options you have selected.

Let me know if you have questions.

Cheers,

Steps: New project (4.8.3, No starter content, blank, blueprints, max quality). Save the default map, set as default in Settings->Maps / Modes, Set packaging mode to Shipping, uncheck Use Pak File (so I can analyze the packaged files), click Package (Win64).

Hey Axtel,

Thank you for your patience while I worked on getting a repro for this issue. I was unable to reproduce this issue during testing in both 4.8.3 and 4.9.2 binary releases?

Would you mind testing to see if this issue occurs in 4.9.2 as well?

Try checking the ‘Full Rebuild’ option, as well as excluding the ‘Include Prerequisites’ option to see if that has an affect on the issue.

Thanks,

No 4.9.2 currently available here, sorry.

I checked Full Rebuild, and the Engine Debug Materials (in the empty project) dropped to ~19 MB(from what, I am not sure); the setting made no difference (even when off) after that.

Include Prerequisites only controls the inclusion of (PackagedName)/Engine/Extras (~11MB).

For Distribution has no difference on the packaged size.

Attached is a graph of the offending folder:

61811-testpackaging_packagedsize.png

I believe there is a console command to enable debug viewmodes in a packaged project, perhaps necessitating the inclusion of this folder.

However, I would think this should not be necessary in a shipping build(with or without ‘For Distribution’ checked), as, to the best of my knowledge, console commands are disabled in a shipping build.

I have renamed it in the packaged project (breaking inclusion, as far as I am aware), and the packaged game still functions perfectly fine.

So, I have resolved my issue, and unearthed another. With ‘Use Pak file’ checked, the (PackagedName)/Engine folder only contains two folders: Binaries and Extras. Total size is around ~58 MB.

With ‘Use Pak file’ unchecked, the same directory looks like this:

61812-packaging_nopak.png

The actual game directories are mostly the same, the No-Pak’s content directory is about 40MB larger. Probably due to the gains from pak-ing the files.

Do note that ‘Full Rebuild’ was checked for all.

I have tested this across two different projects, and I see the same results. Also note that with a blank project, the actual game executable resides in the /Engine directory and not in the PackagedName/ProjectName/ directory.

So, in summary, unchecking the ‘Use Pak file’ option includes lots of (semi) extraneous stuff, bloating the packaged size to an extreme. In the case of my main project, it increased the file size to 400+ MB, from ~197 MB.

Hey Axtel,

I do see the difference in size, but I also could say that the Use Pak file option is doing its job there. You mention “(semi) extraneous stuff” but would you mind telling me what files are extra that you do not want included.

From what I am reading about the Pak process, all assets will be put into a single .pak file instead of copying out all the individual files. This could be where the extra size is coming from.

As another note, we made a lot of fixes and improvements in 4.9.2 which could easily resolve your issue in 4.8.3. This is why I asked if it was occurring in this build as well, so if it does still occur there we can enter a bug to have it fixed for an upcoming release.

Release Notes

You can read over the release notes to see the improvements for packaging made over the previous engine version.

Thanks,