The Nature of my Game

I watched with glee while your kings and queens
fought for ten decades for the gods they made.

On October 19th, 1453 the French army entered Bordeaux. The province of Gascony, with Bordeaux as its capital, had been a part of England since the marriage, in 1152, of Eleanor of Aquitaine to the soon-to-be King Henry II of England. Between 1429 and 1450, the Hundred Years War had seen a reversal of English fortunes and a series of French victories which began under the leadership of Jeanne D’Arc and culminated in the French conquest and subsequent control of Normandy.

Following the French victory in Normandy, a 3 year struggle for the control of Gascony began. As the fight went on, it saw dominance shift from the English to the French – and then back again after the arrival of John Talbot, earl of Shrewsbury. Eventually Talbot succumbed to numbers and politics, leading his army against a superior French position at Castillon on July 17th of 1453. He and his son both paid with their lives and, with the defeat of the English army and the death of its leadership, the fall of all of Gascony and Bordeaux inevitably followed before the year’s end.

The Battle of Castillon is generally cited as the end of the Hundred Years War, although the milestone is considerably more obvious in retrospect than it was at the time. The English defeat did not result in a great treaty or the submission of one king to another. England simply no longer had control of her French territories, save for Calais, and in fact never would again. Meanwhile, the world was moving on to other conflicts. The end of the Hundred Years War, in turn, is often cited as a key marker for the end of the (Late) Medieval period and the transition to the (Early) Modern period. Another major event of 1453, the Fall of Constantinople, is also a touchstone for delineating the transition to the modern world. Whereas the Hundred Years War marked a shift from the fragmented control by feudal fiefdoms to ever-more centralized nation states, the Fall of Constantinople buried the remains of the Roman Empire. In doing so, it saw the flight of Byzantine scholars from the now-Ottoman Empire to the west, and particularly to Italy. This produced a symbolic shift of the presumptive heir of the Roman/Greek foundations of Western Civilization to be centered, once again, on Rome.

The term “Renaissance” refers to the revival of classical Greek and Roman thought – particularly in art, but also in scholarship and civics. Renaissance scholarship held as a goal an educated citizenry with the skills of oration and writing sufficient to positively engage in public life. Concurrent to the strides in the areas of art and architecture, which exemplify the period, were revolutions in politics, science, and the economy. The combination of the creation of a middle class, through the availability clerical work, and the emphasis on the value of the individual, helped drive the nail into the coffin of Feudalism.

The designer for the boardgame Pax Renaissance references 1460 as the “start date” for the game, which lasts through that transitional period (roughly 70 years). Inherent in the design of the game, and expounded upon in the manual, is the idea that what drove the advances in art, science, technology, and government was transition to a market economy. That transition shifted power away from the anointed nobility and transferred it to the “middle class.” The game’s players immerse themselves in the huge changes that took place during this time. They take sides in the three-way war of religion, with Islam, Catholicism and the forces of the reformation fighting for men’s souls. The game simulates the transition of Europe from feudalism to modern government; either the nation state empires or the republic. Players also can shift the major trade routes, refocusing wealth and power from the Mediterranean to northwestern Europe.

Technically speaking, I suppose Pax Renaissance is not a boardgame, because there is no board. It is a card game, although it stretches that definition as well. Some of the game’s cards are placed on the table to form a mapboard of Europe and the Mediterranean, while others serve a more straight-forward “card” function – set down from the players’ hand onto the table in front of them. The game also has tokens that are deployed to the cards and then moved from card to card (or perhaps to the space between cards.). While this starts to resemble the more typical board game, if you continue to see the game in terms of the cards, the tokens can be interpreted to indicate additional states beyond the usual up-or-down (and occasionally rotated-sideways) that cards convey.

Thinking about it this way, one might imagine that it drew some of its inspiration a card game like Rummy – at least the way I learned to play Rummy. In that variant, players may draw from the discard pile, with deeper selections into the pile having an increased cost (of holding potentially negative-point cards in your hand). Once collected, cards remain in the hand or are played in front of the player. Of course, this doesn’t really map one-to-one. A unique point in Pax Renaissance is that there are no secret (and necessarily random) draws directly to the players’ hands. Instead, new cards are dealt into the “market,” the openly-visible and available pile, usually to a position that is too expensive to be accessed immediately, giving all players visibility several turns in advance.

Thus the game has no random component, assuming that one allows that the differing deck order (and content – not every card is used in every game) could be thought of as different “boards” as opposed to a random factor. So rather than a checkers or a chess with its square grid, it is a version where there are many 1000s of variations in the board shape and initial setup. Stretching the analogy to its breaking point, that variable board may have also a “fog of war,” as the playing space is slowly revealed over the course of the game.

I don’t actually mean to equate Pax Renaissance with Rummy or chess, but rather to establish some analogies that would be useful when trying to develop a programmed opponent. The game is the third in a “Pax” series from the designer, and can easily be seen as a refinement to that system. Theme-wise, it is a follow-on to his game Lords of the Renaissance from 20 years earlier. That title is a far more traditional map-and-counter game on the same subject, for 12 (!!!) players.

