This is stolen from my [post][1] in the ‘Packaging and Deployment’ section:
–
After I cook content in the editor, then build my game in ‘Shipping’ configuration (either Win64 or Win32), running that game, either via Visual Studio directly or by finding the Shipping .exe in the Binaries folder and running it, I receive the error that cooked content is missing / the global shader cache file is missing. This does not occur with Development or DebugGame builds. Only Shipping.
I have also tried this after cooking content via UnrealFrontend, by launching a Shipping build and selecting ‘By The Book’ for the cooking options so it will cook everything and save it. This will allow me to launch via the frontend, but I still cannot launch Shipping from VS or run the executable from the Binaries folder.
This has been happening for a long time across multiple versions of the editor and on multiple PCs. Any help would be greatly appreciated.
–
I’m trying to launch a shipping build from Visual Studio so I can easily attach profiling tools to it (ones that are built/integrated into VS). This is made difficult by this problem.
Thanks!
EDIT: I forgot to throw in some repro steps! My bad.
Create an empty C++ project
Compile the project in the Development configuration, then launch it in Development Editor.
Select ‘Cook content for Windows’
Close out of the editor and launch the project in the Shipping configuration.
Observe the ‘global shader cache file is missing’ error
Try launching in Development or DebugGame configurations and notice that it still works - cooked content is working for them but not for ‘Shipping’.
Could you show me the error that is associated with this issue you’re running in to?
I also want to verify whether you are on Binary or Source. Since you’re working within Visual Studio on a code project, I do want to make sure of which version of the editor you’re in.
I am running a binary build of the engine. Currently working with 10.1, but have tested with 4.9 (and probably 4.8 in the past, but I can’t verify that).
We have not heard back from you in a few days, so we are marking this post as Resolved for tracking purposes. If you are still experiencing the issue you reported, please respond to this message with additional information and we will offer further assistance.
Sorry for not getting back to you. I’m not sure what you meant by your previous message - whether I build my solution in DevelopmentEditor or DebugGameEditor configurations, trying to launch the Shipping build via the process I outlined earlier still fails, even after cooking in either of the two ‘Editor’ configurations.
Yes, regardless of the editor configuration I use to do the initial cook (DevelopmentEditor, DebugGameEditor, etc), Shipping is still failing out of Visual Studio with the above error.
I’m trying to follow the steps you posted and have a few questions to make sure I’m following along correctly. What exactly do you mean when you say “launch” in Development Editor / Shipping? My understanding is that you create a new project and then compile in Development. Are you then compiling again in Development Editor and opening the .uproject or are you opening the project from Visual Studio in DebugMode?
We have not heard back from you in a few days, so we are marking this post as Resolved for tracking purposes. If you are still experiencing the issue you reported, please respond to this message with additional information and we will offer further assistance.
This is still an issue in 4.11.0. Again, if you cook content, you can launch non-editor builds from Visual Studio that use that cooked content just fine, unless that build is ‘Shipping’ (and also ‘Test’ but I can’t try that in 4.11.0 just yet).
Cooking in editor, then launching from Visual Studio:
DebugGame = fine;
Development = fine;
Shipping = fail;
Test (only available with source engine build) = fail.
Those two fails look like this.
Repro steps:
Create a new C++ project. I didn’t include starter content for convenience’s sake.
Open the project in UE4 and add some content, including a level (can be empty).
Set the level to be the default game level (Project Settings → Maps & Modes → Game Default Map). The game won’t work otherwise.
We want to cook our content, but we have to build in ‘Development’ config first, so close UE4, open the project up in VS2015, and compile it in ‘Development’ configuration.
Open the project back in UE4 (can be via the .uproject file, can be launched from within VS2015 into DebugGame Editor or Development Editor, etc. Just get back into UE4 somehow).
Cook content so we can launch non-editor builds and use our content (File → Cook Content for Windows)
Close UE4, and return to VS2015. Build the project in ‘DebugGame’ configuration.
In VS2015, launch the project in this configuration and observe that the game loads. If you created a totally blank level as your default, you’ll see a black screen, but that’s okay. The error message I linked above doesn’t display. This means the content cooking worked and we’re all good.
Try the same with ‘Development’ configuration. It also works.
Now try ‘Shipping’. Observe the above fail message.
If you’re using a source build of the engine, also try ‘Test’. Same result as Shipping - fail.
I am able to open the .exe that’s created once building the project in shipping from Visual Studio. Since I am able to run the .exe from that, there doesn’t seem to be an issue here. Shipping isn’t supposed to have debugging capabilities, so when you’re launching it with debugging through VS, errors are expected.
I also receive the above error when I run the project from the ProjectName-Win64-Shipping.exe directly, and this is the same for the ‘Test’ configuration version. These configurations not having debug symbols is unlikely to be a reason why the cooked content can’t be found (both because launching it directly fails, and that I don’t see how they’re connected).
Were you able to launch the .exe directly via the steps I gave? What happened if you launched it from within VS2015?
If you take a look at the documentation linked previously, it specifically states, “Shipping: This is the configuration for optimal performance and shipping your game. This configuration strips out console commands, stats, and profiling tools.” Therefore, if you’re attaching profiling tools to your project, it definitely will not work like you’re wanting it to. I would suggest trying the ‘Test’ building configuration because it uses the shipping configuration, but it includes some of the console commands, stats and profiling tools.