Complexity Analysis and Playing Strategies For Ludo and Its Variant Race Games
Complexity Analysis and Playing Strategies For Ludo and Its Variant Race Games
Complexity Analysis and Playing Strategies For Ludo and Its Variant Race Games
net/publication/224259871
Complexity analysis and playing strategies for Ludo and its variant race games
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:
All content following this page was uploaded by Faisal Alvi on 28 June 2015.
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.
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.
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
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
50.0 207
200
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
(a) % of Games Won in All-Strategy Games (b) Average Number of Moves in Wins
TABLE I TABLE II
P ERFORMANCE S TATISTICS OF BASIC S TRATEGIES P ERFORMANCE S TATISTICS OF M IXED S TRATEGY
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
(a) Mixed Strategy - % Games Won in All -Strategy Games (b) Mixed Strategy - Average Number of Moves in Wins
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