02 Wherigo Cartridges – the structure of a cartridge

WFoundation/WF.Compiler: Compiler for Wherigo cartridges (github.com)
driquet/gwcd (github.com)

A GWC file consists of five sections

  • Signature
  • Information about the existing files
  • Header with general information about the cartridge
    • Start coordinate and description of the start
    • Creation date
    • Type of cartridge
    • Name and ID of the player
    • Cartridge name
    • Cartridge description
    • Version
    • Author and company
    • Completion code
  • LUA byte code
  • Files of images, sounds, texts

The byte-wise structure is as shown in the following table. Here applies:

  • Numbers are stored in the format “Little endian”.
  • Strings end with 0x00.
  • Double numbers are stored in “double-precision floating point” format.

Note: Earwigo has added more data fields in the header!

AdressLengthContentNote
@0000Beginn Signature
2 ByteVersion0x02 followed by 0x0a or 0x0b
4 ByteCART
1 Byte0x00
@0007Number of objects
2 Byte
@0009ID and adress of each object6 Bytes per object
2 ByteObjekt-ID
4 ByteAdress of object
@xxxxBegin of Header@0009 + Number of objects * 6 Byte
4 ByteLength of Header
8 ByteLatitude
8 ByteLongitude
8 ByteAltitude
4 ByteCreation DateSeconds from 10.02.2004 01:00
2 ByteObjekt-ID of Splashscreen-1 if no Splashscreen
2 ByteObjekt-ID of Icon-1 if no Icon
? ByteType of CartridgeTour guide, Puzzle, etc.
? ByteName of Player
4 BytePlayer-IDID aus der Groundspeak-Datenbank
? ByteName of Cartridge
? ByteGUID of Cartridge
? ByteDescription of Cartridge
? ByteDescription of Starting location
? ByteVersion
? ByteAutor
? ByteCompany
? ByteRecommended deviceGarmin Colorado, Windows PPC, etc.
4 ByteLength of Completion Codes
? ByteCompletion Code
? ByteAdditional Datafields by Earwigo; bspw.
– Country
– State
– Completed
– Date of last Play
– Date Publish
– Date Update
– Builder Version
@yyyyBegin of Data/Files@0009 + Number of objects * 6 Byte + Length Header
LUA-BytecodeObjekt-ID = 0
4 ByteSize of LUA-Bytecode
? ByteLUA-Bytecode
@zzzzMedia filesObjekt-ID = 1, 2, 3, …
1 Bytevalid objectif 0, object is deleted
4 ByteType of object1 = BMP
2 = PNG
3 = JPG
4 = GIF
17 = WAV
18 = MP3
19 = FDL
20 = SND
21 = OGG
33 = SWF
49 = TXT
4 ByteSize of object
? ByteContent of object