Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Complexity Analysis and Playing Strategies For Ludo and Its Variant Race Games

Download as pdf or txt
Download as pdf or txt
You are on page 1of 9

See discussions, stats, and author profiles for this publication at: https://www.researchgate.

net/publication/224259871

Complexity analysis and playing strategies for Ludo and its variant race games

Conference Paper · October 2011


DOI: 10.1109/CIG.2011.6031999 · Source: IEEE Xplore

CITATIONS READS

7 31,296

2 authors, including:

Faisal Alvi
King Fahd University of Petroleum and Minerals
8 PUBLICATIONS   60 CITATIONS   

SEE PROFILE

Some of the authors of this publication are also working on these related projects:

Paraphrase Identification View project

All content following this page was uploaded by Faisal Alvi on 28 June 2015.

The user has requested enhancement of the downloaded file.


Complexity Analysis and Playing Strategies for Ludo and its
Variant Race Games
Faisal Alvi, Member IEEE, Moataz Ahmed

Safe Squares
Abstract— Ludo is a 2-4 player non-deterministic race game
with the objective of moving players’ pieces through a desig-
nated circuit into a winning location, in accordance with die
Red Player
rolls. In this paper we evaluate the state-space complexity of Start Area
Ludo, and propose and analyze strategies based on four basic
moves. We also provide an experimental comparison of pure
and mixed versions of these strategies. This research is aimed
Yellow Player
at enhancing the domain specific knowledge for Ludo and its Home Square
Green
variant race games, which can then be used for performance

Yellow
Red
improvement in temporal difference learning networks or in HOME Yellow Player
Start Square
evolutionary game analysis for race games. Blue

I. I NTRODUCTION
Race games [1] are board games with the objective of
being the first player to get one’s pieces around a linear track
and into a designated winning location, usually in accordance
with die rolls. These range from the simple games such as Fig. 1. Ludo Board with Safe Squares (South Asia)
snakes and ladders in which game-play depends entirely on
chance, to the more complex ones such as backgammon
which involves the use of several strategies. stages in game-play resulting in enhanced performance in
Ludo [2], a derivative of Pachisi [3], is a non-deterministic checkers [10].
race game with 2-4 players. Each player is represented Matthews et al. [11] have applied temporal difference
by one of the colors Red, Green, Blue and Yellow, and learning to Parcheesi [12] (a variant of Ludo), using the
has four pieces. The first player to circumnavigate all four basic TD(λ) algorithm. They have experimentally shown
pieces around the board and into the home area is the that, using derived smart features of the board, and training
winner. Obstacles to this objective include shared paths with against heuristic Parcheesi players, initial learning can be
opponent pieces, unlucky die rolls, getting knocked off by achieved in a minimum of 5000 games of training, and
opponent pieces and piece doubling. Several variants of the performance level reaches a steady state at approximately
game exist, for example Parcheesi (United States), Ludo 50,000 games of training. In the presence of a standard expert
(Britain), Parqués (Columbia), Parchis (Spain) and Ludo player, improved learning can be achieved using fewer trials.
(South Asia) [3]. However, they state that no standard expert player exists, due
Temporal Difference Learning [4] is one of the successful to a lack of an in-depth study of Parcheesi [11].
methodologies for developing game-playing agents in board In this work, we undertake a fundamental study of Ludo in
games. Tesauro’s successful application of the basic TD(λ) order to gain a better understanding of the game and enhance
algorithm to produce TD-Gammon is the best known exam- its knowledge base. We analyze the state-space complexity
ple [5]. However, application of the basic TD(λ) algorithm of Ludo and show that it is comparable to the state-space
for other board games such as Chess [6] and Othello [7], has complexity of Backgammon, which probably indicates that
produced mixed results. Variations in learning modes such Ludo has some strategic variety and is not a trivial game [3].
as learning by playing against an expert player and learning Accordingly, we propose strategies based on four basic
by observation have produced improved game-play [8], in moves in the game; we give a comparative analysis of
contrast to the self-play learning approach used by Tesauro. strategies based on expected number of moves. Experimental
Another promising approach for improved game-play in results of the comparison of pure and mixed versions of these
board games has been evolutionary computation [9], with strategies is also included to complement the theoretical re-
the incorporation of domain-specific knowledge at various sults. The enhanced knowledge base resulting from this work
can be used to generate standard players as a benchmark for
The authors are affiliated with the Information and Computer Sci- TD-learning agents to compete against, thereby producing
ence Department, King Fahd University of Petroleum and Miner- better players and reducing the required number of games
als, Dhahran-31261, Saudi Arabia. email: alvif@kfupm.edu.sa,
moataz@kfupm.edu.sa. The authors acknowledge the support of King for training. It can also be used for evolving better strategies
Fahd University of Petroleum and Minerals for this research. in an evolutionary game-play approach for race games.

978-1-4577-0011-8/11/$26.00 ©2011 IEEE 141


The rest of the paper is organized as follows: In Section 2, in which Red’s pieces are on locations (3, 4, 2, 1) is
we evaluate the state-space complexity of Ludo. In Section 3, identical to another configuration in which Red’s pieces
we propose strategies based on four basic move types in the are on locations (4, 3, 2, 1).
game and in Section 4 we provide a comparative analysis • We classify the common locations on a Ludo board into
of these strategies. We describe results of experimentation two types: safe squares and non-safe squares (fig. 1). A
on strategies in Section 5. Section 6 concludes the paper by safe square is defined to be a location on the game board
summarizing the achievements and highlighting future work where multiple pieces of different players can be placed
directions. simultaneously without being knocked off or sent back.
A non-safe square, on the other hand, can accommodate
II. S TATE -S PACE C OMPLEXITY
only one piece at a time.
State-space complexity is defined as the number of legal • The four start area locations for each player can be
game states reachable from the initial state of the game [13]. mapped into an imaginary single safe square for all
Estimated state-space complexities of some of the popular pieces. Similarly, the five home squares for each player
board games are: Chess (1050 ) [13], Othello (1028 ) [13], can be mapped to five common safe squares; likewise
Backgammon (1020 ) [14] and Checkers (1018 ) [15]. The the final home location (fig. 1) can also be considered
primary application of state-space complexity is to determine as a safe square. Therefore, the number of computed
whether a perfect evaluation function can be constructed safe squares is defined to be equal to the sum of actual
using table look-up by listing and evaluating every possible number of safe squares and these mapped safe squares.
state of a game [13]. However, this reasoning may not be
applicable to games for which a perfect algorithmic strategy B. Theorem
has been discovered. The complexity class of generalization The following theorem establishes an upper bound on
of a game is also used as an indication of game complexity, the state-space complexity of Ludo. This upper bound is
however this is dependent on the constructions used for almost-tight as it includes only one location which is not
generalization, for example in n × n chess [16]. legal for each piece, i.e., the location right before the start
It can be argued that a high value of state space complexity square for each piece. We will also establish a lower-bound
is not a definitive indicator of game complexity. For example, by excluding this location (square) from the board and show
although the game of Nim (with n piles having n marbles √ that the upper bound and the lower bound differ by only
each) has state-space complexity of the order of 4n / n one order of magnitude for a typical game board.
which is huge for n = 140 [17], yet a simple polynomial-time
perfect strategy exists for the game. Theorem 1: For a Ludo board, let
However, a smaller state-space complexity is a definitive ns = number of actual safe squares,
indicator that a game may be solved using enumeration. no = number of non-safe squares,
As an example, although an extended generalization of tic- nh = number of home squares for any player,
tac-toe is PSPACE-Complete [18] , yet a perfect evaluation nc = number of computed safe squares = ns + nh + 2,
function may be constructed for a 3 × 3 tic-tac-toe game r, g, y, b = number of pieces of Red, Green, Yellow, Blue,
since its state space complexity is bounded above by 103 . player on non-safe squares at any given instant,
At present no attempts have been made to compute the
complexity of a generalized version of Ludo; several variants Then, the number of states is bounded above by:
of the game may provide some hints in that direction. In the
absence of such a generalization, obtaining a reliable value ∑
4
f (no , nc ) = C(no , r) · C(nc + 3 − r, 4 − r)
of the state space complexity for Ludo is one way to rule out r,g,y,b=0
the possibility that Ludo can be easily solved by enumerating
· C(no − r, g) · C(nc + 3 − g, 4 − g)
every possible state of the game.
· C(no − (r + g), y) · C(nc + 3 − y, 4 − y)
A. Assumptions
· C(no − (r + g + y), b) · C(nc + 3 − b, 4 − b) (1)
A trivial upper bound of (number of locations)16 can be
established by considering that each of the 16 pieces (4 n!
where C(n, r) =
players × 4 pieces/player) can be placed on any location r!(n − r)!
on the board. For the board in fig. 1 this turns out to 5716 ≈ Proof: Initially, consider the locations for the Red
1028 . However this estimate is overly simplistic as several Player. At any given instant let there be r pieces of the Red
of the game’s rules are not taken into consideration. Below Player on any of the no non-safe squares of the board and the
we state certain assumptions based on rules and observations other 4−r pieces be on any of the nc computed safe squares.
within the game, which are used later in the evaluation of These r pieces can be placed on any of the no squares of
state-space complexity: the board in C(no , r) ways, and the other 4 − r pieces can
• We consider all pieces of a player to be identical, since be placed on the remaining nc computed safe squares in
unlike chess, there is no hierarchy between individual C(nc + (4 − r) − 1, 4 − r) = C(nc + 3 − r, 4 − r) ways
pieces of the same player. Hence a board configuration [combinations with repetition] [19]. Then the number of

