Dagaz: Episodes (Part 2)

“One elephant, one chariot, five foot soldiers and three horsemen make up PATTI, a triple PATTI makes up SENAMUKHU ...”

and ten ANIKINI make up AKSHAUKHINI, and this is the largest military unit ...

Henry Lyon Oldie “A Thunderstorm at the Beginning”



In the last article I talked about drafts and this is not accidental. Drafts, with their compound moves, served as the basis of the project , made up its backbone. Until now, checkers give me surprises. For example, just the other day, I happened to fix a long-standing bug related to the delayed capture option. And in general, as I said, checkers games are greatly underestimated. But the matter is not limited to checkers only ...



Chess



Chess does not seem to us some kind of unusual game, but it's all just because we are very used to it. Take, for example, a pawn . If you think about it, this is a very unusual figure. The only chess player that doesn’t beat like he walks. And the rule of taking on the aisle is completely difficult to consider something obvious (yes, yes, I know, it happened historically). But let's not talk about the banal. A pawn can turn into other pieces! Moreover, unlike most other traditional chess games , the choice is not limited to a maximum of two options.









Under this thing, I had to learn how to draw graphical dialogs, right on canvas. Up to this point, pawns turned only into queens, which was somewhat inconvenient in those games where queens are absent. But there are also those in which the available range of shapes depends on the field on which the transformation takes place!









Another important point is the presence of "royal" figures in the game. Of course, this is not a chess invention. The main figures are present in many ancient games. Dablot , Damone , Altai Shatra - in all these games, the “king” can be trapped, thereby completing the game ahead of schedule. Especially piquant games in which ordinary figures can turn into kings. In “ Shashmati ”, for example, the player has a choice: to obtain, as a result of the transformation, a stronger figure or to protect himself by creating a “spare” king.



In all these games, the player loses having lost all the royal pieces. So, if “prince” and “king” are present on the board, to win it is necessary to capture both of them. Such an understanding of the “rule of sudden death” is characteristic of ancient games such as Chaturanga , but already in Chatranja chess thought goes further. Now the king cannot be attacked - this is an inviolable figure, but the player does not have the right to leave his main figure under attack! If it is impossible to avoid the threat to the royal figure, the game ends. So the concepts of shah and mat appear.



Strictly speaking, this is not the case in all chess games.
The main problem of really big chess games is the presence of several kings in the game. In especially neglected cases, the matter is complicated by the elaborate rules for ending the game. For example, in “ Ko Shogi ” the victory is brought by taking the figures “General” and “Middle troop” or “General” and “Banner”. At the same time, the “Middle troop” can turn into a “Governor” (and the rules for turning into “Ko Shogi” are a separate big topic), which, in this case, also needs to be taken. All this devilishly complicates the concepts of check and checkmate. It is much easier to allow royal figures to be taken, dealing with the situation that has arisen along the way. Another factor breaking the idea is the game of more than two players.









Here the concept of the shah (as a threat to the king) becomes even more abstract. In fact, if the southern player attacked the king of the western player, the latter does not have to do anything about this, because before the South gets the right move again, the North and East can significantly correct the situation. In addition, Yonin Shogi has a reset rule , and kings, like other figures, are allowed to be taken to their reserve. Of course, in order to continue the game, the player must keep at least one of his kings on the board (and not in reserve) (more can be, but there is no sense), and in order to win, he must gather under his command the kings of all four armies.



But even if we consider only those games in which the rules of "check" and "checkmate" are in effect, everything is not so simple. First of all, a full check on all kinds of threats to the king is quite costly. Given that attacks, in general, may not necessarily be only chess (in “ Belarusian Chess, ” for example, you can attack the king with checkers, and priority in taking checkers allows you to checkmate with the king ) it would be tempting to generate all valid moves followed by verification of threats to the king. In practice, this is too slow. You have to duplicate the pattern movement scheme to check for possible threats without generating a list of moves.



With the check on the "mat", too, were difficulties. For a very long time, I considered the condition of defeat the absence of a possible move (taking into account the prohibitions due to the king under the check, of course). In general, this is not so wrong, given that in most games (including chess) it is. But not in Chess ! Fortunately, in version 1.2.7 I figured out how to fix the situation without sacrificing performance and now the pat is detected correctly. By the way, the same check for possible threats is also used by bots (which greatly improves the quality of their game), but all the same, the AI ​​in Chess is disgusting (the debut library helps a little). Here I can only sin on myself. All the same, high-quality chess AI is not mine.









All this does not negate the fact that in chess games there is something to be confused about. This game, of course, is to a large extent a joke (and I don’t have confidence that I managed to fix all the errors in its implementation), but it’s quite possible to play seriously in the similar Momentum Chess . With the interpretation of the mat itself, options are also possible. For example, a king may be general or there may be a piece in the game that must always be under the check (there is one, however, it is impossible). In general, chess is fun.



What else can be learned from this game? In Chess, there is a most amusing move, during which two pieces move simultaneously. Of course I'm talking about castling . For my project, this concept is as important as the composite move borrowed from drafts. There are many games in which it can be applied. Dameo , Abalone , Ordo - in all these games, the pieces move simultaneously. But you can go even further!









I agree, this is quite far from the original concept of castling, but why limit yourself? It is necessary to squeeze everything out of the inherent concepts to the maximum.




All Articles