📜 ⬆️ ⬇️

Russian Minesweeper - multiplayer version of the game "Sapper"

image

Hello, dear readers. I sincerely hope that among the readers of Habr there will be lovers of such a wonderful game as "Minesweeper" .

If I remember correctly, for the first time this game appeared on the Windows 3.1 operating system back in the 1994th year. At that time, this game was positioned as a means for teaching how to use a computer mouse and, in general, the OS graphical interface. She looked like this:
')
image

The principle of the game according to Wikipedia
A flat or volumetric playing field is divided into adjacent cells (squares, hexagons, cubes, etc.), some of which are “mined”; the number of “mined” cells is known. The goal of the game is to open all the cells that do not contain mines.
The player opens the cells, trying not to open the cell with a mine. Opening a cell with a mine, he loses. Mines are placed after the first move, so it’s impossible to lose on the first move. If there is no mine under the open cell, then a number appears in it, indicating how many cells adjacent to the just opened one are “mined” (in each game variant the neighborhood is defined in its own way); using these numbers, the player tries to calculate the location of the mines, but sometimes even in the middle and at the end of the game, some cells still have to be opened at random. If there are no mines under the neighboring cells too, then a certain “non-mined” area opens up to cells that contain numbers. The player can mark "mined" cells in order not to accidentally open them. Having opened all the “non-mined” cells, the player wins.

However, as time goes on, the popularity of the sapper falls, and I want to make a new life and colors in this game. That is how the multiplayer version of the game, called “ Russian Minesweeper ”, which is a browser-based online game, was born. Interested please under the cat.

Game Characteristics


Of course, in order for a certain number of players to play this game together, the rules will have to be somehow modernized and generally modified. However, the main rule is the essential principle to leave as in the original.

Thus, in fact, a set of rules was developed to allow several players to play simultaneously on the same field.

The basic rules of the game are as follows:

  1. The goal of the game is to be the first to mark all mines with flags.
  2. Each player has their own (local) flags.
  3. Players have the same (global) mine field.
  4. Players take turns ( however, the development of a "parallel" mode is underway ).
  5. If a player clicks on a mine, he will lose, and his opponent will win accordingly.
  6. The time for the player's turn is limited (~ 25 sec.) - it is necessary to walk as quickly as possible.
  7. If a player misses a move three times in a row, he loses, and his opponent wins accordingly.
  8. If a player misses six turns for the entire game, he loses, and his opponent wins accordingly.
  9. Draw is impossible. One of the players in any case will put the flags correctly faster than the other.
  10. The first move goes to a random player.
  11. The player can surrender at any point in the game.

A number of characteristics of the minefield for the game were also developed:

  1. Undermining the opening of the first cell at the beginning of the game is impossible.
  2. Mines are evenly distributed over the playing field.
  3. Properties of the "void", opened with the first click:
    1. Size A to B empty cells ( 0 min around ).
    2. Emptiness should not be a line of open cells only on one side of the orientation.
  4. The percentage of mine cells (the type of regulator is real ) and the size of the field are regulated in the application settings.


Thus, with the current configuration, with the first click, an “emptiness” from 3 to 12 “zero” cells opens, and a field of size 32x20 .

I apologize for the huge number of lists, however, I can not fail to mention that the game apart from this has the following functionality:


Technology


A complete list of technologies used in product development is as follows:


image

The most problematic places in the project were the following:


Interesting numbers



And also I attach a click-through map from Yandex. Metrics, using it you can make a number of interesting conclusions. For example, it is obvious that the main area of ​​"battle" is the center of the field, and chat is popular.

image

Future plans


In the future, I want to finish the following functionality:



Conclusion


image
In conclusion I want to say the following - please be careful with the game server :)
It is received free of charge by a subscription from Microsoft Azure and its capacity is extremely modest.
I sincerely hope that after this article we will be able to enjoy this game together.
I remind you that it is available at https://rmsweeper.com , and there is also a community on VKontakte.

Thanks for attention,
Peter was with you.

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


All Articles