Skip to content

What a Set contains

Cooking writes a folder. With Pack ticked you also get the same collection as a single .set archive, written inside that folder and named after it -- everything a cook produces stays in the folder you chose.

collection/
  images/       0001.png, 0002.png, ...
  metadata/     0001.json, 0002.json, ...     the standard format
  nfty/         0001.json, 0002.json, ...     the rich format
  models/       0001.glb, 0002.glb, ...       3D models, only when cooked with them
  set.json                                     the collection as a whole
  collection.set                               with Pack ticked: all of the above, zipped

The archive holds those directories and set.json, and nothing else. Not whatever else is in the folder: cook into a Kitchen, or into a folder where you keep your .cbk, and the archive still carries only the Set. It never contains itself, or a .set from an earlier cook, so cooking again -- or extending -- replaces it rather than nesting the old one inside the new.

nfty inspect reads either form -- the folder or the .set -- and reports what the run produced: its seed, the CookBook hash behind it, whether unique DNA was required, and the trait percentages the collection actually came out with. See inspect.

Two metadata files per asset, on purpose: one that marketplaces understand and one that keeps everything nfty knows. Neither is a subset of the other.

Exports are Sets too, minus what you left out

Exporting writes the same shape with parts removed -- a marketplace export has no nfty/, and one for a collaborator has a .cbk beside set.json. set.json is on in every preset but Marketplace, which leaves it out so the seed is not published. An export that keeps it reopens as a Set whatever its file names: when the names are not the Set's own (token ids, a first id of 0) or the links were rewritten, it carries a files block, for example "files": { "naming": "token-id", "start": 1 } (naming is padded or token-id; absent means padded from 1). Such an export cannot be extended. An export without set.json is an upload bundle: nfty opens it read only in the viewer gallery, and inspect summarizes it, but it is not a Set.

A sealed export is the exception. It is a .tin, and its shape is different:

Chest Demo.tin
  seal.json       plaintext: the collection, the count, the sender's note, the policy
  payload.bin     the whole Set above, encrypted

nfty inspect reads seal.json without any passphrase, so a recipient is told what they are holding. Everything else needs the key. See What sealing does and does not do.

metadata/NNNN.json

Standards-pure. Nothing nfty-specific in it.

{
  "name": "Vapor Pets #1",
  "description": "Little creatures with a colorful aura.",
  "image": "images/0001.png",
  "attributes": [
    { "trait_type": "Type",        "value": "Fox" },
    { "trait_type": "Background",  "value": "Plain" },
    { "trait_type": "Body",        "value": "Stand" },
    { "trait_type": "Eyes",        "value": "Wink" },
    { "trait_type": "Aura",        "value": "Glow" },
    { "trait_type": "Aura Color",  "value": "Pale Azure" },
    { "trait_type": "Hat",         "value": "None" }
  ]
}

Type is the Recipe the asset was rolled from. Every other trait_type is a layer name -- which is why two layers in one Recipe may not share a name -- or a layer's color (next section). The image is a relative path in the cooked Set; an export can make it an absolute address, name the files by token id, and add external_url and animation_url. nfty writes no display_type or numeric traits: its traits are categories, not numbers.

Color traits and None

Two things used to be invisible in the published traits, and are written from metadata shape 2 on (every new cook):

  • A rolled color. Each Dynamic layer, and each Static layer, adds "<Layer> Color" right after the layer's own trait, named from the exact rolled hue and saturation. Custom layers add none. The name is the color's bucket: saturation below 0.12 is Gray; otherwise one of twelve hue names centered every 30 degrees -- Red, Orange, Yellow, Lime, Green, Mint, Cyan, Azure, Blue, Violet, Purple, Magenta -- with Pale in front from 0.12 up to 0.35. Boundaries are half-open, so 15 degrees is Orange and 345 is Red. Assets that differ in hue can publish different color traits; hues inside the same named bucket share a trait. The the rarity table counts each color name like any other trait. The exact color stays in nfty/.
  • A left-out layer. A layer that is optional in the asset's Recipe and was left out is published as the value None. A layer the Recipe does not stack is not listed at all.

