Where's Waldo? Exploring Geography
Technical Analysis and Fan Page

Content for everyone

Technical stuff

Links

  • At The Cutting Room Floor -- coming soon
(German or English)

Analysis of the ART files of Eraser Turnabout, Virtual K'Nex and Waldo Exploring Geography

Please see my command line PACKER and UNPACKER written in C!

These tools can also pack/unpack ART files for Blown Away, Panic in the Park and Waldo at the Circus

General structure

File structure

Notes about the ART files

An ART file contains several pictures; the names for each picture can be up to 8 chars.

Pictures are saved in chunks.

At the beginning of each chunk, a 16 bit word defines the length and compression type of the chunk.
If the first bit (MSB with Little Endian) is 1, the data is not compressed, otherwise it is compressed.
The other 15 bits define the actual length of the chunk data.

If raw data is chosen, the max data size is 32767 (0x7FFF) bytes.

Notes about the compression:

  • The compression is a special LZW implementation by Mark R. Nelson and Shawn M. Regan. It features dynamic code size between 9 and 13 bits, with clear code (256) and end code (257).
  • There are two additional requirements for the compression:
    1. Each compressed chunk (except the last one) MUST decode into exactly 16382 (0x3FFE) bytes of uncompressed data. So, if you want to compile an ART file, you must split your original files into 16382 byte chunks, and compress each of these chunks separately.
    2. The size of the compressed data of a chunk MUST NOT exceed the size of the original uncompressed data, otherwise, the decompression might crash. So, if the compressed data is bigger than the original data, you must choose a non-compressed chunk.

The uncompressed data is a Windows bitmap, but without the BITMAPINFOHEADER header.
If you want to save the picture as Bitmap file, you need to add the BITMAPINFOHEADER structure in front of the uncompressed data:

	42 4D xx xx xx xx 00 00 00 00 36 04 00 00

Interpreted:
	bfType		42 4D
	bfSize		xx xx xx xx
	bfReserved	00 00 00 00
	bfOffbits	36 04 00 00

Example: artfile_2_0.h


#define ART_NAME_SIZE 8

#define ART_MAGIC_SEQ "ART_DATA"

#pragma pack(push, 1)

typedef struct tagFileHeader {
	char       magic[ART_NAME_SIZE];  // always "ART_DATA"
	uint32_t   totalHeaderSize;       // size of all headers (file header and all picture headers). headerSize/16 = numberPictures
	uint32_t   reserved;              // always 0
} FileHeader;

typedef struct tagPictureEntryHeader {
	char       name[ART_NAME_SIZE];
	uint32_t   offset;               // offset to the picture (PictureHeader)
	uint32_t   uncompressedSize;     // size of the picture (picture data + palette)
} PictureEntryHeader;

// Commented out because bitfields are implementation specific and therefore not reliable.
/*
#define ART_COMPRESSIONTYPE_LZW 0
#define ART_COMPRESSIONTYPE_NONE 1
typedef struct tagPictureChunk {
	unsigned compressionType : 1;   // Compression type of the follow-up data
	                                // 0 = LZW-like compression (special implementation)
	                                // 1 = None
	unsigned chunkDataSize : 15;    // size of the chunk data
	//char         data[];
} PictureChunk;
*/

#pragma pack(pop)

© 2024 Daniel Marschall - - www.daniel-marschall.de

Please also see my pages for other Imagination Pilots games:
Blown Away | Panic in the Park | Waldo at the Circus | Waldo Exploring Geography | Eraser Turnabout | Virtual K'Nex