142 2011 IEEE Conference on Computational Intelligence and Games (CIG’11)


∑4
ways in which Red’s pieces can be placed is r=0 C(no , r)· f (no , nc ) ≈ 1024 and a lower bound of f (no − 16, nc ) ≈
C(nc +3−r, 4−r). For the next player (let’s say Green), the 1022 . As compared to Ludo, the higher value of both the
number of available non-safe squares is reduced to no − r, lower bound and upper bound is due to the larger number of
however there is no change in the available nc computed squares on a Parcheesi board.
safe squares. Therefore,
∑4 the number of possible locations for
Green is given by g=0 C(no − r, g) · C(nc + 3 − g, 4 − g). C. Blockades
Further application of these formulae for Yellow Player give A blockade is defined as two pieces of the same player
C(no − (r + g), y) · C(nc + 3 − y, 4 − y) ways and for Blue being placed on a non-safe square, which cannot be knocked
player gives C(no − (r + g + y), b) · C(nc + 3 − b, 4 − b) off or passed over. In our computation for the state-space
ways. The resulting expression for f (no , nc ) is the product complexity, we did not take blockades into account. How-
of these using the product principle. ever, it can be argued that inclusion of game-states with
Corollary 1: The state-space complexity of a Ludo-game blockades will not significantly affect the overall state-space
has a lower bound of f (no − 4, nc ). complexity of Ludo. The primary reason is that a blockade
Proof: As explained in the introduction to Theorem 1, is equivalent to three pieces of a player being placed on the
the computation of the expression for upper bound includes board, with the fourth piece deterministically taking one of
one illegal non-safe location for each piece. By excluding all the three possible locations of the blockade. Hence, states
such locations (4 in total), we come up with the expression with blockades form a subset of the states presented by
for lower bound. equation (1). Furthermore, since the pieces are considered
to be identical for each player, the number of game-boards
Remark 1: Using equation (1), we find that the state-space
with blockades is at most 3 × 64 × g(no , nc ). (Reason: Each
complexity of Ludo using the board as shown in fig. 1 is
player can have at least 0 and at most 2 blockades, hence
1022 . This can be obtained by substituting the values, no =
43 = 64 blockades × 3 possible blockade locations). Here
44, nh = 5, ns = 8, ⇒ nc = 5 + 8 + 2 = 15 in equation (1),
the function g(no , nc ) is strictly less than f (no , nc ), since
and getting a resulting value of ⇒ f (no , nc ) = 1.6 × 1022 .
in g(no , nc ) at least ∑
one summation for the∑variables r, g, y
Similarly a lower bound of f (no − 4, nc ) = 5 × 1021 is also 3 4
and b is reduced to r,g,y,b=0 instead of r,g,y,b=0 .
computed. It is clear that the lower bound differs from the
upper bound by a factor of 10 only.
A state-space size of 1022 is slightly larger than that of III. S TRATEGIES
Backgammon, hence it may not be possible to create a perfect The game-tree branching factor for Ludo is 24 correspond-
evaluation function using table look-up. It may be pertinent ing to 4 pieces × 6 possible die rolls for each player. After
to mention here that Ludo is played with some variations in a player has rolled a die in his move, he has four options to
rules and boards worldwide. Equation (1) can be used to find move his pieces. In this section we classify basic types of
state-space complexity for a number of variants of the game. moves that a player may choose during game-play. Then, we
outline various strategies based on these types of moves.

A. Random
In a random move, a player chooses to play one of
Safe Square
(3 in each his pieces completely at random. Such a move may be
player’s area, undertaken when a player may see no advantage in moving
12 in total)
a particular piece.
A random strategy is based on random moves during the
HOME
entire game. Although a random strategy has little usefulness
for winning games, it can be used as a benchmark to compare
performance of other strategies.
Start Square Players’ pieces move in a ccw
(counterclockwise) direction, B. Aggressive
beginning with the start square
In an aggressive move, a player prefers to move a piece
Fig. 2. Parcheesi Board (Top-left and Center Shown) which can knock out or eliminate the piece of another player,
based on the die roll outcome. An aggressive move incurs
Remark 2: For Parcheesi (Fig. 2), a popular race game an additional overhead on the attacked player in the sense
played in the US, the game circuit for a player consists of that the attacked player now has to play his eliminated piece
72 squares. However, there are 12 safe squares on the board, over the entire game board again. Thus, an aggressive move
56 non-safe squares and 7 home squares for each player. gives a definite advantage to the aggressor over its victim.
Out of the 56 non-safe squares, four locations are illegal for An aggressive strategy is based on aggressive moves
each player. Since game rules prohibit placing more than one throughout the game, whenever possible. However, a player
piece on a safe square, we substitute no = 56 + 12 = 68, nc may use another type of move (e.g. a random move), when
= 0 + 7 + 2 = 9 in equation (1) to get an upper bound of there is no chance of attacking another player’s piece.

2011 IEEE Conference on Computational Intelligence and Games (CIG’11) 143


4
moves the most advanced piece, which in turns makes that
3
piece more likely to be played in the next move.
3
1 A fast strategy is based upon a preference for fast moves.
2
3 E. Mixed
1 Green 2 Green
It is possible, and in fact advantageous that a player may

Yellow

Yellow
Red

Red
HOME HOME
choose to play different types of moves at different stages in
Blue 1 Blue
the game. For example, a player may play any combination
Random Move: Aggressive Move:
Red may move any of its pieces Red moves 2 , in order to
of defensive, aggressive, fast and random moves, which may
1 , 2 , 3 or 4 . knock off Green’s 1 . give rise to a mixed or hybrid strategy.
We emphasize that the types of moves and strategies
presented here are by no means exhaustive and several
3 3 strategies or types of moves may be discovered at various
1 1 stages in the game.
3 3 IV. A NALYSIS
2 Green 2 Green
In this section we present a theoretical analysis of the
Yellow

Yellow
Red

Red
HOME HOME

1 1
strategies presented. Using expected values of die rolls and
Blue Blue
average piece movement over a large number of games, we
Defensive Move: Fast Move:
Red moves 3 in order to avoid Red moves 1 in order to make analyze the comparative advantage of some of the proposed
being knocked off by Green’s 3 . it reach home. strategies over others.
Fig. 3. Basic Move Types A. Definitions
Here we formally define a few terms required for the
analysis, which have also been earlier used in the paper.
C. Defensive
• A move is defined as the movement of a player’s piece
In a defensive move, a player always defends his pieces resulting in from a single die roll. We assume that each
against the danger of an impending attack. However, the player plays a single die roll during his turn in the game.
notion of being threatened (or being in danger of elimination) • The distance moved by a piece is measured in terms of
needs elaboration. We propose that a piece is in danger of the number of squares. For example, on a single move, a
being eliminated when it is less than a distance of a single die piece moves a distance of 1-6 squares. The length of the
roll of another piece, i.e., it is 1-6 squares away from another track over the entire board for each piece is represented
piece. This distance can be defined as a knocking range. by dboard .
Therefore, in a defensive move, a player moves his piece if • The winner is defined as the player who sends his pieces
it is within the knocking range of another player’s pieces. to the final home position in the least number of moves.
A defensive move if successful, gives an advantage to the
defender against all players, in the sense that the defending B. Expected number of moves
player has avoided a loss against all other players by saving Although Ludo is a non-deterministic game unlike chess
his piece. and checkers, typical game progress can be modeled based on
A defensive strategy is based on a preference for defensive the expected number of moves over a large number of games.
moves whenever possible. Since the expected value of a single die roll is E[die] = 3.5
[19], the expected minimum number of moves taken by a
D. Fast piece to move a distance of d squares is given by
d d
In a fast move, a player chooses to play the piece which Emin [moves] = =
has moved the maximum distance in its circuit around the E[die] 3.5
board. A fast move is based on the idea that the loss of a This expected minimum value is based on the assumption
piece that has advanced the most in the game (i.e. the fastest that the piece does not get knocked off by another piece. To
piece) would be the most expensive for a player (in terms of complete an entire circuit around the board (fig. 1) a piece
the additional number of moves required), hence it must be will require an expected minimum number of dboard /3.5 =
preferably moved first and sent to the final home location. 57/3.5 ≈ 16.3 moves. Similarly, a player will take an
A fast move reorders the movement of a player’s pieces expected minimum number of 4 × 16.3 ≈ 65 moves to win.
within the game and therefore does not offer any comparative Therefore, the expected-minimum ply-length of a game is
advantage over other players. However the risk of piece 4 × 65 = 260.
elimination is somewhat reduced since a player’s only one However in an actual Ludo game, a piece may get knocked
piece is active (moving) at any instant. In this sense it can off several times. Let us assume that piece i of a player p
be termed as a depth-first game-play, since a player always gets knocked off n times and let dik represent the distance

144 2011 IEEE Conference on Computational Intelligence and Games (CIG’11)


