The Magistrates Mod for Carcassonne

This is an example term paper for course CS/ArtS 107: Creating Games at Williams College. It is intentionally a collage of different analysis techniqu...
1 downloads 0 Views 870KB Size
This is an example term paper for course CS/ArtS 107: Creating Games at Williams College. It is intentionally a collage of different analysis techniques; a real paper would more likely use a restricted set.

The Magistrates Mod for Carcassonne Morgan McGuire, April 1, 2011 across multiple tiles. Immediately after he or she places a tile, that player claims at most one unclaimed feature that at least partly covers that tile by placing a follower on it.

Abstract This paper analyzes our proposed rules modification called The Magistrates for the Carcassonne [2000] board game. The goal of The Magistrates is to increase strategic gameplay of Carcassonne without disturbing its primary tile-laying mechanic and balance of cooperation and competition.

A feature is completed when it can no longer be expanded, even if the ideal tiles were available. A city is completed when its boundary is closed. A road is completed when it terminates at an intersection at both ends. A cloister is completed when surrounded by eight tiles. Completion is irrelevant for farms because of the scoring system.

There are several published expansions for the basic Carcassonne rules. The River, The River II, Builders & Traders, The Mini Expansion, and Inns & Cathedrals primarily expand existing gameplay with new tiles. The Magistrates is compatible with these and the analysis is essentially unchanged. King and Scout, The Count, The Cathars, The Princess and the Dragon, The Tower, and Abbey and Mayor expansions add significant new mechanics that are largely compatible with The Magistrates, however this analysis is incomplete in the presence of those mechanics.

Upon completion, and at the end of the game, points are awarded to the player with the most followers on that feature. In the event of a two- or multi-way tie for ownership, all tying players receive full points. Note that multiple followers often end up on the same feature despite the restriction from the previous paragraph. This is because disconnected, independently-claimed features are often later connected by additional tiles. The primary tactic in the game is to add followers to attractive features despite existing ownership by placing a new piece of the same feature type at a diagonal to the target feature, claiming the new piece, and then connecting the two disconnected pieces on a subsequent turn. When a feature is scored, all followers on it are immediately removed. The point value of each feature is given in Table 1.

1 Carcassonne 1.1

Original Game Rules

The unmodified, 3rd edition1 of Carcassonne is a tile-laying game for 3-5 players. The game state comprises: • A finite, non-renewable draw pile of square tiles whose distribution but not order is known to the players • A set of pawns for each player, called followers • The current board arrangement of tiles, some of which are labeled with followers • The current score for each player On his or her turn, each player draws the next (or equivalently, a random) tile and then places it adjacent to an existing tile on the board. Illustrated on the face of each tile are pieces of features that are cities, roads, cloisters, or the farmland between them. Some city pieces are additionally labeled with shields. Players are required to place tiles so that the features at each edge match adjacent tiles, much like Dominoes (in the event that it is impossible to place the drawn tile it is exchanged for another random tile; this is an extremely unlikely event.) A given feature contains only the currently connectπed pieces, even though it is often likely that a nearby feature of the same type will later become connected to it by the placement of additional tiles.

Feature

Upon Completion

At Game End

City

2/tile + 2/shield

1/tile + 1/shield

Road

1/tile

Cloister

9

1 + 1/adjacent tile

Farm

Not scored; followers are never returned

3/completed city feature bordering the farm

Table 1. Original point awards for features. City scoring changed between editions; in the 1st and 2nd editions, two-tile cities were worth half as many points as three- or more-tile cities. The farm scoring rules changed substantially since the first edition of the game [Wikipedia07, Povilaitis07]. We agree with the developer that the current 3rd edition rule is the best one for game balance. It brings the value of farms to approximately the same as cities in terms of points per follower in the mid-game. Moreover, it is substantially easier for players to perform the end of game accounting under this rule since followers can be removed immediately after a farm feature is scored to prevent accidental double- or under-counting.

A feature is said to be unclaimed if there are no followers placed anywhere on its pieces, which are potentially spread 1

These are the “German rules,” which as of this writing are the latest produced by the developer and published by Hans im Glück. The English edition published by Rio Grande games did not update because employee Jay Tummelson felt that “having two versions adds confusion.” [Povilaitis07].

1/7

1.2

Tile Distribution

The tile distribution for the original game is as follows (pictures and numbers from [Williams2007]):

1

3

1

1

3

2

3

4

2

3

3

3

4*

4

1

9

8

5

1

2

2

2

Table 2. Tile distribution.

3

