On March 24 of this year, the event that we all waited so long ago happened: in the service of digital distribution of computer games Steam, another masterpiece of the Polish game industry -
Hydra Slayer . And although this masterpiece is crooked in some places, and far from all, but rather three and a half people have been waiting for it, I still think it is worthy of my article on Habré. “Wait a minute, my dear author,” the person on the other side of the monitor exclaims from me, “but have you confused an hour as respected a site as Habrahabr with some game portal where young men from fourteen years old and younger share their successes in Minecraft, abundantly using profanity? ”. No, not confused. This material is destined to a special place in the "Mathematics" hub.
I'll start from afar
There was a good man hiding under the nickname Zeno. I am ready to assume that on the Internet and in addition to it there is a non-empty multitude of good people wearing this nickname, but hardly one of them has committed so many glorious deeds. And I must say that this Zeno is still a dabbler. Then he will write a
game about a man wandering along the Lobachevsky plane. That will take up a strange, but ambitious project
Necklace of the Eye , which allows, in theory, relatively little blood to fasten graphics to any croissant - and roguelike, I remind you, is a sort of games where “graphics” traditionally look like something :
')
He is also currently participating in the
ADoM Resurrection project, designed, as the name suggests, to breathe new life into the cult game
Ancient Domains of Mystery in certain circles. Have you heard? How not? Okay, forget it. The reason why I have such affection for this person is not yet listed. Actually, we just go to it.
Hydra Slayer: what it is and how to enjoy it
The art of killing hydra has a long history. The first travelers who had the misfortune to meet these creatures were simply incapable of harming them. As soon as they cut off the hydra's head, two new, or even more, grew in its place. Then, magic swords appeared, allowing to chop off several heads at a time so that in their place only a constant (independent of the number of severed heads) number of new ones grew. If it was possible to chop off all the heads at once with a well-aimed blow, the hydra immediately died out. These swords, however, had an unpleasant feature: a sword enchanted, for example, at chopping five heads, could not do the slightest harm to a four-headed or smaller hydra. The sword, intended to chop off exactly one head, could not always overcome the regenerative abilities of the hydra - it depended on the type of enchantment and on the type and strength of the monster. The blow of the sword, covered with a magical flame, did not allow the frosty hydras of the north to grow a single new head;
Here is a completely everyday example. Suppose, leaving the house in the morning, you suddenly encountered a nine-headed marsh hydra.
Unfortunately, when you were going to work, you did not anticipate such a situation, and you only have a fiery short sword and a silver braid with you. The sword cuts down four heads (and, accordingly, is capable of killing the four-headed hydra in one fell swoop), but at a larger swamp hydra, after such a blow, two heads will grow back. Seven heads can be squinted, but the inhabitants of the marshes are immune to silver, and after striking with silver weapons ten new heads will grow from this hydra. How to win this fight with the least loss and not be late for work?
Hidden textFirst strike with a sword. 9 - 4 + 2 = 7. Then we finish with oblique. 7 - 7 = 0
Now let's get to the bottom line.
Hydra Slayer is a simulator of step-by-step stripping of the hydr den from its slimy inhabitants. Formally, it can be attributed to the genre of roguelike - it contains ascetic graphics, wandering through procedurally-generated dungeons, permanent death and other joys. Once it looked something like this:
- but after integration with the aforementioned Necklace of the Eye, many other graphics modes appeared (although, it must be admitted, in their beauty, they still do not fall short of Crysis).
But let's not say "fu", because not in the schedule is the whole flesh of this game, but in the merciless genocide of the denizens with the widest arsenal of mathematical weapons left by our less fortunate predecessors. On the cold stone floor of the caves wait until we pick them up:
- The blades we talked about earlier.
- Maces that can stun a certain number of heads. Deafened heads wake up after a while, but in the next few moves after the strike, they will not be able to bite the player.
- Axes that chop off heads are like blades, but after hitting which the newly grown heads (if any) turn out to be stunned.
- Shields - in their impact properties are similar to a very weak mace, but they are not worn to beat. When calculating the damage inflicted by the player’s character’s hydra, the shield of force 2 causes each pair of hydra heads to be counted as one. If you carry with you two shields with a force of 2 and 3, respectively, they will work in parallel: the heads of the hydra will be divided into pairs and triples in an optimal way for the player.
- Dividers , without which it is problematic to kill a really big hydra. In one hit, they are able to reduce the number of goals by two or more times, depending on the strength of the divider, but are powerless if the number of goals is not completely divided by this force.
- Extractors , with the help of which square root can be extracted from the hydra. Or even more than square.
- Decomposers, logarithm, time blades, shearing swords and other exotic things are waiting for the most stubborn on the deep tiers of the den.
Squeezing in two (spoiler: or more) hands all these wonderful things, of which I listed less than a third, our character will descend lower and lower, where among the subterranean darkness they will wait:
- Fiery, icy, gold, silver, chaotic, and so on hydra. In total, the game has ten basic elements, each of which correspond to both weapons and enemies. Each type of hydra is practically invulnerable to weapons of the same element, but weak against some other.
- Hydra are malicious , able to grow an extra head of their own accord, or vice versa - to lose several heads by an effort of will. And they lose their heads with the mind (a wonderful oxymoron, is not it?). If a hero has a bisector in his hands, such a hydra in a fight with him will keep the number of his heads odd. If the extractor - do not even hope that you can catch the moment when the number of its heads will be an exact square.
- Hydras are bloody , covered with caked blood of their failed murderers, which is why their type is not visible and how many heads they will grow when they hit a certain element. All this will have to be determined by experience.
- Hydras are ancient , local bosses. There are only two of them, but they are distinguished by a special ferocity and a six-figure number of heads. Good luck with your sword -5.
- Dragons are a kind of hydra that can inflict damage from afar with its poisonous / cold / fiery / some other breath. One of the ancient hydras is part-time dragon.
- Fifty-headed titans - Hekatonheira , as well as their two-headed younger brothers - ettins . They are not relatives of hydram and do not know how to grow new heads in exchange for lost ones, but with pleasure they will shame you with weapons found somewhere in the den. It hurts. Highly.
I could also mention scrolls, powders and potions that can help a player, improve his weapon, turn hydras into mushrooms, and mushrooms into zombies ... About five playable races, each of which requires a radically different strategy than the other. About the topology of levels - some of them are closed into cylinders, Möbius sheets and Klein bottles. About the possibility of choosing the geometry - the figure of your hero can run on squares or hexagons, walk or not walk diagonally, and there is another secret mode that I found while looking at the source code (by the way, it is distributed along with the game). I could, but I will not. I can only say one thing: when I try to imagine the whole variety of situations that can be encountered in this game, a combinatorial explosion occurs in my head.
And yet, why is it on Habré?
The problem with the nine-headed hydra, given above, is capable of confusing unless it is a first grader. However, there are a lot of things in the game that will seem interesting even to a seasoned math lover like me or many of my readers. For example, the Golden Cleaver. He divides the number of heads of the hydra approximately in proportion to the golden ratio. How exactly does this happen? The number of goals is decomposed into a sum of different numbers from the Fibonacci sequence. Then, for each of these numbers, the preceding one is taken in the sequence. After that, the amount is added back. He works, however, only if there is a decomposition in which there are no units. If there is a unit in every possible decomposition, the Golden Cleaver will not have the slightest impact on the hydra.
If you read the Transmutation Scroll above this weapon, the Golden Cleaver will turn into Silver. The principle of its operation is based on the same decomposition into a sum, but unlike the Golden Cleaver, for each term it takes not the previous, but the previous one, and only works if there is one in the decomposition.
If you, my dear reader, are a person with a broad mathematical knowledge, you probably already remembered the
Fibonacci number system . In it, each natural number is represented by a finite sequence of zeros and ones in which two units are not found in a row, and the positions in which there are ones correspond to the positions of those members of the Fibonacci sequence that need to be folded to get the represented number. It is proved that such a representation is unique, as in the "normal" positional number systems.
In the Fibonacci number system it becomes much clearer what sekachi do. If the record of the number ends in zero, then the Golden Cleaver “cuts off” this zero. If the recording ends with "01", then the Silver Bill "cuts off" these two numbers. It can be calculated that the Golden Cleaver will work for approximately 61.8% of the hydra, reducing the number of their heads by about 1.6 times. The silver cleaver works for the remaining 38.2%, but it is already 2.6 times thinning their heads. If the enchanters are enchanted with the Big Cube Scroll, they will begin to operate iteratively, inflicting several blows in one stroke. Accordingly, the Golden Cleaver will be able to cut several zeros, and the Silver - several repetitions of the sequence “01”. Thus, the well-enchanted Silver Cleaver will be able to kill the Hydr with the number of heads
1, 4, 12, 33, 88 ... - that is, 1, 101, 10101, 1010101 and so on in the Fibonacci number system with one blow. This makes the Silver Cleaver a very effective weapon in certain strategies.
Here, however, I have to interrupt. I could talk with you about many more interesting things, such as, for example, how to effectively treat with a trident and Mowing sword, or how to rise from the dead, playing for Titan and carrying with me two identical shields ... However, I will be honest with myself: hardly anyone would have mastered such an article to the end.
By the way, it's almost over
Finally, I want to say something with which, perhaps, should begin. Despite the fact that the game was recently released on Steam, its free version is still available for download
here . It contains a bit more errors and lacks a little bit of content, but in general the user experience is about the same. This is a very specific game full of unafraid bugs, which has a peculiar graphics and a crooked interface. I hope you love her.