📜 ⬆️ ⬇️

Dagaz: Kicks to common sense (part 2)

image I still added a bit hurried -
Everything is not so gloomy near:
In the world of chess, a pawn can come out -
If she trains, she can be queens!

Vladimir Vysotsky "The Honor of the Chess Crown "

Rules, especially such complicated ones as castling or “ taking on the aisle, ” do not appear from scratch. Nobody comes up with them just to annoy the developer (at least, I hope so). In such “established” games as Chess or Checkers, each of the rules has been won over decades. Thousands of games in dozens of countries around the world. This is invaluable material for analysis. Unsuccessful decisions die off, successful ones - flourish in hundreds of different options (among which there are also both successful and not so good ones). Today, we will talk about two particularly successful finds ...

9. Transformation and reset


In many games there are figures that move "only forward." This is a very good design solution, which does not allow the figures to “treading water”, as well as the intensifying struggle of the parties (since this is the most “forward”, usually located on the territory of the enemy). But what to do with the figures that have reached the end of their path? One of the possible solutions is the rebirth of a figure, with the acquisition of new properties by it. Often, the appearance in the game of such transformed figures takes it to a fundamentally new level. A good example is the transformation into the “lady” of the usual “checkers” in a game like “ Russian checkers ”.
')
Italian version
Italians offered their vision of the game. Their lady is almost no different from English, but can not be "eaten" by a regular figure. The strength of her status is intact. Only an equal figure can overcome it. Of course, the privileged position of the woman does not prevent her from “sorting out” with ordinary figures. This version of the game, apparently, inherited the rule of "inviolability" of the Kings from the more ancient Italian game Damone , in which the hierarchical relations were even more complicated (in addition to the usual Kings, the Emperor was present in the game). As always, the rules of the game can tell a lot about its creators.

In contrast to the English version , in which the Kings get only the opportunity to move (including taking) back, the appearance of the “flying” Kings in Russian Checkers literally explodes the game. Due to its maneuverability, it turns into a real “doomsday weapon”, with terrifying effectiveness of “cutting down” crowds of ordinary checkers. The enemy, who has no ladies in his arsenal, is doomed to defeat. The bad point is that even with the ladies on their side, it’s not always possible to catch a single lady of the enemy. The abundance of possible "draw" results, of course, does not benefit the game. Providing the figure of super opportunity, it is important not to overdo it.

By the way speaking
There is a very interesting way to deal with the “no one’s death” of Russian drafts. The fact is that the long-range lady becomes invulnerable only on the main diagonal of the board. If the lady has managed to “get on the bolshak”, even three enemy queens will not be able to defeat her (otherwise, the Petrov triangle will help them). If the main diagonal gives the woman such strength, why not deprive the board of the main diagonal? Simply adding two more verticals to the board solves the problem .

Another approach can be found in " Thai checkers ". In this version of the game, the dame retains its range, but is obliged to stop at the next free field, after the "bat" figure. Such a lady can be overcome only by two ladies of the opponent (regardless of her position on the board).

In games of the chess family, the main candidate for transformation is definitely a pawn. Not in all chess games the pawn turns into another piece. In Syantsy , for example, “crossing the river” and finding themselves in enemy territory, she only gets the opportunity to move horizontally, including taking (in Korean Changi, the pawn initially has this possibility). The rules of the pawn move in Altai Shatra are changed even more oddly :



Perhaps this is the craziest (in a good way) cross between checkers and chess, one of those that I saw. From its initial position, a pawn located not in the “fortress” moves only forward, and, in the first move, can “jump” through one square, just like in Chess. Capturing “on the aisle” works, but it looks somewhat bizarre, since all captures are carried out “on a checkerboard”, jumping over the opponent's figure. Approaching the middle of the board, the pawn gets additional moves along the diagonals forward, and after crossing the “moat” it also gets the possibility of moving horizontally.

