Calligraphy is a custom game data management system developed by Gazillion. Its main purpose was most likely providing game designers convenient tools for editing game data. Data exported from Calligraphy is stored in the `Calligraphy.sip` archive.
Calligraphy uses five file formats: directory, curve, asset type, blueprint, and prototype. All Calligraphy files start with the same four-byte header:
The magic string defines what format is used in the file. The version depends on the game version: game versions 1.9-1.17 used Calligraphy version 10, and all later game versions starting with 1.18 released on January 24th 2014 use Calligraphy version 11.
Directory (`.directory`) files contain information required for the initialization of the `DataDirectory` class. There's a total of five directory files, each containing a number of records with slightly different structures.
`Curve.directory` (signature `CDR`), `Type.directory` (signature `CDR`), and `Blueprint.directory` (signature `BDR`) have the same standard record structure:
`Replacement.directory` (signature `RDR`) is a special directory used for handling deprecated GUIDs. Replacement records are managed by the `ReplacementDirectory` class. This file has a different record structure:
Please note that file paths contained in these directory files use the `\` symbol as the path delimiter, while [pak files](./PakFile.md) use `/`. To use these paths for reading files from the pak file system you need to replace `\` with `/` while reading them.
Curve (`.curve`, signature `CRV`) files contain collections of 64-bit floating point values. They are used for various purposes as values for prototype fields. Loaded curves are managed by the `CurveDirectory` class.
Asset type (`.type`, signature `TYP`) files contain collections of asset references of specific types. They function as essentially enumerators for instances of various types of external data, and some of them are bound to enums in code. Loaded asset types are managed by the `AssetDirectory` class.
Blueprint (`.blueprint`, signature `BPT`) files contain definitions for Calligraphy prototype fields and field groups. Each blueprint is paired with a default prototype (`.defaults`) that contains default values for all fields defined in the blueprint. Default prototypes share ids with blueprints, so the same ulong value can refer to both a blueprint and it's corresponding default prototype.
`Subtype` specifies the id of the parent value that the value in this field has to inherit from. For example, for prototypes it is the id of the blueprint / default prototype. Only assets, curves, and prototypes have subtypes.
Prototype (`.prototype` or `.defaults`, signature `PTP`) files contain values for fields defined in blueprints. Each `.defaults` prototype file is paired with a `.blueprint` file that defines its fields, and `.prototype` files inherit from these default prototypes. `.prototype` files have their own ids generated by hashing their paths, while `.defaults` files share ids with their paired blueprints.
-`Boolean`: a boolean stored as a 64-bit unsigned integer.
-`Double`: a double precision 64-bit floating point value.
-`Long`: a 64-bit signed integer value.
-`RHStruct`: a new prototype definition starting with `PrototypeDataHeader`.
-`Asset`, `Curve`, `Prototype`, `String`, `Type`: a 64-bit data id.
RHStructs are fully-featured prototypes without an id that can have other RHStructs as their field values. Because of that, some prototypes have a heavily nested recursive structure.