Baseball & Cricket Card Games

STILL A PROTOTYPE, TEN YEARS LATER!


This is a prototype web application which plays a card game designed to imitate the statistical characteristics of a real sport. The game is being rewritten using JavaScript, to replace 10 year-old Java code, and to accomodate mobile browsers.

Play the game. Click here to play:

This starts up with a short game that scores like cricket. Use the popup menu to select other games as they are available. The current available games are baseball, tennis, test cricket, limited overs (odi) cricket, and volleyball. In these games, each player (pitcher/bowler and batter/batsman) gets 3 cards drawn from a special deck. Players alternate playing cards (starting with the pitching/bowling player) until an outcome for a pitch/delivery is determined. The current "state" of a trick starts out as "Pitch'/'Bowl" and is altered by each card that is played. The next state is determined by matching the left-hand column of the played card with the current state and reading the next state from the right hand column. When a terminal state is reached, it implies some real action that is carried out in the game. After each terminal state is reached, and the game situation is updated, all used cards are redealt and the next trick is played.

Background

Why did I invent this game? This game was written to help facilitate the design of a real card game, to be played in the low-tech fashion that many people still find appealing and fun. Several ingredients came together for me in 1996 to suggest the idea for this game. I love sports and card games, especially those with finely crafted rules such as baseball and whist. I also enjoy mathematics in general, and I like to view those pastimes using statistics and game theory. When one of my children was six, I discovered that he was able to play the card games war, whist, and almost any simple trick taking game. And I realized that it was possible to design a card game that merged these interests: I could use game theory to construct a game to imitate the rules and statistical patterns of baseball, with some depth that an adult could appreciate, but it would play like whist, so that even a child could play it.

My first attempts at a baseball simulation game used a standard 52-card deck, with only a few cards per hand. Players alternated playing cards from their hand according to "follow-on" rules, which say how to interpret the result of each card played. To achieve realism, when each card is played, it has to be associated with some on-field event. But I could find no simple way to do this with any kind of statistical fidelity to baseball. At that point, I decided to design my own deck of cards, and to make the follow-on rule as simple as possible. As you will see, the rules do not restrict which card can be played, and each card itself says how it is interpreted when it is played.

The rationale. There is some rationale behind modelling sports as a trick taking game. In many sports, players or teams alternate their actions, each time responding to the actions of the opponent. In the card game, this is modelled as the alternating of playing cards, each time playing on previous discard of the opponent. Also in sports, and critical to competition, teams or players have differing strengths, which determines how well they can execute their desired actions, and which they must adapt to in order to make the best of it. In the card game, this is modelled by the strength of cards that the player is holding.

Game engineering. The resulting game is so general that I am able to imitate a wide variety of games, just by changing certain parameters. After tuning the baseball game, I added cricket, allowed for game parameters to be changed (like number of outs and innings), and then for something completely different I wrote tennis and vollyball. Even sports that do not have obvious alternating plays, like basketball, could also be modelled by breaking them down into "fictional" turns, like dribble, pass, shoot, etc. And I have also found that it can be fun to make up a game that is completely abstract and unrelated to any sport.

Whether modelling a real game or making up a new one, the game engineer needs to think about how the game should proceed. For example, it is not interesting to play a very long game in which no player is able to score. One should begin with the desired outcomes and their desired frequencies, and build up a bipartite graph that has these as terminal nodes. The desired frequencies are obtained by setting transition probabilities on the graph. And finally, by simulating play, the desired transitionn probabilities can be achieved by setting the composition of the deck of cards, which specify how the graph is to be traversed.

Is this a sport? This may seem unrelated, but I have given some thought to the meaning of human sport, and since this game was inspired in part by my interest in sport, I would like to describe some of my opinions. To begin with, let me propose a definition. Sports are the modern organized human behavior that developed from primitive play. To understand how this charactarizes sports, one needs to understand what primitive play is and why it evolved. Primitive play can be seen in many species and in virtually all mammals. It involves executing behaviors that are essential to survival but done in situations where the outcome doesn't really matter. For this reason, primitive play may involve a mock prize or it can be noncompetitive as in "showing" play. It is reflected in competitive sport that assigns a winner, such as a foot race, as well as participatory sport in which the object is to correctly perform an activity, such as sky diving. In our species, those skills which have become enshrined in an organized sport may no longer be central to individual or human survival. But nevertheless, they were at one time critical, and we have evloved a genetic disposition to enjoy these activity.

The essential component of primitive play, and therefore sports, is that it involves skills that were essential to the survival of the individual or the species, and those are not necessarily athletic. Take for example games like Nine Men's Morris and Chess. They are strategy games that involve no athletic skill, yet some have considered them to be sports. And viewed as games of positional occupation, they share common ground with many positional athletic games, such as polo or basketball. In my opinion, any intellectual exercise can therefore be viewed as a sport. And more, strategy games played against a computer can be viewed as kinds of intellectual sports, leaving aside the question of whether the computer can be viewed as a competitor.

Description of the game.

This is a card game in which players alternate playing cards from their hand. Most of the rules that govern play are parameters of the game. This includes the information on each card and the proportion of each type of card in a deck, the number of cards dealt at the beginning of a hand, the number of cards at which a player can draw a new hand, and the complete system of scoring.

Game state. At any moment in the play of a hand there is a game state, beginning with a fixed initial state at the start of a hand. Each card contains a list of playable states and for each of these states it identifies a successor state which will result if that card is played in that state. A card is playable in the current state only if it lists the current state as a playable state. Thus a hand consists of a sequence of states determined by the cards that are played until an unplayable state is reached, called a terminal state. The terminal state usually has an interpretation as conferring a score to be accumulated to one of the players.

Game situation. Another paramater of the game is the complete set of rules that determine how the possible terminal states update the overal game score and situation. The game situation is usually more general than a simple numeric per-player score, but it is crucial in determining how terminal states are scored.

For example, suppose in the baseball scored game the situation is this: bottom of the third, a runner on third base and no outs. Then a terminal state, such a long fly ball, would result in the runner scoring, and a new situtation: bottom of the third, no runners on base and one out. But if there had been two outs, the runner would not score and the new situation puts the other player up to bat in the top of the fourth with no runners on and no outs.

Cards. To describe the contents of each player's cards, a list of playable states is given. For each of the playable states, a list of the possible successor states is also given, and the frequency of those successor states in a randomly drawn card. Because players choose which card to play from their current hand, they will tend to play the cards that give the successor state that is most favorable to them. As a result, it will rarely occur that a successor will be chosen with the same frequency that it appears in the deck.

Built-in scoring rules. Several types of scoring systems have been implemented, including baseball and cricket. In order to to take advantage of these scoring rules, cards must be designed with terminal states defined by those systems. All intermediate (nonterminal) states can be varied. The default game is the simplest to develop, it recognizes only two terminal states: "out" and a number of points scored. In this game one player is designated as offense and one as defense. The offense is allowed a specified number of outs, and all scoring terminal states are added to the current offense player's score (regardless of which player played the card). When the maximum number of outs is reached, the players switch roles, and the other player begins scoring. This can go on for a designated number of innings, which may be one or more.

Automated play. The computer uses a simple search algorithm to determine which card to play from the current hand. It does this without "peeking" at the opponents hand, but instead uses the expected frequency specified in the game parameters. It is also able to take advantage of a multi-card combination, which can be difficult for a human player to visualize. On the other hand, humans have a look-ahead advantage over the computer, which does not take into account the cards that it is likely to draw into its next hand. It is easy to design new games that are hard for the user to beat the computer.

History