To chess, I am not indifferent since childhood. Although I never learned to play really well, the process of the game gives me great pleasure. I learned a long time ago that in addition to traditional chess known to all, there are other varieties of them. I do not remember on what computer, on the Spectrum or Vector 06 C, I first saw
Xiangza . The game was completely in Chinese and it was necessary to comprehend its rules "at random". Later, I learned about the existence of
Shogi ,
Chaturanga and other close relatives of Chess. The publications in
Quantum spurred interest in
Fairy-tale chess . I was interested in the question, how many varieties of chess are known at all? It turned out that they are incredibly many. So much so that the list devoted to this issue on
Vika is very, very far from being considered complete.
Much later, when I became a professional programmer, I had the idea to develop a universal application to control the rules of the moves in various chess-like games on square and rectangular boards. Of course, I had no idea that I could create a universal AI. Even the task of implementing a universal chessboard, with a customizable control of various rules and the ability to play online, looked very heavy. I collected the rules of chess games, tried to summarize them, but, given the fact that I did this brief fray, between the main work, the process slipped and went very slowly. This continued until last Friday, I discovered a project called
Zillions of Games .
Realizing what I stumbled upon, I thought that I was in a fairy tale. Even in the free demo-version it was proposed to play 48 completely different games implemented on the same engine. In addition to chess and checkers, there were varieties of tic-tac-toe,
Go (using the plug-in dll as an engine), various puzzles. There were games that I had never heard of. Chess itself was represented by a gentleman's set of traditional, Chinese, Korean, Thai and Japanese chess. The latter, in the demo version, were presented only in a
mini-version , which in itself was a good reason to purchase the full version of the game.
')
But the main thing was not the set of games presented, and not even the fact that, after purchasing the paid version, there was an opportunity to download more than 2000
additional games and puzzles , but that to develop a new game, it was enough to describe its rules in a language reminiscent of
Lisp . A language guide, as well as thousands of examples of its use, have been attached. Then I realized that I had found something I had dreamed about for a long time and that this entertainment would be enough for me for a long time.
In general, I decided to explore the possibilities of the Zillions of Games rule description language (ZRF) more closely, and in the process of studying, write something interesting and useful on it. Of course, I plan to move from simple to complex, but in order not to lose perspective, I will try to describe the “Dream Game” I want to come to in the end.
So:
General information
- The game starts on an empty, large square board (for example, 17x17 cells)
- Opponents take turns
- A move is considered to be a movement of a figure, a change in the state of a figure, or the taking of an opponent's figure.
- Before the start of the course, the player can place figures or obstacles on the field.
- The ability to set an object (shape, barrier or modifier) ​​on the field is determined by the current state of the player’s energy meter
- Energy is generated every turn, with special pieces (Generators) set by players on the field.
- The game starts with the same amount of energy of both players (enough to install one generator)
- Generators can be installed on any free field on the half of the board facing the Player (in the case of an odd number of horizontals, the middle horizontal is considered neutral)
- The figures and obstacles can be installed on any free field, which is not under the battle of the enemy figures, in the battlefield of the player figures
- Modifiers can be applied to Player shapes, to change their state.
- At a time, no more than one modifier can be applied to a figure (the use of the next modifier cancels the effect of the previous one with the loss of energy expended on its use)
- To support heavy pieces, each turn consumes energy (if there is not enough power to support the pieces, some of the heavy pieces can be automatically removed before the next turn begins)
- If taking the opponent's figure (with the exception of the spy) is accompanied by moving the player's figure to the field previously occupied by it, the player receives a bonus in the form of half the energy expended on the initial placement of the taken figure, not taking into account the imposed modifiers (rounding to the whole is reduced)
- The game continues until the complete destruction of the figures of one of the parties, until the recognition of the defeat of one of the parties or until the mutual recognition of a draw
Figures
Generator
- Installation of the Generator requires 20 energy units.
- Each Generator located by the Player on the field generates 5 energy units per turn (the energy generated by several generators is summed up)
- After installation, the Generator cannot be moved and cannot beat the pieces of the Adversary, however, it defines the combat area needed to install the player’s pieces near the Generator
- The battlefield, defined around the Generator, is the perimeter of a square of 5x5 cells with a Generator located in the center
Hourly
- To install Hourly, 1 unit of energy is required
- After installation, Sentry can not be moved
- A sentry hits in any direction on one field, provided that on the previous move on this field the Opponent took another Watch Player (in aggregate, these rules should encourage the location of sentry walls around the Generators they protect)
Soldier
- For installation of the Soldier, 4 units of energy are required
- The soldier moves and hits in any direction one square
- It can be switched to the buried / excavated state without energy, for 1 move
- All figures can pass unhindered through the Soldier in a buried state.
- In the buried state, the Soldier does not beat Tank
- In the buried state, the Soldier cannot move
- If, in the buried state, the Soldier beats the figure of the Opponent, the battle is carried out without moving
the officer
- For installation of the Officer, 8 units of energy are required
- The officer moves and hits in a straight line in either direction 1 or 2 squares.
Cavalryman
- To install a Cavalryman, 10 energy units are required.
- Cavalryman beats and can move "the course of the horse"
- The cavalryman can move in a double “horse move”, continuing to move in the same direction.
- Cavalryman "jumps" any figures or obstacles
A gun
- To install the Cannon, 15 energy units are required.
- To support the Cannon, 1 unit of energy per turn is required.
- The gun moves to any number of cells vertically or horizontally.
- A cannon hits an Opponent's figure (or any obstacle) on any number of cells vertically or horizontally, provided that along the battle line, between the gun and the battlefield, there is one Player or Opponent’s figure apart from the Helicopter or Soldier in the buried state (the figure of the Cannon reminds figure of the same name in Chinese and Korean chess)
- The fight of a figure or barrier is performed without moving the gun
Helicopter
- For installation of the Helicopter, 20 units of energy are required
- Helicopter support requires 1 energy per turn.
- The helicopter moves and hits the enemy Helicopters diagonally across any number of cells, passing through any shapes and obstacles.
- A helicopter cannot beat “ground” figures, but defines a “battlefield” around itself, in the shape of a 3x3 square cell, suitable for “landing” other figures
- All figures can pass through the cell occupied by the helicopter.
- The helicopter ignores any obstacles, can stop on the field with Mina (without losing the helicopter or mines)
- If the helicopter fights on the field with Mina, Mina is also destroyed
- A helicopter may be shot down by a Cannon (according to the usual rules of its combat) or by an Adversary Helicopter.
Tank
- Tank installation requires 30 energy units.
- To support Tank, 1 unit of energy per turn is required.
- Tank moves to any number of cells vertically or horizontally
- Tank beats the opponent's figure or barrier (except for Mina) at a distance of 1, 2 or 3 cells vertically or horizontally
- Tank does not beat Sentinels (which allows him to break through their line of defense)
- Tank is not beaten Soldiers in the excavated state
Scout
- To install a Scout, it requires 100 energy units.
- The scout moves and hits in any direction with 1 or 2 cells, as well as with the “horse move”
- Can jump over any shapes or obstacles.
- Can destroy Traps and Mines.
- We see the Opponent only if he is under combat (including in the Sentinel battlefield)
- When captured, it is captured by the Opponent and can be exposed to it under his own color without energy consumption.
Modifiers
Stimulant
- Requires 5 energy units to use.
- Adds to the movement 1 field with the continuation of the direction (the spy under the stimulator can move a double "knight's move")
- Cannot be applied on the Tank or Vertolet
Ricochet
- It requires 15 energy units to use.
- Allows you to perform a single reflection from the border of the board
- Cannot be applied to Tank.
Around the World
- It requires 25 energy units to use.
- Allows you to perform a single border crossing board, as if it were toroidal
Hedges
Trap
- Installation requires 5 energy units.
- Stops the movement of a piece of any color on its cage until the next turn
Wall
- Installation requires 10 energy units.
- Figures (soldiers and officers) cannot pass through the wall
- Cannot be destroyed by any figure other than Tank or Cannon of any side.
Mine
- Installation requires 20 energy units.
- Destroys the figure of any side (Soldier, Officers and Tanks) while passing through the field
- Destroys the figure of any side (Soldier, Officers, Tanks and Cavalrymen) while stopping on the field
- Destroyed after triggered.
- Can be destroyed by Cannon or Scout.
- Visible to the enemy only on the condition that he is in the battlefield of one of his figures.
It is easy to see that some of these rules can be very difficult to implement. It is quite possible that I will not succeed in realizing my plans in full, but often, the process of movement itself is much more important than the possible result. I will try to illustrate my progress in mastering Zillions of Games with articles on Habré. In the meantime, I propose to discuss the presented rules.