Download

How to speed up content cooking. (Also, why is my cooking acting weird?)

Hello Epic and Friends!

Today I am going to be starting a post all about cooking content with the UE4 Project Launcher, what I have learned (if anything) and what is to be learned from my current mishap. It should be noted that I am packaging a Server and WindowsNoEditor version.

There is a whole mess of options available to us inside the Project Launcher, as well as in Unreal Frontend. However, not all of their functions are terribly clear and a few combinations of options don’t really work, the most important thing to remember is that we should not always have to cook every single thing in our projects. In recent history I had my project cook time down to approximately 1 minute. This is huge as it allows for super fast iteration and testing on blueprints as well as c++ code.

Just to make this clear, as this is important. My team’s entire project was finishing its cook command and testing successfully at 1 minute iterations. The content folder of this project is currently about 16 GB in size and…
The cook time was down to one minute.

The attached image shows the options I had selected to achieve this. If you think about it, they totally make sense as to why they cook out so fast and allow for fast iteration. At the time I had this working I was testing some client login/disconnect code and it worked wonderfullyl.
I don’t cook maps that I have already cooked, because they haven’t changed. This makes sense and should provide a huge speed increase to cook iterations.
Next, I opt to only cook changed content, which means all of those Static Meshes, Textures, Materials, and un-edited Blueprints don’t waste any of my time. Only what I change needs cooking.
These are some simple options that I feel are on top of the reasons why cooking goes so slow for most people. I am hoping if anyone else has any tips or tricks on how to improve this process they will throw in some comments here.

Now we get to my confusion about the state of my cooker: Cooking everything, my cook results in around a 30 minute cook time. I follow up with a cook of un-edited Blueprints and remove all the maps from the maps to cook list… and the time increases to around 40 minutes… What could be causing this atrocity? Someone from Epic, or someone knowledgable, please help me get back the good old days of 1 minute iterations!

Best,
Spiris

Hosted the logs elsewhere. Here they are:
All Maps Cooked
No Maps Cooked

So a few more pointers to the interested developers can be found at this forum post, all good advice from Exi and Alexander.

As far as my issues go, this advice has had little impact. I am forced to conjecture here, but I would guess that a filepath is improperly defined and my cooker is unable to find my previously cooked assets.

What other reason could there be for cooking taking longer the second time?

Good news anyone who is interested!

So I poked more buttons… honestly, what I am doing should not work, so I am going to try to explain it in a way that exposes what I consider a problem to Epic, as well as clears up some confusion that I simply CAN’T be the only one dealing with.

MY COOK TIMES ARE AGAIN DOWN TO LESS THAN ONE MINUTE!

With a content folder well over 16GB. Yeah!

Depending on how much content you have changed since your last cook, these times will vary, and it definitely takes an informed user to figure out just what maps need to be cooked and when (reference viewing is wonderful), but this should help anyone trying to reduce cook times.

Basically, any dynamically spawned blueprints can ignore all maps being cooked… EXCEPT ONE for some odd odd reason UE4 thinks it necessary that you always cook at least one map with this method. If you do not, it will basically default to cooking everything, sometimes multiple times, and I have no idea why! Yay Game Engines!
I would recommend adding a map to your game with nothing in it to serve this function as your dummy map. It cooks faster, because nothing is referenced in it.
It is important to remember which maps have static references to the blueprints you change, because although you may cook the changed blueprint, the old cooked map still has a reference to your old blueprint, which can only change by recooking the map it was in.
Below is my setup screenshot, which is good as a reference so long as you keep the above in mind.
I think that is it… let me know if I need to clarify! Maybe Epic could shed some more light on this topic too? :slight_smile:

Best,
Spiris

711ef77ff13f2acfc7b8c7ff15a7fc21d11c7a9f.png

this is incredibly useful. nobody is commenting on the method? or if it’s actually something wrong ( the reason why it turned up to be 40 minutes ) ?

Hey there, with this now i also speed up my cook time! I’have a question: in UE4.18 i found this in projects settings:

iterative.png

If i enable the “iterative cooking for build launched from the editor (launch on)” option, can i speed up the package process from “File -> Package Project -> Windows”?