nfty stats predicts both from the CookBook: each color name's chance is computed exactly from the layer's hue and saturation ranges and entry weights, then scaled by how often the layer is present.

Because the two would merge with a real trait, the Validator refuses a layer named like another colored layer's color trait (Body and Body Color), and a variant named None on an optional layer. DNA never includes either: names are a view of the roll.

set.json records metadataShape (absent means 1, the older shape without these traits). Extending a Set writes its new assets in the Set's own shape and never rewrites a published file's attributes, so a Set is one shape throughout and its rarity table stays consistent.

nfty/NNNN.json

Everything else.

{
  "setNumber": 1,
  "recipe": "fox",
  "dna": "4524f029e5f81fdd15cb70a1979ebc1bdae132a5c1efecfc76e8a9381f2129b6",
  "seed": "launch",
  "rarity": [
    { "trait_type": "Type", "value": "Fox", "rarityPct": 44.2 }
  ],
  "layers": [
    { "layer": "bg", "kind": "dynamic", "model": "hsv", "h": 31.8, "s": 0.406 }
  ]
}

The Set browser reads the same file when you select an asset:

An asset's rarity panel in the Set browser An asset's rarity panel in the Set browser

Field Is
dna The fingerprint. Unique across a Set cooked with unique DNA required; repeats are permitted otherwise. See How uniqueness is decided.
seed The seed that produced the whole collection.
rarity This asset's traits with their collection-wide percentages.
layers Per layer: its kind, and for Dynamic and Static, the exact hue and saturation it rolled.

The layers block is what lets you reproduce a single asset's coloring exactly, without re-cooking the collection.

models/

Present only when the Set was cooked with models (Cook with 3D models). One model per asset, named like its image: 0001.glb, or 0001.gltf plus 0001.bin, or a single 0001.gltf with its buffer inside, as the format chose. An asset with no fully opaque pixel has no model and no gap-filler; its number is listed in the models block of set.json below.

Each model's texture carries its cooked front and back face pictures, separated by a gutter. For layered assets, each face uses the color of its owning layer; it need not duplicate the flat 2D composite. Export copies models/ as it is and never re-renders it, so the debug number mark, which stamps exported images only, cannot reach one.

set.json

{
  "name": "Vapor Pets",
  "count": 500,
  "seed": "launch",
  "cookbookSha256": "1df72e65a1fa7ce4de73ee52ba11371c02c8f993c40b486ae3802553b7f20214",
  "generatorVersion": "nfty/1.0",
  "distribution": [ { "recipe": "cat", "count": 279, "percent": 55.8 } ],
  "rarity":       [ { "trait_type": "Aura", "value": "Glow", "rarityPct": 73.4 } ],
  "symbol":       "VPET",
  "metadataShape": 2
}

symbol is the collection's ticker, kept so an export can write collection.json without the book; metadataShape is explained under Color traits and None. Both are optional and additive, so older Sets read as before.

A Set cooked with models adds a models block; a Set without them has no such key:

"models": { "format": "glb", "pivot": "bottom-center", "voxelSize": 1, "skipped": [7, 31] }
Field Is
format glb, gltf or gltf-embedded: the tokens the command line uses.
pivot bottom-center, center or min-corner.
voxelSize World units per pixel.
skipped Set numbers that have no model because nothing in them is fully opaque. Omitted when none.

Extend reads this block and makes the new assets' models the same way, so a Set is modeled whole or not at all.

cookbookSha256 ties the Set back to the exact CookBook that produced it. It is what extend checks before warning you that the book has moved on.

Rarity is collection-wide

A percentage is a fact about the whole Set, so growing the Set changes every one of them. Extending rewrites the rarity fields on existing assets. Their images and their dna never change.