File Format

From Prison Architect Wiki
Jump to navigation Jump to search

This page is for notes about Prison Architect's file format. This file format is used as .prison save files, as well as internally for various data inside main.dat, e.g. defining objects in materials.txt or maintaining the texture maps. When creating mods, the same file format has to be used.

Basic idea[edit]

The format appears to consist of key-value pairs, which can also live inside classes, delimited by BEGIN and END.

For example, the main.dat/data/materials-new.txt file contains the following:

BEGIN Material   
    Name                 WoodenFloor  
    ConstructionTime     1.00000  
    IndoorOutdoor        2  
    ObjectRequired       Brick  
    SpriteType           RandomArea  
    NumSprites           2  
    BEGIN Sprite0    x 0  y 6  END
    BEGIN Sprite1    x 5  y 2  END

This block indicates a new Material (presumably an internal class or structure name) named WoodenFloor. It also defines a number of other attributes, and has two sub-objects of type Sprite0 and Sprite1.