Developing Games

"I made some games, but I'm pretending like I didn't because they all turned out weird." (Shigeru Miyamoto)

Games are, unsurprisingly, an essential part of general game playing. In a broad sense, general game playing involves building computer programs that can devise strategies and carry out plans to accomplish goals. Games provide an environment with goals, and with choices that must be made while trying to achieve those goals. Our computer programs would be listless and unhappy without games. So it's up to us to give them games to play.

Game Description Language

Games are written in a logic language called the Game Description Language (GDL). We use the GDL to describe which facts are true at each state of the game; how those facts determine which moves--if any--a player can make; and how the facts of the game state change when players make moves. For the official language spec, please see the most recent official writeup. I also highly recommend this blog post which provides more details, examples, and discussion of GDL.

Writing Game Rules

I defer to this blog post on writing new games, and this blog post on optimizing existing games.

Packaging Games in Repositories

Games aren't just rules: they have names, instructions, visualizations, user interfaces, contact information for their authors and maintainers, and so on. And nobody's perfect, so occasionally old rules will turn out to be broken or unfair, and a new version of the rules will be developed to supersede them. And if many people are all comparing their results on a particular game, it's useful for them to have a universal identifier for that game which they can use to refer to it, and distinguish it from other similar games in the same family. All of this is managed by "game repositories."

Game repositories are servers containing collections of packaged games. Packaged games start with a metadata object, which contains simple information like the name and version of the game, as well as links to files containing essential game content: the rules, the instructions, the visualizations, the user interfaces, and so on. More details about these packages can be found in the game package format spec. Want to know what games are available from Read about game services, or just explore the available game repositories and see what's inside.

Many of the game validation tools in GGP Base depend on having your game properly packaged and hosted on a game repository. This is easy to set up: just create a folder for your game in the "games/games/" directory, put the rulesheet in that directory, and create a file called METADATA that includes the game name and points to the rulesheet. This will add your game to the local game repository. See the existing versions of Connect Four and Tic-Tac-Toe that are already in this repository as examples. Note that the name of the folder should be a simple alphanumeric identifier like "connectFour"; the full name of the game (e.g. "Connect Four") should be in the METADATA file with proper capitalization and spacing.

Validating Games

Once your game has been added to the local game repository, you can run the Validator app, select the "Local Game Repository" as your source of games, and choose your game from the list. This app will run a number of validation steps to identify any possible problems in the game. For example, if the game has a state where a player doesn't have any legal moves, but the game isn't over, that's a validation error: that will never happen in a well-formed game. Likewise, if a game has states where the game is over but a player isn't assigned a score, that's another validation error. The Validator app isn't guaranteed to find all validation errors, but you should fix any errors that it does find.

Developing Excellent Games

I highly recommend the article Defining the Abstract when thinking about how to develop excellent games for general game playing.

Publishing Games

For now, contact us directly to publish your games into the base game repository. An automatic way to do this is being developed, but isn't ready for use yet.