{ "$schema": "https://json-schema.org/draft/2020-12/schema", "title": "Pixelbolt sprite stack", "type": "object", "properties": { "format": { "const": "pixelforge-stack" }, "version": { "const": 1 }, "name": { "type": "string", "pattern": "^[a-zA-Z][a-zA-Z0-9_-]{0,63}$", "description": "Portable name: do not use Windows device names (CON, PRN, AUX, NUL, COM1–9, LPT1–9). Frame/animation names must be unique ignoring case." }, "palette": { "type": "object", "propertyNames": { "anyOf": [ { "const": "$ref" }, { "pattern": "^[^ .\\u0000]$" } ] }, "properties": { "$ref": { "type": "string" } }, "additionalProperties": { "type": "string", "pattern": "^(transparent|#([a-fA-F0-9]{3,4}|[a-fA-F0-9]{6}|[a-fA-F0-9]{8}))$" } }, "sockets": { "type": "object", "maxProperties": 64, "propertyNames": { "type": "string", "pattern": "^[a-zA-Z][a-zA-Z0-9_-]{0,63}$" }, "additionalProperties": { "type": "object", "properties": { "at": { "type": "array", "items": { "type": "number", "minimum": -512, "maximum": 512 }, "maxItems": 3, "minItems": 3 }, "axis": { "enum": [ "x", "y", "z" ] }, "keys": { "type": "array", "items": { "type": "object", "properties": { "heading": { "type": "integer", "minimum": 0, "maximum": 360 }, "offset": { "type": "array", "items": { "type": "number", "minimum": -512, "maximum": 512 }, "maxItems": 3, "minItems": 3 }, "angle": { "type": "number", "minimum": -3600, "maximum": 3600 } }, "required": [ "heading" ], "additionalProperties": false }, "maxItems": 64 } }, "required": [ "at" ], "additionalProperties": false } }, "reliefs": { "type": "array", "items": { "type": "object", "properties": { "face": { "enum": [ "west", "east", "north", "south" ] }, "points": { "type": "array", "items": { "type": "array", "prefixItems": [ { "type": "number", "minimum": 0, "maximum": 512 }, { "type": "number", "minimum": 0, "maximum": 512 }, { "type": "number", "minimum": 0, "maximum": 128 }, { "type": "number", "minimum": 0, "maximum": 128 } ], "minItems": 4, "maxItems": 4 }, "maxItems": 32, "minItems": 2 }, "ramp": { "type": "string", "minLength": 1, "maxLength": 32 }, "light": { "type": "array", "items": { "type": "number", "minimum": -512, "maximum": 512 }, "maxItems": 3, "minItems": 3 } }, "required": [ "face", "points", "ramp" ], "additionalProperties": false }, "maxItems": 128 }, "contours": { "type": "object", "propertyNames": { "type": "string", "pattern": "^[a-zA-Z][a-zA-Z0-9_-]{0,63}$" }, "maxProperties": 128, "additionalProperties": { "type": "array", "items": { "type": "array", "items": { "type": "number", "minimum": -512, "maximum": 512 }, "maxItems": 3, "minItems": 3 }, "maxItems": 32, "minItems": 2 } }, "lofts": { "type": "array", "items": { "type": "object", "properties": { "contours": { "type": "array", "items": { "type": "string", "pattern": "^[a-zA-Z][a-zA-Z0-9_-]{0,63}$" }, "maxItems": 32, "minItems": 2 }, "bands": { "type": "array", "items": { "type": "string", "minLength": 1, "maxLength": 32 }, "maxItems": 31, "minItems": 1 }, "closed": { "type": "boolean" }, "mirror": { "enum": [ "x", "y", "z" ] }, "socket": { "type": "string", "pattern": "^[a-zA-Z][a-zA-Z0-9_-]{0,63}$" }, "twoSided": { "type": "boolean" } }, "required": [ "contours", "bands" ], "additionalProperties": false }, "maxItems": 128 }, "paths": { "type": "object", "propertyNames": { "type": "string", "pattern": "^[a-zA-Z][a-zA-Z0-9_-]{0,63}$" }, "maxProperties": 64, "additionalProperties": { "type": "object", "properties": { "nodes": { "type": "array", "items": { "type": "object", "properties": { "name": { "type": "string", "pattern": "^[a-zA-Z][a-zA-Z0-9_-]{0,63}$" }, "at": { "type": "array", "items": { "type": "number", "minimum": -512, "maximum": 512 }, "maxItems": 3, "minItems": 3 }, "radius": { "type": "number", "minimum": 0, "maximum": 128 }, "axis": { "type": "array", "items": { "type": "number", "minimum": -512, "maximum": 512 }, "maxItems": 3, "minItems": 3 } }, "required": [ "name", "at", "radius" ], "additionalProperties": false }, "maxItems": 32, "minItems": 2 }, "colors": { "type": "string", "minLength": 1, "maxLength": 16, "description": "Palette keys in order across the surface." }, "sides": { "type": "integer", "minimum": 3, "maximum": 16 }, "roll": { "type": "number", "minimum": -360, "maximum": 360 }, "socket": { "type": "string", "pattern": "^[a-zA-Z][a-zA-Z0-9_-]{0,63}$" }, "attach": { "type": "string", "pattern": "^[a-zA-Z][a-zA-Z0-9_-]{0,63}$" } }, "required": [ "nodes", "colors" ], "additionalProperties": false, "not": { "required": [ "socket", "attach" ] } } }, "membranes": { "type": "array", "items": { "type": "object", "properties": { "ribs": { "type": "array", "items": { "type": "string", "pattern": "^[a-zA-Z][a-zA-Z0-9_-]{0,63}$" }, "maxItems": 2, "minItems": 2, "uniqueItems": true }, "colors": { "type": "string", "minLength": 1, "maxLength": 16, "description": "Palette keys in order across the surface." }, "sag": { "type": "number", "minimum": -64, "maximum": 64 }, "scallop": { "type": "number", "minimum": -64, "maximum": 64 }, "veins": { "type": "array", "items": { "type": "object", "properties": { "color": { "type": "string", "minLength": 1, "maxLength": 1 }, "points": { "type": "array", "items": { "type": "array", "items": { "type": "number", "minimum": 0, "maximum": 1 }, "maxItems": 3, "minItems": 3, "description": "Along, across, half-width. Both edges stay within the panel." }, "maxItems": 16, "minItems": 2 } }, "required": [ "color", "points" ], "additionalProperties": false }, "maxItems": 8 } }, "required": [ "ribs", "colors" ], "additionalProperties": false }, "maxItems": 64 }, "poses": { "type": "object", "propertyNames": { "type": "string", "pattern": "^[a-zA-Z][a-zA-Z0-9_-]{0,63}$" }, "maxProperties": 64, "additionalProperties": { "type": "object", "propertyNames": { "type": "string", "pattern": "^[a-zA-Z][a-zA-Z0-9_-]{0,63}$" }, "maxProperties": 64, "additionalProperties": { "type": "object", "propertyNames": { "type": "string", "pattern": "^[a-zA-Z][a-zA-Z0-9_-]{0,63}$" }, "maxProperties": 32, "additionalProperties": { "type": "number", "minimum": -360, "maximum": 360 } } } }, "poseKeys": { "type": "array", "items": { "type": "object", "properties": { "heading": { "type": "integer", "minimum": 0, "maximum": 360 }, "pose": { "type": "string", "pattern": "^[a-zA-Z][a-zA-Z0-9_-]{0,63}$" } }, "required": [ "heading", "pose" ], "additionalProperties": false }, "maxItems": 64 }, "facets": { "type": "array", "items": { "type": "object", "properties": { "color": { "type": "string", "minLength": 1, "maxLength": 1 }, "socket": { "type": "string", "pattern": "^[a-zA-Z][a-zA-Z0-9_-]{0,63}$" }, "twoSided": { "type": "boolean" }, "points": { "type": "array", "items": { "oneOf": [ { "type": "array", "items": { "type": "number", "minimum": -512, "maximum": 512 }, "maxItems": 3, "minItems": 3 }, { "type": "object", "properties": { "at": { "type": "array", "items": { "type": "number", "minimum": -512, "maximum": 512 }, "maxItems": 3, "minItems": 3 }, "socket": { "type": "string", "pattern": "^[a-zA-Z][a-zA-Z0-9_-]{0,63}$" } }, "required": [ "at" ], "additionalProperties": false } ] }, "maxItems": 16, "minItems": 3 } }, "required": [ "color", "points" ], "additionalProperties": false }, "maxItems": 2048 }, "slices": { "type": "array", "items": { "type": "array", "items": { "type": "string", "minLength": 1, "maxLength": 128 }, "maxItems": 128, "minItems": 1 }, "maxItems": 64, "minItems": 1, "description": "Equal-size top-down grids, lowest first. Dot or space is air." }, "decals": { "type": "object", "maxProperties": 256, "propertyNames": { "type": "string", "pattern": "^[a-zA-Z][a-zA-Z0-9_-]{0,63}$" }, "additionalProperties": { "type": "array", "items": { "type": "string", "minLength": 1, "maxLength": 128 }, "maxItems": 128, "minItems": 1 } }, "paint": { "type": "array", "items": { "oneOf": [ { "type": "object", "properties": { "face": { "enum": [ "west", "east", "north", "south" ] }, "at": { "type": "array", "items": { "type": "integer", "minimum": 0, "maximum": 127 }, "maxItems": 2, "minItems": 2 }, "rows": { "type": "array", "items": { "type": "string", "minLength": 1, "maxLength": 128 }, "maxItems": 128, "minItems": 1 }, "depth": { "type": "integer", "minimum": 0, "maximum": 128, "description": "0 paints only the face. Positive depth colours contiguous solid cells inward." } }, "required": [ "face", "rows" ], "additionalProperties": false }, { "type": "object", "properties": { "face": { "enum": [ "west", "east", "north", "south" ] }, "at": { "type": "array", "items": { "type": "integer", "minimum": 0, "maximum": 127 }, "maxItems": 2, "minItems": 2 }, "decal": { "type": "string", "pattern": "^[a-zA-Z][a-zA-Z0-9_-]{0,63}$" }, "flipX": { "type": "boolean" }, "flipY": { "type": "boolean" }, "depth": { "type": "integer", "minimum": 0, "maximum": 128, "description": "0 paints only the face. Positive depth colours contiguous solid cells inward." } }, "required": [ "face", "decal" ], "additionalProperties": false }, { "type": "object", "properties": { "face": { "enum": [ "west", "east", "north", "south" ] }, "at": { "type": "array", "items": { "type": "integer", "minimum": 0, "maximum": 127 }, "maxItems": 2, "minItems": 2 }, "erase": { "type": "array", "items": { "type": "string", "minLength": 1, "maxLength": 128, "pattern": "^[x. ]+$" }, "maxItems": 128, "minItems": 1 } }, "required": [ "face", "erase" ], "additionalProperties": false } ] }, "maxItems": 1024 }, "parts": { "type": "object", "propertyNames": { "type": "string", "pattern": "^[a-zA-Z][a-zA-Z0-9_-]{0,63}$" }, "maxProperties": 32, "additionalProperties": { "type": "object", "properties": { "slices": { "type": "array", "items": { "type": "array", "items": { "type": "string", "minLength": 1, "maxLength": 128 }, "maxItems": 128, "minItems": 1 }, "maxItems": 64, "minItems": 1, "description": "Equal-size top-down grids, lowest first. Dot or space is air." }, "paint": { "type": "array", "items": { "oneOf": [ { "type": "object", "properties": { "face": { "enum": [ "west", "east", "north", "south" ] }, "at": { "type": "array", "items": { "type": "integer", "minimum": 0, "maximum": 127 }, "maxItems": 2, "minItems": 2 }, "rows": { "type": "array", "items": { "type": "string", "minLength": 1, "maxLength": 128 }, "maxItems": 128, "minItems": 1 }, "depth": { "type": "integer", "minimum": 0, "maximum": 128, "description": "0 paints only the face. Positive depth colours contiguous solid cells inward." } }, "required": [ "face", "rows" ], "additionalProperties": false }, { "type": "object", "properties": { "face": { "enum": [ "west", "east", "north", "south" ] }, "at": { "type": "array", "items": { "type": "integer", "minimum": 0, "maximum": 127 }, "maxItems": 2, "minItems": 2 }, "decal": { "type": "string", "pattern": "^[a-zA-Z][a-zA-Z0-9_-]{0,63}$" }, "flipX": { "type": "boolean" }, "flipY": { "type": "boolean" }, "depth": { "type": "integer", "minimum": 0, "maximum": 128, "description": "0 paints only the face. Positive depth colours contiguous solid cells inward." } }, "required": [ "face", "decal" ], "additionalProperties": false }, { "type": "object", "properties": { "face": { "enum": [ "west", "east", "north", "south" ] }, "at": { "type": "array", "items": { "type": "integer", "minimum": 0, "maximum": 127 }, "maxItems": 2, "minItems": 2 }, "erase": { "type": "array", "items": { "type": "string", "minLength": 1, "maxLength": 128, "pattern": "^[x. ]+$" }, "maxItems": 128, "minItems": 1 } }, "required": [ "face", "erase" ], "additionalProperties": false } ] }, "maxItems": 1024 }, "socket": { "type": "string", "pattern": "^[a-zA-Z][a-zA-Z0-9_-]{0,63}$", "description": "The socket the part rides: it moves by the socket's offset and turns about its axis." }, "at": { "type": "array", "items": { "type": "number", "minimum": -512, "maximum": 512 }, "maxItems": 3, "minItems": 3, "description": "The part's lowest corner from its socket's origin, in slice cells and slices; from the stack's own corner with no socket. Default [0, 0, 0]." } }, "required": [ "slices" ], "additionalProperties": false }, "description": "Solids of their own that ride sockets: each its slices, painted on its sides and shaded by the ramps like the stack." }, "animations": { "type": "object", "propertyNames": { "type": "string", "pattern": "^[a-zA-Z][a-zA-Z0-9_-]{0,63}$" }, "maxProperties": 32, "additionalProperties": { "type": "object", "properties": { "frames": { "type": "integer", "minimum": 1, "maximum": 256, "description": "Frames at each heading." }, "duration": { "type": "integer", "minimum": 1, "maximum": 60000, "description": "Milliseconds a frame; the stack's duration when left out." }, "durations": { "type": "array", "items": { "type": "integer", "minimum": 1, "maximum": 60000 }, "maxItems": 256, "minItems": 1, "description": "Milliseconds for each frame, in place of duration." }, "loop": { "type": "boolean", "description": "Default true." }, "headings": { "type": "array", "items": { "type": "integer", "minimum": 0, "maximum": 359 }, "maxItems": 256, "minItems": 1, "uniqueItems": true, "description": "The headings it is baked for; the stack's headings when left out." }, "sockets": { "type": "object", "propertyNames": { "type": "string", "pattern": "^[a-zA-Z][a-zA-Z0-9_-]{0,63}$" }, "maxProperties": 64, "additionalProperties": { "type": "array", "items": { "type": "object", "properties": { "frame": { "type": "integer", "minimum": 0, "maximum": 256 }, "offset": { "type": "array", "items": { "type": "number", "minimum": -512, "maximum": 512 }, "maxItems": 3, "minItems": 3 }, "angle": { "type": "number", "minimum": -3600, "maximum": 3600 }, "ease": { "enum": [ "linear", "hold", "in", "out", "inOut", "overshoot", "bounce" ], "description": "How the move to this key from the one before is eased; linear when left out." } }, "required": [ "frame" ], "additionalProperties": false }, "maxItems": 64 }, "description": "Keys by frame for named sockets, in increasing order; a key at the frame count is the pose a loop comes round to. A socket not named here keeps its keys by heading." }, "poses": { "type": "array", "items": { "type": "object", "properties": { "frame": { "type": "integer", "minimum": 0, "maximum": 256 }, "pose": { "type": "string", "pattern": "^[a-zA-Z][a-zA-Z0-9_-]{0,63}$" }, "ease": { "enum": [ "linear", "hold", "in", "out", "inOut", "overshoot", "bounce" ], "description": "How the move to this key from the one before is eased; linear when left out." } }, "required": [ "frame", "pose" ], "additionalProperties": false }, "maxItems": 64, "description": "Named poses of the jointed paths by frame." } }, "required": [ "frames" ], "additionalProperties": false }, "description": "Sockets and poses keyed by frame, baked for every heading: each plays at a heading as -, or - where directions names that heading, with frames -0, -1 and so on after the heading frames." }, "directions": { "type": "object", "propertyNames": { "type": "string", "pattern": "^[a-zA-Z][a-zA-Z0-9_-]{0,63}$" }, "maxProperties": 64, "additionalProperties": { "type": "integer", "minimum": 0, "maximum": 359 }, "description": "Names for headings, used in the names of animations and their frames: {\"south\": 180}." }, "ramps": { "type": "array", "items": { "type": "string", "minLength": 2, "maxLength": 32 }, "maxItems": 64, "minItems": 1, "description": "Strings of palette keys from dark to light, a key in one ramp. With ramps, a face toward the light draws a step lighter and one turned from it a step darker." }, "light": { "type": "array", "items": { "type": "number", "minimum": -512, "maximum": 512 }, "maxItems": 3, "minItems": 3, "description": "Toward the light as the camera sees it: x right, y toward the viewer, z up. Default [-1, 1, 2]. Needs ramps." }, "lightTurns": { "type": "boolean", "description": "The light turns with the model (x east, y south, z up) instead of staying with the camera." }, "pivot": { "type": "array", "items": { "type": "integer", "minimum": 0, "maximum": 127 }, "maxItems": 2, "minItems": 2 }, "projection": { "enum": [ "oblique", "iso" ] }, "squash": { "type": "number", "minimum": 0.25, "maximum": 1 }, "resolution": { "type": "integer", "minimum": 1, "maximum": 8, "description": "Output pixels per slice cell; default 4." }, "cell": { "type": "integer", "minimum": 1, "maximum": 8, "description": "With projection iso, instead of resolution: puts the stack on a map's 2:1 grid. A slice cell steps this many pixels across and half as many down, and a slice rises as many: at 1, 16 cells cover a 32x16 tile and a cube is the standard block. Whole pixels at headings 0, 90, 180 and 270." }, "spacing": { "type": "integer", "minimum": 1, "maximum": 8 }, "headings": { "type": "array", "items": { "type": "integer", "minimum": 0, "maximum": 359 }, "maxItems": 256, "minItems": 1, "uniqueItems": true }, "duration": { "type": "integer", "minimum": 1, "maximum": 60000 } }, "required": [ "format", "version", "name", "palette", "slices" ], "additionalProperties": false, "if": { "required": [ "projection" ], "properties": { "projection": { "const": "iso" } } }, "then": { "not": { "required": [ "squash" ] } } }