Representing Board Game State — The Cards

Peter Kelley
3 min readMar 13, 2017

--

This is the second in a series of posts describing an idea for a modelling language to represent the state of any board game. Other posts in the series deal with the board, the players and the pieces.

The Cards

Cards are an important part of most games and so the boardgame state modelling language needs to have a way of representing them.

Cards are similar to the spaces described in the previous post in a number of ways. They will almost always (I can’t think of a counter example) have 2 sides, a front and a back, and each side can have properties assigned (though generally only on the front unless the card is 2 sided). For example a standard 52 card deck will have cards with 2 properties on the front, one of 4 suits and a rank within that suit, and no properties on the back.

The Card Row in Through the Ages

Cards, like spaces, can also have relationships with each other. One of the most common forms of relationships is the above/below relationship that cards have in a deck. Another type of relationship is when cards are placed in a line such as in the card row in Through the Ages.

Where cards differ from spaces is the fact that they can move around to different locations. For example in Dominion cards may be in one of a number of “buy” piles in the centre of the table, in a player’s draw deck, in a player’s hand, in a players active area or in a player’s discard deck. Cards move between these different locations during the game.

Dominion Card Stacks. Image courtesy BGG user garyjames

These locations are, in fact, spaces and so each card, as well as being related to other cards, can have a relationship to a space.

A space with multiple cards can also have properties associated with it. For example a draw deck will have one card that is “on top”. Theoretically you could determine which card was on top by searching through all of the cards in the deck and finding the one that didn’t have a related “above” card but being able to reference this card directly is such a common operation that I think that this concept warrants inclusion.

Cards also have the interesting property that the information or properties associated with them may not be “visible” to all of the players in the game. Cards in a face down draw deck are not visible to any player. Cards in a player’s hand are only visible to that player.

Card Holders Used in Ticket to Ride Asia so that Partners can Both See Cards. Image courtesy BGG user saksi.

There are even cases, such as in Ticket to Ride: Asia, where cards are visible to more than 1 player but not to all the players. Visibility of a card does not even have to be an all or nothing proposition. Cards in the game La Granja get placed under certain spaces cut out in the player boards so that only part of their information is visible.

Cards are an important part of representing boardgame state and extend the concept of spaces with concepts such as being placed in a location or space and visibility.

--

--

Peter Kelley

Working as a software architect in Canberra. Boardgamer, Husband, Father.