List of Maps to cook

Hi,

Does anyone knows exactly where to put things in the ini files to get a proper list of maps to be cooked?

There is a list in the ProjectPackagingSettings in DefaultGame.ini
AlwaysCookMaps in DefaultEditor.ini
AllMaps in DefaultEditor.ini

By reading the code in: CookCommandlet.cpp, I can see that AllMaps is a backwards compatibility tag, so I should not use it (but still used in UT4, ShooterGame etc…).

I bet that “AlwaysCookMaps” is used as a “minimum set of maps” for all cook process (in case you didn’t select any maps in UFE??)

MapsToCook in ProjectPackagingSettings is used on if bCookSinglePackage = false (I don’t know what’s the use of this parameter? is it equivalent to chunk?)

So what’s the correct way to cook things and not include test/wip maps in the cooked data?

Thanks

Hi,

Inside the editor’s project settings you can select which map to cook and other stuff. I never had to bother with ini files to cook projects.

Thanks, the editor panel is using the ProjectPackagingSettings approach.

I’m just wondering if AlwaysCookMaps is still valid as there is no Editor way to set this.

I still don’t understand what bCookSinglePackage means and in which case the selected map in the editor panel won’t be taken into account.

DefaultGame.ini
[/Script/UnrealEd.ProjectPackagingSettings]
bCookAll: if true, cook everything in the content directory. This means that if you have an asset that is not referenced by any others, it will still end up in the cook. From this it follows that the list of maps to be cooked is simply all of them, even if they are not in any other .inis.
bCookMapsOnly: this setting only has any effect if bCookAll is set. If it is true, “cook all” does not actually cook every asset, just all maps and the assets they reference.
DirectoriesToAlwaysCook: like bCookAll for subdirectories. You can have more than one of these (possibly combined with DirectoriesToNeverCook) to get more fine-grained control than you would with bCookAll.
bCookSinglePackage: affects MapsToCook behaviour (and nothing else), see below.
+MapsToCook: which maps to cook if: (1) bCookSinglePackage is false (the default), and (2) there are no maps specified on the command line.

DefaultEditor.ini
[AlwaysCookMaps]
+Map: map(s) to always cook (one line for each). Despite what the filename suggests, this setting is also used by the automation tool and project launcher/frontend. And as you suspected, these maps are cooked regardless of whether they are selected in the launcher or not.
[AllMaps]
+Map: map(s) listed here (one line for each) are used as a fallback option in case there are (1) no maps specified on the command line and (2) no maps in MapsToCook. This is for backwards compatibility only.

If you want to make a selection of maps that should really always be cooked, use AlwaysCookMaps. I would not recommend using either AllMaps or MapsToCook, since their behaviour depends on other environment variables which makes them prone to unexpected breakage. If you want you can set MapsToCook, but be aware that if you specify maps on the command line this setting will be ignored.

3 Likes

Thanks for the clarification.

I will had that ProjectPackagingSettings MapsToCook is a file path that is relative to the EDITOR and not the project!!! this is a major failure in the design in my perspective. We just screw up a test session due to that as the PC where we setup the map to be cook and the cook was not the same. As a consequence no MAP where added to the pak file :frowning:

As you have no way to select “Map in project”, I will stuck with AllMaps.

I will raise a request so this behavior is updated / changed for the future, it’s clearly error prone.

bCookSinglePackage will force to exclude InputPackages ,DefaultMaps ,SlatePackages and some other things during cooking procedure.
it basically is there to faster the cooking procedure.

the full definition is here

to see its impact u have to go to:
Source\Editor\UnrealEd\Private\CookOnTheFlyServer.cpp
and search for this lines:

do same for other flags of SinglePackageFlags and u will find their impacts.

Hi. I’m digging out an old topic but I’m confused about how the “Cook only maps” works.

Up to this moment I thought that UE4 will cook and pack only assets that are referenced somewhere. Accoring to one of the last streams “UE4 for Game Jams” ( Redirecting... 28:10 ) UE4 will cook and pack ALL assets from Content directory.

I’ve checked this. I added an Actor and didn’t place it anywhere. It was cooked and added to a pak file when packaging…

So, to add only these files that are referenced somewhere I have to select bCookMapsOnly… but to make it work I have to select bCookAll too. So, to not cook all, I have to select bCookAll? How does it even work? Help?

If you determine your list of maps that should be packaged, then only assets referenced by those maps should be packaged.
If you don’t set the list of maps, every map is packaged into the final exe.

That’s correct. If I don’t set the list of maps - every map will be packaged. But will all assets from Content directory be packaged or only those assets that are referenced somewhere in those maps?

Sorry if this is an old topic, but there was no response to the last question.

I have a game, where I specify only 2 maps to cook, & have cook everything unticked, & cook only maps unticked.
I have 2 movie files that are not referenced by these maps at all. (inside of Content\Movies)
When I package for Win64, there they are under <projectname>\Content\Movies

Digging through all the layers of code to work out the logic is undesirable, but looking more like the only option.