MapsToCook
MapsToCook
#Overview
name: MapsToCook
The value of this variable can be defined or overridden in .ini config files. 1
.ini config file referencing this setting variable.
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of MapsToCook is to specify a list of maps that should be included in a packaged build of an Unreal Engine 5 project. This setting variable is part of the project packaging system and is used to determine which map assets should be cooked and included in the final game package.
The MapsToCook variable is primarily used by the Unreal Engine’s packaging and cooking systems. Based on the provided callsites, it is referenced in the following subsystems or modules:
- DeveloperToolSettings module (ProjectPackagingSettings class)
- UnrealEd module (GenerateDistillFileSetsCommandlet and CookOnTheFlyServer classes)
The value of this variable is set in the project’s packaging settings. It can be configured through the Unreal Editor’s Project Settings under the Packaging category, or directly in the project configuration files.
MapsToCook interacts with other packaging and cooking-related variables and systems. It is used in conjunction with other asset management and packaging settings to determine the final content of a packaged build.
Developers should be aware of the following when using this variable:
- It accepts file paths relative to the game content directory.
- Maps specified here will be included in the packaged build regardless of whether they are referenced elsewhere in the project.
- This setting is particularly useful for ensuring specific maps are included in the final build, even if they are not directly linked in the game’s flow.
Best practices when using MapsToCook include:
- Only include maps that are necessary for the final build to keep package size optimized.
- Regularly review and update the list to ensure it reflects the current state of the project.
- Use this in combination with other packaging settings to create a comprehensive build strategy.
- Consider using this for including tutorial, test, or hidden levels that may not be directly referenced in the main game flow.
- Ensure that the specified file paths are accurate and up-to-date to avoid packaging errors.
#Setting Variables
#References In INI files
Location: <Workspace>/Projects/Lyra/Config/DefaultGame.ini:185, section: [/Script/UnrealEd.ProjectPackagingSettings]
- INI Section:
/Script/UnrealEd.ProjectPackagingSettings
- Raw value:
(FilePath="/Game/System/FrontEnd/Maps/L_LyraFrontEnd")
- Is Array:
True
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Developer/DeveloperToolSettings/Classes/Settings/ProjectPackagingSettings.h:568
Scope (from outer to inner):
file
class class UProjectPackagingSettings : public UObject
Source code excerpt:
*/
UPROPERTY(config, EditAnywhere, Category = Packaging, AdvancedDisplay, meta = (DisplayName = "List of maps to include in a packaged build", RelativeToGameContentDir, LongPackageName))
TArray<FFilePath> MapsToCook;
/**
* Directories containing .uasset files that should always be cooked regardless of whether they're referenced by anything in your project
* These paths are stored either as a full package path (e.g. /Game/Folder, /Engine/Folder, /PluginName/Folder) or as a relative package path from /Game
*/
UPROPERTY(config, EditAnywhere, Category=Packaging, AdvancedDisplay, meta=(DisplayName="Additional Asset Directories to Cook", LongPackageName))
#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Private/Commandlets/GenerateDistillFileSetsCommandlet.cpp:99
Scope (from outer to inner):
file
function int32 UGenerateDistillFileSetsCommandlet::Main
Source code excerpt:
// Add Maps to cook from project packaging settings if any exist
for (const FFilePath& MapToCook : PackagingSettings->MapsToCook)
{
MapList.AddUnique(MapToCook.FilePath);
}
}
// Add any assets from the asset manager
#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Private/CookOnTheFlyServer.cpp:9007
Scope (from outer to inner):
file
function void UCookOnTheFlyServer::CollectFilesToCook
Source code excerpt:
if (bFoundMapsToCook == false)
{
for (const FFilePath& MapToCook : PackagingSettings->MapsToCook)
{
UE_LOG(LogCook, Verbose, TEXT("Maps to cook list contains %s"), *MapToCook.FilePath);
AddFileToCook(FilesInPath, Instigators, MapToCook.FilePath, EInstigator::PackagingSettingsMapToCook);
bFoundMapsToCook = true;
}
}