The pawn moves in this game are determined not by the status of the piece, but only by its position on the board, but unlike Syantsy, in the Tent the pawn can move back, since taking back is possible (and for the pawn are obligatory). In this case, the pawn may lose some of its possible moves. Having reached the last rank (located in the “fortress” of the opponent), the pawn can still turn, but only into a piece “cut down” earlier. As long as the completeness of the pieces is preserved, the player can keep the pawn in the “fortress” (possibly “cutting down” her opponent's pieces) or place it on any of the free fields on the opponent’s half, from where she can repeat the rest of her path.

The rule of "transformation" of a pawn has existed in chess for a long time. In Chaturanga (in its doubles version) and in Shatranj, the pawn, having reached the last rank, turned into a queen (a weak piece that walked on one field diagonally). In the Thai version ( Makruk ), the pawn also turns into a weak queen, but on 6 horizontals (having reached the "camp" of the opponent). In addition, in this game, the pawns are initially located on 3 horizontals. Of course, with such an arrangement, there is no need for an initial “jump” of the pawn, as well as a “capture on the aisle”.

Very original Burmese Sittuyin . Long before the " Fisher's Chess " it used a free arrangement of pieces. Pawns are very peculiar and no less original is their "transformation." A pawn standing on one of the main diagonals (on the side of the enemy), at any moment of the game, can be turned into a weak queen, but only on condition that the queen was lost. Such a "delayed" transformation is considered a move and the player is not entitled to move other pieces.



The transformation of the pawn in Malaysian chess ( Mein Chator ) is even more bizarre. Having reached the last horizontal in any place, except for the corner fields, the pawn must move back to one of the main diagonals. There, she can turn into the figure before which she stood in the initial set-up (the royal pawn turns into a queen). The transformation in the modern version of the “quadruple” Chaturanji takes place in a similar way, but here there are additional restrictions:


This idea gets its further development in Tamerlan Chess . In addition to the figure pawns, in this game, there is a pawn turning into a king (what the presence of several kings in the chess game I will cover in one of the following parts), as well as the “Pawn pawn”, whose life path is a real epic.

Reaching the field of transformation for the first time, she can stay in place indefinitely (the enemy has no right to chop it). Then, it can be put on the board in any place where it will threaten two figures, or a figure that cannot make a move. This can be done even if the required field is occupied by its own figure (the annoying obstacle is simply removed from the board). Reaching the field of transformation again, the Pawn of the Pawns moves to the starting position of the royal pawn, from where it can repeat its path. Having passed the long-suffering pawn through the board for the third time, the player can get at his disposal the third king.

The Japanese, as always, developed the idea of ​​"transformation" and brought it to its logical conclusion. In Shogi, any piece other than the king and the “Golden General” can be turned into an enemy camp (the last three horizons, just like when playing Makruk). For pieces that are not able to continue their movement (pawn, knight, peak), the transformation is mandatory. The remaining figures can be turned in any course, on the territory of the "camp" of the enemy. All figures, except for "dragons", turn into "Gold" (analogue of the "Golden General"). Dragons (analogs of chess rook and bishop) are transformed into their enhanced versions. I will talk about Shogi in more detail below, at the end of this section.

Chess, which are familiar to us, differ from all those listed above (with the exception of Altai Shatra) in that the turning pawn has a choice. In some positions it is more advantageous to get, for example, a knight, and not a stronger queen. In terms of implementation, this leads to a small user interface problem. Instead of one move, many similar moves appear. ZoG solves this problem simply, universally, but not always successfully (why - I will tell later). If there are several possible moves from the source to the target position, a pop-up window opens allowing you to select one move from the list.

Of course, the inventors of modern versions of chess could not pass by such a remarkable opportunity as the transformation of figures. The first thing that comes to mind is the transformation of the figure “on demand”. The figure, having made a “move on the spot”, turns into another, at the request of the player. Too Much Chess is a great example of this game. All the pieces in it (except the king and queen) are double. The lower figure determines the movement, the upper - shock moves. By clicking on the figure, you can change its top and bottom places:



Most of all, in this game, I like the pawn. Her alter ego - the “Berlin pawn” can move one square diagonally forward and “eat” one square forward. From the initial position, the Berlin Pawn can jump diagonally into two squares. It is a pity that the rule of "taking on the aisle" does not affect it. It would be fun.

Another example of the successful use of turning figures is the Fusion Chess family. In the games of this family, the figure acquires the properties of a “bat” figure (one's own or someone else’s, depending on the type of game). So, after beating the bishop, the rook turns into an analogue of the queen, and the king, having joined with the bishop or rook, turns into an extremely mobile monarch. In Fusion Chess, where the merger takes place with their own figures, the combined figures can be subsequently divided, according to the player’s wishes:



An interesting development of the idea is games with “directed” figures, such as Rotary . Each piece can walk and beat along the directions indicated on it and can “rotate” at the request of the player. Pawns, reaching the last rank, turn into one of the pieces (except the king), to choose from:



In a similar game, Stations uses a "space" theme. "Ships" in it can not only fly in the direction where the "turrets" look, but also defend in these directions (at the end of the turn, the figure can be turned at an arbitrary angle). It is almost impossible to beat the Dreadnought, protected in 5 directions out of 6 possible. A “station” moving freely across the field can be beaten from any direction.



Unfortunately, playing such games with ZoG is not very convenient. The choice of a variety of moves, associated with the rotation of the figures at different angles, is displayed to the player in a pop-up window using ZSG notation. To understand which of the list of moves corresponds to the desired angle of rotation is not at all easy.

Transformations can occur regardless of the desire of the player. For example, upon completion of the move to the vertical of the corresponding figure. The figure can turn into an eaten figure or change its color; there are many possible options. The figures can simply turn into each other cyclically, with each move, the way it happens in Kyoto Shogi (I apologize for the hieroglyphs, there are no more clear design options in the implementation of the game):

By the way
A variant of chess, in which the figure performing the fight, changes its color to the color of the eaten figure and having the sonorous name Andernach , after long suffering, I still managed to realize in ZoG. I can not say that it is very playable. Any fight on the board leads to the loss of his own piece and the possible strengthening of the opponent’s piece (it is easier to beat with strong pieces than with weak ones). Not everything that looks interesting in the composition is suitable for a full game of two players.



An interesting (and extremely fleeting) version of chess, called Benedict Chess . There is no battle in this game at all! Any figure that comes under attack of the enemy immediately changes its color. The game ends with the "repainting" of the enemy king:



Shapes can change their properties, depending on the location and behavior of other shapes. This is not quite a transformation, since the figure only temporarily changes its status, but something very similar to it. As an example, I will give one very successful version of Shogi. The figure located on the “head” of another figure (the term commonly accepted in Shogi, meaning the position of the figure one field above), temporarily acquires the properties of the latter. The initial position of the pawns is due to the fact that it would be unwise to give the four pawns the quality of "dragons":



A very interesting figure is the “Chameleon” from Ultima , mentioned earlier by me , who beats the figures in the way they beat themselves. Playing by these rules is also possible. For example, in “Inverse Capture Chess” by Ralph Betz, each piece beats with the move that it goes by itself. Attacking the king from afar, in this game, is simply impossible. In Ultima, with its various rules of capture, this principle literally flourishes, turning the chameleon into an extremely strong figure:



Another mockingbird is used in an extended version of Omega-chess . The jester does not have his initial position and can be installed by the player (once per game) on the initial field of any piece that made its first move in the game. The jester's moves copy the course of the last opponent opponent piece. In addition, this figure immobilizes all enemy figures located in the fields adjacent to it. The enemy's jester, in turn, can "remove the freeze," coming close to the blocked figure.

The “freezing” of a figure is also one of the options for changing its “behavior”. The figures, immobilizing the enemy, when approaching them, like the "Basilisk" of the three-dimensional Dragonchess are realized quite easily. A more complex figure is used in the Mongolian game Hiashatar . In this game, in addition to the usual chess pieces, the “Bodyguard” (Chia) figure is used, capable of stopping any long-range piece, except for the knight:



Entering the area of ​​its action, any piece can move only one cell per turn. This quality well protects the bodyguard himself. The queen cannot eat him in one move. He should come closer, getting in jeopardy. The bodyguard performs its protective functions perfectly. He does not protect the horse from attacks, but it is forbidden to mate a horse in Shatar and Hiashatar. There was another defensive figure (Diplomat) in “ Syantsy of the Seven Kingdoms ”, but it could only block the line of attack. Bodyguards in Hiashatar are much more effective.

Surely, you have already noticed that in the videos dedicated to Shogi, “eaten” figures do not leave the game, but move to the player’s reserve. Subsequently, the player can put these pieces on the board, for playing on “his side”. Such a move, “from reserve”, is called a reset. The “out of reserve” figure can be installed on almost any free board space (there are a number of restrictive rules). Such a figure (even a pawn) is much stronger than if it stood in its initial position. In addition, no one threatens the figures in reserve. Equal exchanges become extremely profitable for players, because, as a result, instead of pieces on the board, players get the same pieces, but already in reserve.

The limitations of dumping in Shogi are simple and logical. First of all, all the figures are dumped on the board in an unconverted state. The next move, the figures dropped into the camp of the enemy, can be turned, at the request of the player. Further, it is impossible to reset the figures to those fields from which they could not make a move (otherwise, they would have remained on these fields, since they could not turn). For pikes and pawns - this is the last horizontal, for horses - the last two horizons. This rule does not consider the possibility of limiting the course by other figures, we are talking about places from which figures cannot make a move, on an empty board. There are two more rules related to pawns.It is forbidden to “double” pawns (that is, to put two not turned pawns on one vertical) and checkmate a pawn (I will tell about this rule in more detail in the next section).

In tactical terms, the reset rule leads to two consequences. The first is obvious - the endgame phase in Shogi is not associated with a decrease in the number of pieces on the board, since all pieces remain in the game. In addition, the resetting rule, together with a relatively small number of long-range pieces, turns Shogi into a melee chess game. In fact, if there are at least one figure “in the hand” of a player, it is almost impossible to checkmate from afar. It is almost always possible to defend yourself against such a threat by dropping a piece.

The reset rules are the main contribution of Japan to the chess game, but in this way the Shogi were not always played. During the periodHeian - the heyday in Japan of various kinds of arts, there were a large number of different variants of this game. Shogi was played on large boards, with a huge variety of pieces. A familiar 9x9 board today was called a “small” board. In the largest of the known variants, Taikyoku Shogi used a 1296-board (36x36) and a set of 402 figures of 209 different types. Most of these figures could turn.


The order in this zoo was imposed in the 16th century by the emperor Go-Nara . In fact, the emperor approved the set of rules (including the reset rule), according to which they play in Shogi today. The reset rule inspired developers to create new games, such as Chessgi , Fusion Chessgi and Crazyhouse , using more familiar sets of shapes. In turn, the traditional Shogi also develops by borrowing new pieces, such as guns from Chinese chess, used in Cannon Shogi .

The reset rule can work without explicitly allocated reserve. For example, in Genesis Chessthe game starts with an empty board. The player, under its own power, can add a new figure to the field, or move one of its figures previously installed on the board. Eaten pieces are not returned to the reserve. When adding pieces to the board, it is advisable to be able to prioritize moves. For example, the king must be put on the board at the very first turn, before placing other pieces.

An interesting variant of this game is used in one of the missions of the Chaos campaign in the game Battle vs Chess. In this mission, the lonely black king confronts the whole army. Black cane to the board. It is the time of the order of the queen. Implementing a reset rule in ZoG is quite complicated. ZRF with In, IT is Possible to the define drop- a paths That the add pieces to the board. Having been given the priority of these moves, you can implement Genesis Chess:

Fragment of Genesis Chess
(board-setup (White (Pawn off 8) (Knight off 2) (Bishop off 2) (Rook off 2) (Queen off 1) (King off 1) ) (Black (Pawn off 8) (Knight off 2) (Bishop off 2) (Rook off 2) (Queen off 1) (King off 1) ) ) (move-priorities kingdroptype normaltype) (piece (name Pawn) (image White "images\Chess\SHaag\wpawn.bmp" "images\Chess\wpawn.bmp" Black "images\Chess\SHaag\bpawn.bmp" "images\Chess\bpawn.bmp") (moves (move-type normaltype) (Pawn-capture nw) (Pawn-capture ne) (Pawn-move) (En-Passant e) (En-Passant w) ) (drops (move-type normaltype) (add-to-empty) ) ) ; ... (piece (name King) (image White "images\Chess\SHaag\wking.bmp" "images\Chess\wking.bmp" Black "images\Chess\SHaag\bking.bmp" "images\Chess\bking.bmp") (attribute never-moved? true) (moves (move-type normaltype) (king-shift n) (king-shift e) (king-shift s) (king-shift w) (king-shift ne) (king-shift nw) (king-shift se) (king-shift sw) (OO) (OOO) ) (drops (move-type kingdroptype) (add-to-empty) ) ) 


The off keyword used in the board-setup section means that the pieces have not yet been placed on the board (the number of pieces available for player use is indicated). The phrase drops determines the discard moves, and move-priorities ensures that the king will be added to the board in the very first move, by each player.

Unfortunately, it is impossible to add figures (taken from the enemy) to the reserve thus defined. The reserve in the implementation of the Shogi should be defined as a full-fledged part of the board, like the “fortress” in Altai Shatra, only without the possibility of moving a figure out of it through the “gate”. The implementation of such logic in ZoG is extremely verbose. It is required to manually manage the logic of the arrangement of the figures in the reserve, to search for figures of a given type, etc. Here is what the search for free space in reserve looks like (for a 5x5 board):

Fragment of the implementation of Shogi
 (define first-empty to-prison (while not-empty? next-prison) ) ; ... (links to-prison (5i pb0) (4i pb0) (3i pb0) (2i pb0) (1i pb0) (5ii pb0) (4ii pb0) (3ii pb0) (2ii pb0) (1ii pb0) (5iii pb0) (4iii pb0) (3iii pb0) (2iii pb0) (1iii pb0) (5iv pb0) (4iv pb0) (3iv pb0) (2iv pb0) (1iv pb0) (5v pb0) (4v pb0) (3v pb0) (2v pb0) (1v pb0) ) (links next-prison (pb0 pb9) (pb9 pb8) (pb8 pb7) (pb7 pb6) (pb6 pb5) (pb5 pb4) (pb4 pb3) (pb3 pb2) (pb2 pb1) (pw1 pw2) (pw2 pw3) (pw3 pw4) (pw4 pw5) (pw5 pw6) (pw6 pw7) (pw7 pw8) (pw8 pw9) (pw9 pw0) ) 


Transformations of figures may require the use of several different mechanisms provided by ZoG. In that case, if only aspects of the figure’s behavior change, not its appearance, attributes can be used (just as in the Chess implementation, the attribute is used to define the king and the rook still before the blocking is completed). If the moves of the piece depend only on its location on the board (like the pawn moves before becoming the Altai Shatra), it suffices to perform a check for finding a piece in a certain zone.

If the appearance of the figure should change - there is no choice, the type of the figure or its owner should be changed. Changing the type of a figure that is moved as part of a stroke is performed by the extended add command, which completes the formation of a stroke in ZoG. Her argument is the type of piece into which the piece performing the turn should turn. If the list contains more than one element, several moves of the same type are formed and ZoG displays the move selection menu from the list. The transformed figure may not go anywhere (as in Too Mach Chess). Here is a fragment of the implementation of this game related to the transformation of figures:

Fragment of the implementation of Too Mach Chess
 (define Pawn-add (if (in-zone? promotion-zone) (add Knight-on-Bishop Knight-on-Rook Bishop-on-Knight Bishop-on-Rook Rook-on-Knight Rook-on-Bishop Queen) else add)) (define Pawn-move ( $1 (verify empty?) (Pawn-add) (verify (in-zone? third-rank)) $1 (verify empty?) add )) (define Pawn-capture ( $1 (verify enemy?) (Pawn-add) )) (define flip-pawn (to (if (in-zone? promotion-zone) (add Knight-on-Bishop Knight-on-Rook Bishop-on-Knight Bishop-on-Rook Rook-on-Knight Rook-on-Bishop ) else (add Berolina-Pawn)))) (define flip-berolina (to (if (in-zone? promotion-zone) (add Knight-on-Bishop Knight-on-Rook Bishop-on-Knight Bishop-on-Rook Rook-on-Knight Rook-on-Bishop ) else (add Pawn)))) ; ... (piece (name Pawn) (image White "images\TooMuchChess\set1\WP.bmp" "images\TooMuchChess\set2\WP.bmp" Black "images\TooMuchChess\set1\BP.bmp" "images\TooMuchChess\set2\BP.bmp") (moves (Pawn-capture nw) (Pawn-capture ne) (Pawn-move n) (Pawn-En-Passant e) (Pawn-En-Passant w) (flip-pawn) ) ) 


To change the shape owner, you can use the change-owner and flip commands. With the change-type command, you can change the type of the figure that did not perform the move (as a side effect of the move). Unfortunately, the target owner of the figure in the teams is not indicated , as a result, changing the owner of the figure will only work correctly in the games of two opposing players. In my opinion, this is an extremely annoying flaw in the design of the ZRF. Here is how the flip command is used in the implementation of Benedict Chess:

Fragment of the implementation of Benedict Chess
 (define step-flip (if (enemy? $1) (flip $1))) (define step-flip-all (step-flip n) (step-flip e) (step-flip s) (step-flip w) (step-flip ne) (step-flip nw) (step-flip se) (step-flip sw) ) (define king-step ($1 (verify empty?) (set-attribute never-moved? false) (step-flip-all) add) ) 


From the analysis of this code, it is clear (and it is easily verified) that Benedict Chess does not track “uncovered” threats. The changes relate only to figures who are hit by the figure that made the move. If the move of one piece opens another attack, it is ignored. Let us leave aside the question of playability of this option and consider only the possibility of its implementation. In order to track the “opened” attacks, we would need to perform a search of all friendly pieces (which is not a trivial task in ZoG), and then all their attacks, changing the owner of the opponent pieces that were hit. At the same time, the list of friendly figures will be updated and you will need to keep track of newly added figures in order not to perform checks for them. In general, this is quite a challenge. As for the Benedict Chess counterpart for more than 2 players, it, alas, is not implemented by means of ZRF.

There is another problem associated with the change of ownership that I encountered when implementing Andernach. The change-owner command allows you to “switch” the owner of any piece on the board, but with the piece that performs the move, a problem arises. On the one hand, we have to complete the move with our figure, but according to our plan, this figure must change ownership before the completion of the move! change-owner does not help here. Fortunately, there is another team ( create ) that allows you to create a figure on the board with the required type and owner (in the implementation of Circe, this team was also not superfluous).

Fragment of the implementation of Andernach Chess
 (define a-rook-slide-wc ( $1 (while empty? (set-attribute never-moved? false) $1) (verify enemy?) (set-attribute never-moved? false) (create $2 $3) add )) (piece (name WhiteRook) (image White "images\Chess\SHaag\wrook.bmp" "images\Chess\wrook.bmp") (attribute never-moved? true) (moves (move-type with-capture) (a-rook-slide-wc n Black BlackRook) (a-rook-slide-wc e Black BlackRook) (a-rook-slide-wc s Black BlackRook) (a-rook-slide-wc w Black BlackRook) (move-type without-capture) (a-rook-slide n) (a-rook-slide e) (a-rook-slide s) (a-rook-slide w) ) ) 


The implementation turned out to be extremely verbose, but working. I was saved by one unobvious feature of ZRF. In the event that a new figure is created on the target field using the create command, it is of higher priority than the one making the move. The figure that performed the move is automatically deleted, since two figures cannot simultaneously occupy the same field. The transformations and dumping of figures are not those tasks with which ZoG or Axiom could not cope, but, in some cases, it is necessary to take a hard look at the implementation and a lot of hands-on work. ZRF has more serious problems, but I will tell about them in the following sections.

Source: https://habr.com/ru/post/248821/


All Articles