Dagaz: Kicks to Common Sense (Part 2)

    imageI added a bit of agility -  
    Everything is not so gloomy near:
    In the world of chess, a pawn can go out -
    If you train, go   to the queens!

              Vladimir Vysotsky “ Honor of the Chess Crown
     

    Rules, especially as complex as castling or “ taking on the aisle”", do not appear from scratch. No one invents them just to annoy the developer (in any case, I hope so). In such" established "games as Chess or Checkers, each of the rules has been plagued by decades. Thousands of games in dozens of countries, all over the world. This is invaluable material for analysis. Unsuccessful solutions die off, successful ones flourish in hundreds of different options (among which there are also successful and not so good). Today, we will talk about two especially successful finds ... 

    9. Transformations and dumping


    In many games, there are figures that move "just forward." This is a very good design decision, which does not allow the figures to "stagnate", as well as exacerbating the struggle of the parties (since this is the "forward", usually located on the territory of the enemy). But what to do with the figures that have reached the end of their journey? One of the possible solutions is the degeneration of the figure, with the acquisition of new properties. Often, the appearance of such transformed figures in a game takes it to a fundamentally new level. A good example is the transformation into a “queen” of the usual “checkers” in a game like “ Russian Checkers ”.

    Italian version
    The Italians offered their vision of the game . Their lady is almost no different from the English, but can not be "eaten" by an ordinary figure. The strength of her status is inviolable. Only an equal figure can defeat her. Of course, the privileged position of the lady does not prevent her from "understanding" with ordinary figures. This version of the game, apparently, inherited the rule of “immunity” of the ladies from the more ancient Italian game Damone , in which hierarchical relations were even more complex (in addition to the usual ladies, the “Emperor” was present in the game). As always, the rules of the game can tell a lot about its creators.

    Unlike the English version , in which the ladies get only the opportunity to move (including taking) back, the appearance of a “flying” lady in “Russian Drafts” literally blows up the game. Due to its maneuverability, it turns into a real “doomsday weapon”, with terrifying efficiency, “cutting down” crowds of ordinary checkers. An adversary who has no dams in his arsenal is doomed to defeat. The bad point is that even if there are ladies on your side, you can not always catch a single lady of the enemy. The abundance of possible "draw" results, of course, does not benefit the game. Giving the figure super powers, it is important not to overdo it.

    By the way
    There is a very interesting way to combat the "no man's death" of Russian drafts. The fact is that a long-range lady becomes invulnerable only on the main diagonal of the board. If the lady managed to "get on the big one" even three enemy ladies will not be able to defeat her (otherwise, the " Petrov triangle " will help them ). If the main diagonal gives the lady such power, why not strip the board of the main diagonal? Just adding two more verticals to the board solves the problem .

    Another approach can be gleaned in Thai Drafts . In this version of the game, the lady retains her range, but is obliged to stop at the next free field, after a “broken” figure. Only two opponent's ladies can defeat such a lady (regardless of her location on the board).

    In games of the chess family, the main candidate for transformation is certainly a pawn. Not in all chess games a pawn turns into a different piece. In Xiangqi , for example, “crossing the river” and finding itself on the territory of the enemy, it only gets the opportunity to move horizontally, including with capture (in the Korean Chang, a pawn initially has such an opportunity). The rules of the pawn move to Altai Shatra are even more bizarre :



    Perhaps this is the craziest (in a good way) cross between checkers and chess that I have seen. From its initial position, a pawn located not in the “fortress” moves only forward, and, with the first move, it can “jump” through one square, just like in Chess. The capture “on the aisle” works, but it looks somewhat bizarre, since all capture is carried out “on a checkerboard” by jumping over the opponent’s piece. Approaching the middle of the board, the pawn receives additional moves diagonally forward, and after crossing the “moat” it also gets the opportunity to move horizontally.

    The moves of a pawn in this game are determined not by the status of the piece, but only by its location on the board, but unlike Syantsa, a pawn in a tent canmove backward, since taking back is possible (and mandatory for a pawn). In this case, the pawn may lose some of its possible moves. Having reached the last horizontal (located in the “fortress” of the enemy), a pawn can still turn, but only into a figure “cut down” earlier. As long as the completeness of the pieces has been saved, the player can keep the pawn in the “fortress” (possibly “cutting down” the opponent’s pieces) or place it on any of the free squares in half of the opponent, from where it can repeat the rest of its path.

    The rule of “transforming" a pawn has existed in chess for a long time. In Chaturanga (in its doubles version) and in Shatrange, a pawn, reaching the last horizontal, turned into a queen (a weak piece that went diagonally on one square). In the Thai version (Makruk ) a pawn also turns into a weak queen, but 6 horizontally (reaching the "camp" of the enemy). In addition, in this game, pawns are initially located on 3 horizontal lines. Of course, with this arrangement, the need for an initial “jump” of a pawn, as well as a “capture on the aisle,” is absent.

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



    Even more bizarre is the transformation of a pawn into Malaysian chess ( Mine Chator ). Having reached the last horizontal line in any place, except for the corner fields, the pawn should move back to one of the main diagonals. There, she can turn into the piece in front of which she stood in the initial arrangement (the royal pawn turns into a queen). In a similar way, there is a transformation in the modern version of the “quadruple” Chaturanja , but there are additional restrictions:

    • The pawn turns, reaching the last horizontal
    • Each pawn can only turn into a piece along the line of which it reaches the edge of the board, taking into account their arrangement at the beginning of the game, and only if at least one of the pawns is already removed from the board
    • If a player has all four pawns on the board, no transformation at all
    • If a player has one or two pawns, he can turn a pawn into a knight or bishop
    • If a player has a pawn, a rook and a king and nothing else, a pawn can become any piece, regardless of the field of transformation
    • If a pawn cannot transform, it remains on this field until the possibility of transformation

    This idea is further developed in Tamerlane Chess . In addition to the pawns-pieces, in this game, there is a pawn that turns into a king (which will be explained by the presence of several kings in a chess game in one of the following parts), as well as the “Pawn of pawns”, whose life path is a real epic.

    Having reached the transformation field for the first time, it can remain in place indefinitely (the enemy has no right to chop it). Then, it can be put on the board at any place where it will threaten two pieces, or a piece that cannot make a move. You can do this even if the desired field is occupied by your figure (annoying interference is simply removed from the board). Having reached the transformation field again, the "Pawn pawn" moves to the starting position of the royal pawn, from where it can repeat its path again. After passing the long-suffering pawn through the entire board for the third time, the player can get at his disposal a third king.

    The Japanese, as always, developed the idea of ​​"transformation" and brought it to its logical conclusion. In shogiany figure, except for the king and the "Golden General" can be turned into an enemy camp (the last three horizontals, as in the game of Macrook). For pieces that are not able to continue their movement (pawn, knight, pike), the transformation is mandatory. The remaining pieces can be turned by any move on the territory of the “camp” of the enemy. All figures, except for “dragons”, turn into “Gold” (analogue of the “Golden General”). Dragons (analogues of chess rooks and bishops) turn into their reinforced versions. I will talk about Shogi in more detail at the end of this part.

    The familiar Chess is different from all of the above (with the exception of the Altai Shatra) in that the transformed pawn has a choice. In some positions, it may be more advantageous to obtain, for example, a knight rather than a stronger queen. From an implementation point of view, 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'll tell you later). If there are several possible moves from the starting position to the target, a pop-up window opens, allowing you to select one move from the list.

    Of course, the inventors of modern chess could not pass by such a wonderful opportunity as the transformation of pieces. The first thing that comes to mind is the transformation of the figure "on demand." The figure, having made a “move in place,” turns into another, at the request of the player. Too Much Chess is a great example of such a 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 upper and lower parts in places:



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

    Another example of the successful use of shape transformation is the Fusion Chess family . In games of this family, a figure acquires the properties of a “beaten” figure (one’s own or another’s, depending on the type of game). Thus, having beaten an elephant, the rook turns into an analogue of the queen, and the king, combined with the elephant or rook, turns into an extremely mobile monarch. In Fusion Chess, where merging occurs with your pieces, the combined pieces can subsequently be split, at the request of the player:



    An interesting development of the idea are games with “directed” figures, such as Rotary . Each figure can walk and hit in the directions indicated on it and can "turn" at the request of the player. Pawns, reaching the last horizontal, turn into one of the figures (except the king), to choose from:



    In a similar game, Stations exploits the "space" theme. The “ships” in it can not only fly in the direction where the “turrets” are looking, but also defend in these directions (at the end of the turn, the figure can be rotated at an arbitrary angle). To beat the "dreadnought", protected in 5 directions out of 6 possible, is almost impossible. "Station", freely moving around the field, can be beaten from any direction.



    Unfortunately, playing such games with ZoG is not very convenient. The choice of the many options for moves associated with the rotation of the pieces 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 easy.

    Transformations can occur regardless of the desire of the player. For example, at the end of the move to the vertical of the corresponding piece. 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, as 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 battle changes its color to the color of the eaten figure and having the sonorous name Andernach , after prolonged torment, I still managed to implement in ZoG. This is not to say that it is very playable. Any battle on the board leads to the loss of one’s own piece and a possible strengthening of the opponent’s piece (to beat with strong pieces, of course, is easier than weak). Not everything that looks interesting in the composition is suitable for a full-fledged game of two players.



    An interesting (and extremely fleeting) is a variant of chess called Benedict Chess . There is no battle at all in this game! Any figure that is hit by an opponent immediately changes its color. The game ends with "repainting" 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 generally accepted in Shogi, meaning the location of the figure one field above), temporarily acquires the properties of the latter. The initial arrangement of the pawns is due to the fact that it would be unreasonable to give the four pawns the quality of “dragons” from the first move:



    A very interesting figure is the "Chameleon" from the Ultims I mentioned earlier , which hits the figures in the way that they themselves. Playing chess by such rules is also possible. For example, in Ralph Betz's Inverse Capture Chess, each piece beats with the move it takes. To attack the king from afar, in this game, is simply impossible. In Ultima, with its various capture rules, 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 set by the player (once per game) in the initial field of any piece that made its first move in the game. The jester’s moves copy the course of the last advancing enemy piece. In addition, this figure immobilizes all enemy figures located on adjacent fields. The enemy's jester, in turn, can “remove the freeze” by coming close to the blocked figure.

    The “freezing” of a figure is also one of the options for changing its “behavior”. Figures that immobilize enemy figures, when approaching them, like the “Basilisk” from 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 figure “Bodyguard” (Chia) is used, which can stop any long-range piece except a horse:



    Entering the area of ​​its action, any figure can move only one cell per move. This quality also protects the bodyguard itself. The queen cannot eat it in one go. He must come closer, getting under the blow. The bodyguard performs its protective functions perfectly. He does not protect against horse attacks, but it is forbidden to put a mate with a horse in Shatar and Khiashatar. In " Xiangqi of the Seven Kingdoms " there was another defensive figure (Diplomat), but it could only block the line of attack. Bodyguards in Khiashatar are much more effective.

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

    Shogi dumping restrictions are simple and logical. First of all, all pieces are discarded on the board in an unformed state. In the next move, the pieces dropped into the enemy camp can be turned, at the request of the player. Further, it is impossible to reset figures to those fields from which they cannot make a move (otherwise, they would remain on these fields, since they could not turn). For the peak and pawns this is the last horizontal, for the horses - the last two horizontal. This rule does not consider the possibility of restricting the move by other pieces, we are talking about places from which the pieces cannot make a move, on an empty board. There are two more rules related to pawns.

    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 reset rule, combined with a relatively small number of long-range pieces, turns Shogi into "melee" chess. In fact, if there is at least one piece in the player’s hand, it is practically impossible to checkmate from afar. It is almost always possible to defend against such a threat by dumping a piece.

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


    The order in this menagerie was established in the 16th century by the emperor Go-Nara . In fact, the emperor approved the set of rules (including the reset rule) by which Shogi is played to this day. 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 evolves, borrowing new pieces, such as the Chinese chess guns used in Cannon Shogi .

    A reset rule can work without an explicit reserve. For example, in Genesis Chessthe game starts with an empty board. The player, on his own, can add a new piece to the field, or move one of his pieces previously installed on the board. The eaten pieces are not returned to the reserve. When adding pieces to the board, it is advisable to be able to prioritize moves. So, for example, the king should be put on the board with the very first move, before placing other pieces.

    An interesting version of this game is used in one of the missions of the Chaos campaign in the game Battle vs Chess . In this mission, a lone black king confronts an entire army. Each move, black can add new pieces to the board. In this case, the pieces must be added in order of precedence: first all the pawns, then light pieces, rooks, and only the last - the queen. Implement a reset rule in ZoGquite complicated. ZRF has the ability to define drop paths that add shapes to the board. Assigning the necessary priorities to these moves, you can implement Genesis Chess:

    A fragment of a possible implementation 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)
             (O-O)
             (O-O-O)
          )
          (drops 
              (move-type kingdroptype)
              (add-to-empty)
          )
       )
    


    The off keyword used in the board-setup section means that the pieces are not yet placed on the board (indicates the number of pieces available for use by the player). The phrase drops defines the reset moves, and move-priorities ensures that the king will be added to the board with the very first move, by each of the players.

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

    Shogi implementation fragment
    (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)
    )
    


    Transforming shapes may require the use of several different mechanisms provided by ZoG. In the event that only aspects of the piece’s behavior are changed, and not its appearance, attributes can be used (just as in the implementation of Chess, an attribute is used to determine the immobility of the king and the rook before blocking). If the moves of a piece depend only on its location on the board (like the moves of a pawn before becoming the Altai Shatra), it is enough to check whether the piece is in a certain zone.

    If the appearance of the figure should change - there is no choice, the type of the figure or its owner must be changed. Changing the type of the figure moved as part of the progress is carried out by the extended add commandcompleting the formation of a move in ZoG. Her argument is the type of piece that the piece executing the move should turn into. If the list contains more than one element, several moves of the same type are formed and ZoG displays a menu for selecting a move 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:

    A 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 owner of a figure, you can use the change-owner and flip commands . With the change-type command, you can change the type of the piece that did not execute the move (as a side effect of the move). Unfortunately, the target owner of the figure is not indicated in the teams , 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 ZRF. This 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 this is easily verified) that the Benedict Chess does not track “opened” threats. The changes concern only the pieces that came under the blow of the piece that made the move. If the move of one piece opens an attack of another, it is ignored. We leave aside the question of the playability of such an option and consider only the possibility of its implementation. In order to track the “opened” attacks, we would need to sort out all the friendly pieces (which is not a trivial task in ZoG), and then all their attacks, changing the owner of the enemy’s pieces that were hit. At the same time, the list of friendly figures will be replenished and you will need to keep track of newly added figures so as not to perform checks for them. In general, this is a rather difficult task. As for the analogue of Benedict Chess for more than 2 players, it, alas,

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

    Andernach Chess implementation snippet
    (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. One unobvious feature of ZRF saved me. In the event that a new piece is created on the target field with the create command , it is more priority than the piece making the move. The piece that completed the move is deleted automatically, since two pieces cannot simultaneously occupy the same field. Transformations and resetting figures are not the tasks that ZoG or Axiom could not handle, but, in some cases, you have to rack your brains over a lot and work a lot with your hands. ZRF has more serious problems, but I will talk about them in the following parts.

    Also popular now: