Skip to content
Techniques & Technology

Data Compression

Fitting more into less

Compression techniques allowed game developers to fit larger games into limited ROM and RAM by encoding data more efficiently, from simple RLE to sophisticated algorithms.

NESSNESgenesisC64Amiga datamemoryoptimisation 1970–present

Overview

Data compression makes data smaller for storage, then restores it when needed. For game developers working with kilobytes of ROM, compression wasn’t optional—it was essential. Level data, graphics, and music all benefited from compression. The techniques ranged from simple run-length encoding to sophisticated algorithms that squeezed every possible byte.

Fast Facts

AspectDetail
PurposeFit more data in limited space
Trade-offStorage space vs decompression time
Common targetsGraphics, level data, text
Modern relevanceDownload sizes, load times

Why Compression Mattered

Storage constraints by platform:

PlatformTypical ROMContext
NES32-512KBEntire game
SNES1-4MBLarger but still constrained
C64170KBSingle floppy disk
Amiga880KBOCS-era disk

Every byte saved meant more content.

Common Algorithms

Run-Length Encoding (RLE)

Replace repeated values with count + value:

OriginalCompressed
AAAAAABBCCC6A2B3C

Simple, fast, works well for graphics with solid areas.

LZ-Family (Lempel-Ziv)

Reference earlier data instead of repeating it:

VariantUsed In
LZSSMany console games
LZ77Later systems
LZ4Modern games

Look for patterns that appeared before, store reference to earlier occurrence.

Huffman Coding

Assign shorter codes to common values:

ValueFrequencyCode
A50%0
B25%10
C25%11

Common data gets fewer bits.

Platform-Specific Techniques

NES

TechniqueUse
CHR-ROM compressionTile graphics
RLE levelsRepeated tile patterns
Metatiles2x2 tiles as single unit

SNES

TechniqueUse
LZSS variantsMost data
Mode 7 compressionBackground maps
Custom schemesGame-specific needs

Mega Drive/Genesis

TechniqueUse
KosinskiSonic series graphics
NemesisTile compression
EnigmaTile mappings

Sega developed multiple proprietary schemes.

Compression Targets

Data TypeApproach
Tile graphicsPattern-based, RLE
Level mapsRLE, dictionary
Music dataPattern references
TextHuffman, dictionary
SpritesCustom per-game

Trade-offs

FactorConsideration
Compression ratioHow much smaller?
Decompression speedCan it run in real-time?
RAM requirementBuffer size for decompression
Code complexityDecompressor size

Real-time decompression (streaming audio/video) needed fast algorithms. Static data (level loading) could use slower, better compression.

Implementation Considerations

ChallengeSolution
RAM limitsDecompress to VRAM directly
CPU budgetDecompress during loading
Random accessStore block offsets
DMA conflictsTime decompression carefully

Notable Examples

GameTechniqueAchievement
Sonic the HedgehogMultiple schemesLarge levels, fast loading
Super MetroidLZSS variantMassive map in 3MB
Kirby’s AdventureHeavy compression6MB of content in 768KB

The Demo Scene Connection

Demo scene coders pushed compression limits:

CompoConstraint
64K introEntire demo in 64KB
4K introExtreme compression

Techniques developed for demos influenced game development.

Modern Relevance

ContextApplication
Download sizesGame distribution
Load timesSSD streaming
Texture compressionGPU formats (BC, ASTC)
Asset bundlesRuntime decompression

The principles remain even as storage grows—users still prefer smaller downloads.

Legacy

Compression taught developers to think carefully about data representation. The habit of asking “can this be smaller?” persists. Modern game developers still compress assets, optimise network packets, and minimise memory footprints. The stakes are different, but the discipline of fitting content into constraints remains valuable.

See Also