.sav Partially documented

The Caesar III savegame format

A savegame is the scenario format's larger sibling: the same idea of ordered chunks with nothing to separate them, but many more of them and most compressed. The container is well understood; the contents mostly are not.

Used by Caesar III

As with scenarios, there is no published specification and Julius's loader is the reference. It reads a savegame as an ordered list of up to a hundred chunks, of which it names seventy-two.

The difference from a scenario is compression. Each chunk carries a flag saying whether it is stored compressed, and the compressed ones are framed.

A compressed chunk

Uncompressed chunks have no framing at all — the raw bytes simply follow, and you must already know how many.

OffsetSizeTypeFieldDescription
04int32lengthLength of the compressed data that follows — or the sentinel 0x80000000, meaning compression was not worth it and the raw data follows instead.
4lengthbytesdataCompressed, or raw when the sentinel is present.

Known constants

0x66
The save version Julius writes.
0x80000000
Chunk sentinel meaning the data that follows is uncompressed.
600000
Julius's compression buffer size — an upper bound on a single chunk, not a format constant.
284
Size of the end marker: seventy-one four-byte zeroes.

Sources