Skip to Content
Stoatly Docs
Reference

Repository file layout

Everything Stoatly commits to your repository is a plain file, so you can read it, review it in a pull request and keep it under version control. The data folder defaults to Assets/Resources/Data, and you can change that in the Unity settings.

The data folder

Assets/Resources/Data/
  weapon/
    schema.json
    iron-sword.json
    frostbrand.json
    records.json
  item/
    schema.json
    ...
  _globals/
    schema.json
PathWhat it holds
object-type-slug/schema.jsonThe object type's definition: its fields, groups, enums, formulas and visuals, and its parent
object-type-slug/record-slug.jsonOne record
object-type-slug/records.jsonA list of the type's records. Only written with the Addressables loader
_globals/schema.jsonThe project's global formulas and global visuals

A record file

A record file has the record's values, keyed by field key. A few keys are added by Stoatly:

  • _type is the object type's slug.
  • slug is the record's slug. It also gives the file its name.
  • _obsolete is true for a record that has been marked obsolete.

A formula field's value is written into the file as well, so it's there when your game reads the record. If the formula uses random values, the value is the lowest and highest result, as { "min": 3, "max": 18 }. A reference is written as the target record's slug, and a quantised entry is an object with ref and quantity.

What a pull request writes

A pull request writes only the files it changes: the records you edited, the schema files of the types you touched and the _globals file if you changed a global. It doesn't rewrite the rest.

Things to know

  • Deleting an object type removes its whole folder, including its records.
  • Changing a record's slug renames its file. See Slugs.
  • A record with values for a field that isn't in the schema being committed can't be sent. Include the field in the same pull request, or merge it first.
  • A record needs a name before it can be committed.

Generated code

The generated C# lives in a separate folder. See Generated files.

On this page