Looking for Spock

“But I am curious about Cho,” said Ugryz.

“Why do you have traffic jams on your hat?”

“To keep the flies away,” Rincewind explained.

- And how it turns out?

“No pepper is clear,” Clancy snorted.

- If it helped, someone would have thought of entoy long ago.

- Well yes. I thought of it, ”said Rincewind.

- Be Spock.



Sir Terry Pratchett "Last Continent"



This game symbolizes continuous spiritual search, fighting stereotypes and reconciliation with your alter ego. Okay, who am I trying to fool? I just saw her in a dream.



Of course, with the classic stone-paper-scissors scheme, I was familiar long before that. As with its “extended” version, designed to solve the problem of a high probability of “replay” when opponents throw out the same figures (however, this addition, for obvious reasons, does not help the heroes of the Big Bang Theory ). Let me remind the rules:



Scissors cut the paper. The paper wraps the stone. The stone crushes the lizard, and the lizard poisons Spock, while Spock smashes scissors, which in turn cut off the head of a lizard that eats paper that has evidence against Spock. Spock evaporates the stone, and the stone, of course, blunts the scissors.



There are even more advanced schemes.






But I would not want to delve into the esoteric.



I have long wanted to adapt these (or similar to them) rules for chess games. Such patterns of interaction of figures, allow you to perform complex tactical constructions, "closing" from one figure by another. At the same time, there is no “strongest” piece in the game, each piece can be beaten by some other one.



Parallels and meridians
Of course, one can not forget about the famous Chinese game " Jungle ", which served as the prototype for a more "adult" version of " Chinese military chess ." In Western countries, it is better known to be very similar to them, but perhaps the simpler game " Stratego ". In all these games, the goal is not the destruction of enemy pieces, but a breakthrough into enemy territory and "capture the flag." The complex interdependencies of the “force” of the figures serve only as a background, forcing the gameplay to play with new colors.



Similar principles are used in Ko Shogi , a challenging 18th century chess game. The problem of this gaming system is the presence of "artillery" - a large number of figures "shooting" at long distances without moving to the attacked position. Without any deterrent, the game would turn into a meaningless slaughter. The situation is saved by “Shield” and “Shield Unit”, located on the field in large numbers and immune to shots.



Part of the requirements for the new game was related to the fact that I planned to use it for debugging the game AI, as part of my Dagaz project. The playing field should have been small. I stopped at a 5x5 square board. To prevent the figures from “pushing” in such a limited space, I allowed them to “jump over” friendly figures as if they were empty fields. The figures themselves were supposed to be recognizable:



Stone - moves one field in any of the eight directions (although, through a chain of pieces of its color, it can suddenly jump to the other end of the board). According to the scheme, he attacks "Scissors" and "Lizard" - the main killers in the game (and, of course, immune to their attacks). This is the most massive figure, a component, a kind of human shield. The figure is mobile, but slow.



Scissors - can only be moved diagonally (if necessary, jumping over figures of their own color), beat "Lizard" and "Paper" ("Spock" is the main figure of the game, "Scissors" is not beaten). This is an analogue of the chess " Elephant ".



The lizard is the most powerful killer, an analogue of the chess “ Queen ”, moves in any of eight directions to any number of fields and hits “Paper” and “Spock”. Must move around the field very carefully, because it is vulnerable to attacks "Scissors" and "Stone."



Paper - moves orthogonally, like a chess " Rook ". As well as the "Lizard", it beats the "Spock", but, in addition, it can also attack the "Stone".



Spock - the main figure in the game. If a player doesn’t have a single Spock (and there may be several of them during the game), he lost (also, traditionally, a failure is the impossibility of completing the next move). "Spock" moves like a chess " Horse ", but only to a busy field (with his own figure, or the figure of an opponent - it does not matter). At the same time, Spock can attack any figure, but does not kill it, but turns it into another (the transformed figure appears on the field from where Spock began to move). "Stone" turns into "Scissors", "Scissors" in "Lizard" and so on. Of course, the transformed figure always becomes friendly.









The initial arrangement is somewhat similar to a chess one. "Spock" - the main figure, is located in the center. Both "Papers", as well as chess "Rooks" - on the flanks. The “stones” in front of them are covered with “Scissors”, but more importantly, the “Paper” cannot attack the enemy “Stone” with the first move, since it will be substituted for the “Spock” ​​attack. Reserve "Spock", plus the deprivation of an opponent of a strong figure - the desired production.



"Lizards" - the strongest figure, in the initial placement there. You can get it only in the process of the game, the transformation of the "Scissors". “Spock” ​​cannot turn the friendly “Stones” from the initial position, as it will be substituted by the enemy “Paper”. It may seem that Spock cannot attack the enemy Spock directly (since it is fraught with attack and petrifies), but this is not so. The appearance on the field of b3 (or d3) "Paper" (no matter whose) will lead to the immediate victory of the "blue".





In general, the game turned out exactly as I planned. Dynamic, unexpected, insidious. More importantly, at each stage of the game, the moves, with a relatively small number of them, vary widely from strong to very weak. One wrong move can lead to immediate defeat.



Spock allowed me to work well on game AI, and although the results of this work are still very modest, my understanding of the minimax , and the UCT too, has improved significantly. All this is a topic for another article. In the meantime, I invite readers to enjoy the new original game , as well as other games and puzzles that are included in iteration 1.1.7 of the project .




All Articles