covered by piece i from its initial position when knocked off In summary it can be inferred that,
for the k th time. Then, the expected number of moves piece
i needs to reach home is given by: D EFENSIVE ≽ AGGRESSIVE ≽ R ANDOM,
∑n FAST ≽ R ANDOM,
dboard + k=1 (dik )
Ei [m] = [ ] (2)
3.5 where the operator ≽ = ’is at least as advantageous as’.
Therefore, a player p will require
V. E XPERIMENTATION AND R ESULTS

4
In this section we describe the experiments conducted on
Ep [m] = Ei [m]
i=1
the proposed strategies and the results obtained. These tests
were conducted on (a) each basic-strategy player playing
expected moves to complete his pieces’ circuit around the
against all random players and (b) each basic-strategy player
board. The player p with the minimum value of Ep [m] would
playing against different basic-strategy players. A mixed
be the expected winner.
strategy was also formulated based on the obtained results
C. Comparison of Strategies and was tested against these basic strategies.
It can be observed from equation (2) that the quantity A. Setup
[ dboard
3.5 ] is a constant. Hence to minimize Ep [m] a player
needs The game was set up by designing classes representing
∑n to do one of the following: (a) minimize the quantity entities involved in a typical Ludo game. Initially we tested
k=1 (dik ) for his own pieces by following
∑n a defensive strat-
egy, or (b) increase other players k=1 (dik ) by following our game setup by running numerous games with all four
an aggressive strategy. players selecting the random strategy. This was done to
In this context, a question arises that which one of the ensure that our game setup is correct and that each random
two options is more advantageous? More specifically, would player wins approximately equal number of times. We found
a player be better off by defending his own pieces or that each random player wins 25.0 ± 1.0% of the games
by attacking other players’ pieces? Intuitively, it can be and that this performance stabilized at nearly 5000 games.
argued that a defensive move is more advantageous than Running a higher number of games did not reduce the
an aggressive move for a given player, since a single save variation in results significantly, suggesting that 5000 games
would give a player an advantage (or not cause a deficit) was an adequate number to observe reliable trends in strategy
evaluation. These results were also unchanged when the
against other three∑n players by not increasing n, which in player order was changed suggesting that there was no
turn minimizes k=1 (dik ) for his ∑nown pieces. On the other
hand, an attack would increase k=1 (dik ) for the attacked significant bias towards the player taking the first turn. The
player only, thereby still leaving two other players to compete tests were also repeated for each strategy separately and
against. identical results were obtained.
It can be inferred that in a typical ludo game, the number B. Testing Performance of Strategies
of successful defenses (where a successful defense is defined
as moving a piece out of the knocking range of one or In the next phase we performed tests on each one of the
more attacking pieces) is probably greater than the number proposed strategies. This phase consisted of two types of
of successful attacks. A detailed proof-outline appears in tests:
the Appendix. Using this argument, we may infer that • Testing each basic-strategy player individually against

a defensive strategy may be more advantageous than an three random players to observe the individual perfor-
aggressive strategy, as not only a defensive move is likely mance data of that strategy.
advantageous over an aggressive move as outlined previously, • Testing all four basic-strategy players against each other

but the number of successful defenses is probably greater in a game to observe the relative performance data of
than the number of successful attacks in a typical game. each strategy.
It may be relevant to mention here that the position at For the first type, we tested each basic-strategy player
which a piece gets knocked off is important. The loss of an individually against all random players. We found that each
advanced piece (i.e., a piece which has covered a greater of the basic-strategy players (defensive, aggressive or fast)
distance and is at the final stages of its circuit) is more wins at least 98% of the games against all random players.
expensive in terms of the additional required number of We state the results of these tests in Table I. This test clearly
moves as compared to the loss of a new piece (i.e., a piece in demonstrates that having any basic strategy is better than
the beginning stages of its circuit). This explains the utility of playing randomly.
a fast strategy since a fast strategy aims to minimize exposure For the second type of test, we tested all basic-strategy
to ripe pieces, by prioritizing their movement. players against each other in several game runs. Figure 4(a)
A random strategy is no strategy at all, since players com- gives a graphical view of test results. It can be seen from
pletely move their pieces at random and hence is the most Figure 4(a) that the defensive strategy always outperformed
disadvantageous. However it can be used as a benchmark other strategies on average (40% wins), and the aggressive
against which to compare other strategies. strategy (32% wins) performed better than the fast strategy

2011 IEEE Conference on Computational Intelligence and Games (CIG’11) 145


Defensive Aggressive Fast Random Vs All Random Players Vs All Strategies

50.0 207
200

Average number of moves


40.0
% Games Won

150
30.0 113 111
103 98 99
93
100
20.0
50
10.0
N/A
0.0 0
100 1000 2000 3000 4000 5000 Defensive Aggressive Fast Random

Number of Games Played Player Type (Strategy)

(a) % of Games Won in All-Strategy Games (b) Average Number of Moves in Wins

Fig. 4. Performance Graphs of Basic Strategies

TABLE I TABLE II
P ERFORMANCE S TATISTICS OF BASIC S TRATEGIES P ERFORMANCE S TATISTICS OF M IXED S TRATEGY

Player 1 Player 2 Player 3 Player 4 Player 1 Player 2 Player 3 Player 4


(% wins) (% wins) (% wins) (% wins) (% wins) (% wins) (% wins) (% wins)

Random All Random Mixed All Random


(25.0±1.0%) (25.0±1.0% for each) (100.0%) (≈0% for each)
Defensive All Random Mixed Defensive Aggressive Fast
(99.3±0.3%) (< 1% for each) (91.4±1.1%) (3.3±0.4%) (2.7±0.5%) (2.6±0.5%)
Aggressive All Random
(99.4±0.2%) (< 1% for each)
Fast All Random C. Mixed Strategy
(98.7±0.4%) (< 1% for each)
Based on the comparative performance of strategies, we
Defensive Aggressive Fast Random
(40.3±1.0%) (32.5±1.0%) (27.2±1.1%) (≈ 0%) formulated a mixed or a hybrid strategy stated as follows:
1) At his turn, a player should play a defensive move;
2) if not possible play an aggressive move;
3) if not possible play a fast move;
(27% wins). However, the random strategy performed poorly 4) else play a random move.
(0% wins). These results enhance our theoretical analysis We conducted tests for the mixed strategy similar to the ones
presented in Section 4. These trends were also independent of done for the basic strategies. Fig 5(a), 5(b) and Table II
the number of games played because, although the individual highlight the performance of the mixed strategy. It can be
number of wins varied in a particular run of games, the seen that the mixed-strategy player wins at least 90% games
comparative ordering of strategies in terms of the percentage against basic-strategy players suggesting that this strategy
of wins remained the same. is far superior than any basic strategy taken alone. We
Fig 4(b) illustrates the number of moves taken by each can also observe from Fig 5(b) that the average number
basic-strategy player on average for winning games. It can of moves taken by the mixed-strategy player against other
be observed that the defensive player took comparatively less basic-strategy players is close to 65, which is the expected
number of moves to win against other-strategy players, de- minimum number of moves required to win (as outlined in
spite it winning a higher number of times. The aggressive and Section 4). This implies that the mixed strategy is close to
fast strategies took an almost equal number of moves. It can being an optimal strategy against the basic-strategy players,
also be observed that each player took more moves against since it takes close to an expected minimum number of
all-random players than against players with strategies, which moves to win a game on average.
at first seems counter-intuitive. However this should not be The above experimental analysis is applicable to Parcheesi
surprising since players won more than 98% of the time as well as other Ludo variants, since these variants differ by
against all-random players which may have included longer only the number of squares on the game-board and a few
games as well. game rules; however the basic game structure is the same.

146 2011 IEEE Conference on Computational Intelligence and Games (CIG’11)


Mixed Defensive Aggressive Fast 100

Average Number of Moves (in wins)


100.0
80 71
66 66
% Games Won (Log Scale)

63 61
60

10.0 40

20

0
1.0 All All All All Fast All Random
100 1000 2000 3000 4000 5000 Strategies Defensive Aggressive

Number of Games Played Opponent Strategies

(a) Mixed Strategy - % Games Won in All -Strategy Games (b) Mixed Strategy - Average Number of Moves in Wins

Fig. 5. Performance Graphs of Mixed Strategy

VI. C ONCLUSIONS AND F UTURE W ORK A PPENDIX


