Help centre › Launching

Writing a manifest.json

The manifest describes a template in one file: its canvas, layers, traits, weights and rules. The platform writes it for you; write your own only to bring structure in with an upload.

A manifest is a JSON file. Start from an export of an existing template if you can: it is always valid. The Export tab of any template, a sample set or a DappFactory starter, gives you one.

{
  "format": "dappfactory.template",
  "manifestVersion": 2,
  "name": "Whisker and Paws Club",
  "kind": "collectible",
  "templateVersion": 1,
  "canvas": { "width": 3000, "height": 3000 },
  "subjectLayer": "Body",
  "layers": [
    {
      "order": 1,
      "name": "Background",
      "optional": false,
      "usedWhen": "always",
      "traits": [
        { "name": "Sage", "weight": 11, "file": "01-Background/Sage.png" },
        { "name": "Night", "weight": 5, "file": "01-Background/Night.png" }
      ]
    },
    {
      "order": 2,
      "name": "Body",
      "traits": [
        { "name": "Ginger cat", "weight": 12, "subject": "Cat", "file": "02-Body/Ginger cat.png" },
        { "name": "Black dog", "weight": 10, "subject": "Dog", "file": "02-Body/Black dog.png" }
      ]
    },
    {
      "order": 3,
      "name": "Whiskers",
      "optional": true,
      "noneWeight": 30,
      "usedWhen": { "layer": "Body", "traits": ["Ginger cat"] },
      "traits": [ { "name": "Long", "weight": 10, "file": "03-Whiskers/Long.png" } ]
    }
  ],
  "rules": [
    { "type": "exclude", "if": { "layer": "Body", "trait": "Black dog" }, "then": { "layer": "Whiskers", "trait": "any" } }
  ]
}

Top-level fields

FieldMeaning
formatAlways "dappfactory.template".
manifestVersion2 for most templates. 3 if you use roles or one-of-ones.
nameThe template's name. You can change it on the editor screen.
kindcollectible, drop, marketplace or keepsake. The page you upload on decides the kind of the new template.
canvasThe size every PNG must be: { "width": 3000, "height": 3000 } or "3000x3000". If most files are another size, the files' size is used.
subjectLayerThe layer that says what each item is. Optional.
layersThe list of layers.
rulesNever-together and requires rules. Optional.

Layer fields

FieldMeaning
orderDrawing order, 1 at the bottom. Layers are sorted by it.
nameShown in the editor and written into each item's traits.
onfalse keeps the layer without drawing it. Default true.
optionaltrue lets an item have nothing from this layer.
noneWeightHow often an optional layer is left empty, as a weight next to its traits. Default 50.
usedWhen"always", or { "layer": "Body", "traits": ["Ginger cat"] } to draw the layer only for those traits.
traitsThe list of traits.

Trait fields

FieldMeaning
nameThe trait's name.
weightHow often it's drawn, relative to the others in its layer. Default 1.
filePath to the PNG inside the zip, such as "01-Background/Sage.png". Leave it out for a placeholder.
onfalse keeps it without drawing it.
subjectOn the subject layer: what this trait makes the item, such as "Cat".
tierOptional: Gold, Silver, Bronze or Participant. The trait is drawn only for pieces of that rank tier. Leave it out for a trait open to every tier.

A trait can also be just a name, such as "Sage", which makes a placeholder with weight 1.

Rules

Each rule names an if trait and a then trait. Type "exclude" means they never appear together; "requires" means the first always comes with the second. Use "trait": "any" in then to mean any trait in that layer. A rule that names a trait the set doesn't have is dropped, and the checks say so.

Roles and one-of-ones (manifestVersion 3)

  • A Role layer: add "role": true to one layer. It can't be optional or have a usedWhen, a template can have only one, and keepsakes can't have one. With a Role layer, the role is the subject, so leave subjectLayer out.
  • Roles have no picture. Leave out file on role traits, except one-of-ones.
  • One-of-ones: "oneOfOne": true on a Role-layer trait with a complete, fully opaque picture. It's drawn once in the whole collection.
  • Shown for: "usedWhen": { "role": ["Angel"] } on a trait in another layer limits it to those roles. Every name must be a role.

See Named roles in templates for what these do when pieces are drawn.

What an export adds

A manifest the platform writes carries a few more fields: each layer's folder, a placeholder mark on traits still waiting for art, and the size of the placeholder images. Leave them as they are; you never need to write them yourself.

Related

Still stuck? Contact support.