CGS Card Game Specification (cgs.json)
Card Game Simulator (CGS) Card Game Specification
| 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
Card Game Simulator (CGS) Card Game Specification
Properties
The name of the custom card game as it appears to the user. This name is required for the Game:Id.
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.
If allCardsUrlPageCount > 1, CGS will download
If allCardsUrlPageCountIdentifier is set, CGS will set the allCardsUrlPageCount to the response value of
allCardsUrlPageCountDivisor can be set to the # of cards per page, ie: allCardsUrlPageCount = <allCardsUrlPageCountIdentifier pointing to total # of cards>/
allCardsUrlPageCountStartIndex is used to identify the first page of allCardsUrlPageCount.
If allCardsUrlPageCount > 1, CGS will download
If allCardsUrlPostBodyContent is set, CGS will make a POST to
allCardsUrlRequestHeader and allCardsUrlRequestHeader can be used together for secured APIs.
allCardsUrlRequestHeader and allCardsUrlRequestHeader can be used together for secured APIs.
If allCardsUrl points to file(s) enclosed by extra characters, set allCardsUrlWrapped to true, and CGS will trim the first and last characters.
If allCardsUrl points to zipped file(s), set allCardsUrlZipped to true, and CGS will unzip the file(s).
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.
If allDecksUrlDataIdentifier is set to a non-empty string, AllDecks.json will be parsed as a JSON object: {"@allDecksUrlDataIdentifier":{"$ref":"AllDecks.json"}}
If allDecksUrlPostBodyContent is set, CGS will make a POST to
If allDecksUrlTxtRoot is set, CGS will parse deck urls as
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.
If allSetsUrl points to a file enclosed by extra characters, set allSetsUrlWrapped to true, and CGS will trim the first and last characters.
If allSetsUrl points to a zipped file, set allSetsUrlZipped to true, and CGS will unzip the file.
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.
autoUpdateUrl indicates the url from which users download Game:Name.json, and CGS will automatically re-download the custom game from this url every
bannerImageFileType is the file type extension for the image file that CGS downloads from bannerImageUrl.
If bannerImageUrl is a valid url, CGS will download the image at that url and save it as Banner.
CGS will go through each CardBackFaceImageUrl and save the data from CardBackFaceImageUrl:Url to 'backs/CardBackFaceImageUrl:Id.
cardBackImageFileType is the file type extension for the image file that CGS downloads from cardBackImageUrl.
If cardBackImageUrl is a valid url, CGS will download the image at that url and save it as CardBack.
If cardDataIdentifier is set to a non-empty string, AllCards.json will be parsed as a JSON object: {"@cardDataIdentifier":{"$ref":"AllCards.json"}}
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.
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 is the file type extension for the image files that CGS downloads for each individual Card.
When defining a Card in AllCards.json or AllSets.json, cardImageFileTypeIdentifier is the Card:Property that overrides the cardImageFileType for this Card. If
cardImageProperty is the Card:Property which points to the image for this Card. If
cardImageUrl is a parameterized template url from which CGS downloads card image files if
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.
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.
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
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 defines the name keys for Card:Propertys. The values should be mapped in AllCards.json or AllSets.json.
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.
Cards will be rotated
When defining a Card in AllCards.json or AllSets.json, you can set
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
If cardSetIsObject is set to true,
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.
If cardSetInList is set to true, Cards will be duplicated for each Set in
If cardSetsInListIsCsv is set to true, Cards will be duplicated for each Set found in the comma-separated list of
cardSize indicates a card's width and height in inches.
cgsGamesLink is a clickable url that will take the user directly to this game on the CGS Games website, which can be shared between users.
copyright indicates the legal owner of this Card Game. CGS will display this value in the bottom-left corner of the Main Menu.
When saving or loading a deck with
When saving a deck as txt, different Cards may share the same name, and if they do, the Card:
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:
deckPlayCards indicates cards that should automatically be played when a player loads a deck in Play Mode.
CGS will go through each DeckUrl and save the data from DeckUrl:Url to 'decks/DeckUrl:Name.
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.
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 is the file type extension for the image files that CGS downloads for each game board.
CGS will go through each GameBoardUrl and save the data from GameBoardUrl:Url to 'boards/GameBoardUrl:Id.
gameCardRotationDegrees indicates how many degrees to rotate Cards in Play Mode.
If possible, CGS will take the gameDefaultCardAction when a Card is double-clicked in Play Mode.
gamePlayDeckName is the name of the card stack shown when a player loads a deck. If
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 will appear in the Play Area in Play Mode.
gameStartDecks indicates decks that should automatically be loaded when a player starts playing in Play Mode.
gameStartHandCount indicates how many cards are automatically dealt from a loaded deck to a player's hand.
gameStartPointsCount indicates how many points are automatically assigned to each player.
playMatImageFileType is the file type extension for the image file that CGS downloads from playMatImageUrl.
If playMatImageUrl is a valid url, CGS will download the image at that url and save it as PlayMat.
playMatSize indicates the width and height in inches of the play area in Play Mode.
playMatGridCellSize indicates the width and height in inches of each cell in the play area in Play Mode.
rulesUrl should link to this game's online rulebook.
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.
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.
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.
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.
If setDataIdentifier is set to a non-empty string, AllSets.json will be parsed as a JSON object: {"@setDataIdentifier":{"$ref":"AllSets.json"}}
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.
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.
Definitions
The id of the card back
The url from which to download the card back
The name of the property: This name can be referenced to lookup a Card's property
The type of the property
The name of the property as it is displayed to the end user
The value to display if the value is null or empty
List
If this property is a stringList or stringEnumList, the value will be delimited by this delimiter
If the Card is a back Face: This name can be referenced to lookup a Card's property
If the Card is a front Face: This name can be referenced to lookup a Card's property
CGS will automatically play the Card that matches cardQuery, when the player loads a Deck in Play Mode matching deckQuery
CGS will automatically play the Card that matches cardQuery, when the player loads a Deck in Play Mode matching deckQuery
Indicates the played Card's position in inches
Indicates the played Card's rotation in degrees
The name of the deck
An optional path that can be used to override the url. See @cgs.json#/properties/allDecksUrlTxtRoot
The url from which to download the deck
Optionally set to false to ignore this deck url
Refers to a Property:Name in
Dictionary with string key-value pairs
A group of extra cards is displayed together with this label in Play Mode
Refers to a Property:Name in
If Card:Properties[ExtraDef:Property] equals ExtraDef:Value, then that card will be moved from the main deck to this extra deck
When a deck is loaded in Play Mode, any card with Card:Id = Card will cause Boards to be put into the play area.
The id of the board
The url from which to download the board image
When a Card enters the Game Play Zone, the Card will display this face
If possible, CGS will take the defaultCardAction when a Card is double-clicked in the Game Play Zone. If null, defaults to
Indicates the Game Play Zone's position in inches
Indicates the Game Play Zone's rotation in degrees
Indicates the Game Play Zone's width and height in inches
The Game Play Zone type from area, dice, horizontal, or vertical