In this research we conducted a fundamental study of Ludo Here we give a proof-outline of the statement in Section 4:
(a 2-4 non-deterministic race game based on Pachisi). We In a typical ludo game, the number of successful defenses is
found the Ludo state-space complexity to be approximately probably greater than the number of successful attacks. The
1022 which is slighly larger than that of Backgammon, proof-outline that follows involves a case-by-case evaluation
suggesting that the game is not solvable using current com- of the probabilities of a successful attack and defense for
putational resources. Accordingly, we identified four basic different types of piece configurations. We then complete
moves and developed a number of playing strategies using our argument by suggesting that the piece configurations for
these moves: defensive, aggressive and fast playing strategy. which p(Def ense) is higher may have a greater chance of
Theoretical and experimental results show that the defensive occurrence in a game than piece configurations for which
strategy performs better than the other strategies based on the p(Attack) is higher.
percentage of wins. We also formulated a mixed strategy and The statement as well as the proof-outline presented here
found it to be far superior to each basic strategy. Furthermore, are informal in nature, since a formal theorem requires a
our analysis both for state-space complexity and playing more precise definition of successful defense and attack;
strategies is applicable to several variants of Ludo. likewise a rigorous proof requires an exact count of the
For future work, the analysis of strategies presented here number of different piece configurations involved. We avoid
can be used as input for TD-learning networks for Ludo in both of these requirements in order to keep our argument
order to obtain better players in lesser number of trials. It simple, yet plausible. We now proceed to a case-by-case
can also be incorporated in an evolutionary game analysis enumeration and analysis of each possibility:
for Ludo, resulting in the discovery of better strategies and Case 1: 2-Piece Configuration
improved game-play. One way of achieving this goal is by A defending piece lies within the knocking range of exactly
formulating one or more evaluation functions, which assign one attacking piece: For this piece layout (Fig. 6), the
weights to each type of move based on the type of game-play probability that the attacking piece successfully knocks off
required and the comparison of strategies presented in this the defending piece is p(Attack) = 1/6 since an exact
work. For example, die throw is required for a knock to be successful. To find
• a defensive move may be assigned a higher weight p(Def ense) we consider the distance d between the two
as compared to an aggressive move in an evaluation pieces. If the distance between the two pieces is d squares,
function. then the defending piece requires a die roll of 7−d or higher
• an aggressive move on an advanced piece may be given to move away from the knocking range of the attacking piece.
a higher value over an attack a new piece. Assuming all 6 possibilities of distance separation ∑6 to be
Using reinforcement learning, the evaluation function(s) equally likely, we find that: p(Def ense) = 1/6· i=1 i/6 =
may be adjusted after several game runs. Evolutionary 21/36 = 7/12
algorithms may also be used to improve the evaluation We emphasize here that these values for p(Attack) and
function(s) after successive generations, possibly leading to p(Def ense) depend upon player order i.e. which player
the discovery of better strategies for improved game-play. makes the first move. Also, these values may not represent
exact probabilities in all situations; for example in case when

2011 IEEE Conference on Computational Intelligence and Games (CIG’11) 147


the defending piece is already placed on a safe square, the We state these results in table 3. From this table we
defense probability is 1 (i.e., the piece is not under threat) observe that p(Def ense) > p(Attack) for the first two cases
which is greater than 7/12. What is important however, is which may have a higher chance of occurrence based on
the relative ordering of these two values, i.e. p(Def ense) > the maximum number of states for that piece-configuration.
p(Attack) for a 2-piece configuration. However, the cases for which p(Def ense) < p(Attack)
may occur less frequently. Based on this table it may be
inferred that the expected value of p(Def ense) in a typical
3 3-Piece Configuration ludo game will probably be higher than the expected value
Red’s 3 is within the of p(Attack), thus implying that the number of successful
knocking range of 2
2
pieces defenses will probably be higher on average.
3

2-Piece Configuration 1 2 Green


TABLE III

Yellow
Red’s 2 is within the
Red

HOME
knocking range of 1 p(Def ense) AND p(Attack) FOR VARIOUS C ONFIGURATIONS
piece Blue

Piece p(Def ence) p(Attack) p(Def ence) Max No


Fig. 6. Various Piece Configurations Config > p(Attack) of States
2 7/12 1/6 Yes 8
Case 2: 3-Piece Configuration 3 1/2 11/36 Yes 5
4 5/12 91/216 Nearly Equal 4
A defending piece lies within the knocking range of exactly 5 1/3 671/1296 No 3
two attacking pieces: Similar
∑5 to the previous case, we find 6 1/4 4651/7776 No 2
that p(Def ense) = 1/5 · d=1 i/6 = 15/30 = 1/2. Simi-
larly, it can be shown that p(Attack) = 1/6 + 1/6 − 1/36 =
11/36, using the Inclusion-Exclusion Principle. Again, sim- R EFERENCES
ilar to case 2, we see that p(Def ense) > p(Attack). Here [1] D. Parlett, The Oxford History of Board Games. Oxford Univ. Press,
we assume that the two attacking pieces are of different 1999.
colors. If the attacking pieces belong to the same player, [2] “Ludo (Board Game),” (Accessed: 16-Feb-2011). [Online]. Available:
http://en.wikipedia.org/wiki/Ludo (board game)
then p(Attack) = 1/3. However, this does not affect the [3] V. K. Petersen, “Pachisi & Ludo ,” (Accessed: 12-Mar-2011).
overall inequality i.e., p(Def ense) > p(Attack). [Online]. Available: http://pachisi.vegard2.no/index.html
Case 3: 4-Piece Configuration [4] R. S. Sutton, “Learning to Predict by the Method of Temporal
Differences,” Machine Learning, vol. 3, pp. 9–44, 1988.
A defending piece lies within the knocking range [5] G. Tesauro, “Practical Issues in Temporal Difference Learning,” Ma-
∑3 exactly r+1
of three attacking pieces: Here p(Attack) = chine Learning, vol. 8, pp. 257–277, 1992.
(−1) C(3, r)/6r = 91/216, p(Def ense) = 1/4 · [6] S. Thrun, “Learning to Play the Game of Chess,” in Advances in
∑4r=1 Neural Information Processing Systems (NIPS) 7, 1995, pp. 1069–
d=1 i/6 = 10/24 = 5/12. Contrary to the previous two 1076.
results, here p(Def ense) < p(Attack). [7] A. Leouski, “Learning of Position Evaluation in the Game of Othello,”
Case 4: 5-Piece Configuration Master’s thesis, Univ. of Massachusetts, 1995.
[8] M. Wiering, J. P. Patist, and H. Mannen, “Learning to Play Board
A defending piece lies within the knocking range of ex- Games using Temporal Difference Methods,” Utrecht Univ., Tech. Rep.
actly four attacking pieces: Here p(Attack) = 671/1296, UU-CS-2005-048, 2005.
p(Def ense) = 1/3, hence p(Def ense) < p(Attack). [9] Y. Jin, Knowledge Incorporation in Evolutionary Computation. New
Case 5: 6-Piece Configuration York: Springer-Verlag, 2004.
[10] K.-J. Kim and S.-B. Cho, “Systematically Incorporating Domain-
A defending piece lies within the knocking range of ex- Specific Knowledge Into Evolutionary Speciated Checkers Players,”
actly five attacking pieces: Here p(Attack) = 4651/7776, Machine Learning, vol. 9, no. 6, pp. 615–627, 2005.
p(Def ense) = 1/4, hence p(Def ense) < p(Attack). [11] G. F. Matthews and K. Rasheed, “Temporal Difference Learning for
Nondeterministic Board Games,” in Intl. Conf. on Machine Learning:
Given the number of pieces and squares in ludo and the Models, Technologies and Apps. (MLMTA’08), 2008, pp. 800–806.
fact that game states may be repeated during game progress, [12] “Parcheesi,” (Accessed: 21-Feb-2011). [Online]. Available: http:
it is almost infeasible to estimate the actual number of n- //en.wikipedia.org/wiki/Parcheesi
[13] V. Allis, “Searching for Solutions in Games and Artificial Intelligence,”
piece configurations in a game. Instead we give an argument Ph.D. dissertation, Univ. of Limburg, The Netherlands, 1994.
based on the maximum possible number of (non-overlapping) [14] G. Tesauro, “Temporal Difference Learning and TD-Gammon,” Com-
n-piece configurations on a ludo-board at any given instant. munications of the ACM, vol. 38, no. 3, 1995.
[15] J. Schaeffer, J. Culberson, N. Treloar, B. Knight, P. Lu, and D. Szafron,
If xn represents the number (non-overlapping) n-piece “Reviving the Game of Checkers,” in Heuristic Prog. in Artificial
configurations on ludo-board at any instant, where x1 specif- Intelligence 2: The 2nd Comp. Olympiad, 1991, pp. 119–136.
ically represents a single piece not defending itself or attack- [16] A. S. Fraenkel and D. Lichtenstein, “Computing a Perfect Strategy for
n x n Chess Requires Time Exponential in n,” Journal of Combinato-
ing any piece, then rial Theory, Series A, vol. 31, no. 2, pp. 199 – 214, 1981.
[17] A. S. Fraenkel, “Nim is Easy, Chess is Hard - But Why??” Intl. Comp.
x1 + 2x2 + 3x3 + 4x4 + 5x5 + 6x6 = 16 (3) Games Association Journal, vol. 29, no. 4, pp. 203–206, 2006.
[18] T. J. Schaefer, “On the Complexity of Some Two-Person Perfect-
Using equation (3), we see that x2 (which represents the Information Games,” Journal of Comp. and System Science, vol. 16,
number of 2-piece configurations at any given instant) can no. 2, pp. 185–225, 1978.
have a maximum value of 16/2 = 8. Likewise, the maximum [19] K. Rosen, Discrete Mathematics and its Applications, 6th ed. Boston:
McGraw-Hill, 2007.
value of x3 = 5, x4 = 4, x5 = 3 and x6 = 2.

148 2011 IEEE Conference on Computational Intelligence and Games (CIG’11)

View publication stats

You might also like