Complete Implementation of WXF Chinese Chess Rules CCS: Computing methodologies Game tree search CCS: Computing methodologies Heuristic function construction CCS: Human-centered computing Usability testing CCS: Computing methodologies Machine learning

Daniel Tan, Neftali Watkinson Medina · 2024

Read Complete Implementation of WXF Chinese Chess Rules CCS: Computing methodologies Game tree search CCS: Computing methodologies Heuristic function construction CCS: Human-centered computing Usability testing CCS: Computing methodologies Machine learning by Daniel Tan, Neftali Watkinson Medina (2024) in the Tower of Babel, a free online library of public-domain works preserved in clean, searchable text. No sign-up. The full text is served as a plain-text file at a predictable URL, where text is present: https://antarctic-labs.com/tower-of-babel/arxiv-2412-17334.txt.

Introduction

Daniel Tan and Neftali Watkinson Medina code the full world rule set for Chinese chess in a 2024 paper. Repeat moves in this chess form can mean win, draw, or loss by kind, which makes calls hard. A sound judge for the rules is a top block for game app work.

Their method rules all the guide book's test cases in the right way. Fresh speed tricks trim the repeat checks with no loss of truth in the calls. In a test engine, the judge added a clear lift in play strength and win share.

Catalog record

CREATORDaniel Tan, Neftali Watkinson Medina
YEAR2024
COLLECTIONPAPERS
FORMATTXT
FILE SIZE46 KB
VERSION1.0
LICENSEhttp://creativecommons.org/licenses/by/4.0/
RIGHTSCC BY
SOURCEarXiv

Source: https://arxiv.org/abs/2412-17334

Browse the full library · About the Tower of Babel

Full text

The opening of the work, from the library's hosted text:

