Hydra Slayer: killing time and numbers

    On March 24 of this year, an event happened that we had all been waiting for for a long time: the next masterpiece of the Polish gaming system, Hydra Slayer, was released in the digital distribution service for computer games Steam . And although this masterpiece is crooked in some places, and not all were waiting for it, but rather three and a half people, nevertheless I consider it worthy of my article on Habré. “Wait a minute, my dear author,” the person will exclaim now on the other side of the monitor from me, “but have you confused for an hour such a reputable site as Habrahabr with some kind of game portal where young men from fourteen years old and younger share their successes?” in Minecraft, abundantly using profanity? ” No, I did not confuse. This material is destined for a special place in the "Mathematics" hub.

    image


    I'll start from afar


    Once upon a time there was a good man hiding under the nickname Zeno. I’m ready to assume that on the Internet and in addition to it there is a non-empty set of good people wearing this nickname, but hardly any of them committed such a number of glorious deeds. And I must say that this Zeno is still a joker. He will write a game about a man wandering along the plane of Lobachevsky. That will take on the strange but ambitious project Necklace of the Eye , which allows, in theory, to fasten the graphics with relatively little blood to any bagel - and roguelike, I remind you, this is a kind of game where the "graphics" traditionally looks something like this :

    image

    He is also currently participating in the ADoM Resurrection project ., designed, as you might guess from the name, to breathe new life into the cult game Ancient Domains of Mystery in certain circles . Have you heard? How not? Ok, forget it. The reason I have such a tender sympathy for this person has not yet been listed. Actually, we are just moving on to it.

    Hydra Slayer: what it is and how to enjoy it


    The art of killing hydras has a long history. The first travelers who had the misfortune of meeting these creatures were simply unable to do any harm to them. As soon as they cut off the hydra's head, two new ones, or even more, grew in its place. Then magic swords appeared, allowing you to chop off several heads at a time so that only a constant (independent of the number of chopped off heads) number of new ones grew in their place. If, with one well-aimed blow, it was possible to chop off all the heads at once, the hydra immediately died out. These swords, however, had an unpleasant feature: a sword, enchanted, for example, by cutting five heads, could not do the least harm to a hydra with four heads or less. A sword, designed to chop off exactly one head, he could not always overcome the regenerative abilities of a hydra - it depended on the type of enchantment and on the variety and strength of the monster. The blow of the sword, covered with a magic flame, did not allow the frosty hydras of the north to grow a single new head, but ordinary swamp hydras could well grow one or two, and in fire hydras, due to the affinity with the element of the sword, each cut head turned into two new ones.

    Here is a completely everyday example for you. Suppose, leaving your house in the morning, you suddenly encounter a nine-headed bog hydra.

    image

    Unfortunately, when going to work, you did not foresee 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 able to kill the four-headed hydra in one fell swoop), however, in a larger swamp hydra, after such a blow, two heads will grow back. You can mow seven heads with a scythe, but the inhabitants of the swamps are immune to silver, and after hitting with silver weapons, ten new heads will immediately grow from this hydra. How to win this battle with the least losses and not be late for work?

    Hidden text
    First strike with a sword. 9 - 4 + 2 = 7. Then we finish the scythe. 7 - 7 = 0


    Now let's get to the point


    Hydra Slayer is a simulator of step-by-step cleaning of the hydra lair from its slimy inhabitants. Formally, it can be classified as a roguelike genre - it contains ascetic graphics, wandering around 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 graphic modes appeared (although, it must be admitted, by their beauties they still do not quite reach Crysis).



    However, we will not say “fu”, because not in the schedule is the whole pulp of this game, but in the merciless genocide of the den inhabitants using the widest arsenal of mathematical weapons left by our less successful predecessors. On the cold stone floor, caves are waiting for us to pick them up:

    • The blades that we talked about earlier.
    • Maces with which you can stun a certain number of goals. Stunned heads wake up after some time, but in the next few moves after the blow, they will not be able to bite the player.
    • Axes that chop heads off like blades, but after hitting them, newly grown heads (if any) are stunned.
    • Shields - in terms of their impact properties, they are similar to a very weak mace, but they are not worn to beat. When calculating the damage caused by a hydra to a player’s character, a shield of strength 2 causes each pair of hydra goals to count as one. If you carry two shields with a force of 2 and 3, respectively, they will work in parallel: the hydra heads will be divided into pairs and triples in an optimal way for the player.
    • Divisors without which killing a truly great hydra is problematic. 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 which you can extract the square root of the offal hydra . Or even more than square.
    • Destroyers, logarithmators, Blades of Time, Shearing swords and other exotics expect the most stubborn in the deep tiers of the den.


    Clutching all these wonderful things in two (spoiler: or more) hands, of which I have listed less than a third, our character will go down lower and lower, where they will be waiting for him in the middle of the underground darkness:

    • Fiery, icy, gold, silver, chaotic and so on hydra. In total, the game has ten basic elements, each of which corresponds to both weapons and enemies. Hydras of each type are practically invulnerable to weapons of the same element, but weak against some other.
    • Malicious hydras that know how to grow an extra head of their own free will, or vice versa - by volitional effort, lose a few heads. And they lose their heads wisely (a wonderful oxymoron, right?). If the hero has a bisector in his hands, such a hydra in a fight with him will keep the number of his goals odd. If the extractor - do not even hope that you can catch the moment when the number of its goals will be an exact square.
    • Hydra bloody , covered with dried blood of his killers failed, because of what is not seen their type and how many goals they grow with the impact of certain elements. All this will have to be determined empirically.
    • Hydra ancient , local bosses. There are only two of them, but they are distinguished by a special ferocity and a six-digit number of goals. Good luck with your sword -5.
    • Dragons are a type of hydra that can inflict damage from afar with its poisonous / cold / fiery / some other breath. One of the ancient hydras is also a dragon.
    • Pyatidesyatigolovye Titans - Hecatonchires , as well as their two-headed younger brother - Ettin . They are not related to hydrams and do not know how to grow new heads to replace lost ones, but they will gladly warm you with weapons found somewhere in the den. It hurts. Highly.


    I could also mention scrolls, powders, and potions that can help the player, improve his weapons, turn hydra 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 the levels - some of them are closed in cylinders, Mobius stripes and Klein bottles. About the possibility of choosing geometry - your hero’s figure can run along squares or hexagons, walk or not walk diagonally, and there is another secret mode that I found looking in the source code (by the way, it is distributed with the game). I could, but I won’t :) I will 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 the first grader. However, there are many things in the game that will seem interesting even to a seasoned mathematics lover like me or many of my readers. For example, the Golden Cleaver. It divides the number of hydra heads in approximately the golden ratio. How exactly does this happen? The number of goals is decomposed into the sum of the various numbers from the Fibonacci sequence. Then, for each of these numbers, the previous one in the sequence is taken. After that, the amount is added back. It works, however, only if there is a decomposition in which there are no units. If a unit is present in every possible decomposition, the Golden Cleaver will not have the slightest effect on the hydra.

    If you read the scroll of Transmutation above these weapons, the Golden Cleaver will turn into Silver. The principle of its operation is based on the same decomposition in the amount, but unlike the Golden bill, for each term it does not take the previous, but the pre-previous, and only works if there is one in the expansion.

    If you, my dear reader, are a person with a wide mathematical erudition, 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 do not occur in a row, and the positions on which the units stand correspond to the positions of those members of the Fibonacci sequence that must be added to obtain the represented number. It is proved that such a representation is unique, as in "normal" positional number systems.

    In the Fibonacci number system, it becomes much clearer what bill hooks do. If the record of the number ends with zero, then the Golden bill will “cut off” this zero. If the recording ends with “01”, then the Silver Cleaver “cuts off” these two digits. It can be estimated that the Golden bill will work for approximately 61.8% of hydras, reducing the number of their goals by about 1.6 times. Silver cleaver works for the remaining 38.2%, but thinnes out their heads somewhere around 2.6 times. If enchanted bill hooks with the help of a scroll of the Big Club, they will begin to act iteratively, inflicting several blows in one stroke. Accordingly, the Golden Cleaver will be able to cut off several zeros, and Silver - several repetitions of the sequence “01”. Thus, a well-enchanted Silver Cleaver will be able to kill hydras with a number of goals with one hit.1, 4, 12, 33, 88 ... - that is, 1, 101, 10101, 1010101 and so on in the Fibonacci number system. This makes the Silver Cleaver a very effective weapon in certain strategies.

    Here, however, I am forced to interrupt. I could talk with you about many more fascinating things, such as, for example, how to effectively heal with a trident and a shearing sword, or how to resurrect from the dead, playing for Titan and carrying with him two identical shields ... However, I will be honest with myself: hardly anyone would have mastered such an article to the end.

    image

    By the way, it's almost over


    In conclusion, I want to say something with which, perhaps, we should start. Despite the fact that the game has recently been released on Steam, its free version is still available for download here . It has a bit more errors and lacks a small fraction of the content, but overall the user experience is about the same. This is a very specific, full of frightened bugs, with a kind of graphics and a crooked interface game. I hope you love her.

    Also popular now: