Type object
File match cgs.json
Schema URL https://catalog.lintel.tools/schemas/schemastore/cgs-card-game-specification-cgs-json/latest.json
Source https://www.cardgamesimulator.com/schema/cgs.json

Validate with Lintel

npx @lintel/lintel check
Type: object

Card Game Simulator (CGS) Card Game Specification

Properties

name string required

The name of the custom card game as it appears to the user. This name is required for the Game:Id.

allCardsUrl null | string

From allCardsUrl, CGS downloads the json that contains the Card data for the game. If CGS is able to successfully download this file, it will save it as AllCards.json.

format=uri
allCardsUrlPageCount integer

If allCardsUrlPageCount > 1, CGS will download with + for each page.

Default: 1
format=int32
allCardsUrlPageCountIdentifier string

If allCardsUrlPageCountIdentifier is set, CGS will set the allCardsUrlPageCount to the response value of from .

allCardsUrlPageCountDivisor integer

allCardsUrlPageCountDivisor can be set to the # of cards per page, ie: allCardsUrlPageCount = <allCardsUrlPageCountIdentifier pointing to total # of cards>/.

Default: 1
format=int32
allCardsUrlPageCountStartIndex integer

allCardsUrlPageCountStartIndex is used to identify the first page of allCardsUrlPageCount.

Default: 1
format=int32
allCardsUrlPageIdentifier string

If allCardsUrlPageCount > 1, CGS will download with + for each page.

Default: "?page="
allCardsUrlPostBodyContent string

If allCardsUrlPostBodyContent is set, CGS will make a POST to with a JSON body that contains . If not set, CGS will just GET from .

allCardsUrlRequestHeader string

allCardsUrlRequestHeader and allCardsUrlRequestHeader can be used together for secured APIs.

Default: "X-Api-Key"
allCardsUrlRequestHeaderValue string

allCardsUrlRequestHeader and allCardsUrlRequestHeader can be used together for secured APIs.

allCardsUrlWrapped boolean

If allCardsUrl points to file(s) enclosed by extra characters, set allCardsUrlWrapped to true, and CGS will trim the first and last characters.

allCardsUrlZipped boolean

If allCardsUrl points to zipped file(s), set allCardsUrlZipped to true, and CGS will unzip the file(s).

allDecksUrl null | string

From allDecksUrl, CGS downloads the json that contains the Deck data for the game. If CGS is able to successfully download this file, it will save it as AllDecks.json.

format=uri
allDecksUrlDataIdentifier string

If allDecksUrlDataIdentifier is set to a non-empty string, AllDecks.json will be parsed as a JSON object: {"@allDecksUrlDataIdentifier":{"$ref":"AllDecks.json"}}

allDecksUrlPostBodyContent string

If allDecksUrlPostBodyContent is set, CGS will make a POST to with a JSON body that contains . If not set, CGS will just GET from .

allDecksUrlTxtRoot string

If allDecksUrlTxtRoot is set, CGS will parse deck urls as +DeckUrl:Txt

allSetsUrl null | string

From allSetsUrl, CGS downloads the json that contains the Set data for the game. If CGS is able to successfully download this json, it will save it as AllSets.json.

format=uri
allSetsUrlWrapped boolean

If allSetsUrl points to a file enclosed by extra characters, set allSetsUrlWrapped to true, and CGS will trim the first and last characters.

allSetsUrlZipped boolean

If allSetsUrl points to a zipped file, set allSetsUrlZipped to true, and CGS will unzip the file.

autoUpdate integer

autoUpdate indicates how many days to use cached files instead of re-downloading. autoUpdate=0 will re-download files at every opportunity. autoUpdate<0 will never attempt to download anything.

Default: 30
format=int32
autoUpdateUrl null | string

autoUpdateUrl indicates the url from which users download Game:Name.json, and CGS will automatically re-download the custom game from this url every days. This url is used in the Game:Id. You should host Game:Name.json at this url, but if you do not, you can set autoUpdate to -1, and there should be no issues.

format=uri
bannerImageFileType string

bannerImageFileType is the file type extension for the image file that CGS downloads from bannerImageUrl.

Default: "png"
bannerImageUrl null | string

If bannerImageUrl is a valid url, CGS will download the image at that url and save it as Banner.. CGS will attempt to display the Banner. as an identifier to the user. If it is unable to read Banner., CGS will simply display the CGS logo.

format=uri
cardBackFaceImageUrls CardBackFaceImageUrl[]

CGS will go through each CardBackFaceImageUrl and save the data from CardBackFaceImageUrl:Url to 'backs/CardBackFaceImageUrl:Id.'

cardBackImageFileType string

cardBackImageFileType is the file type extension for the image file that CGS downloads from cardBackImageUrl.

Default: "png"
cardBackImageUrl null | string

If cardBackImageUrl is a valid url, CGS will download the image at that url and save it as CardBack.. CGS will display the CardBack. when the user turns a card facedown or if CGS is unable to find the appropriate card image. If CGS is unable to get a custom card back, CGS will use the default CGS card back.

format=uri
cardDataIdentifier string

If cardDataIdentifier is set to a non-empty string, AllCards.json will be parsed as a JSON object: {"@cardDataIdentifier":{"$ref":"AllCards.json"}}

cardIdIdentifier string

Every Card must have a unique id. When defining a Card in AllCards.json or AllSets.json, you can have the Card:Id mapped to the field defined by cardIdIdentifier. Most custom games will likely want to keep the default cardIdIdentifier.

Default: "id"
cardIdStop string

Every Card must have a unique id. When defining a Card in AllCards.json or AllSets.json, you can have the Card:Id mapped to the field defined by cardIdIdentifier. Most custom games will likely want to keep the default cardIdIdentifier. If cardIdStop is set, any id that contains cardIdStop will be stopped at .

cardImageFileType string

cardImageFileType is the file type extension for the image files that CGS downloads for each individual Card.

Default: "png"
cardImageFileTypeIdentifier string

When defining a Card in AllCards.json or AllSets.json, cardImageFileTypeIdentifier is the Card:Property that overrides the cardImageFileType for this Card. If is empty, this Card's image file will still be saved as .

cardImageProperty string

cardImageProperty is the Card:Property which points to the image for this Card. If is empty, will be used instead.

cardImageUrl string

cardImageUrl is a parameterized template url from which CGS downloads card image files if is empty. Parameters: {cardId}=Card:Id, {cardName}=Card:Name, {cardSet}=Card:SetCode, {cardImageFileType}=, {}=Card:. Example: https://www.cardgamesimulator.com/games/Standard/sets/{cardSet}/{cardId}.{cardImageFileType}

format=uri-template
cardNameBackIdentifier string

When defining a Card in AllCards.json or AllSets.json, you can have the Card:Name of the back face mapped to the field defined by cardNameBackIdentifier. Most custom games will likely want to keep the default cardNameBackIdentifier.

cardNameIdentifier string

When defining a Card in AllCards.json or AllSets.json, you can have the Card:Name mapped to the field defined by cardNameIdentifier. Most custom games will likely want to keep the default cardNameIdentifier.

Default: "name"
cardNameIsUnique boolean

If cardNameIsUnique is true, different Cards are not allowed to have the same Card:Name. Cards with the same name will be treated as reprints, with the option to hide reprints available. If cardNameIsUnique is false, DeckFileType.Txt will require for every Card.

Default: true
cardPrimaryProperty string

The cardPrimaryProperty is the Card:Property that is first selected and displayed in the Card Viewer, which appears whenever a user selects a card.

cardProperties PropertyDef[]

cardProperties defines the name keys for Card:Propertys. The values should be mapped in AllCards.json or AllSets.json.

cardPropertyIdentifier string

When defining a Card in AllCards.json or AllSets.json, you can integrate objectEnum and objectEnumList properties with enums by using cardPropertyIdentifier. Most custom games will likely want to keep the default cardPropertyIdentifier.

Default: "id"
cardRotationDefault integer

Cards will be rotated degrees, unless you override with cardRotationIdentifier. Most custom games will likely want to keep the default cardRotationDefault.

Default: 0
format=int32
cardRotationIdentifier string

When defining a Card in AllCards.json or AllSets.json, you can set to an int field that indicates the rotation of a card in degrees. If left blank or missing, cards will be rotated degrees.

cardSetIdentifier string

When defining a Card in AllCards.json, you can have the Card:SetCode mapped to the field defined by cardSetIdentifier. If the mapping is missing, CGS will use . Most custom games will likely want to keep the default cardSetIdentifier.

Default: "set"
cardSetIsObject boolean

If cardSetIsObject is set to true, should point to an object (or list of objects) that follows the rules for AllSets.json.

cardSetNameIdentifier string

When defining a Card in AllCards.json, you can have the Card:SetCode mapped to the field defined by cardSetIdentifier. That Set's name can be defined by cardSetNameIdentifier.

Default: "setname"
cardSetsInList boolean

If cardSetInList is set to true, Cards will be duplicated for each Set in .

cardSetsInListIsCsv boolean

If cardSetsInListIsCsv is set to true, Cards will be duplicated for each Set found in the comma-separated list of .

cardSize Float2

cardSize indicates a card's width and height in inches.

Default: "(x: 2.5, y: 3.5)"
deckFileAltId string

When saving or loading a deck with NOT txt, deckFileAltId refers to the Card:Property used to uniquely identify each Card. For hsd, this is stored as a varint within the deck string.

Default: "dbfId"
deckFileTxtId DeckFileTxtId

When saving a deck as txt, different Cards may share the same name, and if they do, the Card: will be used to uniquely identify Cards.

Default: "set"
deckFileType DeckFileType

When saving a deck, the formatting for how it is saved and loaded is defined by the deckFileType. dec refers to the old MTGO deck file format. hsd refers to the Hearthstone deck string format. ydk refers to the YGOPRO deck file format. txt parses each line for the following: [Card:Id] Card:Name (Card:SetCode).

Default: "txt"
deckPlayCards DeckPlayCard[]

deckPlayCards indicates cards that should automatically be played when a player loads a deck in Play Mode.

deckSharePreference SharePreference

For networked games, CGS will use deckSharePreference to: ask players if they want to share the same deck, force all players to share the same deck, or force an individual deck for each player.

Default: "share"
deckUrls DeckUrl[]

CGS will go through each DeckUrl and save the data from DeckUrl:Url to 'decks/DeckUrl:Name.'

enums EnumDef[]

The value is displayed to the user through the UI while the keys remain hidden. If the keys are entered as a hexadecimal integers (prefixed with 0x), multiple values can go through bitwise and/ors to have a single enumValue represent multiple values. The multiple values would be displayed together to the user, using | as the delimiter.

extras ExtraDef[]

Describes extra cards separate from the main deck: The hsd deckFileType treats all extra cards as Heroes, and the ydk deckFileType treats all extra cards as extra deck cards.

gameBoardImageFileType string

gameBoardImageFileType is the file type extension for the image files that CGS downloads for each game board.

Default: "png"
gameBoardCards GameBoardCard[]
gameBoardUrls GameBoardUrl[]

CGS will go through each GameBoardUrl and save the data from GameBoardUrl:Url to 'boards/GameBoardUrl:Id.'

gameCardRotationDegrees integer

gameCardRotationDegrees indicates how many degrees to rotate Cards in Play Mode.

Default: 90
format=int32
gameDefaultCardAction CardAction

If possible, CGS will take the gameDefaultCardAction when a Card is double-clicked in Play Mode.

Default: "flip"
gamePlayDeckName string

gamePlayDeckName is the name of the card stack shown when a player loads a deck. If is empty, the Deck:Name is used.

gamePlayDeckPositions Float2[]

Each deck loaded during a game will be loaded to its corresponding position in gamePlayDeckPositions. The first deck loaded will go to the first position, second to second, etc.

gamePlayZones GamePlayZone[]

gamePlayZones will appear in the Play Area in Play Mode.

gameStartDecks DeckUrl[]

gameStartDecks indicates decks that should automatically be loaded when a player starts playing in Play Mode.

gameStartHandCount integer

gameStartHandCount indicates how many cards are automatically dealt from a loaded deck to a player's hand.

format=int32
gameStartPointsCount integer

gameStartPointsCount indicates how many points are automatically assigned to each player.

format=int32
playMatImageFileType string

playMatImageFileType is the file type extension for the image file that CGS downloads from playMatImageUrl.

Default: "png"
playMatImageUrl null | string

If playMatImageUrl is a valid url, CGS will download the image at that url and save it as PlayMat.. CGS will use the PlayMat. as the background image while in Play Mode. If CGS is unable to get this image, CGS will use the default table image.

format=uri
playMatSize Float2

playMatSize indicates the width and height in inches of the play area in Play Mode.

Default: "(x: 36, y: 36)"
playMatGridCellSize Float2

playMatGridCellSize indicates the width and height in inches of each cell in the play area in Play Mode.

Default: "(x: 0.5, y: 0.5)"
rulesUrl null | string

rulesUrl should link to this game's online rulebook.

format=uri
setCardsIdentifier string

When defining a Set in AllSets.json, you can also define Cards to include in that Set by indicating them with setCardsIdentifier. Most custom games will likely want to keep the default setCardsIdentifier.

Default: "cards"
setCardsUrlIdentifier string

When defining a Set in AllSets.json, you can also define Cards to include in that Set by indicating them with SetCardsUrlIdentifier. Most custom games will likely want to keep the default SetCardsUrlIdentifier.

Default: "cardsUrl"
setCodeDefault string

If a Card does not specify its Set, it will be included in the Set with Set:Code specified by setCodeDefault. This Set's name is specified by setNameDefault.

Default: "_CGSDEFAULT_"
setCodeIdentifier string

When defining a Set in AllSets.json, you can have the Set:Code mapped to the field defined by setCodeIdentifier. Most custom games will likely want to keep the default setCodeIdentifier.

Default: "code"
setDataIdentifier string

If setDataIdentifier is set to a non-empty string, AllSets.json will be parsed as a JSON object: {"@setDataIdentifier":{"$ref":"AllSets.json"}}

setNameDefault string

If a Card does not specify its Set, it will be included in the Set with Set:Code specified by setCodeDefault. This Set's name is specified by setNameDefault.

Default: "_CGSDEFAULT_"
setNameIdentifier string

When defining a Set in AllSets.json, you can have the Set:Name mapped to the field defined by setNameIdentifier. If the mapping is missing, CGS will use the Set:Code. Most custom games will likely want to keep the default setNameIdentifier.

Default: "name"

Definitions

CardBackFaceImageUrl object
id string

The id of the card back

url string

The url from which to download the card back

format=uri
PropertyDef object
name string required

The name of the property: This name can be referenced to lookup a Card's property

type PropertyType required

The type of the property

Default: "string"
display string

The name of the property as it is displayed to the end user

displayEmpty string

The value to display if the value is null or empty

displayEmptyFirst boolean

List as the first option if this property is an enum?

delimiter string

If this property is a stringList or stringEnumList, the value will be delimited by this delimiter

backName string

If the Card is a back Face: This name can be referenced to lookup a Card's property

frontName string

If the Card is a front Face: This name can be referenced to lookup a Card's property

properties PropertyDef[]
PropertyType string
Float2 object
x number
format=float
y number
format=float
DeckFileTxtId string
DeckFileType string
DeckPlayCard object
cardQuery string

CGS will automatically play the Card that matches cardQuery, when the player loads a Deck in Play Mode matching deckQuery

deckQuery string

CGS will automatically play the Card that matches cardQuery, when the player loads a Deck in Play Mode matching deckQuery

position Float2

Indicates the played Card's position in inches

rotation integer

Indicates the played Card's rotation in degrees

format=int32
SharePreference string
DeckUrl object
name string

The name of the deck

txt string

An optional path that can be used to override the url. See @cgs.json#/properties/allDecksUrlTxtRoot

url string

The url from which to download the deck

format=uri
isAvailable boolean

Optionally set to false to ignore this deck url

Default: "true"
EnumDef object
property string

Refers to a Property:Name in

values Record<string, string>

Dictionary with string key-value pairs

ExtraDef object
group string

A group of extra cards is displayed together with this label in Play Mode

Default: "Extras"
property string

Refers to a Property:Name in

value string

If Card:Properties[ExtraDef:Property] equals ExtraDef:Value, then that card will be moved from the main deck to this extra deck

GameBoardCard object
card string

When a deck is loaded in Play Mode, any card with Card:Id = Card will cause Boards to be put into the play area.

boards GameBoard[]
GameBoard object
id string

The id of the board

offsetMin Float2

Indicates the position (in inches) of the bottom-left corner

size Float2

Indicates the board's width and height in inches

GameBoardUrl object
id string

The id of the board

url string

The url from which to download the board image

format=uri
CardAction string
GamePlayZone object

When a Card enters the Game Play Zone, the Card will display this face

Default: "any"
defaultCardAction null | CardAction

If possible, CGS will take the defaultCardAction when a Card is double-clicked in the Game Play Zone. If null, defaults to

position Float2

Indicates the Game Play Zone's position in inches

rotation integer

Indicates the Game Play Zone's rotation in degrees

format=int32
size Float2

Indicates the Game Play Zone's width and height in inches

The Game Play Zone type from area, dice, horizontal, or vertical

Default: "area"
FacePreference string
GamePlayZoneType string