Complete Implementation of WXF Chinese Chess Rules CCS: Computing methodologies Game tree search CCS: Computing methodologies Heuristic function construction CCS: Human-centered computing Usability testing CCS: Computing methodologies Machine learning Daniel Tan, Neftali Watkinson Medina Abstract . Unlike repetitions in Western Chess where all repetitions are draws, repetitions in Chinese Chess could result in a win, draw, or loss depending on the kind of repetition being made by both players. One of the biggest hurdles facing Chinese Chess application development is a proper system for judging games correctly. This paper introduces a complete algorithm for ruling the WXF rules correctly in all 110 example cases found in the WXF manual. We introduce several novel optimizations for speeding up the repetition handling without compromising the program correctness. This algorithm is usable in engines, and we saw a total increase in playing strength by +10 point rating increase, or an increased 5% winrate when integrating this approach into our prototype engine. 1. Introduction Chinese Chess (or Xiangqi) is one of the most popular board games in Asian countries such as China and Vietnam [15]. Chinese Chess is an indispensable part of the daily lives of Chinese people. There are over one hundred Chinese idioms that have their roots in Chinese Chess [15]. Chinese Chess and Western Chess share many similarities. Both games are two player turn-based strategy games where the objective of the game is to checkmate the opponent’s king using a set of pieces with varying kinds of movement. However, while in Western Chess having multiple repetitions can end in a draw, in Chinese Chess repetitions can result in a win, loss, or draw depending on how that repetition is performed. Judging the actual outcome of repetitions is a complex, nontrivial problem. In this paper, we implement and document an algorithm that completely covers all 110 example diagrams. Unlike other implementations that are missing several cases [12], we present an algorithm that correctly identifies each case correctly. 1.1. Overview of Chinese Chess Repetition Rules A short overview of the repetition rules is that no player is allowed to either perpetually chase an unprotected opponent’s piece or perpetually check the opponent’s king. The player that performs a perpetual chase or a perpetual check loses the game. This is completely different than in Western Chess where a perpetual check is a draw and perpetual chases are close to nonexistent. Under all conditions, perpetual check in Chinese Chess results in a loss for the player constantly checking the opponent’s king. If both players simultaneously perform perpetual checks, then the game will result in a draw. If both players simultaneously perform perpetual chases, then the game will result in a draw. If neither player is doing a perpetual check nor a perpetual chase, then the game is ruled a draw. Figures 1, 2, and 3 provide an example of perpetual check, perpetual chase, and both players simultaneously performing perpetual check, respectively. Figure 1. The red rook is perpetually checking the black king R2+1, K6+1, R2-1, K6-1, R2+1, K6+1, R2-1…red loses if he continues to check the king. Figure 2. The red rook is perpetually chasing the unprotected black cannon R2=1, C9=8, R1=2, C8=9 …red loses if he continues to chase the cannon. Figure 3. Both players perpetually check each other simultaneously R5+1, C5=6, R5=4, C6=5, R4=5, C5=6…this repetition leads to a draw Most Chinese Chess players, from casual enthusiasts to top grandmasters, have an intuitive grasp of the repetition rules, but do not fully understand all the repetition rules [12]. The whole set of rules to determine who wins, draws or loses is complex. This is even more complex if both players are engaging in a chase or if multiple pieces are chasing multiple pieces. If a tournament game runs into a dispute, a special qualified referee is called to resolve the dispute. If a referee determines that a player is performing a losing repetition, the referee will warn the losing side to change moves or lose the match. There are two main versions of the official Chinese Chess repetition rules used in tournament play: the WXF rules (World Xiangqi Federation Rules) [21] and the CXA rules (Chinese Xiangqi Association Rules) [3]. The WXF rules are used for international competitions between different countries, while the CXA rules are used in Mainland China. The CXA rules are complicated, subjective, and contradictory [23], but games using these rules are less likely to end with a draw. The WXF rules lead to more draws, but are more straightforward and consistent. This paper focuses on WXF rules because CXA rules are too subjective and WXF is the standard for Chinese Chess engine play and international competitions between different countries. The official WXF rules [21] are summarized in 4 pages (WXF manual 35-39), with around 110 example diagrams with paragraphs of explanations for each diagram spanning 59 pages (WXF manual 40-99). Given that the WXF manual is 116 pages long, over two thirds of the manual is dedicated to outcomes for repetitions. In this paper, we implement and document an algorithm that completely covers all 110 example diagrams. Unlike other implementations that are missing several cases [12], we present an algorithm that correctly identifies each case correctly. When we integrated this algorithm into our game engine, the algorithm slightly improved the engine playing strength without any significant slowdown. 1.2. Motivation Due to the sheer complexity of the rules, Chinese Chess programmers put more emphasis on evaluating millions of nodes as fast as possible rather than rule correctness [12]. Heuristics are used to estimate repetitive chasing accurately for a majority of judgement calls. Errors in heuristics can be compensated by having a good minimax search and/or better handcrafted evaluation heuristics. Despite this, a complete implementation is still important. For example, Chinese Chess websites and software would benefit from a complete implementation of the rules since it is impossible to get a human referee to oversee all possible online or virtual games. People playing online should not be able to swindle a victory or a draw by exploiting losing repetition moves that the software is not able to detect. If even a few example cases are wrong, it could lead to many thousands of games ruled incorrectly and even threaten the program’s stability. To illustrate this point, consider diagram 34 (figure 4) from the WXF manual [21]. Black is attempting to checkmate red by moving the cannon to the bottom rank, while red attempts to block the black cannon using the red rook. Black moves back and forth, perpetually threatening checkmate, while red perpetually threatens the unprotected black cannon. The black perpetual kill is allowed, while the red perpetual chase results in a loss for red. If red breaks the repetition, he will end up getting checkmated by the black cannon. But if red continues to perform the repetition, he will lose due to the perpetual chase rule. Either way, red has lost. These situations are not just hypothetical; grandmaster strategy often involves forcing opponents into critical situations similar to this to either force a significant loss of material or deliver a checkmate [22]. Different software implementations have varying degrees of support for the rules. Many popular Chinese Chess software applications [14] fail

Read the complete text