Overview
Map compression allows you to:- Reduce disk space usage - Maps can be compressed to a fraction of their original size
- Maintain performance - zstd provides blazingly fast decompression
- Automatic decompression - Chimera handles decompression transparently when loading maps
- Memory optimization - When maps in RAM is enabled, compressed maps decompress directly into memory
The chimera-compress Tool
Chimera includeschimera-compress, a command-line utility for compressing and decompressing map files.
Basic Usage
Compress a map
Compress a map file in-place:Decompress a map
Decompress a map file in-place:Command Syntax
compress/decompress- Operation to performinput-map- Path to the input map fileoutput-map- (Optional) Path to the output file. If omitted, the input file is overwritten
Technical Details
Compression Algorithm
Chimera uses zstd (Zstandard) compression with the following characteristics:- Compression level: 19 (maximum compression)
- Algorithm: Facebook’s Zstandard (zstd)
- Header size: 2048 bytes (0x800) - preserved uncompressed
- Version marker: Cache version is OR’d with
0x861A0000to indicate compression
Supported Map Types
All Halo cache file types are supported:- Retail (version 7) - Standard Halo PC maps
- Custom Edition (version 609) - Custom Edition maps
- Demo (version 6) - Halo Trial maps
How It Works
Compression process
When compressing a map:
- The first 2048 bytes (map header) remain uncompressed
- The remaining map data is compressed using zstd level 19
- The cache version field is modified to indicate compression
- Map metadata (name, build, CRC32, Lua script pointers) is preserved
Decompression at runtime
When Chimera loads a compressed map:
- Chimera detects the compressed version marker
- If maps in RAM is enabled, the map decompresses directly into memory
- Otherwise, a temporary decompressed file is created in the Chimera folder
- The game loads the decompressed map transparently
File Size Savings
Compression ratios vary by map, but typical results:- Standard maps: 30-50% size reduction
- Maps with repetitive data: Up to 70% size reduction
- Already optimized maps: 20-30% size reduction
Configuration
Compressed map behavior can be configured inchimera.ini:
Memory Settings
Performance Tip: Enable maps in RAM for best performance with compressed maps. This eliminates the need for temporary files and provides the fastest load times.
Building chimera-compress
Thechimera-compress tool is built as part of the Chimera compilation process.
Requirements
- CMake 3.22 or newer
- zstd library (libzstd)
- C++17 compatible compiler
Compilation
chimera-compress executable will be in the build directory.
Static Build
To build with statically linked zstd:Troubleshooting
”does not appear to be compressed”
The map file is already uncompressed. Use thecompress operation instead.
”appears to be compressed”
The map file is already compressed. Use thedecompress operation instead.
”is not a cache file”
The file is not a valid Halo map file. Check that:- The file is a
.mapfile - The file is not corrupted
- The file size is at least 2048 bytes
”has an unknown version”
The map uses an unsupported cache file version. Only retail (7), Custom Edition (609), and demo (6) versions are supported.Decompression fails during gameplay
Ensure you have enough:- Disk space - For temporary files (if not using maps in RAM)
- RAM - For in-memory decompression (if maps in RAM is enabled)
- Permissions - Write access to the Chimera folder
Best Practices
- Keep backups - Always keep uncompressed copies of your maps
- Compress after editing - Only compress finalized map files
- Use maps in RAM - Enable for better performance with compressed maps
- Test after compression - Verify maps work correctly after compression
- Document compression - Note which maps are compressed for easier management
