GGP.org Game Packaging Format

"If you want to make something old-fashioned, why not build a wooden sailing boat, or a steam engine? They're just as complicated and demanding as a mechanistic game, and you'll keep fit at the same time." (Iain Banks)

All of the games in GGP are based on GDL. But in many cases, we are interested in more than just the GDL rules of the game. We might also want a human readable name and description of the game, or a way to visualize an ongoing match, or an easy way for a human to select moves. We might want metadata that allows us to quickly identify two player games when showing choices on a website. We might want to know whether we're using the latest version of the game, or if there are bug fixes available. And so on.

For handling all of these cases, GGP.org games are packaged in a format that combines GDL rules, metadata, and other resources like stylesheets, together in a useful way. Once we've found the game metadata, we can discover what resources are available, and load the ones we need.

The first thing you'll encounter is the game metadata. This metadata is stored in a JSON object that contains facts about the game and links to resources. Some resources are required, like a game rulesheet. Other resources are optional, like a stylesheet or a human-readable description of the game rules.

The following table describes the resources fields allowed in the game metadata JSON object.

rulesheet REQUIRED The resource containing the GDL description of the game.
stylesheet OPTIONAL The resource containing an XSLT stylesheet for visualizing game states.
user_interface OPTIONAL The resource containing a JS library that lets users interact with the game.
description OPTIONAL The resource containing a human-readable text block that describes the rules of the game.
icon OPTIONAL The resource containing a small image that represents the game.

The game metadata JSON object can also contain facts about the game. The following table describes the facts that can be contained in the game metadata JSON object.

gameName OPTIONAL String The full human-readable name of the game.
numRoles OPTIONAL Number The number of available roles for players in the game.
version REQUIRED Number A non-negative integer that indicates the version number of the game resources being displayed.

Game metadata objects may have additional fields that are not defined here, but such fields must be prefixes with "x-". This ensure that they don't collide with future official fields.