The Caesar .PL8 sprite sheet format
The city's tiles and buildings, its walkers, the toolbar's icons and every font are .PL8 sheets: a small table of frame descriptors followed by the frames' pixels. The descriptors are plain; the pixels are the part that took a capture of the running game to get right, because they are four interleaved streams rather than rows.
Used by Caesar
Layout
A sheet starts with a four-byte container header and a table of frame descriptors, one per frame. A descriptor does not hold pixels, only where they are: the pixel data of every frame lives at an absolute offset in the same file. Frames are packed back to back.
Container header
| Offset | Size | Type | Field | Description |
|---|---|---|---|---|
| 0 | 2 | u16 | unknown_a | 42 in HOUSES.PL8, 61 in the international build's MINIFONT.PL8. Not the frame count. Meaning not established. |
| 2 | 2 | u16 | frame_count | The number of descriptors that follow. Confirmed exactly against HOUSES.PL8's 50 frames. |
| 4 | 8 × frame_count | descriptor[] | frames | The descriptor table, starting immediately after the header. |
Frame descriptor, 8 bytes
| Offset | Size | Type | Field | Description |
|---|---|---|---|---|
| 0 | 2 | u16 big-endian | pixel_offset | Absolute file offset of this frame's pixels. The one big-endian value in the format; everything else is little-endian. |
| 2 | 1 | u8 | width | In pixels. Always a multiple of 4 for a frame that has pixels. |
| 3 | 1 | u8 | height | In pixels. |
| 4 | 2 | u16 | x | The frame's origin x within its sheet's layout. |
| 6 | 2 | u16 | y | The frame's origin y. |
Pixels
A frame's width × height bytes are four streams stored one after another, interleaved one pixel at a time exactly as in a .VPX picture: pixel i, counted row by row, is entry i / 4 of stream i mod 4. The four streams are the planes of unchained VGA, each holding every fourth column, which is why a frame's width has to divide by four. Read row by row, no frame of the city view matches a capture of the real game; read this way, 13 HOUSES, 13 HOUSES2 and 72 FIXTS frames appear in the captures byte for byte, on the 16-pixel tile grid.
Colour index 0 is transparent when the engine draws a sprite. The ground tiles (every tile below 0xC8, from FIXTS.PL8) are drawn opaque. A frame's pixels are indices; the city sheets use only indices 0 to 15 of SHADE.256, the city palette.
.PL1, the one-bit variant
MINIFONT.PL1 has the same container and descriptors, but one bit per pixel: each row is ceil(width / 8) bytes, most significant bit first, a set bit becoming pixel value 1 and a clear bit 0. The extension names the depth. The international build's 4,036-byte MINIFONT.PL8 is the same 72 frames at eight bits.
The sheets, and what draws from them
Frame counts are the US build's.
- FIXTS.PL8, 190 frames
- Terrain and every city tile below 0xC8, one frame per tile id (16 × 16). Drawn opaque.
- HOUSES.PL8, 50 frames
- Buildings and houses, tile 0xC8 and up. Its last six descriptors (frames 44 to 49) point at the end of the file and declare a size that would overrun it: empty placeholders. Why they exist is not explained.
- HOUSES2.PL8, 44 frames
- Building states and animation frames, some of them 64 × 64.
- MOREMEN.PL8, 86 frames
- Walkers and other city actors, drawn between the tile rows.
- FIXT3.PL8, 125 frames; SPRITE2.PL8, 48 frames
- The province view's tiles and sprites. Strong inference: they load in place of the city sheets when the province is shown, and FIXT3 frames turn up in the map captures.
- SPRITE2X.PL8, 48 frames
- The battle screen's banners.
- P_BLOCKS.PL8, 40 frames of 16 × 16
- Frame, border and button pieces of the advisor and management screens: 31 of the 40 are found in captures.
- POINTERS.PL8, 67 frames
- The toolbar buttons' icons (each button record names its frame and its handler), the histories' bar pieces, and the province markers on the empire map.
- FONT1.PL8, 100 frames of 8 × 8
- The main text font; the engine picks a frame through a character table. FONT2.PL8 has the same shape and is the battle screen's font.
- ROMFONT.PL8, 27 frames of 16 × 17
- A second font: letters with case folded to frames 0 to 25 and a 27th frame for everything else.
- MINIFONT.PL1, 72 frames of 8 × 6
- Small capitals and digits: the histories' captions among other things.
- TEMPLBIT.PL8, 3 frames
- The ratings screen's column pieces: the base, the shaft and the capital.
- SHADE.PL8, 17 frames of 16 × 16
- The shading frames the city view's overlay map modes draw, chosen from the land value, water and similar layers.