Building Makruk Endgame Tablebases: A Computational Study of Ma-Bia Ngai and Khon-Bia Ngai Endgames
Main Article Content
Abstract
This research aims to construct Endgame tablebases for the Makruk (Thai Chess) game in order to analyze the outcomes of two complex endgame patterns 1) Ma-Bia Ngai (Knight with Promoted Pawn) and 2) Khon-Bia Ngai (Bishop with Promoted Pawn), considering whether these positions result in a win or a draw according to the rules of Makruk. In the first pattern, the chasing side consists of one King, one Knight, and one Promoted Pawn, while the escaping side has one King. Computer analysis revealed a total of 11,930,016 legal positions, of which the chasing side can force a win in 472,900 positions, requiring a maximum of 36 moves, accounting for 3.96% of all positions. The remaining 11,457,116 positions (96.04%) result in a draw. This pattern is not affected by the Makruk rule on counting the Knight’s moves, which allows the escaping side to count up to 64 moves. In the second pattern, the chasing side consists of one King, one Bishop, and one Promoted Pawn, while the escaping side has one King. Analysis found a total of 12,170,304 legal positions, of which the chasing side can force a win in 10,438,976 positions, requiring up to 57 moves, accounting for 85.77% of all positions, and 1,731,328 positions (14.23%) are draws. However, according to the Makruk rule on counting the Bishop’s moves, the escaping side may count up to 44 moves, which must be adjusted based on the total number of pieces on the board (4 pieces: one chasing King, one Bishop, one Promoted Pawn, and one escaping King). Consequently, the chasing side can only move for 41 moves, and if it fails to checkmate within this limit, the game is considered a draw. This adjustment reduces the number of positions where the chasing side can force a win to 10,160,936, lowering the winning ratio to 83.49%, as 278,040 positions require more than 41 moves to complete.
Article Details

This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License.
References
Anthony, T., Tian, Z., & Barber, D. (2017). Thinking fast and slow with deep learning and tree search. arXiv. https://doi.org/10.48550/arXiv.1705.08439
Breda, G. (2006). KRK chess endgame database knowledge extraction and compression [Master's thesis, Technische Universität Darmstadt]. TUbiblio. https://tubiblio.ulb.tu-darmstadt.de/51627/
Haque, R., Wei, T. H., & Müller, M. (2022). On the road to perfection? Evaluating leela chess zero against endgame tablebases. In C. Browne, A. Kishimoto & J. Schaeffer (Eds.), Advances in computer games, Lecture Notes in Computer Science (Vol. 13262, pp. 142-152). Springer. https://doi.org/10.1007/978-3-031-11488-5_13
Haworth, G. M. (2019). Chess endgame news: 7-man ‘Syzygy’ DTZ 50 EGTs. ICGA Journal, 40(10), 1-2. https://doi.org/10.3233/ICG-190087
Huntington, G., & Haworth, G. M. (2015). Depth to mate and the 50-move rule. ICGA Journal, 38(2), 93-98. https://centaur.reading.ac.uk/id/eprint/39103
Janko, V., & Guid, M. (2016). A program for Progressive chess. Theoretical Computer Science, 644, 76-91. https://doi.org/10.1016/j.tcs.2016.06.028
Nalimov, E. V., Haworth, G. M., & Heinz, E. A. (2000). Space-efficient indexing of chess endgame tables. ICGA Journal, 23(3), 148-162. https://doi.org/10.3233/icg-2000-23304
Prapaithrakul, T. (2023). Winning strategies of multimove games on some asian chess games [Doctoral dissertation, Thammasat University]. Thammasat University e-Thesis Archive. (in Thai)
Rodloytuk, P. (2024). Communicating the soft power of Thailand’s cultural heritage through traditional sport (Thai Chess). Arts of Management Journal, 8(3), 15-38. (in Thai)
Sadmine, Q. A., Husna, A., & Müller, M. (2024). Stockfish or Leela Chess Zero? A comparison against endgame tablebases. In M. Hartisch, C.-H. Hsueh, & J. Schaeffer (Eds.), Advances in computer games (pp. 26-35). Springer. https://doi.org/10.1007/978-3-031-54968-7_3
Silver, D., Hubert, T., Schrittwieser, J., Antonoglou, I., Lai, M., Guez, A., Lanctot, M., Sifre, L., Kumaran, D., Graepel, T., Lillicrap, T., Simonyan, K., & Hassabis, D. (2018). A general reinforcement learning algorithm that masters chess, shogi, and Go through self-play. Science, 362(6419), 1140-1144. https://doi.org/10.1126/science.aar6404
Tudsuan, T., & Jearanaitanakij, K. (2021). Heuristic method for tablebases: A case study of Thai chess endgame in king-knight-queen-king pattern. Ladkrabang Engineering Journal, 38(2), 17-30. (in Thai)
Van Rijn, J. N., & Vis, K. (2014). Endgame analysis of Dou Shou Qi. ICCA Journal, 37, 120-124. https://doi.org/10.3233/ICG-2014-37208
Wu, R., & Beal, D. F. (2001). Fast, memory-efficient retrograde algorithms. ICGA Journal, 24(3), 147-159. https://doi.org/10.3233/icg-2001-24303