Note that each tile may be rotated when played. The tile marked with the * is the starting tile. It is placed before the first player’s turn and cannot have a follower on it.

2

2/7

ply of perfect play from winning. Here, x is the number of ply that a player can “trivially look ahead.” A choice is meaningful if it is not trivially bad.

There are 72 tiles total. The percentage of tiles with each type of feature is listed in Table 3. These numbers sum to more than 100% because most tiles contain multiple feature types. Feature City Road Cloister Farm

Number of Tiles 44 42 6 71

We define strategic complexity as the number of meaningful decisions in the entire game’s decision tree. For example, a 50-ply game where there are no choices has zero strategic complexity, a 10-ply game with two meaningful choices per ply has strategic complexity of about 210. Shannon [1950] estimated the game tree complexity of Chess to be at least 10123, but many players can probably look ahead at least two ply and determine that some of those moves are trivially bad, so this (lower) bound is probably too large for strategic complexity. More usefully, Allis [1994] estimated the branching factor at 35 and the average game length at 80 moves. Perhaps only 20 or so of those 35 choices are meaningful (e.g., one often cannot touch a piece that is guarding the king), giving a strategic complexity of around 10104. Since the exact value of strategic complexity depends on how far the player can see ahead and can only be loosely bounded because the decision tree branching factor changes at each vertex, we only use this concept to show that holding everything else constant a specific rule change increases or decreases the complexity by affecting every vertex of the tree in the same manner.

Percentage 61% 58% 8% 99%

Table 3. Feature distribution.

2 The Magistrates Rule Changes The Magistrates introduces three major rule changes (see also the appendix): 1.

Random tile distribution At the start of each game, a random subset of tiles are removed from the draw pile and not revealed. Communal tile hand A player selects the tile to play from a communal face-up “hand” of three tiles instead of from the draw pile. This hand is replenished with a random tile from the draw pile at the end of each move. Adjusted point awards Points are awarded as shown in Table 4.

2.

3.

Feature City* Road* Cloister Farm

Upon Completion

At Game End

2/tile + 2/shield

1/tile + 1/shield

2/tile

1/tile

9

1 + 1/adjacent tile

Not scored; followers are never returned

3/completed city feature bordering the farm

3.2

There are two reasons that we chose to remove a random subset of the original tiles. The first is that it increases engagement (and to some extent, fairness) by relieving players of the burden of tracking the distribution of undrawn tiles at the end of the game. In the unmodified game, in the endgame it becomes critical to know what tiles are still available to be drawn. For example, if a city has a hole that can be closed by a single kind of piece, knowing whether that piece is available dramatically changes strategy between fighting over and abandoning the city. Players can see all played tiles and know the original tile set, so they can count the played tiles to determine the probability (and critically, whether it is non-zero) of drawing any particular tile. Like card-counting, this process is tedious, and forces players to choose between playing in an engaging manner and playing in an optimal manner. Removing tiles without revealing them at the start of the game reduces the viability of the counting strategy, so there is less tension between in-game and out-of-game optimal choices. Of course, knowing that certain tiles do not exist at all and which tiles have high probability is always a useful guide during play, but it is no longer critical.

* Completed 2-tile roads and cities are worth half points

Table 4. Modified point awards for features. As The Magistrates is an English release, some players may also consider the switch to German 3rd edition rules as an additional change. We feel that Wrede’s rule changes were well-justified and do not analyze them further. See [Povilaitis2007, BoardGameGeek2007] for discussion.

3 Analysis 3.1

Random Tile Distribution

Definitions

A ply is one player’s move. In an N player game, a round is N ply.

The second reason to remove tiles is to shorten the game length. A Carcassonne game’s length is limited by the number of tiles, since play ends when the draw tiles are exhausted and there is no way for players to restock the

An x-trivially bad move is one that allows another player to win within x ply of perfect subsequent play, or one that prevents a player who could have won within x 3/7

draw pile or delay the game. Except for the last two turns, when it viable to exhaustively search the game tree to the end, most play in Carcassonne must be heuristic (due to the randomness) and turns take approximately constant time. Furthermore, there is negligible setup and cleanup time for the game. Therefore the game time is shortened approximately the proportion of tiles that are removed, allowing players to select their own game time. See section 3.5 for a discussion of the net play time taking other aspects of the mod into account.

3.3

the new tile can go in front of A, in between A and B, or after B. So there are three locations at which to insert the third tile. All m insertions produce the same net hand, we should therefore multiply the denominator by m. This logic follows for each m, so for an h-tile hand there are:

