{
  "$defs": {
    "ManifestCurrency": {
      "additionalProperties": false,
      "description": "The game's own currency. Players see their shared Sweet Credits balance in these units; prices of\nitems and memberships are set in them. Nothing is stored in the currency: it's a view of Credits.",
      "properties": {
        "name": {
          "description": "Singular name shown to players, e.g. Sprout",
          "title": "Name",
          "type": "string"
        },
        "plural": {
          "description": "Plural name, e.g. Sprouts",
          "title": "Plural",
          "type": "string"
        },
        "credits_per_unit": {
          "description": "Conversion rate: how many Sweet Credits one unit costs (1 Credit = $0.01). E.g. 2 means 1 Sprout = 2 Credits, so 1,000 Credits show as 500 Sprouts",
          "maximum": 10000,
          "minimum": 1,
          "title": "Credits Per Unit",
          "type": "integer"
        },
        "icon": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Path of a small square icon inside the package",
          "title": "Icon"
        }
      },
      "required": [
        "name",
        "plural",
        "credits_per_unit"
      ],
      "title": "ManifestCurrency",
      "type": "object"
    },
    "ManifestEvent": {
      "additionalProperties": false,
      "description": "A gameplay event the game reports with gp.event(name, value?)",
      "properties": {
        "code": {
          "description": "Compact numeric code used in the trace; unique per game",
          "maximum": 250,
          "minimum": 1,
          "title": "Code",
          "type": "integer"
        },
        "description": {
          "maxLength": 140,
          "title": "Description",
          "type": "string"
        },
        "points": {
          "anyOf": [
            {
              "maximum": 1000000,
              "minimum": -1000000,
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Points this event adds to the score when scoring.mode is 'sum_points'",
          "title": "Points"
        },
        "per_value": {
          "default": false,
          "description": "When true the score contribution is points * value instead of points",
          "title": "Per Value",
          "type": "boolean"
        },
        "max_per_second": {
          "anyOf": [
            {
              "exclusiveMinimum": 0,
              "maximum": 1000,
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Upper bound on how often a legitimate player can trigger this event",
          "title": "Max Per Second"
        }
      },
      "required": [
        "code",
        "description"
      ],
      "title": "ManifestEvent",
      "type": "object"
    },
    "ManifestItem": {
      "additionalProperties": false,
      "description": "A consumable the game sells, priced in the game's currency. Prices are confirmed during review.",
      "properties": {
        "price": {
          "anyOf": [
            {
              "maximum": 100000,
              "minimum": 1,
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Price in the game's currency (manifest `currency`)",
          "title": "Price"
        },
        "price_points": {
          "anyOf": [
            {
              "maximum": 100000,
              "minimum": 1,
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Legacy: price in Credits, for games without a `currency`",
          "title": "Price Points"
        },
        "key": {
          "description": "Lowercase identifier, e.g. extra_life",
          "title": "Key",
          "type": "string"
        },
        "title": {
          "maxLength": 60,
          "title": "Title",
          "type": "string"
        },
        "description": {
          "maxLength": 280,
          "title": "Description",
          "type": "string"
        },
        "max_per_session": {
          "default": 1,
          "maximum": 10,
          "minimum": 1,
          "title": "Max Per Session",
          "type": "integer"
        },
        "inventory_limit": {
          "default": 99,
          "maximum": 999,
          "minimum": 1,
          "title": "Inventory Limit",
          "type": "integer"
        },
        "icon": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Path of an icon inside the package",
          "title": "Icon"
        },
        "effect": {
          "anyOf": [
            {
              "additionalProperties": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "integer"
                  },
                  {
                    "type": "string"
                  },
                  {
                    "type": "boolean"
                  }
                ]
              },
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Declared effect, e.g. {\"type\": \"extra_life\", \"value\": 1}",
          "title": "Effect"
        }
      },
      "required": [
        "key",
        "title",
        "description"
      ],
      "title": "ManifestItem",
      "type": "object"
    },
    "ManifestLeaderboard": {
      "additionalProperties": false,
      "properties": {
        "enabled": {
          "default": true,
          "title": "Enabled",
          "type": "boolean"
        },
        "order": {
          "default": "desc",
          "description": "desc: higher is better; asc: lower is better (e.g. fastest time)",
          "enum": [
            "desc",
            "asc"
          ],
          "title": "Order",
          "type": "string"
        },
        "score_label": {
          "default": "Score",
          "maxLength": 24,
          "title": "Score Label",
          "type": "string"
        },
        "score_format": {
          "default": "integer",
          "enum": [
            "integer",
            "time_ms"
          ],
          "title": "Score Format",
          "type": "string"
        },
        "min_score": {
          "default": 0,
          "maximum": 1000000000000,
          "minimum": -1000000000000,
          "title": "Min Score",
          "type": "integer"
        },
        "max_score": {
          "description": "Hard upper bound; higher claims are rejected",
          "maximum": 1000000000000,
          "minimum": 1,
          "title": "Max Score",
          "type": "integer"
        },
        "max_score_per_second": {
          "anyOf": [
            {
              "exclusiveMinimum": 0,
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Highest plausible scoring rate (score / second of play)",
          "title": "Max Score Per Second"
        }
      },
      "required": [
        "max_score"
      ],
      "title": "ManifestLeaderboard",
      "type": "object"
    },
    "ManifestMembership": {
      "additionalProperties": false,
      "description": "A monthly membership the game sells, priced per month in the game's currency and renewed from the\nplayer's Credits. Perks are what the player gets (shown on the subscribe screen); the game applies\nthem when the session says the player is a member. Prices are confirmed during review.",
      "properties": {
        "price": {
          "anyOf": [
            {
              "maximum": 100000,
              "minimum": 1,
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Price in the game's currency (manifest `currency`)",
          "title": "Price"
        },
        "price_points": {
          "anyOf": [
            {
              "maximum": 100000,
              "minimum": 1,
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Legacy: price in Credits, for games without a `currency`",
          "title": "Price Points"
        },
        "key": {
          "description": "Lowercase identifier, e.g. vip",
          "title": "Key",
          "type": "string"
        },
        "title": {
          "maxLength": 60,
          "title": "Title",
          "type": "string"
        },
        "description": {
          "maxLength": 280,
          "title": "Description",
          "type": "string"
        },
        "perks": {
          "description": "What members get, one line each (max 80 chars)",
          "items": {
            "type": "string"
          },
          "maxItems": 5,
          "minItems": 1,
          "title": "Perks",
          "type": "array"
        },
        "effect": {
          "anyOf": [
            {
              "additionalProperties": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "integer"
                  },
                  {
                    "type": "string"
                  },
                  {
                    "type": "boolean"
                  }
                ]
              },
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Declared effect, e.g. {\"type\": \"score_multiplier\", \"value\": 1.0} for cosmetics",
          "title": "Effect"
        }
      },
      "required": [
        "key",
        "title",
        "description",
        "perks"
      ],
      "title": "ManifestMembership",
      "type": "object"
    },
    "ManifestMultiplayer": {
      "additionalProperties": false,
      "description": "Online play through Sweet's relay (gp.multiplayer). Games never open network connections of their own: the\nplatform hosts the rooms, seats the players, stamps who sent each message and moves the host when one leaves.",
      "properties": {
        "max_players": {
          "description": "Seats per room, 2-16",
          "maximum": 16,
          "minimum": 2,
          "title": "Max Players",
          "type": "integer"
        },
        "min_players": {
          "default": 2,
          "description": "Players needed to start a match",
          "maximum": 16,
          "minimum": 1,
          "title": "Min Players",
          "type": "integer"
        },
        "authority": {
          "default": "host",
          "description": "host: the host runs the game and sends state (it must send checkpoints so the next host can carry on); shared: every player runs the same simulation from everyone's inputs (no host needed)",
          "enum": [
            "host",
            "shared"
          ],
          "title": "Authority",
          "type": "string"
        },
        "modes": {
          "items": {
            "$ref": "#/$defs/ManifestMultiplayerMode"
          },
          "maxItems": 8,
          "minItems": 1,
          "title": "Modes",
          "type": "array"
        },
        "join_in_progress": {
          "default": false,
          "description": "Players may join a started match (never in ranked modes)",
          "title": "Join In Progress",
          "type": "boolean"
        },
        "reconnect_seconds": {
          "default": 30,
          "description": "How long a dropped player's seat is held",
          "maximum": 120,
          "minimum": 2,
          "title": "Reconnect Seconds",
          "type": "integer"
        },
        "host_grace_seconds": {
          "default": 5,
          "description": "How long a dropped host has to return before the host moves",
          "maximum": 15,
          "minimum": 1,
          "title": "Host Grace Seconds",
          "type": "integer"
        },
        "guests": {
          "default": true,
          "description": "Signed-out players may play online (never in ranked modes)",
          "title": "Guests",
          "type": "boolean"
        },
        "chat": {
          "default": true,
          "description": "The platform's text chat (filtered; signed-in players only)",
          "title": "Chat",
          "type": "boolean"
        },
        "requires": {
          "anyOf": [
            {
              "$ref": "#/$defs/ManifestMultiplayerRequires"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "min_inputs_per_minute": {
          "default": 2,
          "description": "Ranked: the fewest real inputs per minute a human needs in a match (any input counts; matches under 20 seconds aren't judged). A match with less isn't rated",
          "maximum": 600,
          "minimum": 0,
          "title": "Min Inputs Per Minute",
          "type": "number"
        },
        "limits": {
          "anyOf": [
            {
              "$ref": "#/$defs/ManifestMultiplayerLimits"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        }
      },
      "required": [
        "max_players"
      ],
      "title": "ManifestMultiplayer",
      "type": "object"
    },
    "ManifestMultiplayerLimits": {
      "additionalProperties": false,
      "description": "Message limits per player; the relay's defaults suit most games. Everything is clamped\nto the platform's caps.",
      "properties": {
        "msg_bytes": {
          "anyOf": [
            {
              "maximum": 65536,
              "minimum": 256,
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Largest message from a player (default 16 KB)",
          "title": "Msg Bytes"
        },
        "host_msg_bytes": {
          "anyOf": [
            {
              "maximum": 131072,
              "minimum": 256,
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Largest message from the host (default 64 KB)",
          "title": "Host Msg Bytes"
        },
        "messages_per_second": {
          "anyOf": [
            {
              "maximum": 60,
              "minimum": 1,
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Per player (default 30)",
          "title": "Messages Per Second"
        },
        "host_messages_per_second": {
          "anyOf": [
            {
              "maximum": 120,
              "minimum": 1,
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "For the host (default 60)",
          "title": "Host Messages Per Second"
        },
        "bytes_per_second": {
          "anyOf": [
            {
              "maximum": 262144,
              "minimum": 1024,
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Per player (default 64 KB)",
          "title": "Bytes Per Second"
        },
        "host_bytes_per_second": {
          "anyOf": [
            {
              "maximum": 1048576,
              "minimum": 1024,
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "For the host (default 256 KB)",
          "title": "Host Bytes Per Second"
        },
        "checkpoint_bytes": {
          "anyOf": [
            {
              "maximum": 131072,
              "minimum": 0,
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Largest host checkpoint (default 64 KB)",
          "title": "Checkpoint Bytes"
        }
      },
      "title": "ManifestMultiplayerLimits",
      "type": "object"
    },
    "ManifestMultiplayerMode": {
      "additionalProperties": false,
      "description": "A way to play online. Players pick it in the game; quick match only pairs players in the same mode.",
      "properties": {
        "key": {
          "description": "Identifier sent to the platform, e.g. duel: 1-24 chars, a-z 0-9 _ -",
          "title": "Key",
          "type": "string"
        },
        "title": {
          "description": "Name players see, e.g. Ranked duel",
          "maxLength": 40,
          "minLength": 1,
          "title": "Title",
          "type": "string"
        },
        "description": {
          "default": "",
          "maxLength": 140,
          "title": "Description",
          "type": "string"
        },
        "max_players": {
          "anyOf": [
            {
              "maximum": 16,
              "minimum": 2,
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Room size for this mode, when smaller than multiplayer.max_players (a 1v1 mode next to 4-player co-op)",
          "title": "Max Players"
        },
        "ranked": {
          "default": false,
          "description": "Skill ratings for this mode. Ranked rooms come only from quick match, take signed-in players only, and every match must end with gp.multiplayer.reportResult",
          "title": "Ranked",
          "type": "boolean"
        },
        "min_match_seconds": {
          "default": 30,
          "description": "Ranked: a match shorter than this doesn't change ratings (a quick forfeit can't farm points)",
          "maximum": 3600,
          "minimum": 5,
          "title": "Min Match Seconds",
          "type": "integer"
        }
      },
      "required": [
        "key",
        "title"
      ],
      "title": "ManifestMultiplayerMode",
      "type": "object"
    },
    "ManifestMultiplayerRequires": {
      "additionalProperties": false,
      "description": "Paid unlocks for online play: the key of an item (owned: at least one in the inventory) or a membership",
      "properties": {
        "host": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Needed to open a room (private or public)",
          "title": "Host"
        },
        "join": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Needed to join someone else's room",
          "title": "Join"
        }
      },
      "title": "ManifestMultiplayerRequires",
      "type": "object"
    },
    "ManifestScoring": {
      "additionalProperties": false,
      "description": "How the platform recomputes the score from the event trace",
      "properties": {
        "mode": {
          "description": "sum_points: sum of event points; count_event: number of `event` occurrences; max_value / last_value: max / last value reported with `event`; custom: verified by a per-game validator written during review; none: no recomputation (generic checks only)",
          "enum": [
            "sum_points",
            "count_event",
            "max_value",
            "last_value",
            "custom",
            "none"
          ],
          "title": "Mode",
          "type": "string"
        },
        "event": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Event name for count_event, max_value, last_value",
          "title": "Event"
        },
        "tolerance_abs": {
          "default": 0,
          "maximum": 1000000,
          "minimum": 0,
          "title": "Tolerance Abs",
          "type": "integer"
        },
        "tolerance_pct": {
          "default": 0,
          "maximum": 25,
          "minimum": 0,
          "title": "Tolerance Pct",
          "type": "number"
        }
      },
      "required": [
        "mode"
      ],
      "title": "ManifestScoring",
      "type": "object"
    },
    "ManifestSession": {
      "additionalProperties": false,
      "properties": {
        "min_duration_ms": {
          "default": 1000,
          "maximum": 600000,
          "minimum": 0,
          "title": "Min Duration Ms",
          "type": "integer"
        },
        "max_duration_ms": {
          "default": 3600000,
          "maximum": 14400000,
          "minimum": 10000,
          "title": "Max Duration Ms",
          "type": "integer"
        },
        "min_inputs_per_minute": {
          "default": 0,
          "description": "The fewest real inputs per minute a human needs to score (any input counts: presses, pointer movement, the wheel; a run under 20 seconds only needs some). A scoring run with less isn't ranked",
          "maximum": 600,
          "minimum": 0,
          "title": "Min Inputs Per Minute",
          "type": "number"
        },
        "max_inputs_per_second": {
          "default": 30,
          "exclusiveMinimum": 0,
          "maximum": 100,
          "title": "Max Inputs Per Second",
          "type": "number"
        }
      },
      "title": "ManifestSession",
      "type": "object"
    },
    "ThirdPartyAsset": {
      "additionalProperties": false,
      "properties": {
        "path": {
          "maxLength": 200,
          "title": "Path",
          "type": "string"
        },
        "author": {
          "maxLength": 120,
          "title": "Author",
          "type": "string"
        },
        "license": {
          "description": "SPDX identifier or license name, e.g. CC0-1.0",
          "maxLength": 60,
          "title": "License",
          "type": "string"
        },
        "source_url": {
          "anyOf": [
            {
              "maxLength": 500,
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Source Url"
        }
      },
      "required": [
        "path",
        "author",
        "license"
      ],
      "title": "ThirdPartyAsset",
      "type": "object"
    }
  },
  "additionalProperties": false,
  "properties": {
    "manifest_version": {
      "const": 1,
      "default": 1,
      "title": "Manifest Version",
      "type": "integer"
    },
    "sdk_version": {
      "const": "1",
      "default": "1",
      "title": "Sdk Version",
      "type": "string"
    },
    "slug": {
      "description": "URL name of the game: 3-40 chars, a-z 0-9 and single hyphens",
      "title": "Slug",
      "type": "string"
    },
    "version": {
      "description": "Semantic version MAJOR.MINOR.PATCH; must increase with every submission",
      "title": "Version",
      "type": "string"
    },
    "title": {
      "maxLength": 80,
      "minLength": 2,
      "title": "Title",
      "type": "string"
    },
    "short_description": {
      "maxLength": 280,
      "minLength": 10,
      "title": "Short Description",
      "type": "string"
    },
    "description": {
      "default": "",
      "maxLength": 4000,
      "title": "Description",
      "type": "string"
    },
    "category": {
      "default": "arcade",
      "enum": [
        "arcade",
        "action",
        "puzzle",
        "word",
        "sports",
        "racing",
        "strategy",
        "casual",
        "trivia",
        "rhythm",
        "platformer",
        "idle",
        "other"
      ],
      "title": "Category",
      "type": "string"
    },
    "tags": {
      "items": {
        "type": "string"
      },
      "maxItems": 8,
      "title": "Tags",
      "type": "array"
    },
    "entry": {
      "default": "index.html",
      "title": "Entry",
      "type": "string"
    },
    "thumbnail": {
      "description": "Path to a 16:9 or 1:1 PNG/JPG/WebP, at least 512px wide",
      "title": "Thumbnail",
      "type": "string"
    },
    "orientation": {
      "default": "any",
      "enum": [
        "portrait",
        "landscape",
        "any"
      ],
      "title": "Orientation",
      "type": "string"
    },
    "menu_corner": {
      "default": "top-right",
      "description": "Where the play page's Sweet menu floats over the game: a small pill with the player's avatar, username and (on larger screens) credits that opens the menu (leaderboard, membership, players & chat). Keep that corner, about 300 x 60 CSS pixels, clear of the game's own buttons and text; gp.menu has the exact area (players can drag the pill)",
      "enum": [
        "top-right",
        "top-left",
        "bottom-right",
        "bottom-left"
      ],
      "title": "Menu Corner",
      "type": "string"
    },
    "controls": {
      "items": {
        "enum": [
          "keyboard",
          "mouse",
          "touch",
          "gamepad"
        ],
        "type": "string"
      },
      "minItems": 1,
      "title": "Controls",
      "type": "array"
    },
    "audience": {
      "default": "everyone",
      "enum": [
        "everyone",
        "teen",
        "mature"
      ],
      "title": "Audience",
      "type": "string"
    },
    "events": {
      "additionalProperties": {
        "$ref": "#/$defs/ManifestEvent"
      },
      "title": "Events",
      "type": "object"
    },
    "scoring": {
      "$ref": "#/$defs/ManifestScoring"
    },
    "leaderboard": {
      "$ref": "#/$defs/ManifestLeaderboard"
    },
    "session": {
      "$ref": "#/$defs/ManifestSession"
    },
    "currency": {
      "anyOf": [
        {
          "$ref": "#/$defs/ManifestCurrency"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "The game's own currency and its rate in Sweet Credits. Recommended for any game that sells items or memberships; without it, prices are in Credits"
    },
    "items": {
      "items": {
        "$ref": "#/$defs/ManifestItem"
      },
      "maxItems": 20,
      "title": "Items",
      "type": "array"
    },
    "memberships": {
      "items": {
        "$ref": "#/$defs/ManifestMembership"
      },
      "maxItems": 3,
      "title": "Memberships",
      "type": "array"
    },
    "third_party_assets": {
      "items": {
        "$ref": "#/$defs/ThirdPartyAsset"
      },
      "maxItems": 200,
      "title": "Third Party Assets",
      "type": "array"
    },
    "multiplayer": {
      "anyOf": [
        {
          "$ref": "#/$defs/ManifestMultiplayer"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Online play through Sweet's relay (gp.multiplayer): rooms, quick match, ranked modes. Submitting needs a paid plan (Builder, Studio or Titan, all the same). Games never open their own network connections"
    }
  },
  "required": [
    "slug",
    "version",
    "title",
    "short_description",
    "thumbnail",
    "controls",
    "scoring",
    "leaderboard"
  ],
  "title": "gp-manifest.json",
  "type": "object",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "gp-manifest.schema.json"
}