However, I’d like to look at this from an AI standpoint, and so I’ll use the comparison to checkers.

Since the “board” is revealed to all players equally (albeit incrementally) there is no hidden knowledge among players. Aside from strategy, what one player knows they all know. Given that factor, one supposes that victory must go to the player who can think more moves ahead than their opponents can.

I recently read an article about the development of a checkers artificial intelligence. The programmer in this tale took on checkers after his desire to build a chess intelligence was made obsolete by the Deep Blue development efforts in the early 1990s. It was suggested to him that he move to checkers and he quickly developed a top-level player in the form of a computer algorithm. His solution was to attack the problem from both sides. He programed the end-game, storing every possible combination of the remaining pieces and the path to victory from there. He also programmed a more traditional look-ahead algorithm, starting from a full (or nearly so) board and analyzing all the permutations forward to pick the best next move. Ultimately, his two algorithms met in the middle, creating a system that could fully comprehend every possible move in the game of checkers.

Checkers, as a target game for the development of AI, had two great advantages. First, it is a relatively simple game. While competitive, world-class play obviously has great depth, most consider a game of checkers to be fairly easy and casual. The board is small (half the spaces, functionally speaking, as chess) and the rules are very simple. There are typically only a handful of valid moves given any checkers board setup, versus dozens of valid moves in chess. Secondly, the number of players is large (who doesn’t know how to play), and thus the knowledge about what strategies to use is known, even if not quite as well-analyzed as with Chess. Thus, in a checkers game an AI can begin its work by using a “book.” That is, it uses a database of all of the common and winning strategies and their corresponding counter-strategies. If a game begins by following the path of an already-known game, the programmed AI can proceed down that set of moves.

At least until one player decides its fruitful to deviate from that path.

After that, in the middle part of the game, a brute force search can come into play. Note that this applies to a programmed opponent only until the game is “solved”, as described in the article. Once the database has every winning solution from start to end, a search over the combinations of potential moves isn’t necessary. But when it is used, the AI searches all combinations of moves from the current position, selecting its best current turn move based on what the (human) opponent is likely to do. At its most basic, this problem is often considered with a minimax algorithm. This is an algorithm that makes an assumption that, whatever move you (thinking of yourself as the algorithm) make, your opponent will counter with the move least advantageous to you. Therefore, to find the best move for yourself, you alternately search for the best move you can make and then the worst move your opponent can make (the minimum and then maximum ranked choices) to determine the end state for any current turn move.

Wikipedia has a description, with animated example, of how such a search works using a technique to avoid searching fruitless branches of the tree. That inspired me to take a look at Pax Renaissance and do a similar evaluation of the choices one has to make in that game.

 

A smallish example of an animated game tree.

I’m following the color coding of the Wikipedia example, although in the above screenshot it’s not as clear as it should be. First of all, not everything is working correctly. Second, I took a screen shot while it is actively animating. The coloring of the nodes is done along with the calculations and, as the tree is expanded and/or pruned, the existing branches are shifted around to try to make things legible. It looked pretty cool when it was animating. Not quite so cool to watch once I upped the number of nodes by a factor of ten or so from what is displayed in the above diagram.

I’m assuming a two-player game. The actual Pax Renaissance is for 2-4 players, but initially I wanted to try to be as much like the “textbook” example as I could. The coloring is red for a pruned/unused branch and yellow for an active or best branch. The cyan block is the one actively being calculated, and the blue means a block that his been “visited,” but it has not yet completed evaluation. The numbers in each block are the best/worst heuristic at the leaf of each branch, which is four plies down (two computer turns and two opponent turns). Since at each layer the active player is assumed to choose the best move for them, the value in a circle should be the lowest value of any square children and the square’s should the highest value of any circular children.

The value is computed by a heuristic, potentially presenting its own set of problems. On one hand, the heuristic is a comparison between the two players. So if the computer has more money, then the heuristic comes out positive. If the opponent has more money, then the heuristic comes out negative, with that value being the difference between the two players’ bank accounts. In that sense, it is much easier than, say, positional elements on the chess board, because each evaluation is symmetrical. The hard part is comparing the apples to the oranges. A determination is needed much like the “points” assigned to pieces in chess. Beginning chess players learn that a rook with worth 5 pawns. But how much is a “Coronation Card” worth in florins? Perfecting a search algorithm means both getting the algorithm working and implementing that “domain knowledge,” the smarts about the balance among components, within the mathematical formulas of the search.

As I said, this was an early and simple example.  To build this tree, I assumed that both players are going start the game being frugal in their spending, and therefore use their first turn to buy the cheapest two cards. A the turns advance, they look at the combinations of playing those cards and buying more. Even in this simple example, I get something like 4000 possible solutions. In a later attempt (as I said, it starts looking pretty cluttered), I added some more game options and produced a tree of 30,000 different results. Remember, this is still only two turns and, even within those two turns, it is still a subset of moves. Similar to chess and checkers, as the initial moves are complete, the number of possibilities grows as the board develops.

At this point, I need to continue building more complete trees and see how well and efficiently they can be used to determine competitive play for this game. I’ll let you know if I find anything.

Leave a Reply

Your email address will not be published. Required fields are marked *