PackageCompressionLevel_DebugDevelopment

PackageCompressionLevel_DebugDevelopment

#Overview

name: PackageCompressionLevel_DebugDevelopment

The value of this variable can be defined or overridden in .ini config files. 2 .ini config files referencing this setting variable.

It is referenced in 3 C++ source files. Also referenced in 1 C# build file meaning it may affect the build system logic.

#Summary

#Usage in the C++ source code

The purpose of PackageCompressionLevel_DebugDevelopment is to control the compression level used for packaging Unreal Engine projects in debug and development configurations. This setting is part of the project packaging system and affects how game assets are compressed during the build process.

This setting variable is primarily used by the Unreal Engine’s packaging and compression systems. Based on the provided callsites, it is referenced in the following subsystems or modules:

  1. DeveloperToolSettings: Defines the variable in the ProjectPackagingSettings class.
  2. TextureEditor: Uses the variable to determine the compression level for textures.
  3. Core: Referenced in the OodleDataCompressionFormat implementation.

The value of this variable is typically set in the project’s configuration files, such as DefaultGame.ini. It can be modified through the Project Settings in the Unreal Editor, specifically in the Packaging section.

This variable interacts with other similar variables, such as PackageCompressionLevel_TestShipping and PackageCompressionLevel_Distribution, which control compression levels for different build configurations.

Developers should be aware that:

  1. This setting specifically affects debug and development builds, not shipping or distribution builds.
  2. The compression level can impact build times and the final size of packaged content.
  3. Higher compression levels may result in longer build times but smaller package sizes, while lower levels offer faster builds but larger packages.

Best practices when using this variable include:

  1. Balancing compression level with build time requirements during development.
  2. Using lower compression levels for frequent iterations and higher levels for milestone builds.
  3. Considering the target platform’s capabilities and requirements when setting compression levels.
  4. Regularly reviewing and adjusting the compression settings as the project progresses to optimize for both development efficiency and final product performance.

#Setting Variables

#References In INI files

Location: <Workspace>/Engine/Config/BaseGame.ini:100, section: [/Script/UnrealEd.ProjectPackagingSettings]

Location: <Workspace>/Projects/Lyra/Config/DefaultGame.ini:109, section: [/Script/UnrealEd.ProjectPackagingSettings]

#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:370

Scope (from outer to inner):

file
class        class UProjectPackagingSettings : public UObject

Source code excerpt:

	 */
	UPROPERTY(config, EditAnywhere, Category = Packaging, AdvancedDisplay, meta = (DisplayName = "Compressor Effort Level for Debug & Development"))
	int32 PackageCompressionLevel_DebugDevelopment;
	
	UPROPERTY(config, EditAnywhere, Category = Packaging, AdvancedDisplay, meta = (DisplayName = "Compressor Effort Level for Test & Shipping"))
	int32 PackageCompressionLevel_TestShipping;
	
	UPROPERTY(config, EditAnywhere, Category = Packaging, AdvancedDisplay, meta = (DisplayName = "Compressor Effort Level for Distribution"))
	int32 PackageCompressionLevel_Distribution;

#Loc: <Workspace>/Engine/Source/Editor/TextureEditor/Private/TextureEditorToolkit.cpp:3295

Scope (from outer to inner):

file
function     void FTextureEditorToolkit::PackagingSettingsChanged

Source code excerpt:

		if (*Selection == TEXT("DebugDevelopment"))
		{
			CompressionLevelFromSettings = ProjectSettings->PackageCompressionLevel_DebugDevelopment;
		}
		else if (*Selection == TEXT("TestShipping"))
		{
			CompressionLevelFromSettings = ProjectSettings->PackageCompressionLevel_TestShipping;
		}
		else if (*Selection == TEXT("Distribution"))

#Loc: <Workspace>/Engine/Source/Runtime/Core/Private/Compression/OodleDataCompressionFormat.cpp:45

Scope: file

Source code excerpt:

PackageCompressionLevel_Distribution=7
PackageCompressionLevel_TestShipping=5
PackageCompressionLevel_DebugDevelopment=4

* This can be set in DefaultGame.ini then overrides set up per-platform.
* 
* The Engine also has a veto compressionformat set up in the DataDrivenPlatformInfo.ini for each platform in the field
* "HardwareCompressionFormat"
* eg. platforms that don't want any software compressor can set "HardwareCompressionFormat=None" and this will override what you
* set in "PackageCompressionFormat".
* 
* The idea is in typical use, you set "PackageCompressionFormat" for your Game, and you get that compressor on most platforms, but on
* some platforms that don't want compression, it automatically turns off.
* 
* If you want to force use of your Game.ini compressor (ignore the HardwareCompressionFormat) you can set bForceUseProjectCompressionFormat
* in ProjectPackagingSettings.
* 
* 
* ***************************/

#include "CoreMinimal.h"
#include "CoreTypes.h"
#include "Misc/Compression.h"
#include "Misc/ICompressionFormat.h"
#include "Misc/CommandLine.h"
#include "Misc/ConfigCacheIni.h"
#include "Misc/Parse.h"

/*
#if WITH_EDITOR
#include "Settings/ProjectPackagingSettings.h"
#endif
*/

#include "HAL/PlatformProcess.h"

#include "Compression/OodleDataCompression.h"
#include "oodle2.h"


#define OODLE_DERIVEDDATA_VER TEXT("BA7AA26CD1C3498787A3F3AA53895042")

// function pointer for old DLL import :
extern "C"
{
typedef OO_SINTa (OOLINK t_fp_OodleLZ_Compress)(OodleLZ_Compressor compressor,
    const void * rawBuf,OO_SINTa rawLen,void * compBuf,
    OodleLZ_CompressionLevel selection,
    const OodleLZ_CompressOptions * pOptions,
    const void * dictionaryBase,
    const void * lrm);

typedef OO_SINTa (OOLINK t_fp_OodleSetAllocators)(
	t_fp_OodleCore_Plugin_MallocAligned* fp_OodleMallocAligned,
	t_fp_OodleCore_Plugin_Free* fp_OodleFree);
};


struct FOodleDataCompressionFormat : ICompressionFormat
{
	OodleLZ_Compressor Compressor;

#References in C# build files

This variable is referenced in the following C# build files:

Location: <Workspace>/Engine/Source/Programs/AutomationTool/Scripts/CopyBuildToStagingDirectory.Automation.cs:3047

			else
			{
				PlatformGameConfig.GetInt32("/Script/UnrealEd.ProjectPackagingSettings", "PackageCompressionLevel_DebugDevelopment", out CompressionLevel);
			}

			if (CompressionLevel != 0)
			{
				CompressionFormats += " -compresslevel=" + CompressionLevel;
			}