Table of Contents

Enum CompressionMode

Namespace
LlamaLogic.Packages
Assembly
LlamaLogic.Packages.dll

Represents the compression mode to use when setting the content of a resource in a DataBasePackedFile

public enum CompressionMode

Fields

Auto = 0

The library will choose whether and how to compress the data or not

CallerSuppliedInternal = 6

⚠️ The data will not be processed for compression by the library and the resource will be marked as having been compressed using Maxis' internal method (use with caution)

CallerSuppliedStreamable = 7

⚠️ The data will not be processed for compression by the library and the resource will be marked as having been compressed using Maxis' streamable method (use with caution)

CallerSuppliedZLib = 8

⚠️ The data will not be processed for compression by the library and the resource will be marked as having been compressed using ZLIB (use with caution)

ForceInternal = 4

The data will be compressed using Maxis' internal method

ForceOff = 1

The data will not be compressed

[Obsolete("This setting can no longer be used and will be removed in a future version. If you need to force a compression, use a different force member of this enum.", true)] ForceOn = 2

Deprecated: do not use

ForceZLib = 3

The data will be compressed using ZLib

SetDeletedFlag = 5

⚠️ The data will not be processed for compression by the library—thus callers will need to invoke ZLibCompress(ReadOnlyMemory<byte>) or ZLibCompressAsync(ReadOnlyMemory<byte>, CancellationToken) themselves and pass the result to Set(ResourceKey, ReadOnlyMemory<byte>, CompressionMode) or SetAsync(ResourceKey, ReadOnlyMemory<byte>, CompressionMode, CancellationToken), respectively, if they intend for the content to be compressed with ZLib despite being flagged—and the deleted flag will be set (use with caution)

Remarks

Important: While this library does support the older compression methods, it does not have a complete catalog of how to do so properly for every resource type automatically (Auto). If you want to be sure that you're compressing a resource correctly, utilize GetExplicitCompressionMode(ResourceKey) with a package the game is currently accepting.

Warning: The Sims 4 does not always expect or tolerate ZLib compression for certain types of resources, such as for world package files which ship with the game (see thepancake1's comment about this on the Creator Musings Discord for more information).