Development of A Program For Playing Progressive Chess
Development of A Program For Playing Progressive Chess
net/publication/300114674
CITATIONS READS
2 705
2 authors:
All content following this page was uploaded by Vito Janko on 14 June 2016.
1 Introduction
Chess variants comprise a family of strategy board games that are related to,
inspired by, or similar to the game of Chess. Progressive Chess is one of the most
popular Chess variants [1]: probably hundreds of Progressive Chess tournaments
have been held during the past fifty years [2], and several aspects of the game have
been researched and documented [3–6]. In this game, rather than just making
one move per turn, players play progressively longer series of moves. White
starts with one move, Black plays two consecutive moves, White then plays
three moves, and so on.
Rules for Chess apply, with the following exceptions (see more details in [2]):
There are two main varieties of Progressive Chess: Italian Progressive Chess and
Scottish Progressive Chess. The former has been researched to a greater extent,
and a large database of games (called ‘PRBASE’) has been assembled. In Italian
Progressive Chess, a check may only be given on the last move of a complete
series of moves. In particular, if the only way to escape a check is to give check
2
on the first move of the series, then the game is lost by the player in check. In
Scottish Progressive Chess, check may be given on any move of a series, but
a check also ends the series. It has been shown that the difference very rarely
affects the result of the game [7].
The strategy for both players can be summarized as follows. Firstly, look
for a checkmate; if none can be found, ensure that the opponent cannot mate
next turn. Secondly, aim to destroy the opponent’s most dangerous pieces whilst
maximizing the survival chances of your own [2]. Searching for checkmates ef-
ficiently – both for the player and for the opponent – is thus an essential, the
single most important task in this game.
The diagram in Fig. 1 shows an example of a typical challenge in Progressive
Chess: to find the sequence of moves that would result in checkmating the op-
ponent. Black checkmates the opponent on the 8th consecutive move (note that
White King should not be in check before the last move in the sequence).
Our goal is to develop a strong computer program for playing Progressive
Chess. We know of no past attempts to build Progressive Chess playing pro-
grams. In the 90’s, a strong Progressive Chess player from Italy, Deumo Polacco,
developed Esaù, a program for searching for checkmates in Progressive Chess.
According to the program’s distributor, AISE (Italian Association of Chess Vari-
ants), it was written in Borland Turbo-Basic, and it sometimes required several
hours to find a checkmate. To the best of our knowledge, there are no documented
reports about the author’s approach, nor whether there were any attempts to
extend Esaù to a complete Progressive Chess playing program.
From a game-theoretic perspective, Progressive Chess shares many properties
with Chess. It is a finite, sequential, perfect information, deterministic, and zero-
sum two-player game. The state-space complexity of a game (defined as the
number of game states that can be reached through legal play) is comparable
to that of Chess, which has been estimated to be around 1046 [8]. However, the
per-turn branching factor is extremely large in Progressive Chess, due to the
combinatorial possibilities produced by having several steps per turn.
In another chess variant, Arimaa, where “only” four steps per turn are al-
lowed, the branching factor is estimated to be around 16,000 [9]. So far, human
3
Fig. 2. Our Progressive Chess playing program. Black’s last turn moves are indicated.
2 Application Description
The graphical user interface of our Progressive Chess playing program is shown
in Fig. 2. We implemented the Italian Progressive Chess rules (see Section 1 for
details). The application provides the following functionalities:
The user is also allowed to input an arbitrary (but legal) initial position, both
for playing and for discovering sequences of moves that lead to a checkmate. The
application and related material is available online [11].
1
The solution to Fig. 1: Bb4-d6, b6-b5, b5-b4, b4-b3, b3xa2, a2xb1N, Nb1-c3, Bd6-f4.
4
3.1 Algorithm
The task of finding checkmates in Italian Progressive Chess has a particular
property – all solutions of a particular problem (position) lie at a fixed depth.
Check and checkmate can only be delivered on the last move of the player’s
turn, so any existing checkmate must be at the depth equal to the turn number.
A* uses the distance of the node as an additional term added to the heuristic
evaluation, guiding the search towards shorter paths. In positions with a high
turn number (where a longer sequence of moves is required) this may not be
preferred, as traversing longer variations first is likely to be more promising (as
they are the only ones with a solution). One possibility to resolve this problem is
to remove the distance term completely, degrading the algorithm into best-first
search. An alternative is to weight the distance term according to the known
length of the solution. Weight a/length was used for this purpose, where the
constant a was set arbitrarily for each individual heuristic. In all versions we ac-
knowledged the symmetry of different move orders and treated them accordingly.
In the experiments, we used both versions of the algorithm: best-first search and
weighted A*.
3.2 Heuristics
For the purpose of guiding the search towards checkmate positions, we tried an
array of different heuristics with different complexities, aiming to find the best
trade-off between the speed of evaluation and the reliability of the guidance. This
corresponds to the well known search-knowledge tradeoff in game-playing pro-
grams [12]. All the heuristics reward maximal value to the checkmate positions.
It is particularly important to observe that in such positions, all the squares in
the immediate proximity of the opponent’s King must be covered, including the
King’s square itself. This observation served as the basis for the design of the
heuristics. They are listed in Table 1.
Fig. 3 gives the values of each heuristic from Table 1 for the pieces in the
diagram. In Manhattan, pawns are not taken into account, resulting in the value
of 13 (2+5+6). The value of Covering is 3, as the squares a1, a2, b1 are not
covered. The Ghost heuristic obtains the value of 7 (2+1+2+2): the Rook needs
7
Fig. 3. The values of heuristics listed in Table 1 for this position are as follows. Man-
hattan: 13, Ghost: 7, Covering: 3, Squares: 8.
Name Description
Baseline Depth-first search without using any heuristic values.
Manhattan The sum of Manhattan distances between pieces and the opponent’s King.
Ghost The number of legal moves pieces required to reach the square around the
king, if they were moving like “ghosts” (ignoring all the obstacles).
Covering The number of squares around the king yet to be covered.
Squares The sum of the number of moves that are required for each individual piece
to reach every single square around the king.
two moves to reach the square immediate to the king, the Bishop needs one, the
Knight needs two moves (to reach a1), the Pawn needs one move to promote and
one move with the (new) Queen. The value of Squares heuristic is 8 (2+3+2+1):
the square a1 can be reached in two moves with the Knight, a2 can be reached
in three moves with the Knight or Rook, b1 can be reached in two moves with
the Rook, b2 can be reached in one move with the Bishop. The player’s King is
never taken into account in the calculations of heuristic values.
Aside from covering squares around the opponent’s King, there are two more
useful heuristics that can be combined with the existing ones; we named them
Promotion and Pin (see Table 2).
A majority of checkmates that occur later in the game include promoting
one of the Pawns, getting an extra attacker for delivering checkmate. Rewarding
promotions of the Pawns is therefore beneficial.
Another useful heuristic takes advantage of a “self-pin.” Fig. 4 shows the
controversial “Italian mate,” which is enthusiastically championed by some but
is felt by others to be undesirably artificial [7]. It occurs where the only way to
escape a check is to give a check in return, making that move illegal. The position
on the left diagram is from a game Boniface – Archer (played in the year 1993),
where White played 7 c4, Kd2, Kc3, Kb4, Nf3, Rd1, Rxd7. The final position
8
Fig. 4. Left: White to move checkmates in 7 moves. Right: the final position.
4 Experimental design
The goal of the experiments was to verify empirically how promising is our
approach for finding checkmates in an efficient manner. In particular, (1) which
of the two search algorithms performs better (best-first search or weighted A* ),
(2) which is the most promising heuristic to guide the search (Manhattan, Ghost,
Covering, or Squares), and (3) what is the contribution of the two additional
two heuristics (Promotion and Pin; see Table 2).
Another research question was who has the advantage in Progressive Chess:
White or Black (note that this is not so clear as in orthodox chess). The Classi-
fied Encyclopedia of Chess Variants claims that masters have disagreed on this
question, but practice would indicate that White has a definite edge [2].
4.1 Experiment
Two sets of experiments were conducted. Firstly, we observed how quickly do
different versions of the program find checkmates on a chosen data set of positions
with different solution lengths (see Section 4.2). Both average times and success
rates within various time constraints were measured. The search was limited to
60 seconds per position (for each version of the program).
Table 2. Additional heuristics that can be combined with the existing ones.
Name Description
Promotion How far are Pawns to the square of promotion, also rewards extra queens.
Pin How far is the King to the closest square where self-pin could be exploited.
9
5 Results
5.1 Average times for finding checkmates
Fig. 5 gives the average times for finding checkmates with the best-first search
algorithm. It roughly outlines the difficulty of the task: finding checkmates is
easier when the solution is short (turns 4–6), more difficult when the solutions
are of medium length (turns 7–10), and easier again in the later stage (turns
11–12), as the material on the board dwindles.
It is interesting to observe that the baseline heuristic (i.e., depth-first search)
even outperforms some other heuristics at turns 4–6 and 11–12, i.e., when the
25000
20000
Baseline
15000
Manhatten
Ghost
10000 Covering
Squares
5000
0
4 5 6 7 8 9 10 11 12
Fig. 5. Average times (in milliseconds) with the best-first search algorithm. The hori-
zontal axis represents the length of the solution.
10
Fig. 6. On the left are average times (in milliseconds) with the A* algorithm, on the
right are average times (in miliseconds) with the improved A* algorithm.
solution is less difficult (note that the problems at higher turns typically contain
less material on the chessboard). The Covering heuristic performs best up most
of the time (up to turn 9), and the Squares heuristic performs best at the later
stages.
The average times with the weighted A* algorithm are given in Fig. 6. They
are slightly shorter than the ones obtained by the best-first search algorithm up
to turn 9. However, the average time increases greatly at the later stages. The
main reason is that the heuristics tend to fail to find the solutions in later stages
(note that each failed attempt is “penalized” with 60,000 milliseconds, i.e., the
time limit for each problem).
However, the performance of the A* algorithm improves dramatically when
it also uses the two additional heuristics: Promotion and Pin (see Fig. 6). In
particular, the Promotion heuristic turns out to be very useful at the later stages
in the game.
Overall, the A* algorithm with the two additional heuristics performed best,
and Covering heuristic turned out to be the most promising one. In particular,
since most of the games in Progressive Chess finish before turn 10.
0,95
0,85
Baseline
0,75 Manhatten
Ghost
Covering
0,65
Squares
0,55
0,45
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
Fig. 8. The success rate for each program (left) and for each piece color (right).
There was the total of 31,260 games played, and each program played the same
number of games. 20,340 games were played at the time control of 1s/move,
6,900 at 4s/move, 2540 at 15s/move, and 1,480 at 30s/move. The average length
of the games was 8.3 turns (σ = 2.8). The success rate of white pieces against
black pieces was 47.2% vs. 52.8%, which suggests that it is Black that has a slight
advantage in Progressive Chess. Only 13.7% of the games ended in a draw.
6 Conclusions
The aim of our research is to build a strong computer program for playing and
learning Progressive Chess. This chess variant was particularly popular among
Italian players in the last two decades of the previous century [2]. By developing
a strong computer program, we hope to revive the interest in this game both
among human players, who may obtain a strong playing partner and an analysis
tool, as well as among computer scientists. In particular, the extremely large
branching factor due to the combinatorial explosion of possibilities produced by
having several moves per turn makes Progressive Chess both an interesting game
and a very challenging environment for testing new algorithms and ideas.
12
Our program follows the generally recommended strategy for this game,
which consists of three phases: (1) looking for possibilities to checkmate the
opponent, (2) playing generally good moves when no checkmate can be found,
and (3) preventing checkmates from the opponent. In this paper, we focused on
efficiently searching for checkmates, which is considered as the most important
task in this game. We introduced various heuristics for guiding the search. The
A* algorithm proved to be suitable for the task. In the experiments with (au-
tomatically obtained) checkmate-in-N-moves problems, the program found the
solutions very quickly: 80% within the first second, and 99% within one minute
of search on regular hardware.
A self-play experiment (more than 30,000 games played) between various
versions of the program lead to the success rate of 47.2% vs. 52.8% in favor of
Black. Notably, each version of the program performed better with black pieces.
Our program requires significant further work to achieve the level of the
best human players. Particularly in the second phase of the game (which is
not directly associated with searching for checkmates) we see a lot of room for
improvements, possibly by introducing Monte-Carlo tree search techniques [13].
The question of who has the advantage in Progressive Chess is therefore still
open and could be the subject of further investigation.
References
1. Pritchard, D.: Popular chess variants. BT Batsford Limited (2000)
2. Pritchard, D.B., Beasley, J.D.: The classified encyclopedia of chess variants. J.
Beasley (2007)
3. Leoncini, M., Magari, R.: Manuale di Scacchi Eterodossi. Siena-Italy (1980)
4. Dipilato, G., Leoncini, M.: Fondamenti di Scacchi Progressivi. Macerata-Italy
(1987)
5. Castelli, A.: Scacchi Progressivi. Matti Eccellenti (Progressive Chess. Excellent
Checkmates). Macerata-Italy (1996)
6. Castelli, A.: Scacchi progressivi. Finali di partita (Progressive Chess. Endgames).
Macerata-Italy (1997)
7. Beasley, J.: Progressive chess: How often does the “italian rule” make a differ-
ence? http://www.jsbeasley.co.uk/vchess/italian_rule.pdf (2011) [accessed
06-March-2015].
8. Chinchalkar, S.: An upper bound for the number of reachable positions. ICCA
Journal 19(3) (1996) 181–183
9. Wu, D.J.: Move Ranking and Evaluation in the Game of Arimaa. PhD thesis,
Harvard University, Cambridge, USA (2011)
10. Kozelek, T.: Methods of MCTS and the game arimaa. Master’s thesis, Charles
University, Prague, Czech Republic (2010)
11. Janko, V., Guid, M. http://www.ailab.si/progressive-chess/
12. Junghanns, A., Schaeffer, J.: Search versus knowledge in game-playing programs
revisited. In: 15th International Joint Conference on Artificial Intelligence, Pro-
ceedings. Volume 1., Morgan Kaufmann (1999) 692–697
13. Coulom, R.: Efficient selectivity and backup operators in monte-carlo tree search.
In: Computers and Games, 5th International Conference, CG 2006, Turin, Italy,
May 29-31, 2006. Revised Papers. (2006) 72–83