
An important part of working on a universal gaming system is the systematization of the rules. For thousands of years of its development, mankind has come up with an incredible number of board games. Their rules, for the most part, are similar, but some may put the developer at a standstill. These rules are as important as the rest. The
Pareto principle does not work here - either we implement the game completely, 100%, or ...
it will be a completely different game. In the process of working on the Dagaz project, I decided to make my own rating of the rules that are most unexpected or inconvenient for the developer. Meet ...
10. Strange moves
Chess is, perhaps, the first game, about which we recall speaking of board games, but they did not immediately find the features familiar to us. In
Shatranj , their immediate predecessor, the queen was a very weak figure! He walked just one field, on any of the diagonals. The elephant was also not long-range, but was able to jump over the figures. The pawn, having reached the last rank, turned only into a queen (and not into any piece to choose from, as it is now). Rook went according to our usual rules, but it still needed to bring to the "operational space". In general, the game was very slow, but this was offset by the presence of a huge number of
tabies - initial positions from which players, by agreement, could begin the game.
First kickApparently, without knowing about the tabias, the people of Ethiopia decided to overcome the slowness of Shatrange in their own way. In their
version of this game, the first moves were performed by the players independently of each other (who managed to do it). Only after the first capture, the normal alternation of moves was established. This blow to common sense is today out of competition, because I simply cannot imagine how to implement such a requirement in a universal gaming system. By the way, such a game of “speed” is very characteristic for the inhabitants of the African continent and is found not only when playing chess.
The horse is another figure that has remained almost unchanged since
Chaturanga . He has forgotten how to jump figures (both his own and his opponent) into
Xiangqi and
Changi , and in
Shogi can only move forward (which, in its own way, says a lot about the mentality of the Japanese), but this figure, as before, remains the most recognizable in all games chess family. It was on the basis of the horse that new types of figures, such as the
Chancellor and the Archbishop, were "designed" for the first time. Subsequently, the flow of such
chimeras became so intense that a special
classification system was needed for newly invented figures, but not a horse, in my opinion, is the strangest figure.
A pawn is the only piece in Chess, the capture of which differs from the usual move. The “chess” principle familiar to us (the figure that performs the taking is set to the place of the taken figure), so far remains unchanged, but the pawn moves one field forward and hits diagonally. This is the smallest problem for the developer, the trouble starts next.
')
In order to capture the center of the board as quickly as possible, the pawns were given the right of a double move from the starting position (in some variants of chess, with larger boards, the pawn jumps even further). Since such a jump allowed the enemy to break through the pawn line, as a result, the rule of “
taking on the aisle ” appeared, and this is already a disgrace. The chess principle is violated here. It is not the field on which the enemy figure stands, but the field through which it has been attacked. Moreover, such a move can be made only on the next move after the "jump" by the opponent's pawn. Let's see how it affected the developers:
En-Passant (ZoG)(define En-Passant ( $1 (verify enemy?) (verify last-to?) (verify (piece? Pawn)) capture n to n (verify last-from?) add ) )
looks a little harder than usual taking:
(define Pawn-capture ( $1 (verify enemy?) (Pawn-add) ) )
Shamanism with movements is a small part of the problem.
ZoG developers had to introduce a new predicate
last-from into the core
? that checks for the fact that the previous move (of the opponent) was performed from the current field. Such a decision is difficult to regard otherwise than the hasty and not very successful "crutch." It is not universal and does not work in more complex cases. For example, in
four-sided chess , the rule of capture on the aisle can be applied to the player sitting opposite, but the previous move is performed not by him, but by the player sitting on the side, resulting in
last-from? does not work! I had to think about a more universal solution:
En-Passant (Dagaz) (define pawn-jump (check (not is-moved?)) (set! turn-jumped turn-number) (check-source Pawn) (check n) (check is-empty?) (check n) (check is-empty?) (drop-pieces current-pieces) add-move ) (define (en-passant piece-type direction) (check-source piece-type) (check direction) (check is-enemy?) (check (<= 1 (- turn-number turn-jumped))) capture (check n) (check is-empty?) (drop-pieces current-pieces) add-move )
If you think that the strangeness of the chess we are used to are limited to “taking on the aisle”, think again. There is a move in Chess, during which several pieces move at once! Yes, it is
castling . She also did not appear immediately and not from scratch. The history of the issue can be found in this wonderful
article . The idea is to hide the king in a “fortress” in one move and, at the same time, bring a heavy figure into battle is beautiful, but the developers suffer again:
Castling (ZoG) (define OO ( (verify never-moved?) e
And it is only short! I did not give a long one, for reasons of humanity. I am grateful to the sky and the whole civilized chess community for the fact that, until today, the “free castling”, so beloved by the Italians, has not been preserved. Especially for the implementation of castling, the developers had to enter the
cascade command into the ZoG core, allowing them to involve several figures in the execution of the move. Here, I will not say anything bad, a good universal solution, but I decided not to limit myself at all with stupid conventions. Castling begins with the king moving, but who said that only one figure should walk?
Castling (Dagaz) (define OO (check (not is-moved?)) (check not-attacked?) (take-piece-to-head current-pieces) (check w) (check is-empty?) (check (not-attacked? King)) (check w) (check is-empty?) (check (not-attacked? King)) (drop-pieces current-pieces) (check w) (check (not is-moved?)) (set! is-moved? true) (take-piece-to-head current-pieces) ee (drop-pieces current-pieces) add-move )
The possibility of castling is associated with the performance of a number of interesting conditions. So castling is impossible if:
- the king or rook already went to the party
- the king is in check
- the king as a result of castling falls under the check
- the field through which the king must pass is attacked by the opponent's figure
- between the king and the rook, in the direction of which the king swaps, there are other figures
Checking the last condition is trivial. In order to check the first condition, the attributes of the figures were introduced in ZoG (a very useful feature, though I think it would be even more useful if the attributes could store not only boolean values). As for the rest, this is a topic for a separate and very serious conversation in one of the following sections.
As you can see, in the implementation of classical Chess, there is something to break your head, but the real fun begins in chess is not classical. What will happen if you put together
Chess ,
Hnefatafl ,
Checkers ,
Fanoron , add one unique, not like anything else figure, mix it thoroughly, but do not stir it up? I do not know about you, but
Robert Abbott , in 1962, turned out to be
Ultima .
In this game, everything is unusual. Perhaps only the king continues to adhere to chess principles. Here you can see the illustrated guide of the rules on which the figures walk. For the developer, in this celebration of life, the most important thing is that, in this game, more often than not, the field to which the figure walks is attacked, and sometimes even several fields at once. This fact has far-reaching consequences, but this is again a topic of conversation in a subsequent section. Another example of such a “problem” game is
Ritmomachia .