" t %" t −1%" t − 2 % " t − h + 1% U(h) = $ '$ '$ '$ ' # 1&# 2 &# 3 & # h & " t −1+ 1%" t − 2 + 1%" t − 3 + 1% " t − h + 1% = $ '$ '$ '$ ' # 1 &# 2 &# 3 & # h &

Number of Unique Hands

unique hands. The second row is a strange way of writing the product. The reason that I wrote it that way s is to reveal the pattern of each factor. When multiplying a series of factors that follow a pattern, there is a mathematical shorthand, analogous to the summation pattern. Summation uses a large sigma, which is the Greek equivalent of “s” for “sum.” For a product we use a large pi, which is the Greek equivalent of “p” for “product.” In this notation, the general form of the number of unique hands is:

Let U(h) be the number of unique hands that can be made from a hand with h tiles when drawing from a set of t tiles. This is an interesting quantity because € the number of play scenarios is the product of the number of unique hands and the number of unique board situations. Understanding how the number of unique hands changes as we increase h helps us to understand how replay ability increases with hand size. For simplicity, assume that all tiles are unique. In practice, there are about two repeats of each tile and the straight road has eight repeats, so our evaluation of U will be an upper bound.

h

U(h) = ∏ i=1

This can also be written using factorial notation as

3.3.1 Derivation Normally a scientist or analyst derives the result “forwards” as is shown here, and then, once the answer is known, proves it “backwards” as is shown in the following section. This saves space in the final publication (since the proof is often shorter) and makes the author really smart, since it is rarely obvious how the proof is going to work until you reach the end. For your own analysis you can choose either method, or include both.



U(h) =

1 t! , ⋅ h! (t − h)!

which you may recognize from a previous probability class as “t choose h” divided by the number of € of h tiles. permutations

3.3.2 Proof

For a two-tile hand there are t possibilities for the first tile and t-1 possibilities for the second tile, so there are t(t -1) pairs that can be drawn. However, the order in which the tiles were drawn does not matter once they are in the hand. For example, the pair “road”, “city” is the same as “city”, “road”. So we should only count half of the combinations, giving U(2) =

t − i +1. i

Theorem: the number of unique h-tile hands drawn from a set of t unique tiles is h

U(h) = ∏ i=1

t(t −1) 2

t − i +1. i

eq. 1

Proof (by induction): There are t ways € of choosing a single tile, so U(1) = t.

unique 2-tile hands. Expand

€ As we expand the hand with more tiles we are simply multiplying the numerator by (T-2), and then (T-3), and so on as the number of available tiles to choose from in the original set shrinks. But as we increase the size of the hand we are also creating many duplicate hands. For example, the hand with tiles ABC is the same as ACB and CAB (and three other combinations). When we add the mth tile to the hand, there are m different places to put it. For example, if our hand already contained AB,

the

last

factor

h

U(h) = ∏ i=1

eq. 1 as follows:



4/7

off

t − i +1. i

h

U(h) = ∏ i=1

the original game. Therefore the branching factor increases by a factor that is bounded below by 1 and bounded above by h.

t − i +1 i

$ h−1 t − i + 1'$ t − h + 1' U(h) = & ∏ ) )& i (% h ( % i=1 $ h−1 t − i + 1'$ t − (h −1) ' U(h) = & ∏ ) )& ( i (% h % i=1 Let h = m+1. The previous equation can thus be rewritten as €

The first tile in the game is fixed to be one which contains a city edge, two road edges, and one farm edge (see Table 2 ) Therefore at the first decision tree vertex any tile is valid. There is nonzero probability of drawing at least two different tiles for the first hand, so for some games the number of meaningful choices at the first move is at least doubled for any size of hand. Thus the complexity must strictly increase when we increase hand size.

$ m t − i + 1'$ t − m ' U(m + 1) = & ∏ ) )& i (% m + 1( % i=1 h

Assume that U(h) = ∏ t − i + 1 .

i for€h = m, so that this simplifies to: t−m. U(m + 1) = U(m) m +1 €

3.4.2 Practical Observations Increasing game tree complexity is not the same as increasing strategic complexity, although they usually increase together. With a hand players have the ability to see farther ahead in the game, since they know that at least h-1 of the current tiles will be available to the next player, at least h-2 available to the player after that, and so on. In a few cases this decreases complexity, since the players are able to trivially reject certain choices (e.g., “if I don’t play this diagonal city tile elsewhere, the next player will use it to bring his follower into my city.”) that otherwise would have remained viable because the future draws were more unknown. In our experience, it appears to increase the number of meaningful choices by about a factor of (h + 1) / 2. This is because only about half of the tiles in the hand are actually useful at any time. There are duplicate tiles in the hand and some that remain in the hand because all players consistently reject them. When a high-value tile (e.g., the one needed to bring a player in or shut a player out of a large feature) appears, it is almost always is played immediately to either seize the advantage or deny it from another player.

eq. 1 holds

i=1

Now we need only show that the factor on the right represents the multiplicative increase in the number of unique€hands when adding one tile to a hand. Extending the m-tile hand to contain a total of m+1 tiles involves drawing a tile from the remaining set and inserting it. The number of potential hands is thus increased by a factor of the t – m ways of drawing a new tile and decreased by a factor of the m+1 locations at which that tile can be inserted, so the number of hands is increased by a factor of t−m. m +1 We have shown that the theorem holds for U(1) and for U(m+1) assuming that it holds for U(m), so by the € the theorem holds for all non-negative induction axiom integers.

3.4

We chose h=3 independent of the number of players. There were many informal reasons for this that quickly became evident after playtesting several variations. The original game can be thought of as h=1. With h=2 there is often one tile that is slightly more useful and the other remains for several rounds. It is also hard to collaborate effectively with other players for using the tiles at this size of hand; with h=3 and above a player knows that a current ally (in a specific feature) will pick up one of the tiles if it is to their mutual advantage and can thus play a different one more selfishly.

Strategic Complexity

Not all proofs require mathematical notation or formal language. The following is a simple proof that relies only on logic.

The Magistrates has increased strategic complexity and less variance than the original Carcassonne.

3.4.1 Complexity Proof Theorem: A hand of size h > 1 strictly increases game tree complexity over the unmodified game.

As h grows beyond 3 the Carcassonne gameplay begins to break down. The number of duplicates becomes ridiculous and also there is no randomness because there are too many tiles available. The large number of choices forces players to either take sub-optimal moves or to think for longer than is practically engaging for everyone at the table.

Proof: If all tiles were unique, then an h-tile hand would provide a branching factor that was h times larger than the unmodified game. Even taking duplicate tiles within a hand into account, at each vertex in the decision tree the unmodified game’s choices are still present, so a k-tile hand provides no fewer choices than 5/7

3.5

Play Time

After removing the outliers, the sample size is N = 26. The final rows of the table show the sample mean m and sample deviation s for each group. Assume that the times are normally distributed. Based on our small sample size, the 95% confidence (t = 2.060) intervals for the true population means are 19.6 < µA < 31.8 and 11.9 < µB < 22.9.

3.5.1 Per Ply We assembled two groups of four players who were not familiar with Carcassonne but who regularly played board games. We taught Carcassonne to group A and The Magistrates to group B and allowed them to each play a complete game. We then asked them to start a second game and (without their knowledge) used a stopwatch to time the duration of each ply between 10 and 40, giving 30 measurements for each. We ignored the first 10 moves because we wanted to measure the middle game; the opening is special because there is little structure yet in the game, and the end game is highly constrained.

(Note that in this section, t is the statistical distribution value and m is the sample mean, unlike previous sections where they are different integer variables.) There was clearly a decrease in play time when using The Magistrates. Is that difference statistically significant? Let

The timing data2 (to the nearest second) is given in Table 5. We have removed the two highest and two lowest values as outliers from each set of samples. These were 10, 14, 32, and 40 for Group A and 5, 10, 25, and 31 for Group B.

m s

Group A

Group B

(Carcassonne)

(The Magistrates)

23 18 25 28 23 27 26 27 30 29 32 22 23 24 25 26 22 25 26 24 27 28 29 26 28 25 25.69 2.95

18 15 16 20 19 19 23 22 20 19 18 16 14 13 16 17 17 15 15 17 16 18 19 13 22 15 17.38 2.68

m = mA - mB m = 8.31 Δ

Δ

be the difference in the means. The standard deviation associated with that difference is then sΔ2 = sA2 + sB2 sΔ = sA2 + sB2 sΔ = 3.99

Thus, with 95% confidence we can say that the true difference of the means is 0.09 < µ < 16.5. Therefore, € with 95% confidence we can say that The Magistrates takes less time per ply than unmodified Carcassonne. Δ

Note that there is the decreased time per ply despite increased strategic complexity. We attribute this to the fact that with a hand players can plan ahead. Thus the players have already considered 2/3 of their potential moves (or more, since the relevant features of the new tile may already be represented in the hand) before the turn begins. We note anecdotally that about half of the time a player chooses an existing tile from the hand, rather than a newly drawn one, so this decrease in play time is probably the time to consider only whether the new tile is better than the currently best found move. Using any kind of pruning, this allows the player to evaluate the new tile much faster because branches of the decision tree that do not appear to be leading to a higher static evaluation can be immediately cut.

3.5.2 Total Game The game contains at most 71 ply because each ply consumes one tile. Players can choose to shorten the game time by removing more tiles. The mean game time and its standard deviation are thus:

Table 5. Ply times (in seconds)

2

I just made this data up for the example paper, however it is close to the real numbers.

6/7

strategy. Instead, the reason to penalize these is that they are not in the spirit of Carcassonne gameplay as it appeals to us personally. Our goal for Carcassonne is to have players build large features and battle over control of them. Small features both discourage that kind of game play and consume valuable cap tiles that are needed to close off the large features.

mG = 71mB = 1234 2 G

2 B

s = 71s

sG = 71sB2 = 22.6 in seconds. With 99% confidence (t = 2.79), we can say that the true mean game time if using all tiles is €19.5 minutes < µG < 21.5 minutes. The original Carcassonne setup time is quoted at five minutes, so we comfortably claim “about 25 minutes” as our game time (Carcassonne claims “30-60 minutes”).

3.6

4 References [Allis1994] Allis, Victor. Searching for Solutions in Games and Artificial Intelligence. Ph.D. Thesis, University of Limburg, Maastricht, The Netherlands., 1994

Adjusted Point Awards

[BoardGameGeek07] What is[sic] the official field scoring rules?, thread on BoardGameGeek.com, http://www.boardgamegeek.com/thread/233198, viewed November 18, 2007.

The Magistrates scores roads the same as cities and reinstates the 1st edition rule penalizing 2-tile roads and cities. In the original Carcassonne, there is no risk in leaving a road uncompleted (except when the Inns & Cathedrals expansion is added) at the end game, however it is so much easier to close a road than a city that a player is constantly at risk of an opponent abruptly shutting down a road to limit its point value.

[Carcassonne00]. Carcassonne. Tile placement board game. Klaus-Jürgen Wrede, Hans im Glück (German), Rio Grande Games (English), 2000. [Povilaitis07] Povilaitis, Vitas. Carcassonne Farmer Scoring, http://www.gracefulboot.com/board_games/carcassonne_farm er_scoring.html, viewed November 18, 2007

Our motivation for scoring the roads the same as cities is simple: there are approximately the same number of tiles containing road and city features, so unless they have equal expected point value, players will avoid road tiles for city tiles. In Carcassonne this manifests as players more frequently choosing to use the city instead of the road on tiles that contain both. The effect is exaggerated in The Magistrates because players can almost completely avoid choosing roads from the hand.

[Shannon1950] Shannon, Claude. Programming a Computer for Playing Chess. Philosophical Magazine 41 (314), 1950 [Wikipedia2007] Carcassonne, Wikipedia entry, http://en.wikipedia.org/wiki/Carcassonne_(board_game)#Fiel d_scoring, viewed on November 18, 2007. [Williams2007] Williams, Russ. Carcassonne Tile Distribution. http://russcon.org/RussCon/carcassonne/tiles.html viewed on November 18, 2007

The penalty for small cities and roads is less clear-cut. We do not argue that it increases engagement or

5 Appendix: Rules summary We change the American 3rd edition Carcassonne rules as follows, to fix some balance problems rules and bring them in line with the newer German edition: • Don't use the pigs--they just turn into a big point swing in the last move for everyone • Don't use the traders--they introduce too much variance • Instead of drawing randomly, have a shared "hand" of three tiles always visible. Choose one of the three as your piece and then replace it with a random tile. This increases strategy and play speed and decreases variance by allowing planning ahead and intentional piece denial. • Farms pay 3/completed city bordering the farm (i.e., each city will buy from all farms around it). This is much easier to keep track of. • Roads are worth 2/tile upon completion, and worth half as many points if uncompleted at game end. This simplifies road scoring to bring it in line with cities and encourage it as a viable strategy. Without this rule, it is almost never worthwhile to build roads. • [Cities are still worth 2/tile + 2/shield, and worth half as many points if uncompleted at game end.] • Completed 2-tile roads and cities are worth half as many points as longer ones; this simplifies road rules and encourages larger building and sharing, which are the essence of the game. • Remove a random set of 10% of the tiles before playing to preclude tile counting, which is not engaging and favors more experienced players.

7/7